Cleanup code style in Harakiri PID controller merge.
[betaflight.git] / docs / Autotune.md
blob4b2af7b771297f78254a9c66ed41ba052d9d82e5
1 # Autotune
3 Autotune helps to automatically tune your multirotor.
5 ## Configuration.
7 Autotune only works in HORIZON or ANGLE mode, before using auto-tune it's best you setup so there is as little drift as possible.
8 Autotuning is best on a full battery in good flying conditions, i.e. no or minimal wind. Autotune does not support 
9 pid_controller 2 (pid_controller 0 is the Cleanflight default).
11 Configure a two position switch on your transmitter to activate the AUTOTUNE and (HORIZON or ANGLE) modes using the auxiliary configuration.
12 You may find a momentary switch more suitable than a toggle switch.
15 ## Using autotuning
17 Turn off the autotune switch.  If the autotune switch is on while not armed the warning LED will flash and you cannot arm.
19 1. Launch the multirotor.
21 1. Turn on/hold the autotune switch on your transmitter. Observe roll left/right.  A beep code will sound on the beeper.
23 1. Turn off/release the switch while still flying to stop this phase of tuning. PID settings will have been updated for ROLL/YAW.
25 1. Turn on/hold the switch again. Observe pitch forwards/backwards.  A beep code will sound on the beeper.
27 1. Turn off/release the switch while still flying to stop this phase of tuning. PID settings will have been updated for PITCH/YAW.
29 1. PIDs are updated, fly and see if it's better.
31 1. If it's worse, flip the switch again to restore previous PIDs that were present prior to arming.
33 1. Land.
35 1. Verify results via an app with power still applied if desired. Cutting the power will lose the unsaved PIDs.
37 1. If you're happy with the PIDs then while disarmed flip the autotune switch again to save all settings then flip it back so you can arm again. A beeper will sound indicating the settings are saved.
40 # References
42 * Brad Quick for the initial Autotune algorithm in BradWii.