i2cdevlib icon indicating copy to clipboard operation
i2cdevlib copied to clipboard

YawPitchRoll angles reset to zero on start-up

Open LeonRonin opened this issue 6 years ago • 3 comments

hi I'm using your code for detecting the angle on a slope and it works just fine with very good accuracy. my only problem is that the angle values reset to zero every time restart the MCU. is there a way to fix this??

LeonRonin avatar Oct 22 '19 08:10 LeonRonin

I need more information to help Do you have fixes offsets or are you using the calibration routines? What version of the libraries are you using V2 or V6.12 of the DMP?

ZHomeSlice avatar Oct 22 '19 15:10 ZHomeSlice

I used the IMU_zero sketch that comes with the library to get the offsets for my mpu6050 the I set those offsets on the V6.12 example and got very accurate readings (down to 0.01 degrees precision). my problem is that the V6.12 example resets the YAW PITCH ROLL values to zero every time the MCU starts up.

LeonRonin avatar Oct 22 '19 19:10 LeonRonin

With fixed offsets, you can remove any calibration routines as they will change your offsets remark out or remove the calibration routines

    // Calibration Time: generate offsets and calibrate our MPU6050
    mpu.CalibrateAccel(6);
    mpu.CalibrateGyro(6);

These will change the fixed offsets.

ZHomeSlice avatar Oct 24 '19 03:10 ZHomeSlice