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.
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.
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.