The EKF no longer trusts the GPS (or the heading is wrong)
What ArduPilot says:
- GPS Glitch or Compass error
- ERR GPS-2 (Subsys 11, ECode 2)
The EKF, ArduPilot's position and attitude estimator, flagged the GPS as unreliable: the receiver's own speed accuracy went above 1.5 m/s, or for a full second the GPS position and velocity disagreed with what the IMU and compass predict. The line changes nothing by itself, but in Loiter, RTL or Auto the copter may drift or lean away from where it should be, and if it gets worse the EKF failsafe follows (“EKF variance”). Be ready to switch to AltHold or Stabilize and fly by hand: those modes do not use the position.
What to do, most likely first
GPS reception got worse: jamming or spoofing, buildings or trees, few satellites, or noise from a video transmitter or camera next to the antenna.
CheckIn the log: GPS.NSats falling, GPS.HDop rising, GPA.SAcc above 1.5 at the time of the message.
FixFly under open sky, mount the GPS away from transmitters and cameras, and take off only with a steady fix. Where jamming is expected, plan to fly without position.
The heading is wrong, so GPS velocity does not match the direction the copter thinks it flies: compass interference from power wires, or a poor calibration.
CheckThe copter circles around its hold point (“toilet bowl”) before the message; in the log the compass innovations (XKF3.IMX, IMY, IMZ) grow with throttle.
FixCalibrate the compass outdoors away from metal, raise it away from power wires, and run the motor-interference calibration if the error grows with throttle.
Strong vibration corrupts the IMU's velocity, and the GPS, which is right, looks wrong.
CheckVIBE.VibeX, VibeY or VibeZ in the log above 30 m/s², or VIBE.Clip counting up.
FixFind and remove the vibration: balance the props, check the flight controller's mounting.
Parameters to look at
| Parameter | What it is |
|---|---|
FS_EKF_ACTION | EKF Failsafe Action |
FS_EKF_THRESH | EKF failsafe variance threshold |
EK3_GLITCH_RAD | GPS glitch radius gate size (m) |
COMPASS_MOTCT | Motor interference compensation type |
Where to do it:Failsafe ExplainerSetup & Tuning GuideSetup & Tuning Guide
The code that sends it
GPS Glitch or Compass error
ArduCopter/events.cpp Copter::gpsglitch_check() · Open in ArduPilot Copter-4.7.1