MAVLINKHUD

Overview

The EAHRS parameter group configures the External Attitude Heading Reference System driver. This allows ArduPilot to utilize high-end, industrial-grade AHRS/INS units (like VectorNav, MicroStrain, or Inertial Labs) as the primary source of attitude and position data, bypassing the internal EKF.

Key Concepts

1. External Fusion

Instead of the autopilot taking raw IMU/GPS data and running its own EKF, it trusts the "Solution" provided by the external box. The external unit does the heavy lifting of sensor fusion.

2. Sensor Selection (EAHRS_SENSORS)

You can choose which data streams to consume:

  • Attitude: Roll, Pitch, Yaw.
  • Position: Lat, Lon, Alt.
  • Velocity: NED velocity.
  • Raw Data: Accelerometers, Gyros (for logging).

Parameter Breakdown

  • EAHRS_TYPE: Driver selection.
    • 0: Disabled.
    • 1: VectorNav (VN-100/200/300).
    • 2: MicroStrain (3DM-GX5).
    • 3: Inertial Labs.
  • EAHRS_RATE: Data update rate (Hz).
  • EAHRS_SENSORS: Bitmask of active data channels.

Integration Guide

  1. Hardware: Connect the unit to a High-Speed Serial Port (Telem 1/2).
  2. Serial: Set SERIALx_PROTOCOL = 36 (AHRS) and baud rate (usually 921600 or higher).
  3. Enable: Set EAHRS_TYPE to your device.
  4. Reboot.
  5. Check: Look for AHRS_EXTERNAL status in the GCS.

Developer Notes

  • Library: libraries/AP_ExternalAHRS
  • Latency: Critical factor. The driver handles timestamp correction to align external data with the autopilot's clock.

EAHRS_LOG_RATE

Hz
Default 10
Range 0 400

AHRS logging rate (EAHRS_LOG_RATE)

Description

Controls how frequently the data from the external AHRS is written to the aircraft's dataflash logs (EAHR and EAHV log messages).

EAHRS_OPTIONS

Default 0

External AHRS options (EAHRS_OPTIONS)

Description

Bitmask for advanced configuration of the external AHRS interface.

Tuning & Behavior

  • Default Value: 0
  • Bitmask:
    • Bit 0: Vector Nav use uncompensated values (direct sensor data)

EAHRS_RATE

Hz
Default 50
Range 50 400

AHRS data rate (EAHRS_RATE)

Description

Configures the frequency at which the flight controller requests orientation and navigation data from the external AHRS module.

  • Minimum value is 50 Hz.

EAHRS_SENSORS

Bitmask
Default 15
Range 0 15

External AHRS sensors (EAHRS_SENSORS)

Description

This parameter determines which sensor data streams from the connected External AHRS (e.g., VectorNav, MicroStrain) should be consumed by the autopilot. This allows for a hybrid setup where, for example, the external GPS and IMU are used, but the internal barometer is preferred.

The Mathematics

Bitmask logic:

  • Bit 0: Use GPS data.
  • Bit 1: Use IMU data (Accel/Gyro).
  • Bit 2: Use Barometer data.
  • Bit 3: Use Compass/Magnetometer data.

The Engineer's View

Defined in libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp.

  • Default (15 / 0xF): Use all available sensors from the external unit.
  • Usage: If the external unit has a poor quality barometer or is mounted in a pressurized box, you might disable Bit 2.

Tuning & Behavior

  • Default Value: 15 (All)
  • Set to: The sum of the bits for the desired sensors.

EAHRS_TYPE

Default 0

AHRS type (EAHRS_TYPE)

Description

Enables the External AHRS library and selects the driver for the specific third-party inertial navigation system (INS) or AHRS hardware.

Tuning & Behavior

  • Default Value: 0 (None)
  • Values: 0:None, 1:VectorNav, 2:MicroStrain5, 5:InertialLabs, 7:MicroStrain7
  • Requires reboot after changing to initialize the external device communication.