MAVLINKHUD

Overview

The TUNE parameter group configures the Transmitter Tuning feature. This allows the pilot to map a PID gain or other parameter (like ATC_RAT_RLL_P) to a knob or slider on their RC transmitter.

This is a powerful tool for finding the "Sweet Spot" of a gain while the vehicle is in the air.

Key Concepts

1. Parameter Selection (TUNE_PARAM)

Defines which parameter is currently mapped to the transmitter knob.

  • 0: Disabled.
  • 1: Roll Rate P.
  • 2: Roll Rate I.
  • ... (See Wiki for full list).

2. Scaling (TUNE_MIN / MAX)

Defines the range of the knob.

  • TUNE_MIN: The value of the parameter when the knob is at its minimum position.
  • TUNE_MAX: The value at maximum position.

Parameter Breakdown

  • TUNE_CHAN: The RC input channel assigned to the tuning knob.
  • TUNE_SELECTOR: Allows assigning a 3-position switch to toggle what parameter is being tuned (e.g., Switch Low = P, Mid = I, High = D).

Integration Guide

  1. Map Channel: Set TUNE_CHAN to your slider channel.
  2. Select Param: Set TUNE_PARAM = 1 (Roll P).
  3. Set Range: If your current P is 0.1, set MIN = 0.05 and MAX = 0.2.
  4. Fly: Move the slider until the drone feels stable but crisp. Land and check the value.

Developer Notes

  • Library: libraries/AP_Tuning.

TUNE

Default 0
Range 0 100

Channel 6 Tuning (TUNE)

Description

TUNE is the master selector for in-flight parameter adjustment on ArduCopter.

By assigning a knob on your transmitter to Channel 6, you can tune gains while the drone is in the air. This is the fastest way to achieve a perfect tune.

Values

  • 1: Roll/Pitch P.
  • 3: Roll/Pitch I.
  • 4: Throttle P.
  • 50: Loiter P.
  • Refer to the Full List for all 50+ options.

Tuning & Behavior

  • Default: 0 (Disabled).
  • Requirement: Requires TUNE_MIN and TUNE_MAX to be set to the safe range for the parameter you are tuning.
  • Safety: Always start with the knob in the center (current known good value) and move it slowly.

TUNE_CHAN

Default 0
Range 0 16

Transmitter Tuning Channel (TUNE_CHAN)

Description

TUNE_CHAN enables you to tune your drone's PIDs or other parameters while you are actually flying, using a knob or slider on your transmitter.

Instead of landing, changing a parameter, and taking off again, you can map a knob to a parameter (e.g., Roll P) and find the perfect value by turning the knob in mid-air.

  • 0: Disabled.
  • 5-16: RC Channel number.

Tuning & Behavior

  • Prerequisite: You must also set TUNE_CHAN_MIN and TUNE_CHAN_MAX to match the output of your knob.
  • Safety: Always start with a small TUNE_RANGE to avoid making the drone unstable with a small turn of the knob.

TUNE_CHAN_MAX

PWM
Default 2000
Range 900 2100

Tuning Channel Maximum PWM (TUNE_CHAN_MAX)

Description

TUNE_CHAN_MAX defines the "Full Scale" position for the tuning channel.

When your transmitter knob is at its highest position and sends this PWM value, the autopilot sets the parameter being tuned to TUNE_MAX.

TUNE_CHAN_MIN

PWM
Default 1000
Range 900 2100

Tuning Channel Minimum PWM (TUNE_CHAN_MIN)

Description

TUNE_CHAN_MIN defines the "Zero Position" for the RC channel used for in-flight tuning.

When your transmitter knob or slider is at its lowest position and sends this PWM value, the autopilot will set the parameter being tuned to TUNE_MIN.

Tuning & Behavior

  • Default: 1000.
  • Calibration: Ensure this matches the minimum PWM reported during your radio calibration for the channel assigned to tuning.

TUNE_ERR_THRESH

Default 0.15
Range 0 1.0

Tuning Instability Threshold (TUNE_ERR_THRESH)

Description

TUNE_ERR_THRESH is an "Over-Gain Alarm" for in-flight tuning.

As you increase PID gains using your transmitter knob, the drone's movements will become sharper. However, if the gains go too high, the drone will start to vibrate or oscillate (instability). This parameter monitors the root-mean-square (RMS) of the PID corrections. If the corrections become too large and fast (indicating oscillation), the autopilot will sound a buzzer alarm and send a "Controller Instability" message to your Ground Control Station.

Tuning & Behavior

  • Default: 0.15.
  • Recommendation: Leave at 0.15. If the alarm triggers, it means you have pushed your gains too far and should immediately lower the tuning knob.
  • -1: Disables the alarm.

TUNE_MAX

Default 0

TUNE_MAX: Tuning maximum

Description

Transmitter Tuning maximum value. The parameter being tuned will have its value set to this maximum value when the tuning knob is at its highest position.

Values

  • Default: 0

Description

This parameter works with the "In-Flight Tuning" feature.

  • Function: When you rotate your transmitter's tuning knob to its maximum position, the parameter you have selected in TUNE will be set to this value (TUNE_MAX).
  • Example: If tuning PSC_POSXY_P and you want to test P-gains up to 2.0, set TUNE_MAX = 2.0.

TUNE_MIN

Default 0

TUNE_MIN: Tuning minimum

Description

Transmitter Tuning minimum value. The parameter being tuned will have its value set to this minimum value when the tuning knob is at its lowest position.

Values

  • Default: 0

Description

This parameter works with the "In-Flight Tuning" feature (usually assigned to Channel 6).

  • Function: When you rotate your transmitter's tuning knob to its minimum position, the parameter you have selected in TUNE will be set to this value (TUNE_MIN).
  • Example: If you are tuning PSC_POSXY_P, and you set TUNE_MIN = 0.5 and TUNE_MAX = 2.0, rotating the knob fully counter-clockwise sets P to 0.5.

TUNE_MODE_REVERT

Default 1
Range 0 1

Tuning Revert on Mode Change (TUNE_MODE_REVERT)

Description

TUNE_MODE_REVERT is an important safety switch for in-flight tuning.

  • 1: Enabled (Default/Safe). If you are tuning your drone and it starts to oscillate dangerously, you can simply flick your flight mode switch to any other mode (e.g. from Stabilize to AltHold). The autopilot will immediately discard the current knob position and revert the parameter to the value it had when you started.
  • 0: Disabled. The tuned value is kept even if you change modes.

Tuning & Behavior

  • Recommendation: Leave at 1 (Enabled) until you are very comfortable with the tuning process. This provides a "Panic Button" to instantly recover from an unstable tune.
  • Usage: Once you find a value you like, you must either "Save" it (using the selector switch or a MAVLink command) or manually enter it into the parameter list before power-cycling.

TUNE_RANGE

Default 2.0
Range 1.1 5.0

Transmitter Tuning Range (TUNE_RANGE)

Description

TUNE_RANGE sets the "Sensitivity" of the tuning knob.

It defines the total spread of values the knob can command, centered around the value the parameter had when the tuning session started.

  • 2.0 (Default): The knob can adjust the parameter from half of its original value (at the low end) to double its original value (at the high end).
  • 1.2: A much smaller range, allowing for very fine control and reducing the risk of a crash.

Tuning & Behavior

  • Recommendation: Start with 1.2 or 1.5 for high-risk parameters like PID gains. Use 2.0 for less sensitive settings.

TUNE_SELECTOR

Default 0
Range 0 16

In-Flight Tuning Selector Channel (TUNE_SELECTOR)

Description

TUNE_SELECTOR allows you to manage multiple tuning parameters from a single knob on your transmitter.

While TUNE_CHAN is the knob that actually changes the value, TUNE_SELECTOR is a separate switch (usually a 2-position spring-loaded switch) that tells the autopilot to:

  1. Toggle between parameters: (If multiple parameters are in the set).
  2. Lock in the value: Saves the current knob position to the parameter.
  3. Re-center: Resets the knob's effect.

Tuning & Behavior

  • Default: 0 (Disabled).
  • Recommendation: Assign to a momentary switch on your transmitter. This allows you to "Dial in" a value with the knob, then "Click" the switch to save it before moving to the next parameter.

TUNE_PARAM: Transmitter tuning parameter or set of parameters

Description

This sets which parameter or set of parameters will be tuned.

Values

  • 0: None
  • 1: RLL_RATE_P
  • 2: RLL_RATE_I
  • 3: RLL_RATE_D
  • 4: PTCH_RATE_P
  • 5: PTCH_RATE_I
  • 6: PTCH_RATE_D
  • ...
  • 101: Roll P, I, and D simultaneously

Description

This parameter works in conjunction with TUNE_CHAN (Channel 6) to allow real-time adjustment of control gains while flying.

  • Values < 50: Select a single specific parameter (e.g., RLL_RATE_P).
  • Values > 100: Select a "Set" of parameters (e.g., 101 adjusts all Roll PID terms together, scaling them up or down proportionally).
  • QuadPlane: Parameters less than 50 generally apply to the QuadPlane vertical lift motors if Q_ENABLE is active.