cancel
Showing results for 
Search instead for 
Did you mean: 

Lis2MDL - Magnetometer

PGorm.1
Associate

When exposing sensor to a piece of metal, the values reported go up. After removing the metal object, the values reported go down, but not to the original set of values for some reason. We want the system to gi back to original values. How do we do this?

2 REPLIES 2
Eleon BORLINI
ST Employee

Hi @PGorm.1​ , let me better understand the physics of the process... has the piece of metal an intrinsic magnetization, higher than the device FS? Or is this piece of metal reducing/inceasing an external magnetic field? And did you check if there was a residual magnetization / offset on the LIS2MDL device before the test? In any case, you are perhaps facing a non-complete offset cancellation after magnetization. A procedure to cancel this offset is available, and you can refer to the application note AN5069 p.18:

Offset cancellation is the result of performing a set and reset pulse in the magnetic sensor and it can be enabled to remove the intrinsic sensor offset.

If the device is operating in Continuous mode, the offset cancellation is enabled by setting the OFF_CANC bit to 1 in CFG_REG_B. In this case, set/reset pulses are continuously performed; a set pulse is applied to one measurement, a reset pulse is applied to the next measurement. If the offset cancellation is disabled (OFF_CANC = 0) and Continuous mode is selected, the set pulse frequency can be configured by setting the Set_FREQ bit in CFG_REG_B. If Set_FREQ is set to 0, the set pulse is released every 63 ODR, otherwise if Set_FREQ is set to 1, the set pulse is released only at power-on from Idle mode (a set of the magnetic sensor is performed anyway, even if the offset cancellation is disabled).

Let me please know if you have been able to solve your issue. Regards

Hi @PGorm.1​ , do you have any feedback on this?

-Eleon