AirMode and throttle mixing: is there a bug?

I am trying to digest the logic behind anything related to the AirMode, including the config bit, arming options 153/154, and throttle mixing.

I see this in ArduCopter/land_detector.cpp:

if (flightmode->has_manual_throttle()) {
    // manual throttle
    if (channel_throttle->get_control_in() <= 0 || air_mode == AirMode::AIRMODE_DISABLED) {
        attitude_control->set_throttle_mix_min();
    } else {
        attitude_control->set_throttle_mix_man();
    }

My logic tells me that if you want complete control even at zero throttle, the second if shall have && rather than ||. Am I missing something, or is this indeed a bug?

2 Likes

@andyp1per, git blame attributes that line to you. Could you please check this?

My impression is that, whenever you are in Acro and have AirMode on, you want to have full control even at zero throttle. In my experience, there is indeed some authority loss when falling from the sky. Some of my chat fellows report similar experience.

I’ll discuss with @Leonardthall - your analysis seems reasonable to me

1 Like

As Andy just suggested to me off line:

should maybe be && air_mode != AirMode::AIRMODE_ENABLED

I believe he is correct.

1 Like

@maxbuzz great catch - @andypiper you might remember I tried increasing MOT_SPIN_MIN a few months back because I thought my 7" didn’t behave well at zero throttle. Hope this is the answer…

1 Like

Untested flies ok

PR is up Keep manual throttle mix at zero throttle when airmode is on by andyp1per · Pull Request #20929 · ArduPilot/ardupilot · GitHub

2 Likes

@Leonardthall @andyp1per I have recently found that RCx_OPTION=154 “Arm/disarm with AirMode on” does not work for Stabilize. This was first found out from experience, and then I could not find a code path that would do it.

Is that intentional? Does that not conflict with e.g. documentation here (Stabilize Mode — Copter documentation)? The separate RCx_OPTION=84, on the contrary, works for Stabilize.

It not working with stabilize is by design - but I do think we should have an option that allows you to turn it on for stabilize as well