The EKF gave up on one compass and moved to the next
What ArduPilot says:
- EKF2 IMUN switching to compass N
- EKF3 IMUN switching to compass N
A copy of the EKF, ArduPilot's position and attitude estimator, stopped trusting the compass it was using and moved to the next one that is healthy and allowed for heading; the last number is the new compass, from 0. It does this in flight when the compass readings have been rejected for 10 s (and not in the first 30 s after the EKF started), or at any time when the compass has sent nothing for 10 s.
What to do, most likely first
The first compass is disturbed in flight by motor current; the other sits further from the wiring.
CheckIn the log the first compass's readings follow the battery current, and the switch comes at high throttle.
FixPut the best-placed compass first in the compass order (usually the one in the GPS mast), and run the compass-motor calibration.
The compass stopped sending data: a loose cable or a failing sensor.
CheckA compass health message appears at the same time, and it also happens on the ground.
FixCheck the cable and connector of the external compass; replace the module if it keeps dropping out.
The two compasses point different ways because one has a wrong orientation or an old calibration.
FixCalibrate the compasses again and check the orientation of each.
Parameters to look at
| Parameter | What it is |
|---|---|
COMPASS_USE | Use compass for yaw |
EK3_AFFINITY | EKF3 Sensor Affinity Options |
EK3_MAG_I_GATE | Magnetometer measurement gate size |
Where to do it:Setup & Tuning GuideSetup & Tuning Guide
The code that sends it
EKF2 IMUN switching to compass N
libraries/AP_NavEKF2/AP_NavEKF2_Measurements.cpp NavEKF2_core::tryChangeCompass() · Open in ArduPilot Copter-4.7.1
EKF3 IMUN switching to compass N
libraries/AP_NavEKF3/AP_NavEKF3_Measurements.cpp NavEKF3_core::tryChangeCompass() · Open in ArduPilot Copter-4.7.1