MAVLINKHUD

Overview

The EFI parameter group configures the interface for monitoring internal combustion engines equipped with Electronic Fuel Injection (EFI) systems or engine control units (ECUs).

ArduPilot does not control the injection timing (the ECU does that); instead, it monitors the engine status to provide:

  1. RPM: For throttle governing and vibration filtering.
  2. Fuel Flow: For accurate remaining range estimation.
  3. Health: Cylinder temperatures, manifold pressure, and ECU errors.

Key Concepts

1. Driver Support

Supports major UAV engine manufacturers:

  • NWPMU: Northwest Power Management Unit.
  • Currawong: CAN-based ECUs.
  • Hirth: Serial interface.
  • Loweheiser: Serial interface.
  • MegaSquirt: Via CAN or Serial.

2. Fuel Density (EFI_FUEL_DENS)

Gasoline weight varies by blend and temperature. Setting this correctly ensures accurate weight/balance calculations if the GCS tracks fuel weight.

Parameter Breakdown

  • EFI_TYPE: Driver selection.
  • EFI_PORT: Serial port selection (if using UART-based ECU).
  • EFI_BAUDRATE: Serial speed.

Integration Guide

  1. Connection: Wire the ECU telemetry output to an Autopilot UART or CAN bus.
  2. Configure: Set EFI_TYPE and port settings.
  3. Verify: Check the "RPM" and "Fuel" values in the Mission Planner "Status" tab.

Developer Notes

  • Library: libraries/AP_EFI
  • Logging: Generates EFI log messages with detailed engine stats.

EFI_BAUDRATE

Default 0
Range 1 1000000

EFI Port Baud Rate (EFI_BAUDRATE)

Description

EFI_BAUDRATE sets the speed for the serial connection between the flight controller and the engine's ECU.

  • Default: 0 (Use driver default).
  • Usage: Set this to match the output rate of your ECU (e.g. 57600 or 115200).
  • Reboot Required: Yes.

EFI_COEF1

Default 0
Range 0 1

EFI Calibration Coefficient 1 (EFI_COEF1)

Description

Scaling factor (slope) for fuel flow calculation when using the MegaSquirt (MS) EFI protocol.

EFI_COEF2

Default 0
Range 0 10

EFI Calibration Coefficient 2 (EFI_COEF2)

Description

Offset calibration value for fuel flow when using the MegaSquirt protocol.

EFI_COEF3

Default 0
Range -1 1

Throttle linearisation - Third Order

Note: This parameter functions identically to EFI_COEF1.

EFI_EN

Default 0
Range 0 1

EFI Throttle Linearization Enable (EFI_EN)

Description

EFI_EN enables advanced throttle mapping for combustion engines.

Combustion engines are inherently non-linear; the power produced at 50% throttle position is rarely 50% of the total available power. This can make the autopilot's altitude and speed control loops (TECS) perform poorly. Enabling this feature allows ArduPilot to use a measured "Power Curve" to translate its requested power into the correct throttle percentage for the ECU.

  • 0: Disabled (Default). Uses a simple linear throttle-to-RPM mapping.
  • 1: Enabled. Activates the linearization model.

EFI_FUEL_DENS

kg/m^3
Default 0
Range 0 10000

ECU Fuel Density (EFI_FUEL_DENS)

Description

The density of the fuel being used, required for accurate mass-based fuel consumption calculations.

EFI_OFS

Default 0
Range 0 1.0

EFI Throttle Linearization Offset (EFI_OFS)

Description

EFI_OFS defines the starting point of the power curve calibration.

EFI_PORT

Default -1
Range 0 10

EFI Serial Port (EFI_PORT)

Description

Defines the hardware serial port instance used by the AP_Periph node to communicate with the EFI ECU.

EFI_THRLIN_OFS

Default 0
Range 0 100

throttle linearization offset (EFI_THRLIN_OFS)

Description

Constant offset added to the linearized throttle output.

EFI_THR_COEF1

Default 1
Range -1 1

Throttle linearisation - First Order (EFI_THR_COEF1)

Description

Primary linear scaling coefficient for the EFI throttle linearization polynomial.

EFI_THR_COEF2

Default 0
Range -1 1

Throttle linearisation - Second Order (EFI_THR_COEF2)

Description

Quadratic term for the EFI throttle linearization polynomial.

EFI_THR_COEF3

Default 0
Range -1 1

Throttle linearisation - Third Order (EFI_THR_COEF3)

Description

Cubic term for the EFI throttle linearization polynomial.

EFI_TYPE

Default 0

EFI communication type (EFI_TYPE)

Description

Enables the Electronic Fuel Injection (EFI) subsystem and selects the communication protocol used to talk to the engine's ECU.

Tuning & Behavior

  • Default Value: 0 (None)
  • Values: 1:Serial-MS (MegaSquirt), 2:NWPMU, 3:Serial-Lutan, 5:DroneCAN, 6:Currawong-ECU, 7:Scripting, 8:Hirth, 9:MAVLink
  • Requires reboot after changing to initialize the driver.