MAVLINKHUD

Overview

The ESC parameter group (primarily within AP_Periph firmware) configures the communication with Electronic Speed Controllers (ESCs) for the purpose of telemetry and calibration.

While the main autopilot handles motor control (via PWM or DShot), a DroneCAN node (or the autopilot itself) can listen to the ESC's serial telemetry stream to report RPM, Temperature, Voltage, and Current for each individual motor.

Key Concepts

1. ESC Telemetry

Many modern ESCs (BLHeli_32, APD, KISS) output a low-speed serial stream (typically 115200 baud) containing real-time health data.

  • ESC_TELEM_PORT: Selects the UART used to listen to the ESCs.
  • ESC_TELEM_RATE: Frequency (Hz) at which this data is forwarded to the main autopilot via CAN or MAVLink.

2. ESC Calibration (ESC_CALIBRATION)

This parameter (in some firmwares) can trigger a passthrough mode to allow a PC-based configurator (like BLHeliSuite) to talk through the autopilot to the ESCs for firmware updates and tuning.

Parameter Breakdown

  • ESC_TELEM_PORT: Serial port index for ESC data.
  • ESC_PWM_TYPE: (AP_Periph) Defines the output protocol to the ESC (PWM, OneShot, DShot).
  • ESC_RATE: The update rate of the motor control signal (Hz).

Integration Guide

  1. Hardware: Connect the "TLM" pin from all ESCs together (usually) and wire to the RX pin of the designated ESC_TELEM_PORT.
  2. Enable: Set the port and rate.
  3. Verify: Check the ESC_TELEMETRY or ESC messages in the DataFlash log.

Developer Notes

  • Library: Tools/AP_Periph and libraries/AP_ESC_Telem.
  • Advanced: Highly integrated with the Harmonic Notch Filter (INS_HNTCH_), which uses individual motor RPM to dynamically target vibration frequencies.

ESC_APD_SERIAL_1

Default 0

ESC APD Serial 1 (ESC_APD_SERIAL_1)

Description

This parameter is not found as a standard ESC parameter. It appears to be a miscategorized per-motor compass compensation value.

ESC_APD_SERIAL_2

Default 0

ESC APD Serial 2 (ESC_APD_SERIAL_2)

Description

This parameter is not found in the main codebase.

ESC_CALIBRATION

Default 0
Range 0 9

ESC Calibration Trigger (ESC_CALIBRATION)

Description

ESC_CALIBRATION is used to match the autopilot's output signals to the input range of your Electronic Speed Controllers (ESCs).

If your motors don't all start at the same time, or if they don't reach full power, you may need to calibrate them. Setting this parameter to 3 (Automatic) and rebooting will put the drone into calibration mode, where it passes your transmitter's throttle stick directly to the motors (with safety limits).

Common Values

  • 0: Normal. No calibration.
  • 3: Automatic. Triggers calibration on next boot.
  • 9: Disabled. Prevents accidental calibration.

Tuning & Behavior

  • Safety: REMOVE PROPELLERS before performing any ESC calibration.
  • Note: Digital protocols like DShot do not require (and cannot use) this calibration process. This is only for PWM/OneShot ESCs.

ESC_CMD_TIMO

ms
Default 100
Range 0 1000

ESC Command Timeout (ESC_CMD_TIMO)

Description

ESC_CMD_TIMO defines how long the autopilot will wait for a response when communicating with "Smart" ESCs (like DroneCAN or serial ESCs).

ESC_EXT_TLM_RATE

Hz
Default 5
Range 0 1000

ESC Extended Telemetry update rate (ESC_EXT_TLM_RATE)

Description

Controls the frequency of high-detail telemetry messages (e.g., input duty cycle, internal status flags) transmitted from the AP_Periph node via CAN.

ESC_PWM_TYPE

Default 0

Output PWM type (ESC_PWM_TYPE)

Description

Configures the motor output protocol for the AP_Periph node.

Tuning & Behavior

  • Default Value: 0 (Normal PWM)
  • Values: 1:Normal, 2:OneShot, 3:OneShot125, 4:Brushed, 5:DShot150, 6:DShot300, 7:DShot600, 8:DShot1200

ESC_RATE

Hz
Default 400
Range 50 400

ESC Update Rate (ESC_RATE)

Description

Defines the output refresh rate for traditional PWM-based ESCs on an AP_Periph node.

ESC_TELEM_PORT

Default -1
Range 0 10

ESC Telemetry Serial Port (ESC_TELEM_PORT)

Description

Specifies the physical serial port on the AP_Periph node used to read telemetry data from the ESCs.

ESC_TELEM_RATE

Hz
Default 50
Range 0 1000

ESC Telemetry update rate (ESC_TELEM_RATE)

Description

Controls the frequency of telemetry messages (voltage, current, RPM) transmitted from the AP_Periph node to the main flight controller via CAN.

ESC_TLM_MAV_OFS

Default 0
Range 0 31

ESC Telemetry mavlink offset (ESC_TLM_MAV_OFS)

Description

Remaps the ESC instance IDs for MAVLink reporting. This allows, for example, motors 5-8 to be displayed as ESCs 1-4 on a ground station for easier monitoring.

  • A value of 4 shifts everything down by 4.