Abnormal drift during GPS hover

During outdoor GPS hover, it was very stable the whole time. During landing (at 1:43), the aircraft suddenly drifted significantly in one direction. Flight logs and video are attached.

Hi,

Thanks for sharing the flight details.

Since the vehicle remained stable during GPS hover and the significant drift appeared specifically during landing at around 1:43, it would be useful to examine the estimator and position controller behaviour around that timestamp.

Could you please share the PX4 ULog file or a public Flight Review link?

A few additional details would also help:

  1. Was the landing performed in Position mode or an automatic landing mode?

  2. Was the drift accompanied by an unexpected vehicle tilt or acceleration?

  3. Was an optical flow sensor or rangefinder enabled?

  4. Did the vehicle recover its position, or did the drift continue until touchdown?

I would suggest checking the following signals around 1:43:

  • Local position and velocity estimates versus setpoints.

  • EKF position and velocity innovations.

  • GPS accuracy and estimator validity.

  • Attitude setpoints versus actual attitude.

  • Land detector state and actuator outputs.

This should help distinguish an estimator-related position jump from an actual vehicle movement or control response.

I’d be happy to take a closer look at the log once it’s accessible.

Best regards,
PAMILANGA LIMITED

Hi

Thank you very much for you reply.

PX4 ULog is here: Flight Review - Quadrotor

Hi,

Thanks for sharing the ULog. I’ve started examining the estimator and position-control data around the landing event.

There are several interesting observations:

  • At approximately 110.18 s, the vehicle enters Auto Land mode.

  • Around 111.76–111.78 s, GPS fusion becomes active while optical flow fusion is disabled.

  • Shortly afterwards, the EKF horizontal position reset counter increments.

  • By approximately 113.9 s, the estimated horizontal position differs from the position setpoint by about 0.77 m.

  • The estimator velocity innovation test ratio exceeds 1.0, and inertial dead reckoning becomes active later.

These observations suggest that the horizontal aiding-source transition deserves closer investigation.

However, I would not yet conclude that GPS caused the physical drift. We still need to correlate the estimator transition with attitude commands, actuator outputs and the actual movement visible in the video.

Could you also confirm whether the vehicle was intentionally switched into Auto Land mode at approximately this point, and whether optical flow and a rangefinder were installed and enabled?

I’ll continue reviewing the control response before suggesting any parameter changes.

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

Hi

Thank you very much for you reply.

  1. yes, The vehicle was manually switched to Land mode at this point in time.
  2. Optical flow and the rangefinder are confirmed to be installed and enabled.

Hi,

Thanks for confirming both points.

Since the transition to Land mode was manually commanded, we can exclude an automatic landing failsafe as the cause of that particular mode transition.

The next step is to determine whether the abnormal drift originates from the state estimator or the position controller.

Although optical flow and the rangefinder are installed and enabled, we should verify whether their measurements were actually being fused by EKF2 during the affected flight segment.

I would suggest checking the following:

  1. Estimator fusion status: Confirm whether GPS and optical flow measurements were accepted and fused by EKF2 during hover.

  2. Position and velocity innovations: Look for increasing innovation residuals, test ratios, or estimator resets around the onset of drift.

  3. Position setpoint versus actual position: Determine whether the vehicle was following an incorrect position estimate or failing to maintain the commanded position.

  4. Local velocity and optical flow: Compare estimated horizontal velocity with optical flow measurements, taking rangefinder validity and sensor quality into account.

  5. Estimator configuration: Check EKF2_GPS_CTRL, EKF2_OF_CTRL, sensor orientation, and relevant optical flow and rangefinder settings.

Could you share the complete ULog file and confirm the PX4 firmware version?

It would also help to know whether the drift occurs consistently in one direction or changes between flights.

I would avoid further autonomous hover testing until the estimator behavior has been verified.

Best regards,
Yiğitcan

Hi

Thank you very much for you reply.

I don’t know how to upload the complete ulog file here, so I replied to you with an email.

Hi huaercsu2017,

Thank you for getting back to me.

I understand that uploading the complete ULog to the forum can be difficult.

You can upload the .ulg file to https://review.px4.io/ and share the generated public analysis link here. Please make sure the log does not contain any information you do not wish to share publicly.

Alternatively, you can attach the original .ulg file to a reply if the forum allows it.

Once the complete log is available, we can examine the GPS and estimator behavior alongside the position setpoints and actual vehicle response to narrow down the cause of the drift.

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

Hi

ulog is here:

Adding one more thing to check alongside the estimator analysis above. The drift starts as the aircraft nears the ground, and that is also where laser rangefinders are least reliable, so it is worth ruling the rangefinder in or out at the same timestamp.

In the ULog around 110 to 114 s, plot the distance sensor reading together with its valid flag and the min/max limits you configured. Below a module’s minimum range, or over dark or glossy ground, a laser module can return nothing, zero, or its last good value, and a held value looks like a plausible height. If the sensor goes invalid at the same moment fusion switches from flow to GPS, you have your trigger, and the question becomes why the flow fusion dropped out, not whether GPS caused the drift. If the valid flag stays solid through the transition, the sensor is not involved and the estimator side stays the main suspect.

A bench check that takes five minutes: put a target at the lowest height you land from and move it 5 cm closer at a time until the reading stops tracking. Repeat with a dark target. That break point is what the landing has to tolerate. (I work on rangefinder modules at ERDI, so I tend to look at that first.) If you post the plot of distance, valid flag and fusion status on one timeline I am happy to read it.

For reference, the short-range class I mean is ERDI’s LRF10VB (0.05-9 m on a 90% target, 50 Hz, UART): LRF10VB 9 m 940 nm Laser Rangefinder Module | ERDI TECH

Hi erdi-lrf,

Thanks for the rangefinder suggestion. I inspected the shared ULog and found several relevant events.

The distance sensor reports a minimum range of 0.02 m, while the optical-flow message reports a minimum operating distance of 0.08 m.

More importantly, the estimator flags show:

  • At approximately 54.58 s, range-height fusion stops and the rangefinder fault flag becomes active.

  • Between 110 and 112 s, the distance sensor repeatedly reports approximately 0.02 m.

  • At approximately 112.52 s, the distance reading changes to around 5.76 m.

  • At approximately 112.70 s, GPS fusion starts, followed by optical-flow fusion stopping at approximately 112.71 s.

  • The horizontal position reset counter subsequently increments from 2 to 3.

These are directly observed log events, but they do not yet establish that the rangefinder caused the reported horizontal drift.

The rangefinder fault also appears substantially earlier than the GPS/optical-flow transition, so the two should not be treated as a single simultaneous failure.

I would suggest checking the actual rangefinder model, its configured operating limits, and the reason for the repeated 0.02 m measurements before changing estimator parameters.

Thanks again for highlighting this possibility.

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