AutoTune is failing. "Failing to level, please tune manually"

Hi all, I’m trying to get my QAV250 frame with a PixHawk 4 Mini flight controller to go through the AutoTune sequence. I get a couple recurring messages:

“AUTOTUNE: ROLL RATE D UP 0%”
repeated every couple seconds, followed by
“AUTOTUNE: FAILING TO LEVEL, PLEASE TUNE MANUALLY”

I don’t observer any obvious twitching going on. The current tuning seems fairly solid in Stabilized and AltHold, but I’d like to get AutoTune to dial things in tighter. I have it set to only attempt to tune the roll axis at the moment, since I don’t think the battery will last through all three axes.

Any ideas how to get AutoTune to run? I’d prefer that over manual tuning.

Log file for one of the flights: https://drive.google.com/file/d/1WwzuAPmHaI02RMBc8Um0nGDhXUbbJ3iA/view?usp=sharing

A 5", or whatever you have on that frame will not be Stable on the PID’s you have set and the result is oscillation on the Motor outputs and very poor initial tuning. I would reset to default and start over as this will never work:
ATC_RAT_PIT_I,0.135
ATC_RAT_PIT_P,0.04
ATC_RAT_RLL_I,0.135
ATC_RAT_RLL_P,0.04

Or:
Set those to .07

INS_ACCEL_FILTER to 10Hz
These to the tuning guide based on MOT_THST_HOVER:
PSC_ACCZ_I
PSC_ACCZ_P

Setup to configure the Dynamic Notch Filter:
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

Then do a AltHold hover flight for a minute or so and configure the Notch Filter as per the Wiki.
Auto Tune

1 Like

Shouldn’t it be: PSC_ACCZ_I = 2 X MOT_THST_HOVER

Yea with P at MOT_THST_HOVER. I think it’s best to suggest a look at the Tuning Wiki as there is a lot of other valuable information there in the Initial Tuning Flight section before you get to those parameters.

1 Like

Thanks for the suggestions, I was able to get the drone to enter Autotune. However, it visually appears somewhat unstable in flight still. I’m not sure if this is just to be expected or if it’s possible to tune out. Here’s a video of it in flight post-autotune, I’d be very interested to hear your thoughts!

It will be noise. Watch the tuning parts of this series - https://www.youtube.com/playlist?list=PL_O9QDs-WAVwjoukkLInqQHmelJzSSNx3 - and you should be able to resolve your issues.

A .bin flight log is worth much more than a video.

Watching through your videos now Andy, thanks.

And of course, here’s the bin file for the final autotune flight where I captured this video.
https://drive.google.com/file/d/14mURqZlVSL6nlaurbs8tEj2XCsj4yWVk/view?usp=sharing

video → onus on user, bin flight log → onus on helper

1 Like

Ah, an Auto Tune flight log. My bad for not being clear. A flight log of a flight after Auto Tune was completed. The actual log of the Auto Tune session isn’t that valuable unless you are trying to pull something out of of it.

Ok, here’s a short flight that demonstrated the “bouncing” behavior from today.

https://drive.google.com/file/d/1DI9WhYv4F11JGrqJn2vhmMSiWpKcin4g/view?usp=sharing

You didn’t set these (from MOT_THST_HOVER):
PSC_ACCZ_I
PSC_ACCZ_P

Not sure what you are doing with both of those notch filters. Re-enable these and make another hover flight:
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

Ah, I missed setting those parameters (PSC_ACCZ_I and PSC_ACCZ_P). I’m not able to set PSC_ACCZ_P equal to MOT_THST_HOVER though, since MOT_THST_HOVER = 0.13 and the minimum allowable P value is 0.2. So I set that P value to 0.2 and I set the I value to 2x MOT_THST_HOVER. This alone seems to have made the flight characteristics a lot more stable, thank you!

With the two harmonic notch filters, I was just trying to follow the process on the wiki and on Andy’s videos. The FFT showed two peaks on the first main peak, so I set each filter to be centered on each peak, and then followed the process through for each individual filter as described in the wiki. Would it be better to just set the first harmonic notch filter to be roughly centered on the overall peak?

In full parameters, or full parameter tree, you can set any value you like - it’s just MissionPlanner giving you a warning.
Set them as Dave advises.

It’s very unusual to need two HNOTCH filters, but possible. Have you got a new log with these set
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

Brian, you are really going to struggle on a quad of that size unless you can use the ESC telemetry driven notches. Are your ESC’s BLHeli32?

That’s interesting to hear Andy, I didn’t realize ESC telemetry driven notches would be critical for a small drone. I do have the BLHeli32 ESCs. I’ll look into the ESC telemetry based tuning process and report back.

I’ll include a bin file of the new tuning flight, hopefully today.

If you do that then use the Bdshot version of firmware. It’s a better source for Motor RPM than serial telemetry.

Got it on the P value. I updated it to 0.13. Here’s a log of the IMU sampling flight from today.
I’ll move on to figuring out the ESC Telemetry based HNOTCH filter this evening, thanks everyone for your help!

https://drive.google.com/file/d/12JIHGoK201pStDzs7K5XzzPwDDO3P7ij/view?usp=sharing

Oscillation is gone, so far so good there.

The HNOTCH is working OK in it’s current form, but might struggle when you get into more dynamic flight, so do persist with changing to bi-directional DSHOT firmware and related changes.