Altitude estimation diverge with no apparent reason

I am using PX4 VERSION: b930c0d built for crazyflie.

Altitude or local position z estimation from ekf2 works ok for a while then start breaking (going down) which causing unintended climbing for no apparent reason. No external force, air flow change. All the tests are done indoor with flat surface.

Unfortunately I cannot get log data due to missing sdcard slot in the board, but happens quite a lot almost every time it fly.
What may be the reason to this and how to minimize impact of this error?
Any help would much appreciated.

Kyu

1 Like

Hi @Kyuhyong_You ,
We would really need a log file to investigate…
Did you set the range sensor as the primary height estimate(EKF2_HGT_MODE = 2)?

Hi @bresch ,
Thank you for you comment, I will try setting the parameter as you said.
But initially I thought setting that parameter might negatively affect height estimation when flying above cluttered area such as flying above high grass.
So I was trying to rely on barometer sensor mostly and only use sonar when data is reliable and assumed as flat.
Have you had any issues with above mentioned situation?

Kyu

Yes, it has indeed negative impacts when flying on a non-flat surface. But since you said that your are flying indoor, I thought it could be an easy fix.

The barometer is really sensitive to temperature changes and airflows or internal pressure changes produced while moving. If you want ro rely on barometer only, you might need to improve the barometer shielding and make thermal calibration.

If you’re planning to fly mostly outside in places with good GPS coverage, an other alternative is to use GPS as the primary height aiding instead of baro. I had really good results with that strategy.