MPU6050 accelerometer drift

The accelerometer readings from my MPU6050 drift over time. See the attached graph.  Throughout, the quad sat stationery on the ground, and only the flight controller powered up - no power to motors / ESCs.

Quad frame accelerometer X, and Y readings (qax, qay) are accepable.  Z axis is not.

Gravity is measured at the start of a flight, and then subtracted from the accelerometer readings to yield net acceleration, integrated to get net velocity and then passed though my motion processing code.

As the sensors drift down during a hover (for example), the PID input (sensors - gravity) drifts negative in a hover.  The PID output comes out positive and the quad climbs as a result.

The sensors are maintained at 40oC (regardless of ambient) so it's not drift due to temperature.

I've tried running the sensor readings through a complementary filter to extract drifted gravity from drifted acceleration peaks - the result is better, but there's lag meaning the quad thinks it's falling and overcompensated.

Anyone else experience this?  Any ideas / solutions?

I know I just add a barometer or ultrasonic range finder to manage the height but I'd rather explore how to suppress or compensate for this drift first.

Thanks

SensorDrift.jpg

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity