The EKF switched to another core (ERR EKF_PRIMARY)
What ArduPilot says:
- ERR EKF_PRIMARY (Subsys 24)
The EKF runs one estimator (a “core”) for each IMU in use and flies on the one that agrees best with the sensors. This error records a change of that primary core; the code is the number of the new one (0 is the first IMU, 1 the second). The message “EKF primary changed:1” says the same. One switch in a flight is the system working as designed; switching back and forth means one IMU's core keeps disagreeing with the sensors.
What to do, most likely first
One IMU suffers more vibration than the other, so its core drifts away.
CheckCompare the VIBE messages of the two IMUs (VIBE.IMU 0 and 1) and their clipping counts.
FixReduce the vibration: balance the props and check how the flight controller is mounted.
The estimate was under stress (a GPS glitch, compass trouble) and the EKF changed cores to recover shortly before an EKF failsafe.
Check“ERR EKFCHECK-2” or “GPS Glitch or Compass error” is in the log within a second or two.
FixFollow the cause of that event: see “EKF variance” and “GPS Glitch or Compass error”.
One IMU is failing or badly calibrated.
CheckWith the copter at rest, IMU.AccZ of the two IMUs differs by more than a few tenths of a m/s².
FixRepeat the accelerometer calibration; if one IMU still disagrees, the board needs attention.
Parameters to look at
| Parameter | What it is |
|---|---|
EK3_IMU_MASK | Bitmask of active IMUs |
EK3_PRIMARY | Primary core number |
EK3_AFFINITY | EKF3 Sensor Affinity Options |
Where to do it:Failsafe ExplainerSetup & Tuning Guide