Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPU6050 on RP2040 reads strange results when offsets are set #715

Open
maxomous opened this issue Oct 22, 2022 · 3 comments
Open

MPU6050 on RP2040 reads strange results when offsets are set #715

maxomous opened this issue Oct 22, 2022 · 3 comments

Comments

@maxomous
Copy link

Hello,

I am using the mpu6050_DMP_V6.12 example to retrieve the yaw, pitch and roll angles using 'OUTPUT_READABLE_YAWPITCHROLL'.

The results are very responsive until I attempt to set the offsets or call the CalibrateAccel() / CalibrateGyro() functions provided.

After setting offsets, the readings become somewhat erratic (it almost seems that the different axes are interfering with each other) and there is a noticeable lag when settling.

I have also noticed that calling PrintActiveOffsets() prints out just the set x values for x, y & z, e.g.
Acc. X = 1000, Y = 1000, Z = 1000
Gyro. X = 10, Y = 10, Z = 10

I have checked using all of the get#AccelOffset() and get#GyroOffset() functions and it seems like the correct values are being set, but PrintActiveOffsets is somehow reading the x value 3 times. I'm not sure if this in relation to the first issue but I thought it may help in diagnosis.

Thanks in advance,
Max

@maxomous
Copy link
Author

I should note, I am running it on a raspberry pi pico hence using the RP2040 code in the link

@ZHomeSlice
Copy link
Contributor

The Calibration uses a PID (minus the D) loop to land the calibration. setting the offset instantly has an effect on the next reading. When the MPU6050 is level and stable the calibration samples the sensors and shifts the offsets to get Zeros on 5 of the 6 axis and adjusts Accell Z to show 1g.
your issue with not calibrating is unusual and your results:
Acc. X = 1000, Y = 1000, Z = 1000
Gyro. X = 10, Y = 10, Z = 10
for offsets are not normal after calibration.
I have not used this on a raspberry pi pico yet, so I'm not sure of the resulting changes to make this work. I am interested in seeing what you discover and your final results.
Thank you
Z

@alphatech56
Copy link
Contributor

May be this is result of bug in int8_t I2Cdev::readWords() #719 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants