Swinging in Loiter only by Roll

Some strange issue with loiter, in Althold pids are working fine, in Loiter drone starts to swing by roll, by pitch is everything fine…

Today drone crashed, it started to fly forward and didn’t react on RC…

Log here:

Drone flies well, stabilizes well in AltHold until i switch to Loiter…
It’s due to high vibrations?

Tuning is poor and the Motor outputs are oscillating.

The vibe spike was probably the effect not the cause. Something happened here with thrust loss on Motor 2&4. Maybe they got hot from the oscillation:

And surely this is a mistake: ATC_RAT_PIT_I,0.01
I see you have Auto Tune aggression at .05. That can produce a poor result.
And the Notch Filter isn’t configured.

I can’t start Autotune on this drone - “autotune failing to level please tune manually”
I’ve copied that parameters from previous drone, that has finished autotune by roll and pitch, with yaw i had same issue…

For tuning i’ve used calculator in MP (34inch props), but autotune doesn’t starts, so i’ve copied paramaters from same drone where Autotune has same error, but finished tuning by pitch and roll.

For doing Alt Hold, Arducopter uses 8 PIDs.
For doing Loiter it uses the same 8 inner PIDs and ads 2 more outer PIDs.
This is an over simplification to let you understand where Loiter is different from AltHold.

To get Loiter to work, the 8 inner PID need to be working properly, otherwise the 2 outer PIDs can make the vehicle do strange things.

We have a wiki PR that clearly shows 6 of the inner PIDs, and how to build a mathematical model and after that optimize it according to the desired requirements without using autotune. We will add information on the missing 2 altitude inner loops soonish. If you are good with math you could try to follow that.

1 Like

My point was that the I value is not good. Auto Tune would not set it like this so I assume it’s an entry mistake.

Rate P&I are generally equal.

I’m stuck with it…
I’ve reset everything to default settings, used calculator in MP to set initial parameters and used Tmotor ESC parameters as Hobbywing X9 has save pwm values.

and autotune throws error: “autotune failing to level please tune manually”

after finishing autotune by roll I’ve disarmed drone then armed it again, and drone almost flipped over due to very high P value after autotune…

Can you suggest me some way to tune it?
I have quad with Hobbywing X9 motors (34 inch propellers)

Did you follow the instructions to test if PIDs are ok to do autotune?
Did you tuned the notch filter before attempting to do autotune?

I don’t see overshoot or a lot of oscilations here… Just some height drop

I’ve enabled notch filter (throttle based with default parameters)
Log here:

Enabling the Notch Filter with Default parameters doesn’t do anything. And if you want to collect data to configure it you need to set INS_LOG_BAT_MASK to 1 and INS_LOG_BAT_OPT to 0.

Already read about that, i’ll make that tomorrow morning

I wouldn’t do anything until you set Rate Pitch I equal to P. I would also set ATC_ANG__RLL back to default (same as Pitch). Default values for this are almost always lower than desired and you lowered it further.
Where did this come from? MOT_THST_EXPO,0

You have some parameters that make no sense, perhaps starting over from default would be the best choice.

Can you help me to setup notch filter, here’s the data:

Now i need to set values:

I can’t figure out how to get them from chart


Not much point in setting the Notch Filter when the outputs are oscillating this badly:

You need to get control of that 1st because the big spike at ~20Hz is probably from this and it needs to be fixed not filtered. You can’t use a Notch Filter with a center frequency of 20Hz it’s too low.

I see you still have the rate Pitch I way too low. 3rd time mentioning that. Start over.

I’ve reset all parameters to default, used initial parameters setup for 34inch props and flame ESC (Hobbywing x9 has same pwm values)

First flight in stabilize was very unstabled, drone just jumpes, so I lowered PSC_ACCZP to 0.22, second flight was also very unstable
also tried to use stock MOT_THST_EXPO 0.65, but I see same result…


OK, I would leave it there. Personally I don’t think the recommendation for low MOT_THST_EXPO values for Flame ESC’s is correct. It’s based on the assumption that the ESC’s have a linearization function. T-Motor told me directly this was not true. I have posted their reply on the forum here. But again just my opinion, others claim it’s required.

At this stage of tuning just make simple Hover flights in AltHold. Take-off, Hover for a minute or so, land and disarm. It wasn’t in the air long enough in the flight to learn much from it. Set INS_LOG_BAT_MASK to 1.

Problem fixed, that was antivibration plate, after removing it drone started to fly normally


Hello @DangerD512 can you please share the log files and your drone specs? Actually we are making a similar drone with 32 inch props but are not sure of initial pid values that we should use. Also what flight controller are you using?