AutoTune: failing to level

I’m having a bit of trouble with getting autotune to complete successfully, I continue to get the message of “AutoTune: failing to level, please tune manually” but it does seem like the auto tune is doing something. I’ve read through some of the solutions posted but nothing is working yet. The manual tune is not perfect but definitely flyable, it tends to freak out a bit when I try to induce an oscillation (full stick back and forth continuously) which is what I am trying to minimize after an auto tune.
Any tips on what i can change to give it a better shot at completing? The drone can fly for about an hour so I could just wait it out though I am not sure if that’s recommended.
I have attached a log bellow of the flight, after this flight i performed another with additional weight but the same problem still occurs. The drone is an Arris m900 with a 5.2kg AUW later increased to 6.4, please let me know if you have any advice.

Thanks,

There are almost certainly too low, set them back to default.
ATC_ANG_PIT_P,3.5
ATC_ANG_RLL_P,3.5
You can try with an aggression at 0.075 but default (0.100) usually works better.

And you have Output oscillation which should have have been realized before running Auto Tune. Set these:
PSC_ACCZ_I,0.48
PSC_ACCZ_P,0.24

The Notch filter should be configured before running Auto Tune, so set these and make a short AltHold Hover flight:
INS_ACCEL_FILTER,10
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

Read the Wiki for throttle based Notch Filter and configure or post the log here.

I will make those changes and try to run it again. I attempted to set a notch filter before auto tuning but I couldn’t make sense of the graphs on the wiki and if the frequency should be set to 47hz or 92hz, so I reverted the changes.

Set the Notch center frequency to 48Hz and BW to 24Hz. You can use the Browser Based Filter review tool to produce estimated settings and review. I won’t post those graphs here, you can set them up for yourself and review:
Filter Review Tool

I set all the changes and applying the notch filter seemed to drop the spike at 48hz by about .1, not sure how I can increase the intensity of the notch or if I should in the first place but it is trending in the right direction. The log file is below.
For auto tune I attempted to run it again and I would still get the same error in regards to the aircraft failing to level. I let it run for a little while but the wind started to pick up so the outputted tune would probably not have been the best anyways. I also tried to run it from loiter which seemed to work a bit worse as it was trying to hold its position. I’ll try it again when the winds are lower.

I reduced the PIDs a bit and tried again in lower winds to tune each axis one at a time and this time it worked. The error was still popping up, more so on yaw, but at least the auto tune completed. I do not think the tune was particularly good however. I performed 4 flights, on the first tuning roll the outputted numbers made sense and it flew ok but propwash is more noticeable, looking at the logs and there was a bit of an improvement. However, on the second flight tuning pitch, the outputted numbers seemed much too high compared to roll, the logs seem ok but the numbers didn’t make sense to me. I didn’t want the pitch tune to affect the yaw so I just copied over the roll params to pitch since the frame is symmetrical.

Tuning yaw on the third flight and once completed it felt a bit sluggish but better overall, looking at the logs it looks like It added high frequency oscillations with these settings however. The only problem now is in loiter mode on the fourth flight, when carrying speed once I release the stick the drone comes to a stop and loses altitude, the faster I go the worse it gets until the drone starts to oscillate as it descends briefly. I’m not sure if having the gps on a mount and not accounting for it is causing this or if it’s something else. Any ideas how I can mitigate that?

Probably it is now a baro problem. Make sure the wind pressure does not change the air pressure measure of the barometer. Use foam to achieve that.

Post a log of a flight post auto tune with some normal flying and some hovering.

Here is a log with some normal flying from today, I still feel like it is flying a bit worse than before in loiter mode.
I don’t think the barometer is at fault for the loss in altitude, i think it has to do with the loiter parameters or the attitude vs altitude parameters.

I had the same problem a few time in the past. For me it worked all the time to reduce the D-Term of pitch and roll to a very low value like 0.001 or 0.002 for autotune. After that it worked flawless.

BR

Harald

I would set these back to default to re-stablish a baseline (values shown are what you have now):
PSC_POSXY_P,0.7
PSC_POSZ_P,2
PSC_VELXY_D,0.4
PSC_VELXY_P,3
PSC_VELZ_P,3.8
This will be very soft, perhaps lower it some:
ATC_INPUT_TC,0.4
And you need to re-enable these to check how the Notch filter is doing:
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

Then another flight.

So I lowered the D term as well as applied all your changes and attempted to run auto tune but it was visibly oscillating between twitches. Because of this the progress was very slow so I decided to increase the D term back up to where it was from the previous auto tune flight. Now the auto tune completed for roll and it does feel better than it did before, i applied the same pids from roll to pitch and it seems better from a pilot perspective but not much was changed in the pids.
In the notch filter flight the loiter seemed to have less oscillations but the same problem still exists, just a bit less so. When carrying speed in loiter once the stick is release the drone will lose altitude and oscillate a bit as it’s coming to a stop. Seems to do it more for pitch rather than roll. When off the sticks the loiter is almost perfectly still which it was not before so that is excellent to see!
I think the notch filter is working better now too.

Yea, you don’t want to do that on a craft that size. That advice was likely from a smaller craft.

Every time I look at the parameters file I see something else off of default. Set the Loiter Parameters back to default. Probably should have started with a reset all to default but no point now.

There is a bit of overshoot on Pitch and Roll. PID’s could be increased a bit I think. Try the Rate P&I’s to 0.14 and the D-terms to 0.006. Transmitter based tuning is the most efficient way to manual tune if you want to try that.

The notch filter is working OK. There is a mode at 37Hz but it may not be worth applying a static notch to. The vibe levels on this craft are not great, X-vibes are a bit high. Are the props balanced?

Also there is still some mechanical yaw bias. Typically from Twisted arms or motor mounts.

I had adjusted some of the loiter parameters to make it a bit smoother, I thought the defaults would be a bit too aggressive basing it off of other large quads that were tuned well. I set those back to defaults just to rule that out just incase.

You really know your stuff! one of the motors was off by about 3 degrees, I assumed the manufacturers would have leveled all the motors but maybe it was bumped out of alignment. I’m curious to know how auto tune would work now with all the motors leveled.

In addition to setting those pids I also setup GPS for yaw as well as using RTK to eliminate the baro as a potential source of error for the alt loss in loiter. After testing it out it seems even better now, I think it is still losing alt but less so. Less oscillations as well but they are still noticeable every now and then.

I think changing the angle of that motor also changed the frequency of where the notch should be so I believe that needs adjustment.

In terms of vibrations the X axis still has more vibration than I’d like, the props are brand new but I haven’t checked the balance. The Pixhawk is mounted on a rubber ball damping mount which they preinstalled and I’m thinking a wire or something is making contact causing the vibes to spike during more aggressive maneuvering.

Wow, big improvement all around. Still need a bit more Pitch/Roll authority. You can try just increasing the Rate D-term more with the same P&I’s and see if it closes the overshoot gap. If I was doing it I would do that and put Rate kP on a Tx tune pot from .14 to .28 and step thru that range giving pitch/roll input after each step (5 steps). Manual tuning can be a bit time consuming…
This is looking really good:


Yaw bias is gone, nice work! And the vibe modes have changed as you suggested. Before resetting the notch you should balance the props and check that wiring. I do this on every 2 bladed prop >6", you can’t rely on the manufacturer.

Did you go set the Motor Ranges? They are at default:
Setting Motor Ranges

I would not bother personally. I would always Manual Tune from this point but you can try it. Easy enough to revert back. A Yaw Auto Tune only might be worthwhile.

This can addressed if it’s still an issue after tuning is completed.

One 2nd thought update these notch parameters:
INS_HNTCH_FM_RAT,0.8
INS_HNTCH_FREQ,42
INS_HNTCH_BW,21

My transmitter doesn’t have any pots (mk15) so I decided to just do a very brief set of flights while incrementing the roll rate P&I’s only. First flight was the original tune, then i increased the D term a bit and each subsequent flight I increased the P&I’s by 0.01 until I noticed it starting to fly worse. From flying it and looking at the logs I believe setting the roll P&I’s to 0.17 yielded the best results (second last flight), I tested it in loiter as well and it seems pretty good. I think I might set the pitch the same way and call it good for now. Might run a yaw auto tune later on.

I’m going to order a prop balancer so in the future I can verify if that was the cause of the x vibrations that we are seeing, the wiring seems in order and nothing is able to flop around. I also corrected the motor ranges.

I set those notch params but i don’t think i was flying for long enough to give any meaningful result, either that or the noise is somehow lower than it was before.

Regardless the drone is flying much better now, thanks so much for your support on this project I really appreciated it!

The harmonic notch filer is working quite well

1 Like

Yes, looking good. In this log Roll looks great so I think your logic is sound with P&I’s at 0.17. You may not be able to increase PID’s much if any more w/o oscillation but you could try increasing these:
ATC_ANG_PIT_P
ATC_ANG_RLL_P
I tend to fiddle with the PID’s to eke out the last bit of performance but you may not want to bother. In any case you will want to wait until you check the prop balance and hope the vibe levels drop.
I see you have the motor ranges set.
Nice job in general working thru it!

1 Like