The EKF's height and the barometer's height differ by more than 1 m
What ArduPilot says:
- PreArm: Altitude disparity
With the copter set to navigate by GPS, the height from the EKF (ArduPilot's position and attitude estimator) and the height straight from the barometer differ by more than 1 m. Both count from where the flight controller was switched on, so on the ground they should agree. The test is skipped when the EKF navigates relative to the ground (optical flow), where the two are allowed to drift apart. It belongs to the Barometer group of arming checks.
What to do, most likely first
The barometer has drifted since power-on: the board warmed up, the weather is changing, or sun or wind reached the sensor.
CheckThe altitude in the ground station is not near 0 on the ground and creeps slowly.
FixReboot: the barometer is zeroed at every start. Let a cold board warm up for a minute first, and cover the barometer with open-cell foam if light or airflow reaches it.
The EKF is still settling after start-up or after the copter was carried, and its height has not caught up.
FixLet the copter stand still for 20 to 30 s.
The EKF takes its height from something other than the barometer, which is drifting away from it.
Check
EK3_SRC1_POSZis 3 (GPS) or 2 (rangefinder) instead of 1 (barometer).FixFor a first build keep
EK3_SRC1_POSZat 1. GPS height needs a receiver with very good vertical accuracy.
Parameters to look at
| Parameter | What it is |
|---|---|
EK3_SRC1_POSZ | Position Vertical Source |
BARO_PRIMARY | Primary barometer |
Where to do it:Setup & Tuning Guide
The code that sends it
PreArm: Altitude disparity
ArduCopter/AP_Arming.cpp AP_Arming_Copter::barometer_checks() · Open in ArduPilot Copter-4.6.3
ArduCopter/AP_Arming_Copter.cpp AP_Arming_Copter::barometer_checks() · Open in ArduPilot Copter-4.7.1