rpicopter / ArduinoMotionSensorExample

MPU6050/MPU6500/MPU9150/MPU9250 over I2c for Arduino
117 stars 40 forks source link

Reading of multiple axis from ypr[]change at the same time #6

Open mugenZebra opened 9 years ago

mugenZebra commented 9 years ago

When the IMU is rotating around z axis, yaw, roll, pitch change at the same time like from 0 to 180. It's yaw for gyro that changes. When the IMU is rotating around x axis, only roll changes as it's supposed to like from 0 to 90, and yaw and pitch goes +- 3 degrees. gyro pitch changes. When the IMU is rotating around y axis and yaw changes from 0 to 90, pitch change by 30 and roll change by 50 degrees. For gyro[], it's pitch that changes. What is wrong here?

mugenZebra commented 9 years ago

I think I found the error. I was using DMP_FEATURE_LP_QUAT instead of DMP_FEATURE_6X_LP_QUAT. I guess the quaternion formula is only for 6X mode.

zelante commented 7 years ago

Hi. I have the same problem but only on one rotation, two others is ok (from -180 to 180). Using gy9255 (mpu6555 + ak8963). Using DMP_FEATURE_6X_LP_QUAT but problem is not solved... How can i get range -180 to 180 on all three rotation? I guess i must change something in mpu.cpp in function quaternionToEuler.