How to tune for more aggressive altitude hold?

I’d like my copters to hold altitude a bit more aggressively. When in Loiter and Altitude Hold, my copters sink more than I’d prefer when transitioning horizontally.

Are there tuning parameters that might help with this? If so, does it require a manual adjustment or is there some sort of “learn” or “auto tuning” capability?

Looking through the parameters - perhaps PSC_POSZ_P might be the thing to adjust - but I wouldn’t want to change it with out some advice from an expert.

1 Like

How good is your baro signal? Sometimes the air pressure drops when the copter stops moving horizontally, causing the baro to tell that the copter is rising. Of course the altitude controller counter acts that by reducing the altitude, hence the effect you see. This is not improved by increasing the controller gains, that will only make it sink faster.

The solution is to either address the cause and put the baro in a better location, or tell the EKF to thrust the baro less and the accel/GPS more. But if you do that it might cause that the accel vibration gets amplified by the rate PID loops and your motors will run hot. This can therefore only be done if your frame does not vibrate. And the notch filters do not help you here, they only apply to the gyros, you need to solve the problem at the source of the vibrations.

So it is a non-trivial balance act. Between different altitude sensor sources and their noise.
RTK GPS height (when there is no glitches) might help you there.

I have been told by Copting GmbH personal that PX4 does not have this problem at all, so I would like @dagar to comment how this issue is solved in PX4 firmware.

1 Like

Or just tune it properly. There’s parameters to enable corrections for baro error due to bad mounting position.

1 Like

Discussion/tutorial here Wind Estimation in multicopters with Dr Paul Riseborough - YouTube

1 Like

Fascinating. Thank you amilcarlucas, for your detailed response. It sounds like the behaviors I’m observing aren’t unique.

I don’t know how to determine how “good” is my baro signal. I have two copters - a Hexsoon EDU-450 and a Hexsoon TD-650. Both use an Orange Cube mounted on the top plate. Both exhibit this behavior.

I’m just now testing and tuning the TD-650. FFT done - and AutoTune to go. The EDU-450 has been done for a while - and now that I think of it, it didn’t used to experience this “sink” quite so much - I wonder if it has anything to do with 4.1.1.

This morning I took the TD-650 out - it was too breezy to AutoTune - but I though might be a good opportunity to see how the copter handled the winds.

The first thing I noticed was that the hover thrust was too low - you can see in the BIN file that it’s notched up early in the flight by hover thrust “learn.” Yesterday in calm conditions, hover thrust was fine.

I spent about 5 minutes just in Loiter - with slow horizontal transitions around the field. Even without having done an AutoTune, I though it did a remarkable job staying stationary. But when I did horizontal transitions, this is where I observed the sink. Then I switched on AutoTune - wanting to see how it worked in Loiter - and in the winds. It was sort of the “dancing bear” phenomena - it wasn’t how well it did it - but that it did it at all!

I charted some of the baro parameters - desired alt, actual alt, and one other - I forget which. I’m still too much a rookie to understand the data.

I’ve uploaded the BIN for this flight - in case you or anyone else wanted to take a peek.

I’ve considered relocating the Orange Cube to the lower deck plate - so that it’s covered by the top plate. I wonder if this might help if the problem has to do with airflow around the OrangeCube. But for what it’s worth - the EDU-450 didn’t seem to exhibit this sink behavior.

Thanks for sharing your thoughts on the subject. I’m curious now about your mentioning that the PX4 “fixed” this. That seems to imply that I’m not alone with this problem.

Many Thanks!

James - thanks for the video link. I’ll look forward to watching it. Regarding the parameters for correcting the baro due to mounting position - perhaps you could point me to where to find them. Many Thanks!

It can help to shield the FC from prop wash and wind, like a dome. And some have found that putting a bit of tape over the USB port of the Cube helps - I haven’t tried that myself.

EDIT: tune still needs a bit of work, and probably vibrations too. You might get better results after tuning is finished.


Best documentation is probably the PR itself.


Shawn - You are so right about the tune needing more work. Maybe you can help me take another look after I get AutoTune completed. Thank you!