I'm missing something about "hold" mode

Hi All-

Flight testing a custom VTOL aircraft. I’ve gotten the attitude rate and position controls tuned OK (not perfect yet). I’m trying to fly a simple profile of “Commanded Take-off → hold → land on command”.

The issue i have that hold mode doesn’t seem to pass attitude position commands on to the attitude controller. I assume this has something to do with my understanding of how “hold” works. But see below screenshots - velocity error goes up and up… and the commanded attitude is … zero and constant? What am I missing?



Do you have a log file you can share? Those plots are not enough to debug the issue.

@bresch Hi thanks for the response.

Here is the link to the log: https://review.px4.io/plot_app?log=4e1830dd-93df-4bef-a42c-966eb6584ff1

Hi @dcg,

I don’t think the issue here is the “hold” logic, but a different protection logic that comes into play when the drone is in thrust saturation. In case the drone can’t reach/hold the desired altitude, it overrules the roll and pitch setpoints to 0° to focus on altitude keeping.

In your case thrust is always at 1 and the vehicle can’t track the Z velocity setpoint. Either you had some issue with your power train or it’s simply underdimensioned.

Hope that helps

Ah makes sense. Thanks.

Can someone point me to the source that does the protection logic for thrust saturation?

Related to https://github.com/PX4/PX4-Autopilot/issues/16246

The code is here: https://github.com/PX4/PX4-Autopilot/blob/fd18ba649678a8aa5f1b871b2f6b3d770c1d87d3/src/modules/mc_pos_control/PositionControl/PositionControl.cpp#L164

Got it thanks!

So can I work around this behavior by setting MPC_THR_MAX greater than 1? Or would that have other unintended effects?

I didn’t check if it’s actually possible to set a value > 1, but if it is, it would basically remove the altitude prioritization logic. In your case, the vehicle would then be able to control the XY position but will also go down.

On the console, this command seems to work just fine:

param set MPC_THR_MAX 1.1

I’ll flight test it and see how it works.