02.05.2020

Arducopter Auto Pid Tuning

Here you will finally learn how to tune a quadcopter once and for all!

If you’ve searched google for a good PID tuning guide, chances are you already have a quadcopter and you’re probably starting to learn to fly. There’s only one problem. Your drone just doesn’t fly as good as the ones you see in those amazing FPV drone racing and freestyle videos.

Jan 18, 2015  My method for tuning arducopter 3.2. Will work on both APM or Pixhawk. Note: Once you’ve finished tuning, you can add STAB RATE P to the CH6 dial; this is good way of adjusting the flight characteristics without breaking the PID’s! Jun 22, 2016  Make sure you watch the tuning video at the bottom of the page to get a better understanding visually of how changing the PID settings affect your drone. I know the video is old and the drone I’m using is massive but it still illustrates the main effects of changing parameters. You are about to report the project 'Arducopter Advanced PID Tuning', please tell us the reason. Send message Hello, I really like your project and I think I have skills to help you. Sep 13, 2019  ArduPlane, ArduCopter, ArduRover source. Contribute to ArduPilot/ardupilot development by creating an account on GitHub.

You may have already tried looking into PID tuning and discovered that it’s just too hard to truly understand. Well, today I’m going to show you that you don’t have to technically understand what PID is to properly tune a quadcopter! Make sure you watch the tuning video at the bottom of the page to get a better understanding visually of how changing the PID settings affect your drone. I know the video is old and the drone I’m using is massive but it still illustrates the main effects of changing parameters.

Before getting started, you should know that every multi rotor is going to have different components that allow for different levels of tunability, but I’m going to assume that you have a small DIY FPV build and you want it to fly as fast, smooth and precise as possible. If that is the case then this guide will be perfect for you.

The Basics

If you’re a super nerd and you understand advanced math concepts, you can learn all about PID by finding a class about control theory. But for the rest of us, there’s no point even trying to fully understand PID because you’ll spend more time learning new math than actually learning how to tune a quadcopter.

PID is basically a specific function inside your flight controller that is responsible for stabilizing your drone. In order to tune a quadcopter, you have to give the PID function some useful parameters to go off of so it knows how it should behave. Honestly, it doesn’t matter what PID stands for, because most flight controllers and tutorials refer to the settings by using the acronyms anyway. I’m not going over the actual meanings behind the words because that would be too hard to understand for a lot of people, so just remember that PID stands for “proportional, integral and derivative” incase someone asks you.

Start the Tuning Process With CG

Before you start tuning, you should make sure that you have a quadcopter worthy of being tuned. One thing that most people don’t realize is that PID tuning is only half of the tuning process.

The first thing that I do before tuning is find the CG (get it balanced). Even the best quadcopter out there is going to fly terrible if the CG is really off, so don’t overlook this subject.

Every object that has mass will have a center-of-gravity (otherwise known as CG). to find the CG of a spoon for example, just simply place different points of the spoon on your finger until you get it to balance itself. you’ll notice that the CG of a spoon isn’t actually located at the center of the spoon, but closer to the bowl instead. However, if you try balancing a pencil you’ll notice that the CG is much closer to the center of the object.

Arducopter Auto Pid Tuning Tool

On a quadcopter, every aspect of flying is handled by the four rotors, so the idea is to get the CG as close to the center of all four motors as possible. Usually the flight controller is also located perfectly between all of the motors, so you can use that as a reference for where the CG needs to be. To change the CG of a quadcopter, all you need to do is move the flight battery forward or backward depending on which direction you want the CG to be moved. If you still can’t get the CG perfectly centered, try moving other parts like the video transmitter, HD camera or even the video transmitter antenna.

When adjusting the CG of an FPV quadcopter, you’re mainly focusing on the forward/backward direction, but on some frame designs where all of the electronics are stacked on top of each other (including the battery and camera) you might need to worry about CG in the up/down direction instead.

Lower Your Angular Mass

Angular mass (or rotational inertia) is basically just how much force is needed to rotate an object around its center of gravity. A great example of this is to spin in circles with your arms extended all the way out and then do the same thing with them in. You’ll notice that it’s much harder to spin with your arms out. This is because your arms have to physically travel much faster to achieve the same “angular speed” as they would when their closer to your body.

When a quadcopter is flipping, rolling or even yawing, it will require less force if the angular mass is lowered. In other words, flipping and yawing will be more precise and in some cases even faster. The question is how do you lower the angular mass of a drone? Well it’s really simple! Just move all of the components as close to the center of gravity as possible. For example, if you find that the battery needs to be pushed really far back to get the CG right, try moving the HD camera (located at the front) and the battery (located at the back) closer to the CG point (where the flight controller usually is).

Angular mass isn’t as Important as CG but it definitely makes a noticeable difference for me when flying.

Don’t Forget the Props

It’s common sense that changing any of the electronics on a drone (mainly the motors, ESCs and flight controller) will always effect how it flies, but people tend to forget how much of a difference props can make. I know that a lot of people like the bullnose prop style, but if you’re doing anything other than racing I wouldn’t recommend them and here’s why.

bullnose props create more thrust than something like an HQ 5x4x3 with the cost of losing efficiency, however they also lose precision. Because the bullnose props will spin at a lower RPM to generate the same amount of thrust as an HQ prop, your ESCs will be sending pulses to the motors at a lower frequency which means there will be less resolution to work with. This isn’t that much of an issue though.

The biggest issue with bullnose props is the increased weight and angular mass. Anything that needs to speed up and slow down really fast should have a low angular mass, so by putting extra weight on the tips of a prop, you’re really just slowing down how fast the quad can make corrections when flying. Did I mention that you will also have more vibrations because of the extra weight if you don’t balance them?

So to some up what I’m trying to say, just get some HQ 5x4x3 props (not the bullnose props) if you’re main flying style is not racing and you want the best tuning experience.

Getting Back To PID Tuning

Arducopter Auto Pid Tuning Kits

I’m going to start off by saying that there isn’t a simple and perfectly easy way of tuning a quadcopter, but I’ll try to take you through “my process of tuning” that seems to be working really well lately.

You won’t need to understand how PID technically works before going out and tuning, but you will need to know how to change parameters of the PID loop to get the effects that you want. To achieve this I’m going to give you a set of concepts to remember that will hopefully give you the knowledge to not only get a good tune, but also come to your own conclusions when tuning in the future.

Pid Tuning Software

Lets start with the concept that PID doesn’t stand for “proportional, integral, derivative”. Instead lets say PID stands for “power, inspiration, dampening”. You will understand why I’m saying this later, but for now just go with it! Legales auto tuning deutschland.

The P value is literally the first and most fundamental part of any control loop. All PID controllers have what’s called a current value (in this case it’s the current orientation of the drone) and a desired value (the orientation that it wants to be at). When you move the control stick on your transmitter in a particular direction, you actually aren’t the one making the drone move. You’re actually just changing the desired orientation and the PID loop figures out how much power each motor needs to get the drone pointed in the direction you want. So getting back to what P does, it really just uses more force to get the drone where it needs to be depending on how far away it currently is from the desired orientation. In simple terms, if you want the drone to make corrections at a faster pace, turn up the P.

Now that you understand the concept of a current orientation and desired orientation, and P is no longer a mystery, lets move on to the I value. In a perfect world with no errors or variables like wind, a PID loop wouldn’t actually need an I value. In the real world we need I though. Without I, any outside force like wind or gravity would make it impossible to keep a drone at a specific orientation. Because P simply scales itself depending on how far it is from it’s target, it doesn’t care if it gets to the desired orientation in less than a second or ten years! This is where I comes in. Instead of scaling based on position, I scales itself based on how long it isn’t at the desired orientation. You could think of I as an inspirational value. The more I you have, the more inspiration your drone will have to stay where it needs to be or get to it’s new orientation (stay on track and achieve it’s goals).

D is a more complicated value to understand, but what it does is very simple. With P and I in the control loop, your quadcopter will have plenty of power and inspiration to go places, but without some focus or dampening it’s going to bounce all over the place like it’s had too much coffee or red bull to drink. The problem with P and I is that they just don’t know when to slow down and think, so D just dampens their effects.

In technical terms, D works by using the mathematical difference between the current acceleration towards a desired value and a previous acceleration towards a desired value. That difference is then mixed in with P and I to dampen/cancel out their effects. Like I said earlier, you don’t need to understand the technical details, just remember that D dampens and smooths out the effects of P and I.

The Tuning Process

Before tuning, I start out with settings that are either default, or that I know won’t cause any strange unwanted behavior. In the old days of tuning, it was a common practice to start out with a very low or even no D value at all, but now it’s better to leave everything at the defaults until you see how it flies.

Start off by taking off and seeing what happens. If the quadcopter moves and feels like an unstable boat, raise the P setting (vary slowly) until it starts to behave more like a robot. When the P setting is set high enough, the overall flight at this point should be pretty smooth, but at the end of aggressive maneuvers, the quadcopter may shake for a split second. This is fine, unless the shaking continues. If it sounds very twitchy even when not touching the controls, you should probably lower it until the motors sound smooth again when hovering.

Once the drone seems stable enough to fly around safely, you should be able to take it to a park or open space to try some FPV flying. Don’t forget to mount your HD camera of choice and press the record button before taking off. It also helps to record at 60FPS so you have more frames in the video to look at. once your flying using FPV, take it up high and do some flips and rolls. Try to keep your control inputs short and fast but also precise so you don’t have to figure out the difference between PID loop issues and your stick input mistakes.

After flying, take the footage that you recorded from the camera and play it back on your computer. once you get to a point in the video where the drone is flipping or rolling, stop the footage and analyze it frame by frame (if you can). This is the best way to really understand what your aircraft is doing.

At this point you can start asking yourself questions like “is it holding angles properly or should I turn the I gain up?”, “does the drone look like it has too much dampening or maybe not enough?”. Is the problem I’m having a PID issue, or could it be e limitation of the hardware I’m using?”.

One thing that I like to do is leave my D gain relatively low so that I can better analyze what’s happening with my P and I gains. Once everything is how I want it then I’ll turn D back up. For smooth flying, slowly increase the D setting until you no longer see the shake at the end of aggressive maneuvers that you saw when tuning the P and I gains. Don’t go too high with the D setting or it will behave like a slug.

Pid Tuning Simulators

To sum everything up, you start tuning P (the power output), then I (to give it some inspiration to stay on track), then D (keeping it smooth and focused to avoid overshooting).

What Is Throttle PID Attenuation (TPA)

After tuning, you might find that your drone shakes when flying at full throttle. I’m honestly not completely sure why this happens, but I think it’s because the power output of the motors becomes more sensitive at higher RPMs. In any case, TPA will help reduce the shaking by scaling down the PID values when the throttle is raised passed a specified point.

On the Kiss FC (flight controller) you have a lot more options for TPA than CF (Cleanflight) and it can be a bit complicated to understand, so I’ll talk about Cleanflight first. In the CF configurator, all you need to do is slowly turn up the TPA value until the drone stops shaking at high throttle ranges. If it still shakes, try lowering the TPA breakpoint value.

Pid Loop Tuning Guide

TPA breakpoint controls how high the throttle needs to be before TPA starts to take effect. In CF this value is usually around 1500. By lowering the TPA breakpoint, you’re basically just getting the TPA to activate sooner (at a lower motor speed).

Going over to the Kiss FC, things work a bit differently. In the Kiss configurator, TPA is actually a value that you turn down instead of up. You get three separate TPA values. There’s a TPA value for P, a value for I and a value for D. To add more TPA, all you need to do is lower all three TPA PID values. The cool thing about Kiss is that these TPA values actually just represent a percentage, so when you see a TPA value like 0.3 then you know that the PID will be at 30% of its original power (or whatever your PID is times 0.3).

The last thing I want to mention is that Kiss does have an equivalent to TPA breakpoint in CF, but it’s more complex so don’t worry about it unless you absolutely have to. Usually you won’t need to use it because the default TPA breakpoint settings for Kiss seem to work better than CF anyway.

How To Master The Tuning Process

Arducopter Auto Pid Tuning Chart

Tuning drones can take a long time. Some might even say it’s an on going process, but there are some things you can do to make it easier. One thing that helps is separating flying days from tuning days. When you go out for a day of tuning, you’re one and only goal should be to get your quadcopter tuned. This means bring your laptop, a ton of batteries and only stay in the air long enough to do the maneuvers that you need for analyzing the video frames. You should spend all day flying, analyzing, adjusting and flying again. It also helps to watch videos of other people flying and compare their tunes side by side with yours. Strive to achieve tuning results that are similar or equal to the best pilots out there. You’ll find that it’s much easier to pull off more complex maneuvers and learn new ones when your drone does exactly what you want it to do.