In-Depth PID Tuning Guide

3
33181

 

PID Tuning.

Serious FPV pilots take great care in tuning their fleet. Dialing in every quad to its perfect settings, and then ripping up the track at local meets and national competitions. PID Tuning might seem intimidating at first, and to some extent, it is. But my goal is that, by the end of this guide, you’ll have a grasp on why PID tuning is important and how it works, as well as some basic reference points to help you dial-in any quad out at the field.

With that, lets get started.


 

WHAT IS PID TUNING?

PID stands for Proportional, Integral, and Derivative. Because pilots only have 2 hands, controlling 4 motors on a quadcopter manually (like you would an RC Plane) is next to impossible. So, we have an onboard Flight Controller help us to control the craft. The goal of PID tuning is to try and get the craft to execute  the pilots command , with just the right amount of influence from the fc, a perfect combination of man and machine. So, think of PID tuning like telling your Flight Controller what to do when X event happens. Hard to understand? Okay, lets take a closer look at what’s going on inside your Flight Controller.

If you’re flying in Acro Mode, that is, where no Auto-Stabilization is taking place, your Flight Controller has one sensor active, and that is the Gyroscope. The Gyro is responsible for collecting information about the craft’s current state- which is why its CRITICAL that your quad is as level and square as possible when you calibrate the gyros, so that the Gyros can zero properly. Anyway, the onboard Gyro takes the data collected and processes it through the algorithms P, I, and D, in order to get the final result as close as possible to the desired result. The Flight Controller’s job is a constant process of recalculating where exactly to apply thrust to maintain its commands. Each letter in PID has a different job when calculating the desired result, and each axis has its own separate PID tuning for Pitch, Roll, and Yaw.

  • P- Proportional: The Proportional gain responds to the present error. This tells the quadcopter at what angle it should be at, trying to get the final result as close as possible to the pilot’s input. If you were to try flying with no P Gain, the quadcopter would be very sloppy and floaty, as it would not try to correct the pilot’s input to get the desired input.
  • I- Integral: The Integral gain is used to collect past data errors and use them to correct the craft. It assists the P gain and helps to keep the quad corrected from outside forces like wind. However, a tuned I gain will not correct outside forces like auto-stabilize will. Rather, it will hold the quad steady in its last position, so that you don’t have to continuously correct it. When flying forwards at a pretty high speed, you can see if your I gain is tuned by letting go of the stick and seeing how well it maintains its angle specified by the pilot.
  • D- Derivative: And finally, Derivative. You can think of D as a cushion, helping to smooth the movement from one position to another. If you notice your quadcopter flies with very “jerky” inputs, your D gain likely needs to be tuned. D can help to limit vibrations and make the entire quad fly smooth, but because it blends the P and I gains (especially P), you may actually need to tune your P and I gains to adjust them for the D gain. We’ll talk about tuning next.

 

TUNING YOUR PIDs

You should almost, if not always, start with the P gain, then to I, then to D, and then re-tune all 3 here and there until you’re happy with the result. PID tuning just takes a little bit of experience, and the more quads you’ve tuned the better you’ll get at it. Before we get started, there is something that you should know.

EVERY QUAD IS DIFFERENT

And although that sounds like a motivational poster, its true. If you decide to switch from a 3S battery to a 4S battery, you’ll have to retune your PID’s. If you decide to switch from 2-bladed props to tri-blades, you’ll have to retune. However, it is worth noting that cleanflight allows you to adding PID profiles to a switch, which makes switching from 3s to 4s less of a nightmare. You can also have the exact same setup as someone else, and their PID’s might not work with your quad 100%. For the most part, PID tuning across similar platforms works, but it often needs tweaking. Flying style will also drastically effect your PID’s. For instance, FPV pilots Skitzo and Steele both fly the ImpulseRC Alien frame, and their setups are very much alike, take one look at their videos and you’ll see a huge difference in flying style. While your PID’s don’t necessarily make you a better pilot or change your ultimate flying style, they are not one-size-fits-all. With that out of the way, let’s get the actually tuning your quadcopter.


 

P GAIN: Proportional gain is the first thing you should tune. Slowly, gradually, increase your P gain until the quad just barely starts to oscillate. Then back it down a few ticks until you’re happy with it. If your P gain is too high, the quad will oscillate and feel very shaky and unstable. If your P gain is too low, it’ll feel like you’re trying to fly through syrup. Once your P gain is tuned, we can move onto the I gain.

I GAIN: Integral gain, when tuned properly, should make every control input be as rock-solid as possible, with no slop, optimally. Your I gain should be tuned so that outside elements like wind don’t push the quadcopter from its intended position unless the pilot specifies to do so. Tuned I gains will keep the quad steady, while an I gain that is too high will overcorrect and an I gain that is too low won’t hold the control input very well and your controls will feel like jello. If your quad shakes when descending, turn down your I gain just a little.

D GAIN: The need for Derivative gain is especially noticeable when making aggressive maneuvers, especially tight turns. Your quadcopter might wobble or oscillate uncontrollably as it tries to correct itself. When this happens, you know your D gain is too low. Keep turning the D gain up, until the quad is smoothed out enough so that, in an aggressive maneuver, the quad still remains relatively stable. But if you turn your D gain too high, it will smooth the maneuver too much and the quadcopter will feel unresponsive.


Congratulations, you’ve made it through the basics of PID tuning! As you can see, PID tuning isn’t exactly easy, but its not too bad in terms of difficulty either. But, there is even more to tuning your quadcopter and other options you can choose. And we haven’t even covered Yaw PID’s. But, these are ADVANCED OPTIONS for experienced pilots. So, proceed at your own risk.


 


LOOPTIME

A seemingly not talked-about part of tuning is the your flight controller’s looptime. Looptime is the time it takes for, in microseconds, your flight controller to process the data it has collected through its PID’s and then send it to the ESC’s. You can set this looptime in some FC software, such as Cleanflight. Changing your looptime will change how your PID’s effect flight performance. For the most part, a lower looptime will mean a more responsive machine with potential vibration problems, while a higher looptime will mean a less responsive machine but with much smoother flight characteristics. You will have to re-tune, or at least tweak your PID’s after changing the looptime, so this is an advanced option.


TPA- Throttle PID Attenuation

TPA is typically an option used by pilots like Skitzo, that want to achieve very smooth flight. TPA takes your PID’s and lowers them when your throttle reaches above a set point. The result is crazy-smooth flying with very little vibrations. Your PID’s are changing when you are causing at high speed, so tuning your PID’s becomes a little bit more difficult because you’ll have to think about how the quad flies before and after TPA kicks in automatically. Again, an advanced option for advanced users.


BETAFLIGHT

Betaflight is an experimental version of CleanFlight that changes the way control loops work. The result is incredible flight characteristics on basically any quad, on default settings. It requires very little tuning(in most cases), and because its experimental (and open-source), may or may not merge with CleanFlight in the future as Flight Controller technology gets cheaper, faster, and smaller. As of now, Betaflight is basically overclocking your flight controller to achieve its new take at control loop processing. But since overclocking is technically pushing the Flight Controller harder than what it is designed to do, it makes Betaflight that much more unpredictable. Betaflight is available for most common platforms, and even supports the Vortex’s Fusion FC/OSD. Remember that this version of CleanFlight is experimental!

If you want to check out the BetaFlight project, click here.


YAW PID’s

For the most part, the default Yaw PID’s that come default on your Flight Controller will be just fine. But, in the event you decide to build a quadcopter that has some weird yaw properties, or you’re like me and think you’re cool if you set your own Yaw PID’s, don’t worry, its pretty straight-forward. Ultimately, we don’t want the yaw to mess with the rest of the craft’s flight. First, start off by hovering. Yaw in a direction using about 40-50% of the stick range. Then, let go of the stick. Observe that the quad stops quickly. If its sluggish, turn the P gain up. If the quad stops hard and dips on the pitch/roll axis, your P gain is too high and should be backed down. Next, tune the D gain so that when the quad yaws, it is a little smoother when it starts the yaw and finishes it, but not so much that its sloppy. You can tune this setting while under the goggles. Keep turning the D gain up until it just barely starts to feel “mushy”, and then turn it down just a  little until you’re happy with it. Yaw control should be responsive, but not so sudden that it disrupts the quad. Now, onto the I gain. To tune the I gain, fly the quad diagonally- that is, flying the quad like you would fly it forwards, but angled maybe 40 degrees to the left or right. Let go of the stick and see if the quad tries to continue yawing. If so, increase the I gain. Once it seems to hold its position, you have it tuned properly.


PID CONTROLLERS 

In CleanFlight, you can select a different “PID Controller”. These PID Controllers all make the quad behave differently, and all need different set of PID’s in order to fly properly, although tuning is much the same across all platforms. In CleanFlight there are currently 6 different PID Controllers supported. They are the following:

  • PID CONTROLLER = 0 (Multiwii)
  • PID CONTROLLER = 1 (Multiwii Rewrite)
  • PID CONTROLLER = 2 (Luxfloat)
  • PID CONTROLLER = 3 (Multiwii 23)
  • PID CONTROLLER = 4 (MultiWii Hybrid)
  • PID CONTROLLER = 5 (Harakiri)

Each controller responds differently to stick input and PID settings. The difference between each PID controller may or may not be a future article here, but in the meantime, just experiment and see what feels the most natural with its default PID’s, and then go from there. Personally, I use PID Controller 1, but I know pilots that have had success with all of the PID controller options.


 


 

PID Flow Chart

 

 

 

SHARE
Previous articleThe Hubsan x4 Guide
Next article5 Tips For Maintaining Your Quad
Preferring his username than his real name, Glitchy got into FPV in late 2014 and spent more than 8 months trying build a capable FPV platform. In those 8 months Glitchy was given several rewards, such as "Most Likely To Break Everything He Owns" by his very concerned friends, and "Most Unlucky Person To Walk The Face Of The Earth" by FrSky. He currently lives in Michigan with a Caipirinha, Vortex, and enough broken parts to justify his existence.

3 COMMENTS

Comments are closed.