This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMAG3001: how to calculate Magnitude threshold

Part Number: TMAG3001

Tool/software:

Hi experts,

We are considering a project using TMAG3001's magnitude threshold interrupt.
The TMAG3001 dataset shows how to calculate the magnetic threshold, but lacks a clear explanation for the threshold (M_THR_LO, M_THR_HI) value of the Magnitude Limit Check.

please let me know how to calculate Magnitude threshold.

thanks

Regards,

  • Hello Robin,

    Thanks for posting to the sensors forum!

    The values for the LSB's for each range option are given above table 6-14. To calculate what threshold you would generate based on the entered hex value you need to take your entered value and divide it by the appropriate LSB value which is dependent on your devices magnetic range.

    Threshold = x/ LSB size

    So in order to calculate the magnitude you would like to set as a threshold you could do the following:

    Example set magnitude threshold = 20 for the 40mT range option

    20* 3.281 LSB/mT = 65.62 here you would need to round either to 65 or 66. 65/3.281 would generate a threshold of 19.811 using 66/3.281 would generate a threshold of 20.115.

    If you were using the 80mT option then you would use an LSB of 1.640 instead of 3.281 which belongs to the 40mT option.

    I hope this helps!

    Best,

    Isaac

  • Hi Isaac,

    thanks for reply.

    i have an additional question.

    In the table 6-14 at datasheet, what determines the Magnitude range?

    I don't know the meaning of "range of device" as mentioned in the datasheet.

    is this mean the Magnetic range selection? depend on Magnetic range selection?

    thanks 

    Regards

  • Robin,

    The magnitude function is the result from the CORDIC function which evaluates both the angle of the magnetic field vector and its magnitude.  The CORDIC uses the output values from the selected axes from the angle calculation (XY, YZ, or XZ).  Since the output values scale based on the user setting for the sensitivity range, this will directly impact the calculation for the vector magnitude.

    The individual axes can be programmed to different sensitivity ranges using the X_Y_Range or Z_Range settings in the Config_2 Register (0x03)

    Note that if your angle is using the Z axis, that you will want to be sure it is set to the same sensitivity range as X&Y to ensure the calculation is handled properly.

    Thanks,

    Scott