PID tuning is was a huge part of getting your copter to fly well. Back in the days of Naze32s, Baseflight, and older versions of Cleanflight, if you didn’t tune your copter, the stock settings resulted in an impossible to fly copter that vibrated like crazy and had a mind of its own.
Then along came BetaFlight, and the was Boris re did the PID algorithms made copters suddenly fly better even on stock settings. You would still need to do some tuning to get it flying just right, though.
Since Betaflight first came out, the PID algorithm has been constantly updated, and with BetaFlight 3.0 onwards, it’s reached a whole new level, especially since you can tune through the OSD on boards like the Betaflight F3.
PID Tuning the old way
I have compiled quite an extensive guide on PID tuning which puts together the best PID tuning resources on the internet – I highly suggest you check it out and go through it as it’s still important to know which value does what.
To recap:
P(roportional) = This affects how responsive the motors are to your stick inputs and directly affects behavior. A low P gain will result in a sloppy copter that doesn’t quite move the way you want it to, and a high P gain will cause the copter to oscillate because it’s constantly trying to overcorrect itself to maintain the inputs you give it.
A “sweet spot” for the P gain is just a little bit of oscillation which you can dampen with the D gain.
To tune the P gain(on firmwares below Betaflight 3.0), you would turn down your I gain and D gain, and slowly start increasing the P gain until you could see/hear oscillations. Then you could either dial it back a little, or leave it where it is.
I(ntegral) = This affects how the copter maintains its attitude. The I gain makes sure that the copter is pointing in the direction you want it to be pointing in, and maintaining that direction. Low I often results in the nose dipping/going up or a bit on unwanted roll when you punch out, or when you punch out, chop the throttle, and punch out again. If I is too high, then the copter will start to wobble very slowly and steadily, but to large extents.
D(erivative) = This effectively dampens the P gain – which is why you can have slight oscillations on P without any D and then dampen those down with D gain. If your D gain gets too high, then your motors will get hot and maybe even smoke out – you want to be careful when increasing D, especially on powerful motors and heavy props.
PID tuning in Betaflight 3.0 and above(the easy way)
From Betaflight 3.0 onwards, the developers have really dialed in the default P gains for all 3 axes, as well as the D gain. When you do your maiden flight, you may not have any oscillations at all and your copter may just fly superbly right out of the proverbial box.
Still, you should do a quick test to see what’s up – take a couple of laps around a path, and do some sharp turns and rolls. During the sharp turns, you want to see if you are getting any propwash oscillations. And during the rolls, you want to see if you’re overshooting/undershooting the rolls and flips or you’re getting any wobble at the end of the rolls and flips.
- Overshooting/undershooting rolls and flips is indicative of a low P gain – you can move P gain up just a little until you feel your rolls and flips are dialed in(a little wobble at the end is OK for now)
- If you’re getting wobble at the end of rolls and flips, then your P gain is OK and you can fix that by raising your D gain.
- If you’re getting propwash oscillations, first try to fix them by increasing the D gain – if you’ve increased D gain significantly and it still hasn’t solved the issue, you can set D gain back to where it was and decrease the P gain little by little.
However, you may find that decreasing the P gain makes your copter sloppy – which is not good .
Here comes the tricky part: you may find that no amount of decreasing P gain or increasing D gain is getting rid of propwash or other weird oscillations – in that case, it’s probably a noisy gyro and you need to change the gyro filter settings. Set your D gain back to stock, and start lowering your gyro_lowpass filter – the default should be 100 – decrease it by 10 points at a time.
You can do this through the Filters tab in the PID tuning tab of Betaflight, or if you’re using the OSD, there is an option in the OSD too.
Once you’ve decreased the filter value, you’ll see that the vibrations are less than before – now try increasing D again to a reasonable level and trying to get rid of your unwanted vibrations and propwash.
At this point, you must check that your motors are not getting too hot any time you increase the D gain – if your motors are too hot to touch, then you’re at risk for smoking your motors!
If you increased D a lot and the vibrations are still there, decrease the filter by 10 more points and repeat.
The reason I’m stressing playing with D and filters more than playing with P is that the way P works on Betaflight 3.0 with powerful motors, you can bump up P by a lot and D will properly filter it and you won’t have bad oscillations.
Note: the key to notice P oscillations is to listen for them – P oscillations are very harmonic, and have a defined frequency
Instead, leave P where it is – or even increase it a little if you feel the copter is sloppy – and start increasing D and if necessary lowering the filter value to get the vibrations out.
You also have to tune the I term
The I term is very easy to tune – do some punchouts and fast turns – and notice if the nose dips, or one side of the copter dips a little more than the other.
In case you see the nose dip, increase the I term on the Pitch axis until it gets better – but don’t go too high – you should be able to dial it in within 20-30 points(increase by 10 points at first and then use 5 point differences to dial it in).
If you see one side dip, then increase the I term on the Roll axis.
In case you see the copter yawing without you giving input, then you can a) increase the yaw P term a little and see if that does the trick or b) increase the yaw I term a little and see if that does the trick.
It’s always better to try and dial in P perfectly before anything else, though, as that allows you the most control.
If none of that fixes the dipping, you can add some anti_gravity gain.
Configuring your rates
Betaflight has a neat rates feature called Super Rate, which helps you combine rate and expo to get a really nice curve and have your sticks be as sensitive/responsive as you need them to be.
If you choose to use RC rate and expo, then your degrees/second of rotation will change even as you increase the roll/pitch/yaw rate.
I would suggest first adjusting the RC rate and Expo until you see a curve that you like – the center of the graph is center stick, and the lines are how responsive the sticks will be depending on how far you push them.
For acro flying, I keep the rates in a way that the center stick is slightly less responsive, and the further you go out, the faster the quad responds. This lets me make minor corrections very smoothly, and also allows me to do very fast flips and rolls and the full deflection of sticks.
The higher your RC rate will be, the more “S” shaped the curve will be. The more expo you add, the flatter the “body” of the S will become.
Once you’ve got a shape you like, increase the roll/pitch/yaw rate until you see a maximum degrees per second you are comfortable with.
Removing filters
(coming soon)
ArcherFPV says
Love this tuning guide. After watching a crap ton of videos and never fully understanding it I find your article. You had some info that I’ve never heard in a vid or at least didn’t pay it any attention. Now I have finally got my I tuned to where I don’t have a roll axis wobble on a punch out woohoo. My P and D were pretty much there but I tweaked a little and got her flying perfect. I’ve had this little 210 for a good 8 months but never had tuned it as betaflight stock pids were pretty good except that punch out wobble. Thanks for the info!
Gulzaar says
Hi ArcherFPV!
Thank you so much for the kind words(and sorry for the delay in replying)
You’re very welcome and happy flying – keep ripping!
ArcherFPV says
No worries! But I did finally get my 3inch tuned for both 3s and 4s. The pids are a little tame tho so I can run both with out having to retune. I love the way she flys now tho. Once I go to just 4s I will retune her tho. Now my 5 inch freestyle rig…. wow, just wow at the way she flys now. Perfect!
Gulzaar says
Awesome, glad to hear that!
BTW, I’m sure your’e aware that you can have two different PID profiles – say one for 3S and one for 4S. Just copy the 3S profile onto the second one and start making that one more aggressive until you get a good fit for 4S 🙂
Andy says
I agree with the previous commenter. I too have watched every video around and your explanation is the best. One issue I have always had with my new quads is that out of the box its super-bouncy (up/down). The typical recommendations are to focus on the Throttle Expo to smooth it out but can this be related to non-optimized PID settings?
Gulzaar says
Hi Andy,
Thank you for the kind words. Bouncy as in throughout the flight, or wobbling and not maintaining attitude? If the former, then your P gains are probably too high, but it’s strange that it’s present in all of your quads.
Otherwise your I gains are off, or you can just try to turn on the Anti Gravity feature.
George says
Question. I roll to the left about 30-45º and then I punch out. The quad maintains the attitude but as soon as I cut throttle it rolls to the right quite a bit like it’s rolling over dead. I have anti-gravity at 6. It’s not nearly as bad on the left. Any ideas? Using Dshot1200 and T Motors F40 Pro IIs 2600kv. 5x4x3 V1S.
Gulzaar says
Hmm, that’s strange. I would try swapping the motors from the left to the right and seeing if you have the same issue.
Ethan says
This has helped me a LOT. The only thing that confuses me is that I am running a Emax Magnum stack with Emax(2600) motors and lowered my D from stock by 10 points on roll/pitch. The motors still run a little hot, but today was 90 degrees out.
Can you go lower than 20 on D? I was told that if you do and then come up, you run the risk of burning up your motors?
Gulzaar says
Hey. You can go as low on D as you want, it’s a high D term that can possibly burn your motors. What do you mean “a little” hot? If you can still grip them, they’re fine. The moment they’re too hot to grip, you are in problem territory. Lowering the D term too much may mess up your flight.