10-07-2020 10:45 AM
Hi,
We have used BMM150 in one of our Android 9 device. The BMM150 is already mounted in the PCB.
We want the Hard-iron calibration data for the device so that when the device boot for the first time it have calibrated magnetometer data.
Would you please share the steps to perform Hard-iron calibration for BMM150.
Thanks,
Niranjan
10-07-2020 05:35 PM
Hi,
Thanks for your inquiry.
There are two ways to perform hard-iron calibration for BMM150 in your Android 9 device. One way is put your device in a Helmholtz coil and program the coil to generate rotating magnetic field in 3D space. The other way is rotate the device in your hand in 3D space for a few full rounds like figure-8 motion. After you plot the BMM150 data in 3D space, you can quickly figure out the x/y/z offsets of BMM150 which are the hard-iron of your device.
Thanks.
10-08-2020 03:10 PM
Hi,
I appreciate your help.
I have figure out X, Y, and Z axis orientation with respect to Display with the help of figure-8 motion.
In android 9 for Hard-iron calibration, I need compensation_matrix and bias values so that when the device boots up for the first time I don't need to perform manual calibration.
I need a bias value for X, Y, and Z.
Compensation_matrix for below:
COMPENSATION_MATRIX_0_0
COMPENSATION_MATRIX_0_1
COMPENSATION_MATRIX_0_2
COMPENSATION_MATRIX_1_0
COMPENSATION_MATRIX_1_1
COMPENSATION_MATRIX_1_2
COMPENSATION_MATRIX_2_0
COMPENSATION_MATRIX_2_1
COMPENSATION_MATRIX_2_2
On Query:
In your previous comment, you have mentioned plotting BMM150 data in 3D space. Which BMM150 register value I need to plot in 3D space.
Thanks,
Niranjan
10-08-2020 05:40 PM
Hi,
Thanks for your inquiry.
The bias values for x/y/z are the hard-iron of your Android 9 device. After you remove these bias values, you should be able to move the sphere or ellipsoid of the 3D plot from your figure-8 motion to the origin. BMM150 values on the 3D plot are in the unit of uT. You can use BMM150 API on the Github at https://github.com/BoschSensortec/BMM150-Sensor-API to convert BMM150 raw data in signed integers to uT.
The 3x3 matrix is for soft-iron and mismatch of sensitivity compensation. Please do Google search for Android magnetometer calibration algorithms.
Thanks.