2
\$\begingroup\$

Using the IMU6050 IMU, one can use the accelerometer to calibrate for the drift in x and y rotational axes by applying a complementary filter.

However, I haven't found a way to calibrate for the drift in the z direction. If it's drifting, eventually the situation appears where the axes of x and y are switched, and the program starts to fail.

How to calibrate the drift around the z-axis?

\$\endgroup\$

2 Answers 2

6
\$\begingroup\$

The accelerometer doesn't see changes in gravity when you rotate around the vertical z-axis, so you can't use it as an input for a complementary filter (or any other filter/algorithm) to compensate for z-axis gyroscope drift.

You would need an added compass (magnetometer) for that, which does see changes in heading/yaw when you rotate around the z-axis.

The IMU6050 module has an MPU6050 on it which doesn't have a magnetometer built in; it only has gyroscopes and accelerometers, so it can't compensate for gyro drift around the z-axis on its own.

\$\endgroup\$
1
\$\begingroup\$

You need to mount two IMU modules on perpendicular planes - like on the facing pages of an open book. Then you won't need the magnetometer signal, since at least one accelerometer will see changes in gravity as you rotate along any axis.

For even better filter performance, you'd want three IMUs mounted on faces of a cube, such that the faces share a common vertex.

And, for noise reduction, you could then just keep going and put one IMU on each face of the cube, or even better: rotate the 2nd set of 3-faces 45 degrees away in two axes relative to the first set of 3-faces.

\$\endgroup\$
1
  • \$\begingroup\$ I can’t see that working - it sounds good in principle but imagine a situation where such a setup is slowly rotating on the z axis - how would it detect this? You would hope that multiple devices will reduce the drift but it won’t go away completely. \$\endgroup\$
    – Frog
    Commented Sep 9, 2022 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.