This page is specifically dedicated to the details of usage of the auto-tuning feature developed for Auterion PX4.
Auto-tuning is a tool for the experienced flight control engineer meant to speed up the process of finding a suitable controller tuning for an unmanned aerial vehicle. Auto-tuning does not give any guarantee regarding the stability of the resulting tuning parameters applied to the system at hand. It is therefore imperative to have an experienced flight control engineer verify that the auto-tuned parameters are safe to fly with. In case you want to try autotuning parameters and feel unsure, please submit a ticket. Please provide a description of the vehicle such as shape, weight, size and include picture to speed up the process.
Overview of the auto-tuning workflow
Self-tuning of the rate and attitude controllers needs to be performed in flight. For this reason, the drone must be able to fly decently before using the auto-tuning feature. In most cases, a multirotor or fixed-wing drone can fly with the default parameters of a similar airframe in terms of size and weight. A default configuration is loaded during the initial setup of the drone. Check the PX4's official Airframe Setup section for more details, as well as our guide on creating custom airframes if necessary.
To make sure the current controller is able to stabilize the drone during the auto-tune procedure, follow the steps below on how to perform a sanity check:
- 1.For a multirotor drone, switch to altitude mode and then take off and hover at about 1m above ground. In case of a fixed-wing drone, fly at cruise speed in altitude or position mode.
- 2.Starting with only a few degrees, slightly tilt the drone using the roll stick of the remote controller to perform the following maneuver: "roll left -> roll right -> center" (the whole maneuver should take about 3 seconds)
- 3.Repeat the maneuver with larger amplitudes of up to ~20 degrees
- 4.Repeat the same maneuvers but on the pitch axis
When the auto-tuning sequence finishes , the gains can be applied following the behavior defined by the MC_AT_APPLY and FW_AT_APPLY parameters respectively:
- 0: the gains are not applied. This is used for testing purposes if the user wants to inspect results of the auto-tuning algorithm without using them directly.
- 1: apply the gains after disarm (default for multirotors). The operator can then test the new tuning while taking-off carefully.
- 2: apply immediately (default for fixed-fings). The new tuning is applied, disturbances are sent to the controller and the stability is monitored during the next 4 seconds. If the control loop is unstable, the control gains are immediately reverted back to their previous value. If the test passes, the pilot can then use the new tuning.
Additionally, for fixed-wings, it is possible so select which axes are going to be tuned using the FW_AT_AXES bitmask parameter:
- bit 0: roll (default)
- bit 1: pitch (default)
- bit 2: yaw
The auto-tuning sequence needs to be performed in a safe flight zone, with enough space. For best results, it is recommended to fly in calm weather conditions.
For safety reasons, the sequence can be aborted at any time by the operator by moving the roll/pitch stick of the remote controller.
- 1.Multirotors / VTOL planes in MC mode: Takeoff using the remote controller in altitude mode. If the drone is known to be stable in position controlled mode, it can also be flown in this mode during the auto-tuning or an automatic takeoff can be triggered from the ground station. Hover the vehicle at a safe distance and at a few meters above ground (between 4 and 20m).
- 2.Fixed-wings / VTOL planes in FW mode: once flying at cruise speed, activate auto mode. This will guide the plane to fly in circle at constant altitude and speed. If enough distance is available, it is also possible to fly straight in altitude or position modes. However, this does not give a significantly better tuning result.
- 4.In AMC (Auterion Mission Control), go to the Tuning tab of the Vehicle setup page, stop moving the joysticks and click on the Autotune button (Fig 1). Read the warning popup and click on "OK" when ready.
- 5.The drone will first start to perform quick roll motions followed by pitch and yaw motions. The progress is shown in the progress bar, next to the Autotune button.
- 6.When completed, depending on the value of MC/FW_AT_APPLY (see previous section), land and takeoff again to test the new tuning gains, or immediately use them.
- 7.If any strong oscillations occur, land immediately and follow the instructions in the Troubleshooting section below. If questions remain, and for assistance, please contact the Auterion engineering team.
Fig 1: Tuning Setup page in AMC - the auto-tuning section can be found on the middle section
- slow oscillations (1 oscillation per second or slower): this often occurs on large platforms and means that the attitude loop is too fast compared to the rate loop -> decrease
MC_[ROLL|PITCH]_Pby steps of 1.0.
- fast oscillations (more than 1 oscillation per second): this is because the gain of the rate loop is too high -> decrease
MC_[ROLL|PITCH|YAW]RATE_Kby steps of 0.1
If the drone was not moving enough during auto-tuning, the system identification algorithm might have issues to find the correct coefficients. Increase the
MC/FW_AT_SYS_IDby steps of 1 and trigger the auto-tune again.
Due to effects not included in the mathematical model such as delays, saturation, slew-rate, airframe flexibility, the loop gain can be too high. To fix this, reduce the
MC_[ROLL|PITCH|YAW]RATE_Kparameters by steps of 0.1 until the oscillation stops. If a slow oscillation appears, reduce
FW_[RPY]R_Pby steps of 0.5.