EKF2 IMU0 has stopped aiding

I am using PX4Flow and Lidar Lite v3 with Pixhawk.

I am getting an error “EKF2 IMU0 has stopped aiding” on MP. This error comes sometimes and then disappears. I tried flying the quad. But the quad had a very strong drifted forwards, right after takeoff in Loiter mode. Another time, the quad was flying as expected in loiter mode but suddenly drifted again (strong drift).

The error does not come when the PX4Flow is disabled.
I also tried by recalibrating again but no luck.

Thanks in advance. Been struck since many days.

got the same Problem and also no Idea…

@ppoirier, can you suggest anything?

Everything was working fine. The quad had some drift so just tried to focus the PX4Flow feed a little. Though did not change since the focus was fine. After that, this error is being shown.

Thank you.


That error happens in OF mode. There are different causes, mostly dealing with compass… Are flying EK2 or EK3 or both ?

Yeah… The error comes with Optical Flow.

We are using EK2.

How to deal with the compass problem?

Well, this is a complicated challenge, especially when flying indoor.
You can add additionnal compas on the I2C line and try to install them (just like the one on the GPS) far from EMI like motors.

I am using both EK2 & EK3 and this error does not really impact on the flight performance, unless you have very bad OF quality , for this you have to checks on the logs.

Thank you. I will check the logs.

For now, I changed the EK2_IMU_MASK to 2 i.e. using only one imu, loiter is working quite okay.
But when I kept EK2_IMU_MASK as 1, the orientation on MP was haywire (random orientation, speed, and height). So, I used the value as 2 and tested.

But now there are issues with maintaining a constant height. But I don’t think these are related.

Any comments?

If you want precise altitude within rangefinder enveloppe (about 30 M for the LidarLite), you can set the rangefinder as the primary altitude source in the ekf

Yeah… I had changed EK2_RNG_USE_HGT to 50 i.e use Lidar till 20m. Still the problem.

@poirierp may this be the reason for altitude fluctuations? The primary imu is not working maybe.

You need to look at the logs, all the sensors are recorded and you can analyse if there is a fault. I would look at the baro parameter vs rangefinder altitude for any discrepancy.

Please refer the following log:

Mode: Altitude hold
First 25 seconds on a flex, then on a non reflective surface.

Why are spikes of 0 range coming in the rangefinder data? That may be the reason for fluctuations in the quad height.

With PX4Flow,

@ppoirier, any suggestions?

Do you have a video , or a pucture of wht the reflective vs non reflective surfaces look like ?

^Reflective (Not sure if the picture helps, it is a pattern printed on flex)

Non reflective: Grass

(Reflective and non reflective were not the correct words to describe… I guess)

Ok It seems that this surface is not ideal for the tests. Grass is much better up to 5 meters, above that height it’s missing texture.

Depends on what you plan to do with this setup you can test over different surfaces or create the best by using a high texture rug

Yeah… Is there a way to get a stable altitude quad independent of the surface?
As far as I knew, Lidar Lite v3 was the best option.

And another doubt, @ppoirier.
I was testing loiter mode with PX4Flow. Loiter is working at 1.5m around but there is drift at higher heights 2m around.
On searching, some had suggested that there may be a problem with incorrect focus hence unable to detect features. But the problem still persists despite checking the focus. Is their any other tuning parameter that can be changed to solve the issue?

Have you followed the instructons? Setting focus is step 7…

For reflectivity, this is dependant on use case, as I wrote before, its up to you to experiment :slight_smile:

Good Luck, Have Fun