1

My situation:

  • I am able to communicate over i2c with my MPU6050 IMU
  • I can get accelerometer and gyro data
  • I can compute the sensor's orientation using my accelerometer

Issue:

  • when trying to compute the sensor's orientation using my gyroscope my values seem to be totally incorrect. I am computing the orientation using a complementary filter.

This is the code I use https://paste.ubuntu.com/p/vZmbnc23gj/

This is the computed orientation, when the sensor is lying on a table: https:https://paste.ubuntu.com/p/W7DzVKR9c7/ Those measurements are totally incorrect, because when moving the senor randomly around its axis it never goes above 1.8. (even when I do an 180 degree turn)

Could somebody give me some hints or explanation on why my results are incorrect and drifting so much?

asked Dec 30, 2019 at 21:35
2
  • Could you post a schematic of your connections? I understand you can communicate with it, but am interested in what you have. Commented Dec 30, 2019 at 23:01
  • @Wendall connection, are just typical "i2c connection" without pull ups Commented Dec 30, 2019 at 23:27

1 Answer 1

-1

You need to perform offset calibration, otherwise you'll get large drift errors. The MPU6050 has a dedicated Digital Motion Processor (DMP) where data from the gyro and accelerometer are fused for you. I recommend grabbing the results of that fusion from the DMP. As far as I know the only libraries that do this are ones based on Jeff Rowberg's work. For a detailed guide please see:

https://youtu.be/k5i-vE5rZR0

answered Jan 18, 2022 at 5:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.