The EKF stopped agreeing with its sensors (ERR EKFCHECK)
What ArduPilot says:
- ERR EKFCHECK (Subsys 16)
Code 2 (bad variance): for a full second the EKF, ArduPilot's position and attitude estimator, failed its check. Two of its compass, velocity and position test ratios were at or above FS_EKF_THRESH (0.8 by default), or velocity alone at twice that, or the position estimate was lost outright. The message is “EKF variance”, and the EKF failsafe (“ERR FAILSAFE_EKFINAV-1”) follows at once. Code 0: the check has passed again for a second. In flight, switch to AltHold or Stabilize and fly by hand: those modes do not use the position.
What to do, most likely first
The GPS went bad: jamming or spoofing, poor reception, or the fix was lost.
CheckIn the log XKF4.SV (velocity) and XKF4.SP (position) rise towards 1 while GPS.NSats falls or GPA.SAcc grows; “GPS Glitch or Compass error” may come first.
FixFly where the sky is open and the GPS is clear of transmitters; where jamming is expected, plan to fly without position.
The compass is disturbed by the motors' current or badly calibrated, so the heading is wrong.
CheckXKF4.SM (compass) rises with throttle; the copter circles around its hold point before the error.
FixMove the compass away from power wires, calibrate it outdoors, and run the motor-interference calibration.
Vibration is corrupting the accelerometers, so the EKF's own prediction is wrong.
CheckVIBE.VibeX, VibeY or VibeZ above 30 m/s², or VIBE.Clip counting up.
FixBalance the props, check the flight controller's mounting and remove whatever shakes or touches it.
Parameters to look at
| Parameter | What it is |
|---|---|
FS_EKF_THRESH | EKF failsafe variance threshold |
Where to do it:Failsafe ExplainerSetup & Tuning GuideSetup & Tuning Guide