Mission Planner Auto Tune

This video is a step by step tutorial on how to prepare the aircraft for flight, fly the aircraft, and auto-tune the aircraft. In this video I cover everything that a licensed operator needs to know in order to fly our aircraft which is equipped with a Cube flight controller and HereLink. If you were to open up mission planner for our use. Mar 07, 2020  What am I missing I’m copter 4.0.3 and want to run an autotune but it seems Mission Planner has changed since I last setup an autotune.I see the channel 7-10 drop down boxes where 7 and 8 use to be but there isn’t anything to select on the drop-down boxes now.Thanks for any help.

AutoTune attempts to automatically tune the Stabilize P, Rate P and D, and maximum rotational accelerations to provide the highest response without significant overshoot. Copter needs to be 'basically' flyable in :ref:`AltHold mode <altholdmode>` before attempting to use AutoTune as the feature needs to be able to 'twitch' the copter in the roll and pitch axis.

Note

Mission Planner Auto Tune

Position Hold during AutoTune is available in Copter 3.5 (and higher).

Setup before flying

  1. Set up one flight mode switch position to be AltHold.
  2. Set an :ref:`Auxiliary Function Switch <channel-7-and-8-options>`to Autotune to allow you to turn the auto tuning on/off with the aswitch.
  3. Remove the camera gimbal or any other parts of the frame that could wobble in flight
  4. Select which combination of axis (roll, pitch, yaw) you wish to tune using the :ref:`AUTOTUNE_AXES <AUTOTUNE_AXES>` parameter
  5. Set the autotune's aggressiveness using the :ref:`AUTOTUNE_AGGR <AUTOTUNE_AGGR>` parameter (0.1=agressive, 0.075=medium, 0.050=weak), normally start with the default 0.1.
  6. For large copters (with props at least 13inch or 33cm diameter) set the Rate Roll and Pitch filters to 10hz, these are: :ref:`ATC_RAT_RLL_FLTT <ATC_RAT_RLL_FLTT__AC_AttitudeControl_Multi>` , :ref:`ATC_RAT_RLL_FLTD<ATC_RAT_RLL_FLTD__AC_AttitudeControl_Multi>` , :ref:`ATC_RAT_PIT_FLTT <ATC_RAT_PIT_FLTT__AC_AttitudeControl_Multi>` , :ref:`ATC_RAT_PIT_FLTD <ATC_RAT_PIT_FLTD__AC_AttitudeControl_Multi>` , (in Copter-3.4 they are ATC_RAT_RLL_FILT and ATC_RAT_PIT_FILT)
  7. It is recommended to enable :ref:`battery voltage scaling of PID gains <current-limiting-and-voltage-scaling>`
Mission planner auto tune reviews

How to invoke AutoTune

  1. Wait for a calm day and go to a large open area.

  2. Ensure the ch7 or ch8 switch is in the LOW position.

  3. Take off and put the copter into AltHold mode at a comfortablealtitude.

  4. Face the vehicle so that it will twitch at 90degrees from the direction the wind is blowing (i.e. if tuning Roll first, point the vehicle into the wind)

  5. Set the ch7/ch8 switch to the HIGH position to engage auto tuning:

    • You will see it twitch about 20 degrees left and right for a fewminutes, then it will repeat forward and back.
    • Use the roll and pitch stick at any time to reposition the copterif it drifts away (it will use the original PID gains duringrepositioning and between tests). When you release the sticks itwill continue auto tuning where it left off.
    • Move the ch7/ch8 switch into the LOW position at any time toabandon the autotuning and return to the origin PIDs.
    • Make sure that you do not have any trim set on your transmitter orthe autotune may not get the signal that the sticks are centered.
  6. When the tune completes the copter will change back to the originalPID gains.

  7. Put the ch7/ch8 switch into the LOW position then back to the HIGHposition to test the tuned PID gains.

  8. Put the ch7/ch8 switch into the LOW position to fly using theoriginal PID gains.

  9. If you are happy with the autotuned PID gains, leave the ch7/ch8switch in the HIGH position, land and disarm to save the PIDspermanently.

    If you DO NOT like the new PIDS, switch ch7/ch8 LOW to return to theoriginal PIDs. The gains will not be saved when you disarm.

If you find after performing an AutoTune that the vehicle feels overly twitchy when flying Stabilize, AltHold or PosHold (but ok in moreautonomous modes like Loiter, RTL, Auto) try increasing the :ref:`ATC_INPUT_TC<ATC_INPUT_TC>` parameter to 0.25. This smooths out the pilot's input.Alternatively try reducing the :ref:`AUTOTUNE_AGGR <AUTOTUNE_AGGR>` parameter (it should always be in the range 0.05 to 0.10) and try again.

If the vehicle feels sloppy after the AutoTune, try increasing the :ref:`AUTOTUNE_AGGR <AUTOTUNE_AGGR>` parameter as high as 0.10 and attempt the autotune again.

Invoke AutoTune with Position Hold

In Copter-3.5 (and higher) AutoTune performs a weak position hold if invoked from Loiter or PosHold flight modes (as opposed to AltHold).

  • The vehicle will gently lean (up to 10 degrees) towards a 'target point' which is initially set to the vehicle's location at the moment AutoTune was invoked.
  • The pilot can reposition the vehicle using the roll, pitch, yaw or throttle sticks. The target position will be reset to the vehicle's location at the moment the pilot releases the roll and pitch sticks.
  • In order to twitch perpendicular to the wind direction, the vehicle may suddenly rotate in either direction up to 90 degrees as it drifts 5m (or more) from the target location.
  • If there is little or no wind, the vehicle's gentle position control may mean it moves back and forth, ping ponging around the target point changing yaw each time it strays more than 5m from the target. In these cases it may be more comfortable to revert the simpler AltHold based AutoTune.

Additional Notes

  • In Copter-3.3 (and higher) AutoTune can be setup as a flight-mode. Switching into or out of the AutoTune flight mode responds in the same way as raising or lowering a ch7/ch8 aux switch high assigned the AutoTune function.

  • :ref:`AUTOTUNE_AXES <AUTOTUNE_AXES>` allows control of which axis are to be tuned. This is useful if the vehicle's battery life is not long enough to complete all 3-axis). '1' = tune roll, '2' = tune pitch, '4' = tune yaw. Add these numbers together to tune multiple axis in a single session (i.e. '7' = tune all axis)

  • :ref:`AUTOTUNE_AGGR <AUTOTUNE_AGGR>` : Should be in the range of 0.05 to 0.10. Higher values will produce a more aggressive tune but sometimes results in gains that are too high. More specifically this parameter controls the threshold for D-term bounce back and P-term overshoot. This affects the tuning noise immunity (a higher value is more tolerant to flex in the frame or other disturbances that could trick the tuning algorithm). High values also leads to a tune that rejects external disturbances better. Lower values result in a tune that is more responsive to pilot input.

  • The full list of parameters that may be updated by AutoTune

    • Roll angular P gain :ref:`ATC_ANG_RLL_P <ATC_ANG_RLL_P>`
    • Roll rate P, I and D gains :ref:`ATC_RAT_RLL_P <ATC_RAT_RLL_P__AC_AttitudeControl_Multi>`, :ref:`ATC_RAT_RLL_I <ATC_RAT_RLL_I__AC_AttitudeControl_Multi>`, :ref:`ATC_RAT_RLL_D <ATC_RAT_RLL_D__AC_AttitudeControl_Multi>`
    • Roll max acceleration :ref:`ATC_ACCEL_R_MAX <ATC_ACCEL_R_MAX>`
    • Pitch angular P gain :ref:`ATC_ANG_PIT_P <ATC_ANG_PIT_P>`
    • Pitch rate P, I and D gains :ref:`ATC_RAT_PIT_P <ATC_RAT_PIT_P__AC_AttitudeControl_Multi>`, :ref:`ATC_RAT_PIT_I <ATC_RAT_PIT_I__AC_AttitudeControl_Multi>`, :ref:`ATC_RAT_PIT_D <ATC_RAT_PIT_D__AC_AttitudeControl_Multi>`
    • Pitch max acceleration :ref:`ATC_ACCEL_P_MAX <ATC_ACCEL_P_MAX>`
    • Yaw angular P gain :ref:`ATC_ANG_YAW_P <ATC_ANG_YAW_P>`
    • Yaw rate P, I gain :ref:`ATC_RAT_YAW_P <ATC_RAT_YAW_P__AC_AttitudeControl_Multi>`, :ref:`ATC_RAT_YAW_I <ATC_RAT_YAW_I__AC_AttitudeControl_Multi>`, :ref:`ATC_RAT_YAW_D <ATC_RAT_YAW_D__AC_AttitudeControl_Multi>`
    • Yaw rate filter :ref:`ATC_RAT_YAW_FLTT <ATC_RAT_YAW_FLTT__AC_AttitudeControl_Multi>` , :ref:`ATC_RAT_YAW_FLTE <ATC_RAT_YAW_FLTE__AC_AttitudeControl_Multi>` (in AC3.6: ATC_RAT_YAW_FLT)
    • Yaw max acceleration :ref:`ATC_ACCEL_Y_MAX <ATC_ACCEL_Y_MAX>`
    • Roll and pitch axis rate feed-forward is enabled (:ref:`ATC_RATE_FF_ENAB <ATC_RATE_FF_ENAB>`)
  • After you have a good tune, you may wish to increase :ref:`ATC_THR_MIX_MAX <ATC_THR_MIX_MAX>` to 0.9 (default is 0.5) to increase prioritization of attitude control over throttle. This can reduce the pitch overshoot sometimes seen (especially on copters with large propellers) in AltHold if the vehicle suddenly slows after performing fast forward flight. In this situation wind catches under the propellers providing lift but also disturbs the vehicle's attitude leading to a conflict between throttle and attitude control. The danger in increasing this parameter's value is that if the rate gains are later raised so high that the vehicle oscillates badly it may be difficult for the vehicle to descend (because it will prioritize trying to correct the attitude oscillations and never reduce throttle sufficiently).

  • AutoTune can request very large and fast changes in outputs to the motors which can cause ESC sync issues especially when using SimonK firmware and/or low KV motors (under 500KV). See this video showing a test which recreates a sync problem.

  • AutoTune is sometimes unable to find a good tune for frames with very soft vibration dampening of the autopilot or very flexible arms.

  • For best results the copter shouldn't be allowed to build up too much horizontal speed. This can be prevented by applying a quick correction between tests (twitches) to stop the vehicle from flying too fast.

  • Be advised that AutoTune will engage from Stabilize, so don't accidentally flip your AutoTune switch until you are in AltHold and ready to begin the procedure.

Common Problems

  • If the vehicle will not start tuning (i.e. it won't twitch) even though it is in AutoTune mode then the problem is likely that the roll, pitch, yaw or throttle sticks are not exactly in the middle. It may help to increase the deadzone on the RC input by increasing :ref:`RC1_DZ <RC1_DZ>`, :ref:`RC2_DZ <RC2_DZ>`, :ref:`RC3_DZ <RC3_DZ>` and :ref:`RC4_DZ <RC4_DZ>` to 50 (or higher).
  • If the AutoTune produces an overly twitchy vehicle try reducing the :ref:`AUTOTUNE_AGGR <AUTOTUNE_AGGR>` parameter (should never be below 0.05) and perform the AutoTune again.
  • If the AutoTune produces a sloppy vehicle, try increasing the :ref:`AUTOTUNE_AGGR <AUTOTUNE_AGGR>` parameter (should never be above 0.1) and perform the AutoTune again.

Tip

When reporting issues with AutoTune please include a description of your frame and a dataflash log of the flight.

Mission

Dataflash logging

Mission Planner Auto-tune

ATUN (auto tune overview) and ATDE (auto tune details) messages arewritten to the dataflash logs. Some details of the contents of thosemessages can be found on the :ref:`Downloading and Analyzing Data Logs in Mission Planner <common-downloading-and-analyzing-data-logs-in-mission-planner_message_details_copter_specific>` wiki page.