MAVLINKHUD

Overview

The MODE parameter group (specifically MODE_CH) configures the primary method for switching between vehicle behaviors.

Key Concepts

1. The Mode Channel

ArduPilot uses a designated RC input channel to select the active flight/drive mode.

  • MODE_CH: Specifies the RC channel number (1-16).
    • Default: Usually 5 (for Copter/Plane) or 8 (for some Rover setups).
    • Logic: The PWM value of this channel is divided into 6 segments, which are mapped to the flight modes defined in the FLTMODE_ (or MODE1..MODE6) parameters.

Integration Guide

  • Setup: Ensure your RC transmitter is mixing switches to the channel specified in MODE_CH.
  • Verification: Move the switches and verify the mode name changes in your Ground Control Station HUD.

Developer Notes

  • Library: RC_Channel::read_mode_switch().

MODE_CH

Default MODE_CHANNEL

Mode channel (MODE_CH)

Description

The Mode Channel parameter selects which Radio Control (RC) input channel is used to switch between flight/drive modes (e.g., Manual, Acro, Auto, Loiter) on the vehicle. This is a fundamental setup step that maps a physical switch on your transmitter to the vehicle's mode selection logic. The value corresponds to the RC channel number (1-16).

The Mathematics

The logic performs a direct mapping from the Pulse Width Modulation (PWM) value of the selected channel to a mode index.

$$ \text{Selected Mode} = f(\text{PWM}(\text{MODE\_CH})) $$

The PWM range (typically 1000us to 2000us) is divided into 6 segments, allowing for up to 6 different modes to be selected via a single channel (often mixed with switches on the transmitter).

The Engineer's View

This parameter is defined in Rover/Parameters.cpp as a GSCALAR (Global Scalar). It is read into the mode_channel variable. The RC_Channel::read_mode_switch() function checks the PWM input of the specified channel against standard thresholds (1230, 1360, 1490, 1620, 1750) to determine the active mode index (0-5).

Tuning & Behavior

  • Default Value: 0 (Disabled) or vehicle specific default.
  • Range: 0 - 16
  • 0: Disabled (Mode switching via RC is turned off; vehicle remains in initial mode or controlled via GCS).
  • 1-16: The RC input channel number to use for mode switching.