Pixhawk 6X (v1.17.0): baro altitude drifts up to ~1 m on the bench with nothing connected

Hi all,

I’d like an expert opinion on barometer drift on my Pixhawk 6X before I start flying indoors without GPS.

Setup

  • Pixhawk 6X (internal ICP20100 + BMP388), PX4 v1.17.0
  • Only USB connected: no GPS, no power module, no other sensors
  • Board sitting still on a desk indoors, disarmed
  • Log and params attached

Result (10 min test, attached log)

  • EKF altitude (vehicle_local_position): 0 → +0.55 m → −0.29 m, with the board not moving.
  • Both barometers mostly move together: the pressure difference between them changed by only ~3 Pa.
  • Two other bench tests the same day showed the same pattern, once up to +1.1 m (24 min) and once down to −0.8 m (16 min). The direction changes from test to test.

My intended use
Holybro S500 indoors, no GPS, barometer for height, plus a Holybro H-Flow (optical flow + rangefinder over DroneCAN).

Current settings:
EKF2_HGT_REF 0 (baro)
EKF2_RNG_CTRL 1 (conditional)
EKF2_RNG_A_HMAX 10
EKF2_RNG_A_VMAX 1
EKF2_BARO_NOISE 3.5
EKF2_OF_CTRL 1

Please check the attached log which was took during bench test, connected only Pixhawk6x to PC with latest stable version of PX4 V1.17.0

Questions

  1. Is ~1 m of altitude drift on the bench, with the board still, normal for the 6X internal barometers? Or does it suggest a hardware or sensor problem?
  2. What is the most likely cause: room air pressure changes (AC, doors, ventilation), or something on the board itself?
  3. Without GPS, does the EKF correct baro drift at all? For example, does conditional range aid correct the baro offset while hovering, or does the drift stay uncorrected?
  4. For no-GPS indoor flight, which setup is recommended:
    • EKF2_HGT_REF = 0 (baro) + EKF2_RNG_CTRL = 1 (conditional), or
    • EKF2_HGT_REF = 2 (rangefinder) + EKF2_RNG_CTRL = 2 (always)?
  5. Are there parameters I should change to reduce the effect of baro drift without GPS (for example EKF2_BARO_NOISE, EKF2_RNG_A_HMAX)? Or is the right practice simply to arm just before takeoff, so altitude starts from 0?

Thanks in advance!

This is a useful companion experiment to your PX4 v1.14.3 indoor Takeoff-mode investigation.

The fact that both internal barometers show broadly correlated altitude changes while the board remains stationary makes a common pressure/environmental or thermal contribution plausible. It does not, by itself, establish a hardware fault.

I would distinguish three separate questions:

  1. Are the raw barometric pressure measurements changing?

  2. Is EKF2 following those changes because barometer is the configured height reference?

  3. Does the resulting local-altitude drift affect takeoff target generation or preflight behaviour?

For the bench log, I would compare raw pressure, sensor temperature, estimator local z, vertical velocity, height innovation and estimator reset counters on the same timeline.

One useful detail is whether the two barometers track the same pressure changes in pascals, not only their individually referenced altitude values.

For indoor flight over a flat surface, using the rangefinder as the height reference may be worth evaluating, provided the sensor is valid throughout the intended height envelope. I would not recommend changing multiple EKF parameters or increasing barometer noise simply to hide the drift.

I would also avoid treating arming immediately before takeoff as a complete solution. It may reduce the time available for pre-takeoff drift, but does not establish a stable height reference during flight.

Your two threads together suggest a useful validation sequence:

stationary barometer drift → EKF local-altitude response → Takeoff-mode entry → altitude setpoint construction → actual climb.

The key is to determine whether the first divergence occurs in the height estimate or when the takeoff setpoint is generated.

If the bench ULog and the three Takeoff ULogs are available, a synchronized comparison could help establish that boundary without guessing from the final altitude alone.

Thanks @yigitcan-ozturk. I followed your suggestion and plotted raw pressure, sensor temperature, and EKF height on one timeline. This is from a new set of logs on 20 Oct (same Pixhawk 6X, v1.17.0, indoors, nothing else changed in the room).

  1. Bench test, 9 min stationary right after power-on (USB + H-Flow only)https://logs.px4.io/plot_app?log=4466bfa8-614b-4353-bb65-b7332ee0c261

Both baros drift in the same direction. The pressure difference between them changed by only 3.9 Pa (about 0.3 m) over the 9 minutes, so a single faulty sensor seems unlikely. The drift closely tracks the board warming up after power-on. During a later 17-minute flight session, the board temperature kept rising from 32.7 °C to 40.7 °C.
2. Does the EKF correct it without GPS? With EKF2_HGT_REF=0 (baro), no: baro defines height, so the drift goes straight into local z. I switched to:

  • EKF2_HGT_REF = 2 (range sensor)
  • EKF2_RNG_CTRL = 2
  • EKF2_BARO_CTRL = 1 (baro kept as an aiding source)
  • EKF2_BARO_NOISE = 3.5 (unchanged)

On the same bench test, raw baro drifted −1.1 m but EKF height ended at +0.15 m. The EKF’s baro bias estimate moved by −0.7 m, which matches the baro drift, so the EKF absorbs

  1. In flight (about 20 short indoor hovers at 1 nder height averaged between −0.26 and +0.25 m inmost flights, with short peaks of ±0.3–0.9 m. One flight averaged +0.8 m and peaked at +1.8 m, which I think was prop wash near the ground. Height control followed the rangefinder throughout, and Takeoff to MIS_TAKEOFF_ALT (1.0 / 1.5 m) was consistent.

My conclusion for indoor, no-GPS, flat floor:

  • About 1 m of baro drift on the bench looks normal for this board. It’s mostly thermal warm-up plus room pressure changes, not a fault.
  • Use the rangefinder as the height reference (HGT_REF=2, RNG_CTRL=2) and keep baro fusion enabled. There’s no need to raise EKF2_BARO_NOISE.

Please let me know if my understanding is correct

Hi Rathi,

Thank you for the detailed follow-up and for carrying out the additional bench and flight tests.

Your interpretation is largely consistent with the results you’ve reported.

For indoor, GPS-denied operation over a flat floor, using the rangefinder as the primary height reference while retaining barometric aiding is consistent with the PX4 EKF2 documentation.

The improvement from approximately −1.1 m of raw barometric drift to +0.15 m of final EKF height displacement is encouraging.

A few points are worth keeping separate:

  1. Thermal drift: The correlation between board temperature and pressure drift suggests a thermal contribution, but it does not yet establish how much comes from sensor warm-up versus ambient pressure changes.

  2. Sensor agreement: Both barometers drifting similarly makes an isolated single-sensor fault less likely, although common-mode effects remain possible.

  3. Rangefinder reference: Your configuration appears appropriate for the tested flat-floor environment. It should not automatically be generalized to uneven terrain, obstacles or operation beyond the sensor’s reliable range.

  4. Flight outlier: The +1.8 m peak deserves separate inspection. Prop wash is plausible, but comparing rangefinder measurements, vertical innovations, barometric pressure and thrust would help determine whether it was a measurement disturbance or actual height excursion.

I also agree that the current results do not justify increasing EKF2_BARO_NOISE without further evidence.

One useful final check would be to compare the EKF height innovations and rangefinder validity during the outlier flight against one of the stable flights.

Overall, this is a useful validation of the selected height-reference configuration for your specific operating conditions.

Thanks again for documenting the measurements so clearly.

Best regards,
Yiğitcan Öztürk
PAMILANGA LTD