TauLabs/TauLabs — pull request #1224 by peabody124 (2014-08-08 14:47:01+00:00)
Title: System identification and new autotune

So this is some code I have been working on for some time with the help of Korken that performs system identification to measure the gain and latency of each axis. From this it calculates PID settings based on some analytic equations I derived that allow you to essentially tune the amount of damping (where more damping is more stable, default 1.3) and the sensitivity to high frequency noise (used to tune the gyro derivative filter and Kd, higher sensitivity is snappier but also will eventually start to twitch).

This has been tested by a number of people and the feedback is positive. It seems to converge to reasonable values quite reliably. The default settings on the sliders produce quite smooth flights (for AP work more than aggressive flight), so it would be great to find settings that are good for FPV targets.

You can find an early example of it being used here: https://vimeo.com/92452965 and the discussion thread here http://forum.taulabs.org/viewtopic.php?f=17&t=99

Once this is merged there are a few planned improvements:
- factor the throttle into the estimation, which should have a rather straightforward form. this will allow a gain scheduling of the PID settings which should build nicely on top of TPA (#1214)
- on line updating of the PID settings. this will be useful for two reasons: 1) it seems like running this twice produces a slight improvement on the first run, so it is sensitive to the current settings. 2) currently it requires a computer to verify the settings. the current AT algorithm lets you land and then loads up the new settings. We can do this, but I want to have a large number of people that test with a computer first
- new equations for PID calculation that specify overshoot and phase margin (robustness) directly