SLYA072 may 2023 TMAG5253
After finalizing the trigger hardware, a method of translating the TMAG5253 device output into the corresponding angle needs to be determined. Assuming the device and mechanical tolerances are sufficiently small, use a look-up table or a regression equation. In both methods, several trigger systems must be characterized to determine what voltage corresponds to the angle. Then an average curve can be generated based upon the sample measurements. As shown in Figure 7-1, the averaged data points serve as the look-up values, and any value in between indicated by the dotted line is interpolated. More data points can be required to accurately predict a nonlinear output.
Since look-up tables can take up more memory than desired, the regression equation approach is a viable option. A regression equation can be as simple as a linear equation or as complex as a quartic equation. Figure 7-2 shows an examples of using linear, quadratic, and cubic regressions to recreate the measured curve. Beside each curve is the corresponding equation.
For the trigger design featured here, which has one plot bend due to non-linear behavior of magnetic field magnitude and another plot bend for the output exceeding the linear range of the output voltage (VOUT > VL), a cubic regression equation seems most appropriate. To get the cubic regression equation, a system of equations like Equation 2 through Equation 5 needs to be solved. Since the angle is the unknown that needs to be solved for in the application, voltage can be substituted for x, while angle can be substituted for y, and n equals the number of data points collected. Table 7-1 shows the values used to calculate the summation values, while Table 7-2 shows the summation values used in Equation 2 through Equation 5. With coefficients provided in Table 7-2, coefficients a through d can be solved in Microsoft® Excel® with Equation 6.
Angle (degrees) | Output (V) | Output2 | Output3 | Output4 | Output5 | Output6 | Output Angle | Output2 Angle | Output3 Angle |
---|---|---|---|---|---|---|---|---|---|
110 | 1.799433 | 3.23796(1) | 5.82649(2) | 10.484387 | 18.86596 | 33.94803 | 197.9376 | 356.1756(3) | 640.9143(4) |
105 | 1.85587 | 3.444241 | 6.392052 | 11.8627 | 22.01577 | 40.85833 | 194.866 | 361.6453 | 671.1655 |
100 | 1.932033 | 3.732753 | 7.211803 | 13.93344 | 26.91988 | 52.0101 | 193.2033 | 373.2753 | 721.1803 |
95 | 2.082433 | 4.33652 | 9.030532 | 18.80548 | 39.16116 | 81.5505 | 197.8312 | 411.9702 | 857.9005 |
90 | 2.248933 | 5.057701 | 11.37443 | 25.58034 | 57.52848 | 129.3777 | 202.404 | 455.1931 | 1023.699 |
85 | 2.705 | 7.317025 | 19.79255 | 53.53885 | 144.8226 | 391.7451 | 229.925 | 621.9471 | 1682.367 |
80 | 3.0829 | 9.504272 | 29.30072 | 90.33119 | 278.482 | 858.5323 | 246.632 | 760.3418 | 2344.058 |
75 | 3.313167 | 10.97707 | 36.36887 | 120.4961 | 399.2238 | 1322.695 | 248.4875 | 823.2805 | 2727.666 |
Row | a | b | c | d | Right-Side Terms |
---|---|---|---|---|---|
1 | Σxi6 = 2910.717061 | Σxi5 = 987.0197 | Σxi4 = 345.0326 | Σxi3 = 125.2975 | 10668.95 |
2 | Σxi5 = 987.0197 | Σxi4 = 345.0326 | Σxi3 = 125.2975 | Σxi2 = 47.60755 | 4163.829 |
3 | Σxi4 = 345.0326 | Σxi3 = 125.2975 | Σxi2 = 47.60755 | Σxi = 19.01977 | 1711.287 |
4 | Σxi3 = 125.2975 | Σxi2 = 47.60755 | Σxi = 19.01977 | Σni = 8 | 740 |
From the values in Table 7-2 and the Excel formula Equation 6, the coefficients for Equation 7 can be calculated. Figure 7-3 provides a comparison between our average measured values and equation generated angle values for voltage outputs between 1.7 V and 3.3 V.