Barometer drift while quadcopter is sitting on the ground

I armed my quad and left it armed with props spinning slowly for about 7-8 minutes. During that time I notice baro drift as below:

In GUIDED mode I commanded the quad to take off to 2 metres at 17:38:32.044. It left the ground but got nowhere near to 2 metres altitude when at 17:38:34.049 takeoff finished*. Zooming in on the XKF1.PD graph I just see a 40cm increase in altitude before the drone thinks it has reached 2 metres:

Why does takeoff finish prematurely?

Is it possible that having large baro drift before takeoff while the drone is armed will cause takeoff to use some out of date value for the start altitude?

Thanks!

*I am checking for when Mavlink message EXTENDED_SYS_STATE changes from MAV_LANDED_STATE_TAKEOFF to MAV_LANDED_STATE_IN_AIR to determine end of takeoff

This is why airports report the local pressure when a pilot approaches. Pressure changes all the time because of the weather.
If you want accurate altitude using pressure, you need a second pressure sensor at your base station.

Edit: Apparently the quadcopter can directly effect the pressure reading.
https://ardupilot.org/copter/docs/ground-effect-compensation.html

You are only supposed to arm moments before takeoff.

When you arm the barometric pressure is taken as 0 altitude reference. And all works as you expect it to work.

The only issue is the 7-8 minutes that you waited between arming and taking off. Just do not do that.

1 Like

Okay, it sounds like that is just the way it works. Thanks for confirming this. It was incredibly scary having the drone at 40cm above ground thinking it was at 2m.

It’s a shame as my use case needs the drone to always be armed and ready to take off.

I just had a thought which is if I measure the pressure at the time of arming, I can set a different takeoff altitude based on the pressure difference at takeoff time.

I don’t know if this is possible but one idea is to reset the value just before takeoff by a script.

I think what is also concerning about Arducopter behaviour is that the XKF thinks the altitude is changing during these 7 minutes.

The drone is stationary on the floor!

Air pressure changes with time.

I realise that. But a stationary drone’s XKF should not think it is increasing in altitude!

IMUs also drift, there is no way to know for sure that it is not moving.
The correct procedure is to arm and take off immediately. The action of arming tells the copter that after that moment it will start to move.