MPU6050 calibration
Posted: Fri Mar 29, 2019 4:39 pm
Hello,
I'm trying to use MPU6050 with pyBoard, I use this libs
https://github.com/micropython-IMU/micropython-mpu9x50
and
https://github.com/micropython-IMU/micropython-fusion
MPU6050 don't have magnetometro, so I use Fusion.update_nomag.
Pitch value and roll value are pretty stable, value of heading (Yaw) is constant 0.
For me is important value of heading so I copy calculation from Fusion.update and rewrite
self heading = 0
to
self.heading = self.declination + degrees(atan2(2.0 * (self.q[1] * self.q[2] + self.q[0] * self.q[3]),
self.q[0] * self.q[0] + self.q[1] * self.q[1] - self.q[2] * self.q[2] - self.q[3] * self.q[3]))
The value of heading is good but after while it start integrating some mistake. And value continuously change after 5 minutes almost up to 180°, without rotating mpu6050.
I guess that it is some static mistake from gyro, is there any way how to calibrate it?
Really thank for help
I'm trying to use MPU6050 with pyBoard, I use this libs
https://github.com/micropython-IMU/micropython-mpu9x50
and
https://github.com/micropython-IMU/micropython-fusion
MPU6050 don't have magnetometro, so I use Fusion.update_nomag.
Pitch value and roll value are pretty stable, value of heading (Yaw) is constant 0.
For me is important value of heading so I copy calculation from Fusion.update and rewrite
self heading = 0
to
self.heading = self.declination + degrees(atan2(2.0 * (self.q[1] * self.q[2] + self.q[0] * self.q[3]),
self.q[0] * self.q[0] + self.q[1] * self.q[1] - self.q[2] * self.q[2] - self.q[3] * self.q[3]))
The value of heading is good but after while it start integrating some mistake. And value continuously change after 5 minutes almost up to 180°, without rotating mpu6050.
I guess that it is some static mistake from gyro, is there any way how to calibrate it?
Really thank for help