The arducopter tuning guide.
This guide was written at the time of the release of Arducopter 2.8.1 FW. It is a compilation of everything I have gathered from the experts in the field of flight controller tuning. It will help give you an understanding of how to tune any rotor based flight controller, but its specific to Arducopter and this firmware release.
I will update this as necessary, or if you can convince me any of it is incorrect just post below and I’ll update this text.
There is a summary/quick reference at the bottom, so once you’ve read this rather rambling explanation you won’t have to again, other than to check details :D
Tuning your flight controller is essential for a perfect flight. Even a fully stock frame will fly better if you tune. The default params will be close, but your battery or motors might be performing differently, your air maybe ‘thinner’ compared to the developer that last published the default params, so you should tune.
What we are trying to achieve is control. We start to accomplish this by modifying the amount of P, I and D in our control loops. All three react to our stick inputs and the errors created by measurements from our sensors, and all three will help us fly better. If we do not have enough of any of the params the copter will not feel like it’s under control, it will wander about, not resist wind and be hard to fly. Too much of any of the params and the copter will seem to have a mind of its own. It will over-react. At best you will see it oscillate, very fast, not so fast or somewhere in between, depending on which parameter has been overclocked. At worst it will simple flip over on take-off or be very unpredictable in flight.
We need to find a balance. You can tune each param up individually, but one will have an effect on another. Therefore we must tune one, then another, then go back and see if we can retune the first one again, this is the balance.
And this is where we adjust those parameters – Mission planner config page:
Before you start:
So let’s start tuning
Everything you read below will be demonstrated in the tuning video further down, so you know what to look for, and at the bottom is a summary for quick reference. I think, however, it’s important to include as much information here as possible as anyone starting into this hobby will often find this process to be a bit of a black art.
I’ve found the quickest way to tune the arducopter is to start with rate_D, (but you simply can’t do this unless you can hold your beast in hand or in a jig as the copter won’t fly without any rate_P or I) so a more universal way to start, and actually a more informative way is to start with rate_P.
Since this is about learning for everyone, let’s do it that way. I’ll give a brief low-down on the ‘rate_D’ tune (or Dave C tune, as it’s become known) ‘ later. (BTW, that’s very flattering but I’m only relaying info from the real experts, but hey, if I’m gonna be famous, why not for doing something I love :)) Anyway....
STEP ONE - Tuning rate_P
STEP TWO – Tuning rate_D
NOTE: once you have found your rate_D you can try something interesting - you will have to hold onto your bird for this obviously. Set rate_P to zero, then crank up your rate_D as you just have. You will discover that these fast oscillations occur at pretty much the same level of rate_D, no matter what you have set rate_P to. This is why I think it’s more than possible to start tuning rate_D then move on to P. But that’s a shortcut, and this is not what this guide is all about.
STEP THREE – Tuning rate_P even more
Congratulations, your copter should be flying better than it ever has done before.
STEP FIVE - HEAD OUTSIDE!!!
For now set Stab_P at 3.0 - 3.5, closer to 3.0 if you have a high power machine, just to get you flying in stab mode. Then spend your time tuning rate_I and stab_P.
If you find your set up immediately too harsh, back off on rate_P and rate_D by 10% each, and try a lower i-term, if it's still too harsh do that again!
All that’s left is to watch the video below so you can see what I’m describing and head outside for fine tuning. Oh, and await part two of the guide and amendments from any discussions raised, then we will have a proper tuning guide that will be integrated into the wiki advanced tuning guide :D
Results for tuning in this video were
Oh and as promised, below is Part One of the Summary Guide. I aim this to be on one sheet of A4 and tell you everything you need know ‘in the field’.
Summary of what you are looking for
Too much rate P will oscillate quickly, and cause to copter to sound angry under stick input, bouncing rather than smoothly following your inputs. It will also shake more at full throttle and under hard turning.
Not enough you will not feel like you have full control. It will feel sloppy and be very easy to over correct with your inputs. It will feel delayed.
Perfect is where it feels locked in, stiff in the air, but not shaky. (although if I’m sport flying I turn it up a bit for maximum ‘wang’ and just tolerate the slight oscillations)
Too much rate_I will oscillate if you get high enough (a much slower oscillation than a rate_P shake). But quite a long while before it oscillates it will have other detrimental effects on flight performance, like a sluggish feeling or a tendancy to flip over on take-off. This is why I suggest tuning this in flight rather than in your hand/jig.
Not enough will cause the copter to get pushed by a constant wind, then it will fight back using just P. It will not hold a very firm angle during forward flight and will need more correction. This will not be as smooth as it could be in either case.
The perfect amount will cause the copter to lean gracefully into a constant wind, but also allow you to set a lean angle and stay there as you fly about. As you dial rate_i in pay close attention to the feel of the copter, you are not looking to create oscillations here at all, you should notice a strange ‘feel’ long before this point.
Too much rate_D will oscillate very fast, you will see a twitch forming then a fast buzzing oscillation
Not enough rate_D will simply mean you can’t dial enough rate_P and so you will suffer the effects of having rate_P too low.
A perfect rate_D will help fight the wind and follow your sticks as its fast to react, but will also allow you to reach a maximum rate_P level for you frame, thus giving better control.
Nothing has changed in the tuning of the Stabilized Flight mode described here. Just change the INS_MPU6K_FILTER to 20 from default. (this will be the default for the next release)
If you find your copter is overpowered when you start to use Alt_Hold drop Thr_Accel_P and I to 0.5 and 1.
Other than that, provided your vibrations are reasonable you shouldn't have a problem. And even then vibrations only effect Alt_Hold and the auto modes.
Copters like this are very prone to oscillating up making it impossible to get them down without cutting the throttle to zero.
Before you fly for the first time you want to make sure that you have a LOW rate_P on your Roll and Pitch and I would put it on a channel 6 slider and only slowly increase it. If you are going to put a camera on it I would again put the Rate_P on the slider with your final value at maximum and a low value at minimum. That way if you get oscillation you can cut your Rate_P to get control again.
I would suggest starting at 0.05 For Rate_P but I would probably set my slider to go from 0.02 to 0.1. And don't get the decimal point in the wrong place :)
So yes, this will be overpowered! :)
Thanks Leonard! Helpful suggestions. I'm just finishing my tuning on a microquad with 3S and it's working great. Getting a feel for what each parameter does. Ended up with:
RI still tuning but have it at 1.5. Probably need to bring it down but I don't see much difference.
Rest is at 2.9.1 defaults. I need to put channel six on a slider. Right now I'm just using an xbee and 'write params' On the octo I will have it on a slider for sure so I don't have to practice doing slow mo crash videos :)
I finally got around to doing the tuning today and it made a big difference especially with Loiter on a windy day. With my old setup I had to turn Rate Loiter P to 2.5 to keep it stable but after tuning it's rock solid with P = 5.7
I just did it in-flight and used CH6 to tune.
Step 1 I get Rate P up to 0.161
Step 2 I got Rate D up to 0.018
Step 3 I re-tuned Rate P and got it up to 0.199. I could get slightly higher but it had some wobble close to the ground.
Step 4 I tuned Rate I and settled on 0.375. This is a little hard to tune but I took the advice of keeping it in the 1 to 2 times P range.
I think that tuning D makes the most difference. I have a quad with 14" props and V2.8.1 firmware.
Good to hear Mike, that must be rock solid! This method of tuning really helps you understand whats going on don't you think?
Dave, just wanted to say thanks for the guide. I was pretty lost before I read this. I have a large hex that I plan on using with my SLR for AP. Not my first multirotor but my first time using Arducopter. Before this evening, I had about ten flights but I could never get it to fly just right. My maiden flight started with my hex flopping around on the ground like a fish. Once I actually got it in the air, it felt very sloppy with the stock PIDs. Tonight, I followed your guide and now it's perfect. I ran through four batteries without incident. It cruses around like its on rails. I couldn't be happier with the performance! Thanks again for taking the time to educate those of us who don't know what we are doing!
Thank you for the guide. I haven't tried to do this yet because after taking my new copter out just a couple times I'm now waiting for new parts to arrive in the mail. :( I plan to be much more diligent and patient on the learning curve before risking more hardware. I've got to get myself a jig like this and I want to make a freakin roll cage for my copter.
My question starts with the screenshot of the page in the Mission Planner where you can change the PIDs of (for instance) Rate Roll, Rate Pitch, and Rate Yaw. Throughout the guide there are references to rate_P, rate_I and rate_D.
It isn't clear to me if the PIDs being refered to are for Roll, Pitch or Yaw.
If you change the P value under for Rate Roll does the P value change automatically for Rate Pitch?
Do you do the procedure for each function (Roll/Pitch/Yaw) independently?
i.e. work on the PIDs for Rate Roll and then Rate Pitch etc.?
The main parameters you adjust are Rate P, Rate I, Rate D (that is the internal PID loop). Then adjust Stab P, Stab I, Stab D. If you change the number in Roll, Pitch will change with it and visa versa. If your craft is not symmetrical or it's weighted too much on the roll vs the pitch then you can unlock these and give different PIDs for roll and pitch but that's not the norm. Yaw you shouldn't need to mess with in the initial tuning.
Unless you go to secial effort the roll and pitch values for Rate P I and D will be coupled and equal. Unless you have very different width vs length or weight distribution in X and Y you shouldn't need to worry about it.
To get a very in depth look at tuning look at Dave C's tuning guide. It has made things much clearer for many users here!
Dang it leonard, he's already looking at it! I must i must improve my tuning guide :)
Seriously though, thanks guys L and F11, for covering on this one, life manic.
And don't worry folks, with Gary's help and a bit of time off work in a week or two we will have a guide that will get my grandma to fly on rails. Without the valium.
But yeah, read/watch the bit above again, and give it a go for yourself. We are only dealing with P I and D on pitch and roll here, generally then just match yaw-p to whatever you ended up with for roll and pitch. Everything else default (ish) -keep an eye on the wiki too Gary is doing great work.
Alright. Thanks for the clarifications. What I understood is that I can do this procedure by going to the page in the Mission Planner for Arducopter Config, changing the values in the PID fields for Rate Roll and then these same values will be automatically used for the PIDs for Rate Pitch. Once satisfied with my results I can just copy these PID values from that tuning into the Rate Yaw PID fields. Then I can move on to tuning Stabilize Roll and Stabilize Pitch. Once I have my new parts I'll give it a shot.