Hi all
I am newbie and now i am trying to use MPU6050 module .
When i use DMP6 library to take yaw value, i see that yaw drift back about 0.5 degree after few seconds when i stop rotated
Ex: When i rotate from 0 degree to 90 degree and stop when yaw is 90, few seconds later, yaw drift back to about 89.5
And other, when i rotate from 90 degree to 0 degree and stop when yaw is 0, few seconds later, yaw drift back to about 0.5
Please help me fix this problem !!!!!!!!!!!!!!!! ~>.<~
P/S : Sorry if my english is bad and you try hard to understand
The MPU6050 has no magnetometer, so there is no absolute yaw reference. Yaw will always drift.
The latest commit to jrowberg's MPU6050 driver updates the DMP run-time calibration so it might reduce drift.
gbafamily:
The latest commit to jrowberg's MPU6050 driver updates the DMP run-time calibration so it might reduce drift.
There are several updates that just arrived at Jrowber's repository
1st is the PID based offset generator. it will automatically generate offsets for your MPU6050. if you transfer those offsets to the defaults the MPU will start off very close to what you want.
2nd is the NEW MPU6050_6Axis_MotionApps_V6_12.h which uses the latest firmware instance provided by InvenSense. This version has a Run-time calibration routine enabled: Once a no motion state is detected the gyro calibration will trigger. Calibration will complete within .5 seconds of no motion state detection.
This will automatically calibrate the MPU6050 gyro for you.
So get the latest library That just got updated today!!!
Change these lines to match the offsets provided by the example code
// supply your own gyro offsets here, scaled for min sensitivity
mpu.setXGyroOffset(51);
mpu.setYGyroOffset(8);
mpu.setZGyroOffset(21);
mpu.setXAccelOffset(1150);
mpu.setYAccelOffset(-50);
mpu.setZAccelOffset(1060);
Calibration can be activated at any time just have you MPU6050 level for proper accelerometer calibration.
// Calibration Time: generate offsets and calibrate our MPU6050
mpu.CalibrateAccel(6);
mpu.CalibrateGyro(6);
Serial.println();
mpu.PrintActiveOffsets();
(6) loops should create offsets and calibrate from scratch. (1) or (2) loops will do a great job of fine-tuning at startup the offsets once they are set.
Z
Thank for all your replies !
gbafamily:
The latest commit to jrowberg's MPU6050 driver updates the DMP run-time calibration so it might reduce drift.
zhomeslice:
There are several updates that just arrived at Jrowber's repository
Nice one! Thanks for mentioning those updates.