Najjednostavnija kalibracija IMU je izračunavanje offseta za svaku osu potpuno mirnog senzora. Svaka od tri ose rotacije žiroskopa bi u mirovanju trebalo da očitava vrednost od 0 degrees-per-second (dps, °/s). Offset merimo tako što očitamo vrednosti za svaku osu koje dobijemo u nekom periodu i onda ofsetujemo vrednosti giroskopa za srednju vrednost očitavanja za svaku osu. Ovo je zaista najjednostavnija kalibracija koja je dovoljna za većinu hobi upotreba IMU-a. Postoje kalibracije žiroskopa na mnogo višem nivou.
Kalibracija
Semplujem nesto malo uzoraka dok je senzor potpuno miran i izračunam srednju vrednost za svaku osu. U u konkretnom primeru preskocim 10% od pocetka zbog mogućih nesigurnih vrednosti. Prikaz vrednosti nekalibrisanog ziroskopa.

I na ponovo snimljeni podaci sa ziroskopa ali offsetovani za vrednosti dobijene u prethodnom merenju

Provera kalibracije numeričkom integracijom
Validating the Gyroscope Calibration by Numerical Integration We can further test the calibration of the gyroscope by integrating an array of angular velocity values over time under a known rotation. For example, we can rotate the IMU Calibration Block by 180° and integrate the gyro over time to verify that the gyroscope is functioning properly.
By integrating the gyroscope’s angular velocity, approximations of angular displacement can be made:
angular_velocity_integration.png For discrete points, a numerical integration technique is required, for which we use trapezoidal numerical integration:
The ‘scipy’ package in Python has a great implementation of the trapezoidal numerical integration, which makes it easy to approximate rotation of the IMU by integration of the gyroscope. An example implementation of the gyroscope integration is given below in the plot:
The gyroscope approximates the 180° rotation to be roughly 179.8°, which is quite accurate. It also tells us that the directionality of the IMU is accurate, as in the case above the rotation was carried out in the counter-clockwise direction. Thus, we have a reasonably accurate calibration of the gyroscope on the MPU9250 (MPU6050). Of course, the validation above is for a very steady and idealized rotation. Nonetheless, the gyro can be considered as zeroth-order calibrated. In the next section, the accelerometer will be calibrated similarly, but with a first-order approximation, which is slightly more involved and requires three calibration steps for each axis. The accelerometer will also be validated by numerical integration in a similar manner as the gyroscope.
