Altitude Mode – EKF thought it was descending while the drone was clearly climbing

Hi all,

I’m trying to understand something that happened in Altitude mode and would really appreciate some estimator-level insight.

Firmware: PX4 v1.16.1

What happened

  • Drone was hovering normally.

  • Mid-flight it started climbing unexpectedly.

  • I reduced throttle (including strong downward input).

  • The drone kept climbing.

  • In the log, EKF vertical velocity (-vlp.vz) shows descent during that period.

  • The controller reacted consistently with that estimate (increased thrust to “stop” the perceived descent).

So at that moment:

  • The drone was physically climbing (visually confirmed).

  • The barometer altitude trend (from vehicle_air_data.baro_alt_meter) shows climb.

  • EKF vertical velocity estimate shows descent.

What I’ve already ruled out:

  • No EKF instance switch.

  • No attitude resets.

  • Baro test_ratio stayed low.

  • cs_baro_hgt = 1 (barometer was the active height source).

  • EKF appears to be internally consistent (v_up_est matches d(alt_est)/dt) (see image below).

  • Motors follow thrust setpoint normally.

So this doesn’t look like a classic reset or measurement rejection.

In the figure below, the X-axis represents log time in seconds (so 320 s ≈ 5:20 in the flight). The derivatives of the estimated altitude and the barometer altitude (used here as vertical velocity proxies) begin to diverge in that interval. After ~350 s (≈5:50), the data is no longer reliable, as the vehicle was already in an abnormal state and I attempted a non-standard external intervention to prevent further damage, which contaminates the measurements beyond that point.

Other observations

  • From some point onward, the drone flies with a persistent ~5° pitch offset.
    Not sure if it’s related, but worth mentioning.

  • Vibration levels are higher than recommended.

  • GPS was physically connected but not used for estimation (SYS_HAS_GPS = 0, and related parameters disabled). Height source was barometer only.

  • Additionally, the Local Position X/Y values in Flight Review seem to be several orders of magnitude larger than expected, considering the vehicle never left a ~5 m radius from the takeoff point. I’m not sure whether this is a logging reference issue or something estimator-related

Main question

Is there a realistic EKF2 mechanism where high vibration (or something similar) could bias vertical acceleration/velocity enough to produce a sustained vertical velocity error without triggering innovation failures or high test_ratio?

In other words, can the estimator drift in vertical velocity while still looking statistically “healthy”?

Flight Review link:

Flight Review - Hexarotor

If needed, I can upload the full .ulg file and/or .params for more details.

I’m trying to understand whether this smells like configuration, vibration-induced bias, or something deeper.

Hi !

I may have a related issue, in position mode with Vision as height source (in a fork of 1.16.0).

The EKF estimated altitude was stable, but the drone was clearly climbing or falling (ev_odometry was consistent with reality but EKF estimated that altitude was stable).

In my case, I believe it is a configuration issue, but I don’t know for sure and the symptoms seem to be close to yours (data are consistent but the EKF estimation is not).

I spent a lot of time looking into my log, checking sensors and the estimator, but I couldn’t find anything clearly wrong. The only obvious problem was vibration, so I suspect that might be the root cause in my case.

After the up and down behavior you described, did your drone stabilize itself and keep flying, or did it end up crashing?

Did you discovered the main cause of your problem?

Hi !

The EKF2 estimate recover itself after some times yes, and the drone did not crash.

I also did some experiment and found that my issue is probably due to velocity estimate. I re-activated EV velocity fusion with patched velocity estimate from the SLAM algorithm and it worked waaaay better.

Also, how do you check vibration level ? Without ev velocity fusion I beleive the EKF uses accelerometer to estimate velocity and had issue doing so

edit:

I may have a vibration issue…