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.
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
Can someone point me to the source that does the protection logic for thrust saturation?
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.