MinIMU-9v5 Calibration

Hello.

I’ve been testing the MinIMU-9v5 sensor and minimu-9 AHRS library examples with an ESP32, connected via I2C. I’ve followed the instructions, commented/uncommented the SENSOR_SIGN appropiately, and calibrated the gains for the magnetometer with the LIS3MDL Calibrate example code. However, I almost always need to recalibrate those gains before each use(in the same location/enviroment) and the precision is not always the best, so I’m asking here to make sure I’m calibrating the sensor correctly: moving and turning around the sensor in every direction possible, and changing the min/max gains in the code.

If that’s the correct wayto calibrate, is there a way to increase the precision of the AHRS system? I’ve been thinking on reducing the integration time, but not sure if that would affect the sensor readings the way I want.

Also, what would be the expected accuracy when using this sensor as an AHRS? Current output is euler angles and ±1° accuracy approximately.

Current gains, if any use are:

#define M_X_MIN -3002
#define M_Y_MIN -1560
#define M_Z_MIN -2990
#define M_X_MAX +756
#define M_Y_MAX +1556
#define M_Z_MAX +603

Thanks in advance

If you really are getting +/- 1° accuracy, for the full 3D range, that is about the best you can do with a consumer grade sensor. That is, if you are comparing sensor-reported 3D orientations to precisely known 3D orientations.

3D orientation accuracy is limited by calibration errors (systematic errors) as well as sensor noise (random errors), which is stated in the sensor data sheet. To reduce sensor noise, you need to average over many static 3D orientation measurements, which is not usually practical for a robot.

Test calibration of accelerometers and magnetometers by making a 3D plot of the corrected data, which should map to a sphere exactly centered on the origin. A magnetometer calibration example is posted here: Correcting the Balboa magnetometer

Incidentally, I’ve recently posted Python code to replace Magneto for estimating the calibration constants for the 9 parameter method . If you are familiar with Python on a PC, it is much easier to use than Magneto and especially nice for producing publication quality plots. See GitHub - jremington/AltIMU-AHRS: Arduino Madgwick/Mahoney AHRS filters for the Pololu AltIMU9 and 10 series of 9 and 10DOF sensors. Includes code for sensor calibration.