AutoTune: failing to level, manual tune may be req

Ok, all 3 axes complete (again) with few warnings about failure to level, and I think I have a conclusion and resulting methodology:

It’s probably not good practice to rely on “failure to level” messages as the sole reason that your tune is too aggressive, but it’s likely indicative of just that.

Autotune roll and pitch first. A couple of “failure to level” messages won’t hurt. If it fails due to those messages, see my comments in the next paragraph regarding PID terms. Once roll and pitch are autotuned, make sure the new terms are saved before moving on to yaw (which will, in effect, test the roll/pitch tune).

If autotune spits out “failure to level” messages during the yaw (or any other) routine, it’s likely indicative that the tune is too aggressive. Review the log for desired vs actual pitch and roll values along with RATE.ROut/POut. Determine where the oscillation/overshoots are occurring and (EDIT - see Leonard’s feedback below) back off on each of the PID terms by the same small percentage for the offending axis. I ended up just rounding all of the terms down to the nearest tenth or hundredth, and things seemed to improve, but that may not be the best tactic for every case. If the warnings continue, continue decreasing the aggressiveness of the offending axis and re-accomplish at least a few minutes’ worth of yaw autotuning (even after it’s successful) to confirm the absence of “failure to level” messages.

I’m happy to take criticism here - this is my first foray into copter tuning, though I have some pretty extensive (but narrowly focused) experience with the rover firmware.

Here are some graphs of the resulting tune. The top two graphs show RATE desired vs actual during a portion of the flight where I commanded increasingly aggressive inputs on each axis and then centered the stick. The bottom two show oscillation of roll and pitch during a brief period of autotune in the yaw axis, entering from AltHold. Based on the oscillation amplitude from my previously failed attempt and (particularly the roll rate) oscillation during commanded excursions, there may still be room for improvement, but I received no “Failure to level” messages on this demo flight, and the copter appeared to be stable.

Here’s a link to the log itself, including altitude hold, position hold, brief altitude hold + yaw autotune, large control inputs in altitude hold, drift, and RTL modes.

2 Likes