← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

The magnetic field the compass measures is too strong or too weak

Stops itCompass

What ArduPilot says:

With the offsets taken off, the first compass in use should read the Earth's magnetic field alone: ArduPilot expects about 530 milligauss and accepts 185 to 875. The message gives the value it sees, then the two limits. A reading outside them means the compass is measuring something besides the Earth, or instead of it.

What to do, most likely first

  1. You are next to steel or a magnet: a car, a metal table, reinforced concrete, a speaker.

    CheckCarry the aircraft a few metres into the open and watch the number in the message change.

    FixArm, and calibrate, away from metal. A field that is right outdoors and wrong on the workbench needs no fixing.

  2. The calibration is wrong: made near metal, or copied from another aircraft.

    CheckCOMPASS_OFS_X, COMPASS_OFS_Y and COMPASS_OFS_Z shift every reading; values that came from a parameter file were measured on another compass.

    FixCalibrate again outdoors, then reboot.

  3. A magnet or a wire carrying current sits close to the compass on the aircraft.

    CheckWith the aircraft still, switch equipment on and off (lights, video transmitter) and watch the raw compass values.

    FixMove the compass away from power wiring and magnets, or use the external one.

  4. The sensor reads on the wrong scale, or has failed.

    CheckThe value stays far off wherever you go, even after a fresh calibration.

    FixCalibrate with a GPS fix, so that ArduPilot can set COMPASS_SCALE from the field expected at your location. If the field is still out of range, replace the compass.

Parameters to look at

ParameterWhat it is
COMPASS_OFS_XCompass offsets in milligauss on the X axis
COMPASS_OFS_YCompass offsets in milligauss on the Y axis
COMPASS_OFS_ZCompass offsets in milligauss on the Z axis
COMPASS_SCALECompass1 scale factor
COMPASS_EXTERNALCompass is attached via an external cable
The code that sends it

PreArm: Check mag field: N.N, max N, min N

libraries/AP_Arming/AP_Arming.cpp AP_Arming::compass_checks() · 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