No AutoTune for STM32F1 based hardware
AutoTune is currently not built into CC3D/Atom firmware, due to small CPU and lack of memory.
LibrePilot version 16.09 and later has AutoTune. Here is the simplest version of how to use AutoTune for those that don't want details. If you don't read the details (problems to avoid and useful features you didn't know existed) and ask questions that are answered farther down in the details, be prepared for a bit of derision.
Simplest use of AutoTune:
- use stock PIDs (or known, slow, smooth PIDs that do not have "invisible oscillation") in bank #1
- set up and save FMS (Flight Mode Switch) for
--- FMS#1 Attitude mode manual throttle (Stabilized 1) on bank 1
--- FMS#2 AutoTune mode (like Attitude mode but with shaking) on bank 1
--- FMS#3 Attitude mode manual throttle (Stabilized 1) on bank 3
- after saving, power off and on the FC so it sees AutoTune and enables the AutoTune module
- take off with FMS #1
- switch to FMS #2 and after 2 seconds, it will shake around for 60 seconds
- land after shaking stops
- switch to FMS #3
- carefully take off to test the new PIDs (be ready to instantly drop by using zero throttle if anything strange happens)
If everything works, set up FMS as you like, with all modes pointing to bank 3
For the slightly less impatient, skip down to the section titled "Flight Mode Switch setup".
Background and Details
LibrePilot has ported Tau Labs / dRonin "Autotune" into 'next' and the coming 16.09 release (including RC#'s).
First some precautions. Tuning carries a risk of oscillation and for LibrePilot firmware, oscillation tends to effectively move the throttle toward 50%. If your copter requires more than 50% power to hover, then oscillation will make it descend. If your copter needs less than 50% to hover, then obviously 50% will have it climbing. In extreme cases any throttle above 0% will effectively be 50%. Remember that zero throttle stick will stop the motors. Don't make any changes to this important "motor off" safety feature. Tuning is known to fail in some cases. Testing has shown that these same cases fail dRonin Autotune as well. Be prepared.
Oscillation generally comes in 3 forms.
Normal oscillation is a rhythmic motion that is generally visible and audible. It is usually caused by PIDs being too high.
Jerkiness is random, and is not actually an oscillation. It is usually caused by too much vibration. Replace or straighten bent shafts, balance and track your props, and if that is not enough and the tuning doesn't fly right, try increasing (doubling) GCS -> Configuration -> Stabilization -> Expert -> Gyro Noise Filtering.
Invisible oscillation (sometimes D term oscillation or yaw oscillation) generally cannot be seen or heard. One way you know you have it is that all throttle stick positions can act as if they were closer to the middle. Another way you know is if you have two FMS positions that use different PID banks (and manual thrust), and one set of PIDs has significantly lower D terms (or a lower yaw PID) and you are hovering and switch from one to the other, you may notice that you need to add power to maintain altitude. Increased thrust from the high D term / high yaw PID is caused by the ESCs being commanded up and down and being quicker when increasing RPM than when decreasing it. You may find that motors tend to run hotter and batteries don't last as long as they should. Powerful copters (those that require less than 50% power to hover) will take off with much less throttle than expected. Weak copters (those that require more than 50% power to hover) will need more power than expected to take off, or will not take off even at full power. Try reducing your D terms (Stabilization -> Advanced), reducing your yaw PID, or increasing (doubling) GyroTau (GCS -> Configuration -> Stabilization -> Expert
> Gyro Noise Filtering), but realize that increasing GyroTau requires rerunning the AutoTune flight and will make AutoTune create very slow smooth PIDs.
If your multicopter is already tuned and you reduce performance by adding weight like a camera or larger battery (with same cell count); or reducing power (fewer cells in battery, different props) then you have created an oscillation.
On the other hand, if you remove a camera from a multicopter that is tuned to fly with the camera (or generally do something to increase performance), it wont' oscillate, it just won't be quite as quick reacting as it could be. It will fly a bit "like it has a camera mounted" even when it doesn't. That isn't so bad.
So if you are only going to do one tune, then do it with the camera on. You can fly this tune with or without the camera. Be aware that PID banks are excellent for storing different PIDs if you want different tunes for e.g. with / without a camera. You can use one PID bank for with camera and one PID bank for without camera.
Oscillation can cause AutoTune to fail and even to crash. If you have a problem with oscillation, it must be corrected before running AutoTune. This is especially true of invisible oscillations if only because they are not obvious. This is also especially true if you are adding a camera to a multicopter that is already tuned.
Ringing (Attitude mode) is when you move the stick suddenly and it doesn't immediately settle at the new bank angle. Instead it oscillates a few times, but the oscillations die out quickly.
Assume that stock PIDs may oscillate or ring, especially with small multicopters or adding cameras. Cutting your R/P/Y PI's in half will usually remove oscillation or ringing and make it safe to run AutoTune.
If AutoTune internal sanity checks fail, it won't write PIDs. It's also possible to get PIDs that don't fly well. This was more true in earlier versions of AutoTune.
This version of AutoTune puts the copter into a special version of Attitude flight mode that shakes the copter and measures the motions. As a pilot, you should be able to confidently fly in Attitude mode because it will be a bit more difficult than normal to maintain control. Tuning also needs a larger area than simple hovering. As a point of reference, a good pilot should be able to do a tuning in a single car garage stall.
Multicopters fly better if they have "Light Damping (BLHeli)" or "COMP_PWM + MOTOR_BRAKE (SimonK)". Without these, when there is a lot of stick control (or oscillation) happening, the copter tends to climb because the motors speed up more quickly than they slow down. With slow or undamped/unbraked ESCs you may notice this when AutoTune mode starts shaking the copter.
AutoTune is not currently supported on CC3D, although it is hoped that a CC3D firmware can be made that removes other features to add AutoTune. This would be flashed temporarily just to run AutoTune and then normal firmware would be reflashed.
AutoTune tries to produce results that make the tuning flight correctly tuned. That does not take into account the non-linearity of thrust response. To remove high thrust oscillations (or increase stability during descent), use TPS to decrease PIDs at high thrust (and if necessary, increase PIDs at low thrust). Typically you want the TPS curve/line to cross the horizontal axis at the point (thrust value) where the copter hovers. Examine SystemIdentState -> HoverThrottle after tuning and before you power off (SystemIdentState is not saved) to see what your hover thrust is. Beware of throttle "bloom" that happens when slow responding ESC's make a copter climb just because of the fast RPY controls.
SystemIdent stabilization mode