← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

The aircraft changed to another copy of the EKF

WarningPosition and attitude estimate (EKF, AHRS)

What ArduPilot says:

The EKF, ArduPilot's position and attitude estimator, runs one copy (a lane, or core) per IMU. Each has an error score: how badly GPS and barometer (and compass or airspeed, if asked) disagree with it. Armed, the aircraft follows one lane and moves to another when the active one turns unhealthy or scores above 1.0 while another does better, or as a last attempt just before an EKF failsafe. The number is the new lane, counting from 0. On a copter “EKF primary changed” reports the same event.

What to do, most likely first

  1. One IMU saw more vibration than the other, or clipped, and its lane drifted.

    CheckCompare the IMUs in the log (vibration, clipping, accelerometer traces). The lane that was left is the suspect.

    FixReduce the vibration. If the same IMU is always the bad one, look at how the board is mounted: on many boards one IMU is damped and another is not.

  2. The lanes use different compasses, GPS units or barometers, and one of those sensors went bad.

    CheckEK3_AFFINITY is not 0; look for compass, GPS or barometer messages at the same time.

    FixThe switch did its job; find and repair the sensor that failed.

  3. A GPS glitch or a compass disturbance hit every lane, and the switch was the last attempt before an EKF failsafe.

    Check“EKF variance” or an EKF failsafe follows within a second or two.

    FixSee “EKF variance”.

One switch in a flight that otherwise went well is the redundancy working. Repeated switches mean an IMU or a sensor needs attention. In the log: error subsystem 24, the code is the new lane.

Parameters to look at

ParameterWhat it is
EK3_IMU_MASKBitmask of active IMUs
EK3_PRIMARYPrimary core number
EK3_AFFINITYEKF3 Sensor Affinity Options
EK3_ERR_THRESHEKF3 Lane Relative Error Sensitivity Threshold
EK3_OPTIONSOptional EKF behaviour
The code that sends it

NavEKF2: lane switch N

libraries/AP_NavEKF2/AP_NavEKF2.cpp NavEKF2::checkLaneSwitch() · Open in ArduPilot Copter-4.7.1

EKF3 lane switch N

libraries/AP_NavEKF3/AP_NavEKF3.cpp NavEKF3::UpdateFilter() · Open in ArduPilot Copter-4.6.3

libraries/AP_NavEKF3/AP_NavEKF3.cpp NavEKF3::checkLaneSwitch() · Open in ArduPilot Copter-4.6.3

libraries/AP_NavEKF3/AP_NavEKF3.cpp NavEKF3::switchLane() · Open in ArduPilot Copter-4.7.1

EKF primary changed:N

ArduCopter/ekf_check.cpp Copter::check_ekf_reset() · Open in ArduPilot Copter-4.7.1

Written here for Copter 4.6. In the tool you choose your vehicle and version, see your own parameter values beside the ones named here, and drop a flight log to have every message in it explained.

Open it in the Message & Error Explainer