MAVLINKHUD

Overview

The AUTOTUNE parameter group configures the AutoTune flight mode. This is an automated system-identification routine where the autopilot rapidly twitches the vehicle in Roll, Pitch, and Yaw to measure its physical response (inertia, authority, damping) and automatically calculates the optimal PID gains (ATC_ group).

Key Concepts

1. Aggressiveness (AUTOTUNE_AGGR)

This parameter controls how "sharp" or "locked-in" the resulting tune will be.

  • 0.1 (Default): Standard crisp tune. Good for most racers and camera drones.
  • 0.075: Softer tune. Better for large cinematic builds, older frames, or if the default tune causes oscillation.
  • 0.05: Very soft/damped.

2. Axes Selection (AUTOTUNE_AXES)

Selects which axes to tune during the session.

  • 1: Roll only.
  • 2: Pitch only.
  • 4: Yaw only.
  • 7 (Default): Roll, Pitch, and Yaw.

Parameter Breakdown

  • AUTOTUNE_AGGR: Aggressiveness target.
  • AUTOTUNE_AXES: Bitmask of axes to tune.
  • AUTOTUNE_MIN_D: Minimum D-gain to ensure damping.

Integration Guide

Running AutoTune

  1. Setup: Map a switch to AutoTune mode (or use AUTOTUNE_AXES).
  2. Safety: Find a large open area on a calm day.
  3. Process:
    • Take off and establish a stable hover (AltHold or Loiter).
    • Switch to AutoTune.
    • The vehicle will start twitching (Roll -> Pitch -> Yaw).
    • Pilot Input: If the vehicle drifts too far, use the sticks to gently bring it back. The tuning pauses while sticks are moved and resumes when centered.
  4. Completion: The twitching stops. Land and Disarm to save the new PIDs. Switch out of AutoTune before disarming to discard them.

Developer Notes

  • Library: ArduCopter/mode_autotune.cpp
  • Algorithm: Iterative Step Response optimization. It tries to match the requested Rate vs Actual Rate with minimal overshoot.

AUTOTUNE_ACC_MAX

$deg/s^2$
Default 0
Range 1 4000

AutoTune maximum allowable angular acceleration (AUTOTUNE_ACC_MAX)

Description

Limits the intensity of the "twitches" used by the Helicopter AutoTune process by capping the maximum angular acceleration.

Tuning & Behavior

  • Default Value: 0 (Calculated automatically)
  • Range: 1 to 4000 $deg/s^2$

AUTOTUNE_AGGR

Default 0.075
Range 0.05 0.10

Autotune aggressiveness (AUTOTUNE_AGGR)

Description

Determines how "sharp" the resulting PID gains will be. Higher aggressiveness results in a more responsive aircraft but increases the risk of oscillation.

Tuning & Behavior

  • Default Value: 0.075
  • Range: 0.05 to 0.10 (Typical)
  • Lower values (e.g., 0.05) produce a "softer" tune suitable for cinematic flight.
  • Higher values (e.g., 0.10) produce a "stiffer" tune suitable for racing or high-precision flight.

AUTOTUNE_AXES

Default 7

Autotune axis bitmask (AUTOTUNE_AXES)

Description

Selects which flight axes (Roll, Pitch, Yaw) will be tested and tuned during the next AutoTune session.

Tuning & Behavior

  • Default Value: 7 (Roll, Pitch, and Yaw)
  • Bitmask:
    • Bit 0: Roll
    • Bit 1: Pitch
    • Bit 2: Yaw
  • Tuning one axis at a time can be safer for large or unbalanced aircraft.

AUTOTUNE_FRQ_MAX

Hz
Default 70.0
Range 50 120

AutoTune maximum sweep frequency (AUTOTUNE_FRQ_MAX)

Description

The ending frequency for the automated frequency response testing used in Helicopter AutoTune.

Tuning & Behavior

  • Default Value: 70.0 Hz
  • Range: 50 to 120 Hz

AUTOTUNE_FRQ_MIN

Hz
Default 10.0
Range 10 30

AutoTune minimum sweep frequency (AUTOTUNE_FRQ_MIN)

Description

The starting frequency for the automated frequency response testing used in Helicopter AutoTune.

Tuning & Behavior

  • Default Value: 10.0 Hz
  • Range: 10 to 30 Hz

AUTOTUNE_GN_MAX

Default 1.0
Range 1 2.5

AutoTune maximum response gain (AUTOTUNE_GN_MAX)

Description

Target closed-loop gain for the Helicopter rate controller during the tuning process.

Tuning & Behavior

  • Default Value: 1.0
  • Range: 1.0 to 2.5

AUTOTUNE_MIN_D

Default 0.0005
Range 0.0001 0.005

AutoTune minimum D (AUTOTUNE_MIN_D)

Description

A safety floor for the Rate D gain. AutoTune will not lower the D gain below this value, even if the physics of the aircraft suggest it.

Tuning & Behavior

  • Default Value: 0.0005
  • Range: 0.0001 to 0.005

AUTOTUNE_OPTIONS

Default 0

AutoTune options (AUTOTUNE_OPTIONS)

Description

Bitmask for configuring specific AutoTune behaviors, such as whether to automatically save gains upon completion or use specific tuning logic.

Tuning & Behavior

  • Default Value: 0

AUTOTUNE_RAT_MAX

deg/s
Default 0
Range 0 500

Autotune maximum allowable angular rate (AUTOTUNE_RAT_MAX)

Description

Limits the maximum angular velocity reached during the Helicopter AutoTune process.

Tuning & Behavior

  • Default Value: 0 (Calculated automatically)
  • Range: 0 to 500 $deg/s$

AUTOTUNE_SEQ

Default 3

AutoTune Sequence Bitmask (AUTOTUNE_SEQ)

Description

Controls the sequence of tests performed during Helicopter AutoTune (e.g., FeedForward, Rate D/P, Angle P).

Tuning & Behavior

  • Default Value: 3
  • Bitmask:
    • 1: VFF Only
    • 2: Rate D/Rate P Only
    • 4: Angle P Only
    • 8: Max Gain Only
    • 16: Tune Check

AUTOTUNE_VELXY_P

Default 0.1
Range 0 1

AutoTune velocity xy P gain (AUTOTUNE_VELXY_P)

Description

Proportional gain for the position-hold logic active during Helicopter AutoTune. This helps keep the aircraft from drifting significantly while it is being "twitched" for frequency response analysis.

Tuning & Behavior

  • Default Value: 0.1
  • Range: 0 to 1