hideakitai / MPU9250

Arduino library for MPU9250 Nine-Axis (Gyro + Accelerometer + Compass) MEMS MotionTracking™ Device
MIT License
279 stars 92 forks source link

Understanding acc and gyro calibration #79

Closed pezosanta closed 2 years ago

pezosanta commented 2 years ago

Hi @hideakitai !

I would like to understand how acc and gyro calibration works.

Below is the orientation of the accelerometer axes according to the MPU9250 documentation. image

CASE I Placing the imu plane on the table (just like in the illustration below) and calibrate it in that position. normal_z The measured values seems correct:

Acc_x: 0.00048828125
Acc_y: 0.00146484375
Acc_z: 1.00146484375

image

CASE II/a Placing the imu differently, with the y axes pointing down (see the illustration below) and calibrate it in that position. rotated_y After calibration, I get odd measurements values (imu is still in the same position as it was during the calibration).

Acc_x: -0.013671875
Acc_y: -0.4892578125
Acc_z: -1.08642578125

image

CASE II/b After calibrating the imu in CASE II/a position, during measurements, move the imu into CASE I position (so z axes points upwards). Now it seems like the y axes and the z axes are virtually mixed up. Is this behaviour intentional? That would mean that the imu can only be used (with calibration) correctly if it placed like in CASE I. image

Am I doing something wrong? Or the imu can really be calibrated correctly only in horizontal (CASE I) position?

hideakitai commented 2 years ago

Sorry for the late reply. Please calibrate with the horizontal (CASE I) position.