Closed Mael19 closed 3 years ago
Hello Mael19,
With the definition of the angles used in this library, there is an angular jump when the MPU6050 is turned upside-down. However the complementary filter integrates the gyroscope data, that provides a quite smooth angular estimation. In this point the jump is then smoothed by the complementary filter. It is possible to give less weight to the gyroscope data, but then the measure relies more on the accelerometer data, that is noisy...
I don't know how to avoid this angular jump without using quaternions (that is not the formalism used in this library...)
I will think about this, any idea is also welcome.
Kind regards,
Romain
The issue has been solved in the new version of the code available for download on Github. Do not update the code from the Arduino library manager (in case you use it) since I did not push yet the new version to the library manager.
You should now have a sharp transition from +180° to -180° on the X angle.
The credit for the solution goes to Edgar Bonet's answer to this issue.
Kind regards,
Romain
Hello, thank you so much for your fix! I just tried the new version and it seems to work perfectly!
Best regards, Mael
Hello, I have an issue when the MPU6050 is upside down and the angle passes from 180 to -180 and vice versa. I get some "parasite values" (see code) that I'd like to remove, does anyone know how to do that? Cheers and merry Christmas!