SBAA632 April   2024 TMAG3001 , TMAG5170 , TMAG5170-Q1 , TMAG5170D-Q1 , TMAG5173-Q1 , TMAG5273

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Implementation and Testing
    1. 2.1 Build Configuration
    2. 2.2 Data Collection
    3. 2.3 Speed Calculation Methods
      1. 2.3.1 Continuous Sampling
      2. 2.3.2 Running Average
      3. 2.3.3 Zero-Crossing
      4. 2.3.4 Periodic Sampling
  6. 3Summary
  7. 4References

Data Collection

For this demonstration, TMAG3001 was used to detect the passage of each tooth. An initial calibration routine is necessary to make full use of the magnetic field to remove the fixed bias produced by the stationary magnet. Figure 2-4 shows the X and Z axis field vector measurements as four teeth of the sprocket rotate near the sensor.

 Sampled Data Figure 2-4 Sampled Data

What is seen is that on each axis, an oscillation occurs about some nominal magnetic flux density observed by the Hall-effect sensor. If the pedal crankset were not present, this field can remain static at the back-bias condition. The fixed offset in the measurement presents an immediate challenge to calculations of angle.

The target input for an arctangent angle calculation has X and Y components that follow a cosine and sine behavior with matching amplitude. Plotted as a Lissajous curve in Figure 2-5, this can be easily observed as a unit circle. Similarly plotting the back-biased results in Figure 2-6, significant offset and amplitude mismatch produce an output which can not generate a full 0-360deg angle calculation.

 Target Output Lissajous
                        PlotFigure 2-5 Target Output Lissajous Plot
 Measured Lissajous
                        PlotFigure 2-6 Measured Lissajous Plot

Following a brief calibration routine to measure peak output values, the offset to subtract from each measurement can be determined using Equation 1.

Equation 1. O f f s e t   =   O u t m a x + O u t m i n 2

And the amplitude mismatch can be normalized next by dividing each output by the total amplitude calculated in Equation 2.

Equation 2. A m p l i t u d e   =   O u t M a x -   O u t M i n

The calibrated result is then found with Equation 3.

Equation 3. C a l i b r a t e d   O u t p u t   =   O u t p u t - O f f s e t A m p l i t u d e

The resulting shift in the measured data is shown in Figure 2-7 and Figure 2-8.

 Normalized Output
                        PlotsFigure 2-7 Normalized Output Plots
 Normalized Lissajous
                        PlotFigure 2-8 Normalized Lissajous Plot

Some skew from tooth to tooth does exist in the output plot, which is related to the chainset sprocket having some tilt relative to the mounting on the bottom bracket axle. This manufacturing defect causes a slight change in proximity to the magnet as the pedals move. For the segment of rotation shown in Figure 2-7 the amplitude was not at the peak value, and so the normalized results do not fully reach ± 0.5mT. Despite this defect, the resulting angle after this brief calibration is shown in Figure 2-9.

 Calculated Angle Figure 2-9 Calculated Angle

The resulting calculated angle over the full rotation of the sprocket is shown in relative to the entire gear wheel is shown in Figure 2-10. While some skew is still present to the output angle, the effect of this non-linearity to the overall angle measurement is reduced considering this only represents a small portion of the total rotation. Since the angle output ranges from 0-360 degrees per tooth, the effective angle non-linearity observed on each tooth is divided by the total number of teeth. In this case the number of teeth is 32. Even if an angle non-linearity of 10 degrees were observed for each tooth, the equivalent error can be limited to 0.31 degrees of the entire sprocket rotation.

 Calculated Sprocket Angular
                    Position Figure 2-10 Calculated Sprocket Angular Position

The speed of rotation was controlled manually in this demonstration, so some fluctuation in speed was present. To approximate the angle error, the expected change in angle from one sample to the next was determined using the rate of change for the span of one gear tooth. Continuous sampling was used to determine the relative angle change from the start position, and a normalized angle error is shown in Figure 2-11.

 Speed Normalized Angle
                    Error Figure 2-11 Speed Normalized Angle Error

With a 32 tooth gear and a 0-360 degree response per tooth, the resulting relative angle error is less than ±1 mechanical degrees.