Cleanflight PID controller 2 Yaw overshoot tuning

nilsen

Senior Member
Hey Guys,

I'm in the laborious process of tuning my QAV 250 and need some advice from the guru's.

I'm pretty happy with the flying characteristics for PID Controller 0 and had NO luck with PID Controller 1 but with Controller 2 (Floating point) I am actually quite happy with the exception of the YAW overshoot.
The Yaw is brilliantly precise and snappy but it overshoots.

Now I would normally increase I to hold the desired position but it doesn't seem to have any affect.

Any help would be appreciated.
 

FinalGlideAus

terrorizing squirrels
Are you meaning that when you yaw 180 deg and then stop it continues to yaw for a split second longer before stopping and then goes back? This is the sign of a low P gain. Either that or the quad is just so heavy that the motor torque is having trouble keeping up.
 

nilsen

Senior Member
I don't think it's a weight issue as on controller 0 the yaw is rock solid, it's just that with this controller it just kind of carries on a bit after yawing, the faster and harder I yaw the more it continues until it settles.

If I yaw 90 degrees it'll probably stop at 110. If I yaw 180 it'll probably stop at 230, etc.
 

Craftydan

Hostage Taker of Quads
Staff member
Moderator
Mentor
I agree with FGA -- your "I" is high enough if you're recentering/not drifting, but turning it higher is pushing you into borderline stability in "I", which is really what you're seeing.

"I" is there to prevent drift. Set it at an angle and it stays there. Bump it off in a correction and "P" returns the gyro rate to 0 asquickly as it can, "I" remembers how much farther back it needs to go to return to where it was while P is slowing everything down. Too much and "I" will force a positional overshoot.

IMO "I" should never be higher than is needed to prevent drift (maybe a touch above that). Any higher and it contributes to instability and actually reduces your responsiveness.
 
Last edited:

nilsen

Senior Member
Ok I dropped it a lot and tried with 2 separate profiles, not looking so good as it still swings after I let go of the sticks.

Profile 2 is the first part of the video, profile 3 is the second part, both with quite different YAW settings yet similar result.

Profile 2
Screen Shot 2015-02-02 at 16.28.36.png

Profile 3
Screen Shot 2015-02-02 at 16.28.51.png


Thanks Gents
 

FinalGlideAus

terrorizing squirrels
Are they Gemfan 5030 props. I'm watching at work on my phone with a lot of background noise so it's hard to tell. Little light weight props like the 5030 have bad yaw authority. Try increasing yaw P to about 11 but keep an eye on temps. CraftyDan is right, you want your I gains as low as you can have so it still holds the quad in place but doesn't start to effect response too much. D gains are similar as well.
 

nilsen

Senior Member
Thanks FGA, I'll give it a try this evening.
Yes those are the rubbery flappy 5030 props, the odd thing is that on the "standard" PID controller the yaw isn't half bad.

On a side note, I have been using tthe QAV250 with 3s 1300 and it's fast-ish (I mean compared to my large hex and other things) however I put in a 4s 1300 nanotech and it becomes a rocketship. Phenomenal.
I'm scared to add the tilted motor mounts and 6 inch props. I have a new appreciation for all od you guys and your mad flying skills.
I also really appreciate how important proper PID's must be at those speeds.
 

FinalGlideAus

terrorizing squirrels
PID controller 1 doesn't link PID's with RCrate like PID controller 0 so what in fact happens is you get a more responsive yaw. That will in turn make the overshoot worse so you need to tune accordingly.

Trust me when I say that when you change from the GF5030 to the bullnoseHQ 5x4.5 or the HQ6x4.5 props it's like pulling out the old 1.5 4 cylinder engine out of your car and putting a Formula 1 engine back in its place as well as transferring the suspension over as well :)
 

FinalGlideAus

terrorizing squirrels
Just watched the video on my computer. Are you flying in stabilized mode? IF so then maybe PID 1 is not for you. PID 1 was designed to work the best in rate mode and I believe stabilized modes are not as good. If flying in a stabilized mode I would suggest sticking with PID 0 or if you want similar feel to PID 1 then try PID 3 which is in the latest beta FW. PID 3 is a port of MW2.3 which I intend to compare when I next have a chance for the cleanflight dev team.
 

nilsen

Senior Member
so I tried with PID 1 in Rate mode and you're right, it does fly much better than 0 in rate mode. The tuning I was talking about above is on PID 2 (the float point one) even though it's experimental and all of the bugs aren't ironed out yet it does fly well in the stabilized modes as well as rate mode, although I noticed that the Rates aren't the same in Horizon and Rate mode (flips and rolls were much slower in rate mode, maybe it was just me).
I'll give PID 3 a try this evening but I really want to get PID 2 tuned nicely, my only gripe at the moment is the yaw overshoot but I'll up the P this evening when I get home from work and see what effect that has.
Thanks again!