SBAA463A january   2021  – april 2023 TMAG5170 , TMAG5170-Q1 , TMAG5170D-Q1 , TMAG5173-Q1 , TMAG5273

 

  1.   Abstract
  2.   Trademarks
  3. 1Introduction
    1. 1.1 Angle Measurement With One-Dimensional Sensors
    2. 1.2 Challenges of Angular Measurements
  4. 2Benefit of Multi-Axis Sensors
    1. 2.1 Simplified Mechanical Placement
    2. 2.2 Sensitivity Matching
    3. 2.3 CORDIC Angle Estimations
    4. 2.4 Tamper and Stray Field Detection
  5. 3Angular Measurement Considerations
    1. 3.1 Sensor Alignment
    2. 3.2 Sensor Calibration
    3. 3.3 Input Referred Noise
    4. 3.4 Impact of Sample Rate
  6. 4Practical Application
    1. 4.1 Push-Button Knob
      1. 4.1.1 Evaluating Design Constraints
      2. 4.1.2 Magnet Selection
      3. 4.1.3 Prototyping and Verification
    2. 4.2 Off-Axis Design
      1. 4.2.1 Sensitivity Gain Correction
      2. 4.2.2 Accuracy Verification
  7. 5Summary
  8. 6References
  9. 7Revision History

Sensor Calibration

In some systems, the sensor placement may be mechanically constrained such that neither 45° alignment In-Plane or On-Axis is possible. In these cases, sensor output matching will be necessary for optimal performance. Angular position calculations require that the components maintain a fixed magnitude throughout rotation to produce consistent results.

The circular shape of the magnet allows transcendental functions, sine and cosine, to describe angular changes in position. As long as both of these functions are scaled equally, the resulting calculated rotational path will be circular. If the scaling of each component is unequal, the predicted path becomes elliptical. Angle error will be introduced by attributing an elliptical reference to a circular rotation (or movement).

To resolve this, the simplest method is to ensure the inputs to the CORDIC calculation are equal in magnitude. TMAG5170 device allows the user to adjust the CORDIC inputs by implementing a gain attenuation factor to any one channel.

Figure 3-3 illustrates a case where the amplitude of the X component, Ax, is greater than the amplitude of the Y component, Ay. Ax must be reduced to match the scale of Ay.

GUID-E4AEEA14-8213-4635-8F42-217297422D55-low.gif Figure 3-3 Magnitude Correction for Angular Calculations

The calibration process to set the peak values for TMAG5170 is simple:

  1. Set the device to acquire the maximum number of samples per conversion by setting CONV_AVG register to 32x.
  2. Rotate the magnet a full 360° rotation and record the output values for the axes of interest.
  3. Determine the peak value for each axis
    1. Note which axis achieves the greatest magnitude input. Depending on sensor orientation and placement relative to the magnet, it is possible that this could be any of X, Y, or Z.
  4. Calculate the gain adjustment:GUID-5B83ADAC-3B41-4EDF-B1FA-E22C6EB2B4D5-low.gif
    1. The ratio should always have the larger peak value on the denominator, such that G < 1. This axis will be attenuated by the Gain Factor, and is selected using GAIN_SELECTION register.
  5. Multiply the Gain Factor, G, by 1024. Program the nearest integer value into the GAIN_VALUE register.

This feature allows the user to simultaneously correct for sensitivity mismatch and any error resulting from non-ideal alignment. Providing this correction allows the sensor to be placed anywhere near the magnet where two sufficiently large inputs are present.