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

Angle Z gyro drifting #34

Open
Gabriel110302 opened this issue Oct 7, 2022 · 3 comments
Open

Angle Z gyro drifting #34

Gabriel110302 opened this issue Oct 7, 2022 · 3 comments

Comments

@Gabriel110302
Copy link

I made the MPU6050 calibration several times and tried to change some values from the <MPU6050_light.h> library, but I cannot figure out to get the angle Z gyroscope not to drift away. Sometimes it drifts up sometimes down. I read that Earth moves 15 degree per hour so that's why it's drifts like this. What should I do to counter this?

@rfetick
Copy link
Owner

rfetick commented Dec 3, 2022

Hello Gabriel110302,
The MPU6050 is a cheap device that is subject to important noise and drift. I assume that you calibrate well your device on a flat surface as required by the library. Then the error might be due to the limited sensitivity of the sensor itself. If this issue is important for you, you may need a better sensor or couple the one you have with a magnetometer to get an absolute reference around the Z angle.
Cheers,
Romain

@cemyasam2
Copy link

cemyasam2 commented Sep 8, 2023

MPU6050_light.cpp dosyasında alttaki satırı bulun

accX = ((float)rawData[0]) / ACC_LSB_2_G;
accY = ((float)rawData[1]) / ACC_LSB_2_G;
accZ = ((float)rawData[2]) / ACC_LSB_2_G;
temp = (rawData[3] + TEMP_LSB_OFFSET) / TEMP_LSB_2_DEGREE;
gyroX = ((float)rawData[4]) / GYRO_LSB_2_DEGSEC - gyroXoffset;
gyroY = ((float)rawData[5]) / GYRO_LSB_2_DEGSEC - gyroYoffset;
gyroZ = ((float)rawData[6]) / GYRO_LSB_2_DEGSEC - gyroZoffset;

yukarıdaki satırın altına alttaki 2 satırı ekleyin böylecee gelen parazitik sıçramaları önleyebilirsiniz.
if(gyroZ>0 && gyroZ<0.4) {gyroZ=0;}
if(gyroZ<0 && gyroZ>-0.4) {gyroZ=0;}

@cemyasam2
Copy link

Merhaba Gabriel110302, MPU6050 önemli gürültü ve kaymalara maruz kalan ucuz bir cihazdır. Cihazınızı kütüphanenin gerektirdiği şekilde düz bir yüzey üzerinde iyi bir şekilde kalibre ettiğinizi varsayıyorum. O zaman hata, sensörün sınırlı hassasiyetinden kaynaklanıyor olabilir. Bu konu sizin için önemliyse, Z açısı etrafında mutlak bir referans elde etmek için daha iyi bir sensöre ihtiyacınız olabilir veya sahip olduğunuz sensörü bir manyetometreyle eşleştirebilirsiniz. Şerefe, Romain

MPU6050_light.cpp dosyasında alttaki satırı bulun

accX = ((float)rawData[0]) / ACC_LSB_2_G;
accY = ((float)rawData[1]) / ACC_LSB_2_G;
accZ = ((float)rawData[2]) / ACC_LSB_2_G;
temp = (rawData[3] + TEMP_LSB_OFFSET) / TEMP_LSB_2_DEGREE;
gyroX = ((float)rawData[4]) / GYRO_LSB_2_DEGSEC - gyroXoffset;
gyroY = ((float)rawData[5]) / GYRO_LSB_2_DEGSEC - gyroYoffset;
gyroZ = ((float)rawData[6]) / GYRO_LSB_2_DEGSEC - gyroZoffset;

yukarıdaki satırın altına alttaki 2 satırı ekleyin böylecee gelen parazitik sıçramaları önleyebilirsiniz.
if(gyroZ>0 && gyroZ<0.4) {gyroZ=0;}
if(gyroZ<0 && gyroZ>-0.4) {gyroZ=0;}

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