SLYA092 June   2025 TMAG3001

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Z-Axis Pressing Offset Issue in 3D Linear Hall Sensor
    1. 2.1 Root Cause of X, Y Offsets in Z-axis Pressing Action
  6. 3The Z-Axis Pressing Detection Method
    1. 3.1 General Introduction of Proposed Method
    2. 3.2 Software Slew Rate Detection
    3. 3.3 Hardware Threshold Detection and Interrupt
    4. 3.4 Latching Method
      1. 3.4.1 Implementation of Two-Level Detection Method
    5. 3.5 Test Result
  7. 4Summary
  8. 5References

Test Result

To test the performance of proposed method, a test environment has been implemented by using customer’s end products and the customized joystick as the basic platform. TMAG3001EVM is directly connected to the joystick and the TI-SCB board. TI-SCB board was connected to XDS110 to communicate with host computer. The software environment uses TI CCS. To protect customer information, the picture of customer information is not shown here.

Regarding the code, this application note first used the TMAG3001 Example Code, then adds modified and relevant code into the code to achieve the proposed method.

The aim of proposed algorithm is to decrease the X and Y offsets when users press the joystick. To verify the performance of algorithm, the aim is to compare the offset value after press action with and without algorithm

  1. Tilt joystick without press, record the maximum and minimum value of X and Y axis
  2. Tilt joystick with press, record the maximum and minimum values of X and Y axis.
  3. Add proposed two-level detection method into the code
  4. Tilt joystick with press, record the maximum and minimum values of X and Y axis.
  5. Read the buffer data in the latch array

Step 1 and 2 is used to prove the mechanical error. Through comparison between step 2 and 5, the performance of proposed method can be verified.

Figure 3-5 and Figure 3-6 shows the results of step 1 and 2, respectively. As shown in these figures the minimum value decreased from -0.4mT to -4.5mT after pressing the thumbstick. This indicates there are significant mechanical errors between the joystick and TMAG3001. Furthermore, this means that the device rolls along the X-axis.

 Y and X Axis Performance Without PressingFigure 3-5 Y and X Axis Performance Without Pressing

From the perspective of offset caused by the pressing action, -4.5mT can be considered the largest offset without any operation.

 Y and X Axis Performance With PressingFigure 3-6 Y and X Axis Performance With Pressing

In step 3,4 and 5, because the refresh speed in dual-time function in CCS is relatively slow, The conversion number is read in the buffer array as shown in Figure 3-7. The value in the figure refer to the last Y axis conversion value before the trigger.

 Offset Results in Y AxisFigure 3-7 Offset Results in Y Axis

Using the detection range without press as the reference value to calculate the average error with and without algorithm, the results are shown in the following calculation. Since Y-axis is affected by the mechanical error most and has the most offset, this is used as the reference value during the calculation, the average error of Y-axis without algorithm is 4.5/1.7mT, which is 265%. After implementing the algorithm, the average error in the array is -0.158mT, therefore the average error is 0.158/1.7mT, which is 8.8%.

Through this two-level detection method, the average error is decreased from 265% to 8.8%, which provided an effective and easy-implement algorithm to better utilize TI 3D linear hall sensor.