Experiencing large (10-100-1000+ meters) drift in local position with PX4FLOW

Hi all, I’ve been experiencing a problem with the PX4FLOW unit in combination with various PX4 FCs. When the PX4FLOW unit is sending good data, LOCAL_POSITION_NED.x (and y) will experience various amounts of constant drift, ranging from tiny (5mm/s) to huge (6m/s). As a result, I’ve been unable to use position control mode as the drone will go haywire and quickly drift off some direction (usually forward as found when I turned position controller tunings down).

The facts:

  • Tested on Pixracer (FW versions 1.4.4, 1.5.1, 1.5.3, via I2C connection), Pixhawk (1.5.1, I2C connection), and DronesmithTech Luci (1.5.1, serial connection) flight controllers
  • Frame used for flights is a QAV 250
  • Tested with multiple PX4FLOW units, all of which appear to output good XY data and up to date firmware
  • Tested both indoors with sufficient lighting and outdoors in daylight
  • Using LPE, GPS disabled
  • No local position drift when there is no flow data (“XY timeout”) NOR when using only GPS
  • Have found the drift occurs regardless of if powered via USB or via battery
  • Distance measurement is marred by occasional blips of “0” when above minimum value of 0.3, possibly affecting LOCAL_POS_NED.z (will post better log showing this data)

Thoughts:

  • Dampening MPC tunings did not resolve the issue, leading me to believe it is either an issue with the LPE or the opitcal flow unit. As such…
  • May be caused by the PX4FLOW’s gyro as the values will sometimes start off usable, but will quickly shift to a constant drift when any movement is applied to the unit (is there a way to recalibrate the gyro?)
  • Would LIDAR improve XY local position data and position hold as a result?

One of many logs showing the drift

Any ideas or help is appreciated!

EDIT: After perusing another post with a similar issue (Pixhawk+PX4: Cannot get Optical Flow to work!), I have added a few more notes above in italics.

1 Like