Enormous drift in LPE estimation with PX4Flow

Hello,

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 -
http://logs.uaventure.com/view/PzCrUU4EU3Z65ZJFfX6fLJ

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

Thanks,
Karthik

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:
http://logs.px4.io/plot_app?log=3f14be80-3596-4043-8aa6-dacb749d2b08
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?