tockn / MPU6050_tockn

Arduino library for easy communication with MPU6050
218 stars 84 forks source link

Angle Z shifted after rotating many times ,although X & Y were perfect ? #33

Open Elkhawaga opened 5 years ago

Elkhawaga commented 5 years ago

Angle Z shifted after rotating many times by -40 or 20 or -11 ,... but X & Y angles didn't effected even when moving fast

you are using coff of Gyro & Acc in Angle X ,Angle Y but in Z angle you didn't made that , Why?

angleX = (gyroCoef (angleX + gyroX interval)) + (accCoef angleAccX); angleY = (gyroCoef (angleY + gyroY interval)) + (accCoef angleAccY); angleZ = angleGyroZ;

thanks alot for your wonderful effort :)

tockn commented 5 years ago

Because we cannot calculate angleZ by using accelerometer, so I use only gyro sensor in calculating angleZ. If you want to more accurate angleZ, you can use other sensor together. (ex: geomagnetic sensor)

nhphuong91 commented 4 years ago

You can find detailed explanation as well as many more useful information here: https://www.w3.org/TR/motion-sensors/#relative-orientation-sensor