Enormous drift in LPE estimation with PX4Flow



I’ve been working on a custom airframe (singlecopter) with the PX4. I’ve achieved very good flight stability and good altitude hold. I’m using a PixHawk (with px4fmu-v2_lpe). Currently, I’m working on achieving position hold now, with the PX4Flow Optical Flow module. Previously, I had attained very good position hold with the same optical flow module on a quadcopter.
However, since moving to the custom airframe, my LPOS.X and LPOS.Y estimates have been going haywire. I’m running all my tests indoors, as it is the final objective. I’ve tried various flow sensor orientations (with appropriate changes in the parameters), to no avail. I’m using an MB1242 SONAR as my rangefinder, I’ve made changes in the driver file to allow me to use it facing upwards. Can this be a reason for bad LPOS estimation? I’ve also tried various surfaces in a attempt to get better position estimation, with no improvement in the results.

Here’s a log where I move the copter in an “L” in ALTHOLD mode -

What can I do to improve my LPE estimation? Could this be a hardware issue?



I’m getting very similar results to you, which makes me think it’s not a hardware issue.

I’m using a DJI Flamewheel with PX4Flow and LidarLite v3.

I find that even when my drone is at rest (nothing armed, no motors on) with all sensors seeing the ground, I get a constant drift in the LPE.

I’ve started looking at the raw sensor data from each sensor that’s going into the LPE. One thing I’ve found is that even when my vehicle is level, it puts out a constant X acceleration of about 0.05. It’s noisy, as expected, but I would expect the noise to be centered at zero. The offset is high enough that none of the noisy points get below zero. I re-calibrated the IMU and it did not help.

I think the LPE is a pretty new addition to the PX4 family, so maybe there’s a bug that hasn’t been found yet? I haven’t been able to find such a bug, if it exists.


Have you tried running some closed loop tests with your setup (after ARMING in stabilise mode)?
The LPE was working great (GPS denied, with MB1242 SONAR and PX4Flow) on my quadcopter, perhaps there’s an issue with my hardware.


Yeah I’ve done all sorts of unit tests. When I am flying and flip to position control I get a lot of drift and some odd behavior from the vehicle. That’s how I first discovered that the LPE was drifting. I started debugging the odd behavior.

About a year ago I had an almost identical hardware setup to what I have now, but the LPE didn’t exist yet (at least not in the stable release that I was using at the time). I believe I used the INAV estimator at that time, and everything worked great.


I am having a similar issue and position control is rejected.
This is my flight log:
To help debug this issue, can somebody share a log file of a successful flight where position control was achieved (PX4FLOW + Lidar-Lire, NO GPS). I am looking to compare the parameters and the flight graphs to find out why we are now having issues.


@tomatac , according to your logs, you have a lot of vibration; which it might have caused to reject the Position Control mode. Unfortunately, the the logs don’t show the flow_quality value; which it should be around 250. On the other hand, I’ve not been able to get the optical flow to work properly indoors with the v1.6.0 RC1 and LPE myself either. I suggest you try the v1.4.4 release; which works great for me with the same “DJI Flame Wheel F450, Quadrotor x” configuration that you have.

1 Like

Upon further testing, I’ve figured it is an hardware issue with my PX4Flow module which was returning erroneous values. Looking forward to implementing other visual methods for odometry.


@Al_B, Thanks! I will try to decrease the vibrations (thicker foam pad and maybe change the props, I am not sure if calibration can be a factor for vibrations). Also, on firmware 1.4.4., did you test with Lidar Lite or the sonar?


@tomatac, the sonar that comes with the PX4Flow doesn’t work well for us in 1.4.4 like it used to do with 1.3.4 so we had to use the Lidar Lite. However, we used the latest version 3.


@Al_B Great! That is what I have. Could you share your parameter file for that configuration? Some of the parameters are different in the latest version and the documentation for the old firmware has been replaced. Do you, by any chance have a flight log to a successful flight? I will post mine. It would be nice to compare. Thanks for your help!


The rare singlecopter! Would you be willing to share your custom mix?