Hi,
Thanks for your inquiry.
Regarding BMM150 magnetometer calibration, you can refer to the hands-on video from Digikey talking about how to calibrate magnetometer hard-iron and soft-iron at https://www.youtube.com/watch?v=cGI8mrIanpk. It can be both offline calibration and automatic calibration. If your device is only rotating on a leveled surface, then BMM150 magnetometer itself can be calibrated and used to measure the magnetic heading with respect to earth magnetic north pole.
However, if your device can be tilted up and down, or left and right, then you need ACC to compensate the heading. You can find a lot of articles about how to use ACC to work with magnetometer to behave eCompass. The heading accuracy is good only when your device is stationary.
If your device needs to output accurate dynamic heading for 3D fast rotation motion, then you also need gyro to help. This is so called 9-axis sensor fusion. At this time magnetometer can help gyro z axis not to drift away and gyro can help magnetometer be immune to external magnetic interference. There are also a lot of articles for it.
Thanks.
... View more