MAVLINKHUD

Overview

The RPM parameter group configures the Rotations Per Minute (RPM) sensors. This system monitors the speed of motors or engines.

RPM data is critical for:

  1. Heli Governor: Maintaining main rotor speed.
  2. Harmonic Notch Filter: Tracking motor vibration frequency.
  3. Engine Health: Monitoring ICE (Gas) engine state.

Key Concepts

1. Sensor Types (RPMn_TYPE)

  • 1 (PWM Pin): Connects to a Hall Effect sensor or Optical tachometer that sends a pulse for every rotation.
  • 2 (ESC Telemetry): Pulls RPM data from a BLHeli_32 or DShot ESC.
  • 4 (DroneCAN): For CAN-based RPM sensors.

2. Scaling (RPMn_SCALING)

Converts pulses per second into actual RPM.

  • For Hall Effect: Set to the number of magnets on the shaft.
  • For BLHeli ESC: Set to the number of motor poles divided by 2.

Parameter Breakdown

  • RPM1_PIN: The GPIO pin assigned to the sensor.
  • RPM1_MAX: Maximum expected RPM (sanity check).

Integration Guide

  1. ESC Setup: If using DShot telemetry, set RPM1_TYPE = 2 and ensure SERVO_BLH_BDMASK includes the motor you want to track.
  2. Verification: Check the RPM1 value in the GCS Status tab while the motor is spinning.

Developer Notes

  • Library: libraries/AP_RPM.
  • Usage: Often fed into AP_ICEngine or AP_InertialSensor_HarmonicNotch.

RPM_MSG_RATE: RPM sensor message rate

Description

This is the rate RPM sensor data is sent in Hz. Zero means no send. Each sensor with a set ID is sent in turn.

Values

  • Range: 0 to 200
  • Units: Hz
  • Default: 0

Description

This parameter controls the frequency of RPM telemetry messages sent by the AP_Periph device (e.g., a CAN-based RPM sensor or ESC).

  • Usage: Set this to a non-zero value (e.g., 10Hz or 20Hz) to see motor or rotor RPM on your GCS or OSD.
  • Function: The peripheral will sample the RPM and broadcast it on the CAN bus at this interval.
  • 0 (Default): Disables RPM telemetry from this device.

RPM1_DC_ID

Default 0
Range 0 65535

DroneCAN RPM Message ID (RPM1_DC_ID)

Description

RPM1_DC_ID identifies which specific piece of hardware on the DroneCAN bus is providing the RPM data for this instance.

This allows you to map multiple DroneCAN RPM sensors (e.g., from different ESCs) to specific slots in the autopilot's telemetry system.

  • 0: Auto-detection.
  • Value: Specific Node ID.

RPM1_ESC_INDEX

Default 0
Range 0 32

RPM ESC Telemetry Index (RPM1_ESC_INDEX)

Description

RPM1_ESC_INDEX allows you to "Inject" external RPM data into the ESC telemetry system.

If you have a motor that doesn't provide internal RPM telemetry (like a gas engine or an older ESC), but you have an external RPM sensor (optical or hall effect), you can use this parameter to tell the autopilot: "Take the RPM from this sensor and record it as if it were coming from ESC X."

Tuning & Behavior

  • Default: 0 (Disabled).
  • Usage: Set to the motor number (e.g. 1) to have this sensor's data appear in the ESC[0] telemetry logs and GCS fields.

RPM1_ESC_MASK

Default 0
Range 0 4294967295

RPM ESC Telemetry Mask (RPM1_ESC_MASK)

Description

RPM1_ESC_MASK allows a single RPM sensor to represent multiple motors.

This is useful for vehicles where multiple motors are physically linked to a single shaft (e.g. a geared twin-motor setup) or for helicopters where one RPM sensor on the main gear represents the speed for the entire power system.

  • Bit 0 (1): Motor 1
  • Bit 1 (2): Motor 2
  • Example: Set to 3 (1+2) if this sensor's data applies to both Motors 1 and 2.

RPM1_MAX

RPM
Default 100000
Range 0 200000

Maximum Reported RPM (RPM1_MAX)

Description

RPM1_MAX is a safety filter to prevent "Spikes" or unrealistic data from affecting the autopilot.

Electrical interference or a loose sensor wire can sometimes cause a burst of pulses that look like the motor is spinning at an impossibly high speed (e.g. 500,000 RPM). If the autopilot used this data for a governor or dynamic notch filter, it could cause a crash. This parameter sets the "sanity limit" – any reading higher than this is ignored.

Tuning & Behavior

  • Default: 100,000 RPM.
  • Recommendation: Set this to roughly 20% higher than your motor's maximum possible physical RPM. For most small multicopters, 50,000 is plenty. For large gas engines, 10,000 might be appropriate.
  • Context: Only applies when using GPIO-based (pulse counting) RPM sensors.

RPM1_MIN

RPM
Default 10
Range 0 1000

Minimum Reported RPM (RPM1_MIN)

Description

RPM1_MIN acts as a "Noise Gate" for the RPM sensor.

At extremely low speeds or when the motor is stopped, electrical noise on the sensor pin can sometimes look like a valid pulse, causing the GCS to show "Ghost RPM" (e.g. 2 or 3 RPM). This parameter tells the autopilot to ignore any calculated RPM below this value and simply report 0.

Tuning & Behavior

  • Default: 10 RPM.
  • Usage: For large, slow-moving rotors (like on a large helicopter), you might need to lower this to 5. For high-speed racing motors, you can increase this to 100 or more to ensure a clean zero-reading when disarmed.
  • Context: Only applies when using GPIO-based (pulse counting) RPM sensors.

RPM1_MIN_QUAL

Default 0.5
Range 0 1.0

Minimum RPM Quality (RPM1_MIN_QUAL)

Description

RPM1_MIN_QUAL defines the "Certainty Threshold" for digital RPM sensors.

Some RPM sensors (especially those reporting via DroneCAN) calculate a confidence or quality score based on the stability of the signal. If the signal is weak or inconsistent (due to electrical noise or poor sensor alignment), the quality score drops. This parameter tells the autopilot to reject any data if the quality falls below this level.

  • 0.5 (Default): 50% confidence required.
  • 1.0: Perfectly clean signal required.

Tuning & Behavior

  • Recommendation: Leave at 0.5. If you see your RPM readings "flickering" to 0 during high-speed flight, you may need to decrease this value slightly or check your wiring for noise.

RPM1_PIN

Default -1
Range -1 103

RPM Input Pin (RPM1_PIN)

Description

RPM1_PIN tells the autopilot which digital port on the flight controller is connected to your RPM sensor (e.g., an optical sensor, a hall effect sensor, or the RPM output from an ESC).

  • -1: Disabled.
  • 0-103: The pin number assigned to the physical input.

Tuning & Behavior

  • Default: -1.
  • Setup: Refer to your flight controller's documentation to find the correct GPIO pin number for the port you are using.
  • Requirement: Only used if RPM1_TYPE is set to 1 (GPIO).

RPM1_SCALING

Default 1.0
Range 0 100

RPM Scaling (RPM1_SCALING)

Description

RPM1_SCALING is the "Gear Ratio" or "Pole Count" setting for your RPM sensor. It tells the autopilot how many pulses from the sensor equal one full revolution of the motor or shaft.

$$ \text{RPM} = \text{Sensor Rate} \times \text{RPM1\_SCALING} $$

  • Example (Hall Effect): If you have 1 magnet on the shaft, set Scaling to 1.0.
  • Example (Pole Count): If using an ESC sensor on a 14-pole motor, the sensor sends 7 pulses per rev. Set Scaling to $1/7
    approx$ 0.142.

Tuning & Behavior

  • Default: 1.0.
  • Accuracy: Verify the reported RPM against a handheld tachometer. If the reported RPM is exactly double the actual RPM, divide your Scaling value by 2.

RPM1_TYPE

Default 0
Range 0 7

RPM Sensor Type (RPM1_TYPE)

Description

RPM1_TYPE enables real-time monitoring of motor or rotor revolutions per minute (RPM).

This is highly recommended for Helicopters (to monitor head speed) and for large Internal Combustion Engine (ICE) vehicles. It is also used by the Harmonic Notch Filter to dynamically track and eliminate motor-induced vibrations.

  • 0: None. Disabled.
  • 2: GPIO. For Hall effect or optical sensors connected to a digital pin.
  • 4: Harmonic Notch. Derived from internal motor controllers (SITL/Special use).
  • 5: ESC Telemetry. Averages RPM data from all ESCs reporting telemetry.
  • 7: DroneCAN. For CAN-based RPM sensors.

Tuning & Behavior

  • Reboot Required: Yes.
  • Integration: Once enabled, you must configure the input pin (RPM1_PIN) if using GPIO, and the scaling (RPM1_SCALING).

RPM2_DC_ID

Default -1
Range -1 10

DroneCAN Sensor ID

Note: This parameter functions identically to RPM1_DC_ID.

RPM2_ESC_INDEX

Default 0
Range 0 10

ESC Telemetry Index to write RPM to

Note: This parameter functions identically to RPM1_ESC_INDEX.

RPM2_ESC_MASK

Default 0
Range null

Bitmask of ESC telemetry channels to average

Note: This parameter functions identically to RPM1_ESC_MASK.

RPM2_MAX

Default 100000
Range null

Maximum RPM

Note: This parameter functions identically to RPM1_MAX.

RPM2_MIN

Default 10
Range null

Minimum RPM

Note: This parameter functions identically to RPM1_MIN.

RPM2_MIN_QUAL

Default 0.5
Range null

Minimum Quality

Note: This parameter functions identically to RPM1_MIN_QUAL.

RPM2_PIN

Default -1
Range null

Input pin number

Note: This parameter functions identically to RPM1_PIN.

RPM2_SCALING

Default 1.0f
Range null

RPM scaling

Note: This parameter functions identically to RPM1_SCALING.

RPM2_TYPE

Default 0
Range null

RPM type

Note: This parameter functions identically to RPM1_TYPE.

RPM3_DC_ID

Default -1
Range -1 10

DroneCAN Sensor ID

Note: This parameter functions identically to RPM1_DC_ID.

RPM3_ESC_INDEX

Default 0
Range 0 10

ESC Telemetry Index to write RPM to

Note: This parameter functions identically to RPM1_ESC_INDEX.

RPM3_ESC_MASK

Default 0
Range null

Bitmask of ESC telemetry channels to average

Note: This parameter functions identically to RPM1_ESC_MASK.

RPM3_MAX

Default 100000
Range null

Maximum RPM

Note: This parameter functions identically to RPM1_MAX.

RPM3_MIN

Default 10
Range null

Minimum RPM

Note: This parameter functions identically to RPM1_MIN.

RPM3_MIN_QUAL

Default 0.5
Range null

Minimum Quality

Note: This parameter functions identically to RPM1_MIN_QUAL.

RPM3_PIN

Default -1
Range null

Input pin number

Note: This parameter functions identically to RPM1_PIN.

RPM3_SCALING

Default 1.0f
Range null

RPM scaling

Note: This parameter functions identically to RPM1_SCALING.

RPM3_TYPE

Default 0
Range null

RPM type

Note: This parameter functions identically to RPM1_TYPE.

RPM4_DC_ID

Default -1
Range -1 10

DroneCAN Sensor ID

Note: This parameter functions identically to RPM1_DC_ID.

RPM4_ESC_INDEX

Default 0
Range 0 10

ESC Telemetry Index to write RPM to

Note: This parameter functions identically to RPM1_ESC_INDEX.

RPM4_ESC_MASK

Default 0
Range null

Bitmask of ESC telemetry channels to average

Note: This parameter functions identically to RPM1_ESC_MASK.

RPM4_MAX

Default 100000
Range null

Maximum RPM

Note: This parameter functions identically to RPM1_MAX.

RPM4_MIN

Default 10
Range null

Minimum RPM

Note: This parameter functions identically to RPM1_MIN.

RPM4_MIN_QUAL

Default 0.5
Range null

Minimum Quality

Note: This parameter functions identically to RPM1_MIN_QUAL.

RPM4_PIN

Default -1
Range null

Input pin number

Note: This parameter functions identically to RPM1_PIN.

RPM4_SCALING

Default 1.0f
Range null

RPM scaling

Note: This parameter functions identically to RPM1_SCALING.

RPM4_TYPE

Default 0
Range null

RPM type

Note: This parameter functions identically to RPM1_TYPE.