How should I tune my Copter? For later versions read the additional information and discussions below. In a sense P is proportional to the amount of control you have over an axis. Less P is less positive control. More P is more positive control.
|Published (Last):||20 February 2009|
|PDF File Size:||16.33 Mb|
|ePub File Size:||13.9 Mb|
|Price:||Free* [*Free Regsitration Required]|
How should I tune my Copter? For later versions read the additional information and discussions below. In a sense P is proportional to the amount of control you have over an axis. Less P is less positive control. More P is more positive control. The problem is that if P gets too high, it will start to overshoot the intended end state. This causes it to constantly overcorrect -- hence, oscillations.
High quality ESCs and faster PID loop times help with this as well by allowing the flight controller to make corrections more quickly and effectively. If your P is too low, then I has too much of a job to do because P has never quite done enough D looks forward to see if the axis is reaching its intended value too quickly. If you give the copter a command to stop a roll very quickly, a high P value just like we want might tend to overshoot just a little bit and then "bounce back". IF you see a lot of this, you might want to increase D just a bit.
Adding D term can also help with the small oscillations that come right after a quick change in direction or low throttle drop prop-wash. Very important to not use too much D. Steps Make sure your motors are balanced and that your quad is as free from vibrations as practical. Trying to tune PIDs without having a clean gyro signal is like trying to build a house without having a proper foundation. This video explains an easy way to check for vibrations coming from your motors.
Adjust your lowpass filter settings as necessary to get a clean gyro signal. Set the TPA value to 0 while performing this initial tune. TPA can be added at a later date if needed. Start with slightly lower than default P gains as provided by the installed BetaFlight firmware. Also lower the I and D gains on pitch and roll in order to tune P with minimal interference from I and D.
I of 20 and D of 5 are good starting points. For yaw, it is prudent to decrease default P by HALF and reduce I just a bit, to eliminate that axis as a source of oscillations. Yaw will be tuned last.
Over a series of flights, increase P gain on Roll axis until you see oscillations when you approach full throttle and you get very rapid visible and audible shakes. Repeat step 4 for Pitch axis. Test to see if the quad holds the desired roll angle and does not drift by rolling the copter to a specific angle, and then punch and drop throttle several times.
The angle you gave it relative to the horizon should not change significantly. If the angle appears to drift, increase I gain. You can change the "feel" of your copter by raising or lowering I after you achieve a good tune. I does not really affect final P and D values. Repeat step 6 for Pitch axis. Note: Too high of D term can cause motors to get hot. Do a short flight, seconds, land and check motors. If you can hold your finger on the motors then they are not too hot.
Yaw often requires the least tuning, but it may still introduce significant oscillation if you ignore it. Start with the Yaw P that you chopped in half in step one and verify that you do not get significant vibrations when you do a long punch-out or fast forward flight.
Start pushing up Yaw P by. Then decrease a bit. Fine tune by looking at Yaw P term in blackbox. It MAY be oscillating a bit, but pull up the Yaw gyro trace to see if those P oscillations actually make it to the Gyro. Note: Because yaw inherently has less positive control a. Relatively higher P and I values and relatively low D values are the norm because of the inherent lack of authority compared to pitch and roll. A blackbox log is usually necessary to fine-tune.
Most excess P oscillation comes from either roll or pitch, but if any roughness at full throttle remains, look at a blackbox log to see if yaw P starts to oscillate on full throttle. If so, decrease yaw P.
Finally, refine the relationship between P and I by looking for a tendency to resist or "fall into" strong turns. Very low I values will result in an axis that drifts over time. Low I values on an axis will allow that axis to change attitude more freely but may still hold attitude. Higher I values on an axis will hold attitude very well, but may tend to resist movement and can add a feeling of inertia.
Very high I values can create an overly "robotic" feeling and even oscillations. Can also refine P by analyzing Blackbox Logs. This may get you closer to a perfect tune. If you must. Remember not to get too carried away trying to get the BlackBox traces to be as clean as possible. If the copter flies really well and suits your needs then just get out there and fly!
Other Notes When you look for high P term oscillation in a BB log, they do not generally look like wide sweeping arcs or jagged peaks and valleys.
High P term oscillations manifest first at the very top of the throttle range and look like tight sine waves. When these show up on BB logs, they may not always be detectable by sight or sound. I term is usually not active enough to cause trouble, and can usually get it roughly tuned in pretty quickly. But the D term can vary significantly depending on many different factors, and its amplification effect means that if D term is bad, it can be very bad, and in odd and unpredictable ways, depending on how noise is presenting itself and how the P term is acting.
For more information see these resources: FAQ page located here Death Rolls The most common reason for a copter to not stop rolling flipping is too low of minimum throttle setting.
This is basically the ESC not being able to get a motor running after commanding a motor to minimum throttle. In a BB log this shows up as a motor being Commanded to Full throttle but copter keeps rolling.
If using BB logging then you will see a motor being Commanded to full throttle but that arm will drop if the Accelerometer is enabled indicating that motor is Not producing thrust. This is a Swap and try to see if it is the motor or the ESC. Not all ESC run all of the newer high power motors well. Read carefully the Wiki FAQ 57 for discussion of the issue and possible solutions. Additional Notes for BetaFlight version 3 3.
P is tuned mostly by feel, and for me anyway, by the amount of propwash oscillation you get. Also, looking for oscillation or bounce at the end of flips and rolls. These are pretty much the only clear indicators of what P is doing other than feel. These can help refine the tune. Discussion about how to adjust these is in the 3. If increasing D term does not help bounce back then try adjust the Setpoint sliders.
Some high power systems do not fly with Default. I have between 14 and 17 for D with P in the upper 50s. Is there really any benefit to trying higher D if the quad is flying so well? Answer from ctzsnooze: D exists primarily to allow more P. It pushes against any fast uncommanded changes, resisting more strongly the faster the rate of change. If you get an un-commanded fast wobble from high P, then D can attenuate that wobble, allowing use of higher P without wobble than would be possible with no D.
Classical tuning involved turning D down to near-zero, gradually increasing P until you just get wobble after sharp inputs, then bringing D up to see if you can control that wobble a bit, then see if you can add a bit more P. It was essential to try to get P as high as possible and adding the right amount of D was essential to getting as much P as possible. Nowadays, with more powerful motors, P alone is much more quickly able to track control inputs, because P alone can make very fast changes to the attitude of the quad.
Often P can do this below its natural oscillation frequency. If the natural P oscillation frequency is high enough, the gyro filters start suppressing P feedback anyway, so D becomes less important. In betaflight this benefit only exists D weighting is above zero ie 1 or higher in practice. When D weighting is zero, D opposes stick inputs just as it opposes uncommanded inputs like wobbles. If you have a lot of D, the quad will become less responsive to stick inputs.
But if D weighting is above zero, a quick stick input generates a brief D spike that helps initiated the movement in the quad and avoids the tendency for D to oppose stick input.
Somewhere around a weghting of 0. A lot of D weighting and not enough P can result in a twitchy quad that is a bit floaty at the same time. If you set the D relaxation to zero, when you return sticks to normal, D will dampen the rate of return of the quad to centre as if there was zero D weighting. This allows a quad with significant D and significant D weighing to have crisp turn initiation and smooth recovery at the end of rolls and flips.
To be noticeable a lot of D is needed. But again this effect needs D to work. The biggest drawback of D, by far, is amplifying high frequency noise and heating up the motors with that noise. D is highly frequency sensitive.
Save Yourself Hundreds of Hours by Getting an Immediate Blueprint to PID Tuning Success Tune your loop today — the Blueprint gets straight to the point with no distractions, so you can get your process up to maximum performance ASAP Gives you a loop that is Robust — this means that you can rest easy safe in the knowledge that it will stay tuned for the long term Say goodbye to trial and error — this technique will give you the best settings first time, every time. This technique will automatically identify any nasty loop characteristics like time delays and lags and provide tuning constants that will handle them. This is PID Tuning software written in MS Excel that both hugely speeds up the tuning process and lets you learn the techniques in the blueprint on a simulation of your process. Plus you get instant downloads of the Blueprint, bonuses and software.
PID Tuning Guide
Torcuato Fernandez pointed out an error in original version, which has since has been corrected. I would like to thank Torcuato for pointing out the error. I would also like to thank Hannu Lehmuskuja for pointing out an error related to the delay. Jose Maria, has shared some of his work with me and has kindly agreed to let me share it with others through this site. He has added scrollbars to the tool, which assist the user understand how the controller settings affect the loop.
PID Loop Simulator
My copy is sitting on a bookshelf waiting to someday serve a purpose other than impressing my customers with its cover. The book starts off with nice pictures and common sense terminology. Then around page 20 you start getting uncomfortable. Theory sets in with equations ever more complex and abstract graphs and terms. After page the only joy you find in the book are pictures of "modern military aircrafts that utilize many control systems" and a "robotic cleaning system at NASA".