LSM9DS1 offset bias appears to be changing
We are using the LSM9DS1 to track orientation and measure the surrounding magnetic field. However, in our application the field being measured also includes the magnetic field from a permanent magnet. When briefly exposing the sensor to the magnet, the offset bias of the sensor is changing. This makes our previously calibrated parameters for the magnetometer unusable.
The screenshot below shows raw magnetometer output from our program. After we introduce a permanent magnet (within the full-scale range) and remove it from its vicinity, the magnetometer bias changes. For this screenshot, the change in magnetic field norm was approximately 1051 LSB, or 0.51 gauss at +/- 16 gauss. This gets much worse with stronger magnetic fields (>16 gauss) but nowhere near the 50 gauss indicated in the datasheet where a degrading offset would be noticeable. Is there any way to prevent this? I also found that this thread had a similar issue, but was never fully resolved. Any help would be greatly appreciated.

