← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

The compass was disturbed on the ground; the heading was corrected during the climb

WarningPosition and attitude estimate (EKF, AHRS)

What ArduPilot says:

Right after take-off the EKF, ArduPilot's position and attitude estimator, saw its heading error grow as the aircraft rose: the mark of a magnetic disturbance on the ground that fades with height. Having climbed more than 0.5 m, with the error grown by more than 0.25 rad (about 14°), it set the heading again from the compass. This can happen twice per take-off, before the regular in-flight alignment at 2.5 m. IMU and MAG number the EKF copy and the compass, from 0.

What to do, most likely first

  1. The take-off spot is magnetic: reinforced concrete, a car roof, a manhole cover, a steel table, rebar under tarmac.

    CheckIt happens at one take-off spot and not at another.

    FixTake off from soil or grass, a few metres from metal. The correction is automatic, but the first metres are flown with a wrong heading: climb straight up to 3 m before moving away.

  2. It happens everywhere: the aircraft itself disturbs the compass as the throttle comes up.

    CheckIn the log the compass readings move together with the battery current.

    FixMove the compass away from the battery leads and ESC wires, then run the compass-motor calibration.

Parameters to look at

ParameterWhat it is
EK3_MAG_CALMagnetometer default fusion mode
COMPASS_USEUse compass for yaw
The code that sends it

EKF2 IMUN MAGN ground mag anomaly, yaw re-aligned

libraries/AP_NavEKF2/AP_NavEKF2_MagFusion.cpp NavEKF2_core::controlMagYawReset() · Open in ArduPilot Copter-4.7.1

EKF3 IMUN MAGN ground mag anomaly, yaw re-aligned

libraries/AP_NavEKF3/AP_NavEKF3_MagFusion.cpp NavEKF3_core::controlMagYawReset() · 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