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.
If you had to take an educated guess as to whether or not decoupling pitch and roll is warranted...
Would you decouple them on this frame?
The platforms more of a rectangle then a square so I can see theoretically how it might help.
I really struggle with roll tuning...I still get a lot of D overshoot on roll (i.e. release sticks on max deflection, it stops, then continues on to level). So with Pitch and Roll coupled, Pitch is fine, but those same values cause the D overshoots.
The only way to tune it is to tune to the lowest common denominator which means easing the tuning values overall, which makes maintaing pitch angle in forward flight really mushy.
Sounds like you have answered your own question Lito.
I would uncouple the Roll and Pitch and set your initial values that you found gave poor roll into the pitch and the second set of values that gave mushy pitch into your roll.
I would have thought that you would be able to get good values with them coupled (I have a similar rectangular copter) but your experiences are suggesting otherwise.
I'm so glad I have you guys to bounce ideas off of. I think intuitively I knew this was the direction I had to eventually go in, I just had to validate the theory first.
I just got back from the field (lunch break), and just a single word...
You can't imagine how long I've been fighting these parameters, and of course - the simplest solution turns out to be the best one.
I decoupled pitch and roll and I saw an immediate improvement in the banking ability in Stabilize mode.
For reference my #'s ended up here:
SP - 4.0000
SI - .02000
PRP - .1100
RRP - .0900
RRI - .0900
RRD - .003
It's not perfect, it's still a little mushy in the turns, especially if I get a blast of wind into the turn, but that's the first improvement I've seen in a long time. I have the video encoding now and will share shortly. Before these changes, I literally had to come to a stop, turn, then fly forward. The I Term for roll was such that I'd immediately go into slow wobbles the second I went into a turn.
I played around with 2.9's alt hold and loiter too. Loiter scared the poopie out of me...the PIDs are so high for this class rig that as soon as I engaged it banked hard to get back into position. Very jarring experience behind the goggles.
ALT HOLD I have to play around with Throttle Mid, but I came very close on my first try with using 400 as a value. Rig rose about 1m every 10 seconds in gentle forward flight.
The transition out of ALT hold is a little jarring too if you don't remember to reposition your stick so that took me for a ride a few times.
Anyhoo - will post the vid as soon as it's done :)
Thanks again for ALL your help.
The only thing I would suggest is keeping Stab_I = 0. This will be removed in the future but shouldn't be used. The reason is applied in the Earth Frame and therefore the pitch I term will get applied to Roll and Yaw depending on the orientation of the craft. It is an old hold over to the days when we corrected for CG offset from the Stab PID loop instead of the Rate, and before we added the Earth Frame to Body Frame translation.
I broke 3 props following this guide :(. The thing is, my quad didn't oscillate in my hands when I turned up the P rate until it was quite high. So thinking it was tuned well, I took off and crashed. I wish the APM firmware had a tune-itself feature.
How much throttle were you using when you were tuning?
Personally I like to get something that I know is stable then do the tuning in the air with the value I know is stable set to the bottom of my slider. That way if it starts to oscillate I can pull it down quickly.
Sorry to hear about your crash.
LT you've seen this already, but just wanted to throw this here also.
The string tuning method ultimately didn't work for me, because it was because of those roll and pitch couplings. I may have to revisit it, now that I have a better sense of the right ranges. I tuned in the air in Stab mode and will be moving on the Acro mode soon.
This is honestly the first time I've been able to do those long sweeping runs without bobbing up and down like a yoyo, and the turns are much more graceful than my earlier videos.
Thanks again for the support fellas.
what are the specs of you copter Lito? Would be good to have a list of peoples specs and PIDs they are using so we can learn from each others settings as well.
How many cells is that battery? (is it 6 or is that part of the battery name)
3 cells...but at 360g, it was the lightest 5ah battery available on the market. Just 100g more on this bird is the difference between smooth and a flying pig.
Enough to hover as recommended in step 1.6. I'm going to try it in a jig the next time. Hand held testing and shaking the quad around is just too dangerous anyway.