The first compass needs too large a correction
What ArduPilot says:
- PreArm: Compass offsets too high
A calibration stores offsets for each compass: the constant magnetic field of the aircraft itself, subtracted from every reading (COMPASS_OFS_X, COMPASS_OFS_Y, COMPASS_OFS_Z, in milligauss). For the first compass in use, the three taken together as one vector are longer than COMPASS_OFFS_MAX (1800 by default). ArduPilot expects about 530 for the Earth's field itself, so the aircraft's own magnetism is several times stronger than what the compass is meant to measure.
What to do, most likely first
The first compass is the one on the flight controller, right next to the battery leads and the power board.
Check
COMPASS_EXTERNAL0 means the first compass is on the board itself. The ground station's compass screen shows which compass is first and whether it is external.FixUse the compass in the GPS module, mounted away from the wiring: move it to the top of the list in the compass screen, set
COMPASS_USE2(orCOMPASS_USE3) to 0 for the internal one, reboot and calibrate.Something magnetic sits close to the compass: steel screws, a buzzer, a magnet in a battery strap or a canopy latch.
CheckWatch the raw compass values (mx, my, mz in the ground station's status) while you move the suspect part away: a jump of hundreds is the answer.
FixMove the part or the compass, use brass, aluminium or nylon hardware near the compass, then calibrate again.
The calibration was done near a lot of steel: indoors, over reinforced concrete, beside a car.
FixCalibrate again outdoors in the open, with the battery and everything that flies with the aircraft fitted.
The calibration accepts each axis up to COMPASS_OFFS_MAX on its own, while arming measures the three together, so a calibration can succeed and arming still refuse. Raising COMPASS_OFFS_MAX does not move the iron away: the heading stays poor.
Parameters to look at
| Parameter | What it is |
|---|---|
COMPASS_OFS_X | Compass offsets in milligauss on the X axis |
COMPASS_OFS_Y | Compass offsets in milligauss on the Y axis |
COMPASS_OFS_Z | Compass offsets in milligauss on the Z axis |
COMPASS_OFFS_MAX | Compass maximum offset |
COMPASS_EXTERNAL | Compass is attached via an external cable |
COMPASS_USE | Use compass for yaw |
COMPASS_USE2 | Compass2 used for yaw |
COMPASS_USE3 | Compass3 used for yaw |
Where to do it:Setup & Tuning Guide
The code that sends it
PreArm: Compass offsets too high
libraries/AP_Arming/AP_Arming.cpp AP_Arming::compass_checks() · Open in ArduPilot Copter-4.7.1