QuikTune¶
The VTOL QuikTune Lua script simplifies the process of finding a good tune for a multicopter’s attitude control parameters.
The script slowly increases the relevant gains until it detects an oscillation. It then reduces the gains by 60% and moves onto the next gain. Once all the gains have been tuned the tune completes and the user can decide to save or discard the new gains.
Note
be sure that you have prepared the vehicle for tuning by setting up parameters discussed here: Setting the Aircraft Up for Tuning. Also to assure the best tune, setup the noise notch filtering, see Managing Gyro Noise with the Dynamic Harmonic Notch Filters. You may run QuickTune without this step to obtain initial fine tune, see Manual tuning of Roll and Pitch if the vehicle cant do an initial hover stably. Then setup the filters and retune for best results.
The script attempts to tune all these parameters (in the given order)
The advantage over AutoTune is that QuikTune is safer because the vehicle does not need to move or twitch. The disadvantage is that QuikTune cannot find the vehicle’s maximum rotational accelerations (e.g. ATC_ACCEL_R_MAX, ATC_ACCEL_P_MAX, ATC_ACCEL_Y_MAX)
Installing the Script¶
Set SCR_ENABLE = 1 to enable scripting and then reboot the autopilot
Download VTOL-quicktune.lua to your PC
Copy the script to your autopilot’s SD card’s APM/scripts directory. If using MP it may be easiest to use the Config, MAVFtp screen
Reboot the autopilot and set QUIK_ENABLE = 1
If an RC switch will be used to start/stop the tune set RCx_OPTION = 300 where “x” is the RC input channel number. Alternatively set one of Mission Planner’s Aux Function tab’s rows to “Scripting1”
Running QuikTune¶
Wait for a calm day and go to an open area with good GPS reception
Connect with a ground station (e.g Mission Planner or QGC) and ensure that the Messages tab can be seen. This is where output from the tune will appear
Move the RC switch to the low position OR push MP’s Aux Function’s “Low” button
Arm and takeoff in Loiter mode and climb to a height of about 3m
Begin the tune by moving the RC switch to the middle position OR push MP’s Aux Function’s “Mid” button
Monitor the progress of the tune using the GCS’s Messages tab
If necessary reposition the vehicle using the RC transmitter. This will temporarily pause tuning and restore the original gains. Tuning will resume a few seconds after the RC sticks are returned to their center position
If the vehicle begins oscillating violently cancel the tune by moving the RC switch to the low position OR push MP’s Aux Function’s “Low” button
Once the tune has completed accept the new gains by moving the RC aux switch to the high position OR push MP’s Aux Function’s “High” button
Land and disarm the vehicle
Advanced Configuration¶
The full list of available parameter settings are here