Thrust Dropout when Switching from Manual to Altitude Mode

When transitioning from Manual to Altitude flight mode, the thrust momentarily drops out, followed by a hard kick, after which it settles within half a second (log).

This has a few implications:

  • the transition is not smooth, which can be a problem for sensor payload
  • the drone sags briefly, which is risky in low altitude
  • the hard kick causes a high current draw and mechanical jolt in the system, unnecessarily speeding up wear
  • the dropout causes a disturbance, which has to be corrected by the controller afterwards

What exactly causes this behavior, and how can I fix it?

During further analysis, I’ve come across a related item in the vehicle_local_position_setpoint message:

In manual mode there is no position setpoint, therefore the first (logged) sample is from directly after the mode switch into altitude mode. The image below shows a one second of the message’s fields acceleration[2] and thrust[2]:

The thrust setpoint correlates with the actuator controls message depicted in the first post, as it is in fact the same signal. The acceleration setpoint in the down direction also matches the observed behavior; a commanded downwards acceleration of ~10g is likely to cause a low thrust setpoint.

To me it seems like the initial acceleration[2] setpoint is the main issue here.

This issue was discussed and resolved on GitHub in #20555.

As it turns out, the root cause was already solved in #19162 half a year ago, but the patch is missing from the firmware I was using.