SBAA539 March 2022 TMAG5170 , TMAG5170-Q1 , TMAG5173-Q1 , TMAG5273
All trademarks are the property of their respective owners.
Achieving the highest precision angle measurements in magnetically sensed applications requires consideration of all possible error sources. These various sources may be the result of mechanical imperfections of the system, or may be related to the signal chain of the sensing device. Taking appropriate design steps in consideration of these factors will help produce the highest accuracy result.
Angle is typically measured using sinusoidal inputs 90 degrees out of phase. This sine/cosine relationship allows the use of the arctangent to calculate the final error. This may be achieved using two one dimensional sensors strategically placed with a 90 degree separation about the rotating magnet, or a two or three dimensional sensor may be placed anywhere the magnetic field is sufficiently strong. The separate components of the magnetic field vector will be naturally 90 degrees out of phase, which makes these sensors more ideal for angle detection.
Of initial important when designing for any angle measurement using magnetic inputs (Hall-effect, AMR, GMR, TMR) is the magnet used as an input source. Depending on the directional sensitivity of the sensor, it will be important to ensure that adequate field inputs are present for the sensor to operate normally.
Consider briefly TMAG5170 or TMAG5273. These devices are linear three dimensional (3D) Hall-effect sensors. TMAG5170 uses an SPI interface, while TMAG5273 communicates using I2C. With sensitivity in all three axes the sensor placement is flexible for either sensor.
There are a few key considerations to note from the positions shown in Figure 2-2. The On-Axis case is the most ideal location for angle sensing using a single magnetic sensor. In this placement, the field is naturally parallel to the surface of the magnet and will reside entirely within the XY plane of the sensor. To achieve this placement, the diametric magnet is centered on the rotating shaft and the sensor is aligned exactly to the magnet's axis of rotation. This relationship will hold true in this position even when using a magnet with a non-circular profile.
While the square faced magnet may be used in this location, it will otherwise not be recommended due to the non-sinusoidal nature of the input magnetic field. The square magnet is useful to help facilitate alignment during assembly of the end product. For any magnet profile, the primary benefit of on-axis alignment is that mechanical errors tend to have a lesser impact on the final angle measurement. This is demonstrated in Section 4.
Another option shown in Figure 2-1 is an In-Plane alignment. This is a very compact alignment option but produces inputs which are significantly mismatched. The resulting amplitude mismatch creates non-linearity of the angle calculation. TMAG5170 and TMAG5273 offer amplitude correction to minimize this effect. This alignment allows a dipole ring magnet to be installed anywhere along the rotating shaft, and this keeps the end of shaft free for use by the rest of the system. In-plane alignment enables angle measurement to be more easily integrated into a BLDC motor with minimal increase to the motor size.
The final placement option is shown as off-axis and represents any other location. Outside of the in-plane and off-axis alignments, there are any number of locations that will produce a measurable field with a component in all three Cartesian directions. The amplitude of each component will vary with location, but will remain sinusoidal and separated in phase from each other by 90 degree intervals. While there are positions which may be found that will produce equally balanced inputs, it should be expected that there will likewise be amplitude mismatch between the two axes used for angle calculation.
Aside from selecting whether or not to use a diametric cylinder for an on-axis measurement or a ring magnet for either off-axis or in-plane measurements, various other magnet properties will influence the magnetic field being observed.
The material grade for any magnet directly influences the B-H relationship of that magnet. It is useful to understand the relationship of the resulting B-field for any magnet as a result of an applied external H-field source.
When the applied H-field used to magnetize a permanent magnet is removed, the residual B-field value is referred to as remanence, or Br. This value is measured in a closed magnetic circuit, and is not equivalent to the surface field of the magnet. Surface field is measured in an open magnetic circuit using a magnetometer, and will vary with the magnet geometry. Br will be constant for any size magnet of the same grade, while the surface field produced by a magnet will depend on the relationship between the surface area and pole length of that magnet.
The various difference grades of any magnetic material will have a different Br values, which determine the resulting magnetic field strength for that magnet. Consider the relationship between B-field and distance of various grades and materials of magnets with equal dimensions shown in Figure 2-5. With the sensor placed along the axis of polarization of the magnet, it is possible to adjust range to find the peak B-field value which will be observed during rotation. For this case and all following plots, a magnet which has a diameter of 6 mm and a thickness of 3 mm will be used.
As mentioned in Material Grade, the size of the magnet will influence the surface magnetic flux density, and resulting measured field for any given magnet. Consider the relationship of B-field vs. Distance for various N52 grade neodymium magnets whose height and radius are equal shown in Figure 2-6.
Notice that the surface field is equivalent for each magnet, and the observed field at any air gap distance is greater for a larger magnet radius. What is also interesting to note, is that the ratio of the field observed at any distance to the radius of the magnet remains constant. That is, the field observed at 2 mm using the 1.5 mm radius magnet is equivalent to the field at 8 mm using the 6 mm magnet radius.
The various magnetic materials available all have differing responses to variations in temperature. For all magnets, the magnetic field strength will reduce by some value up until the Curie temperature, where the atomic dipoles within the magnet can no longer retain magnetic alignment. The typical value for various magnet materials is shown in Table 2-1
Material | Temperature Drift (C) |
---|---|
NdFeB | -0.12%/C |
SmCo | -0.04%/C |
AlNiCo | -0.02%/C |
Ferrite | -0.2%/C |
Ultimately for most applications, the goal will be to use the smallest magnet available that can produce a measurable input for the sensor. For any system, the ability to mount the magnet to a rotating shaft, cost and availability might be the dominant factors in magnet selection. Neodymium magnets (NdFeB) tend to offer the highest magnetic field strength while ferrite magnets tend to be the lowest cost.
Beyond the material properties of the magnet that will influence the strength of the field, mechanical misalignments and tolerances may result with non-linearity in angle calculations.
At a high level, the end error results that will be observed fall into four main categories. These each have a direct impact on the linearity of the measurement and need to be managed appropriately to minimize final angle error. These are:
Amplitude mismatch is the dominant factor which will influence accuracy. When plotting the separate inputs against each other, it is possible to compare against the ideal unit circle.
Notice that at the axis crossings, the error will be zero. At points in between, the error may become quite significant. This is typically managed by applying a normalization factor to either of the two input sources. Either the amplitude of the larger input may be attenuated, or the amplitude of the smaller input may require an increase in gain. This function is integrated into both TMAG5170 and TMAG5273 to assist with system calibration.
Input referred offset results with inputs not centered about zero. This imbalance results with the unit circle not being properly centered.
Phase error between the two inputs used for arctangent calculations results from the inputs being out of phase by more or less than 90 degrees. Combined together, the resulting plot of these inputs appears similar to the amplitude mismatch case, but is not skewed along either axis.
Distortion is the result of the magnetic inputs being sensed not being purely sinusoidal. This may result from various factors such as inconsistent range to the magnet or irregularities in magnet shape. For instance, rotating a non-circular magnet or varying the distance to the sensor may produce inputs with a more complex non-linearity.
The various non-linearities are typical byproducts of system level mechanical errors. These typically are caused by assembly tolerances and produce various combinations of the previously discussed patterns.
These errors may be the results of any of the following conditions:
What will be evident, is that for any configuration, it will be beneficial to limit manufacturing variances in order to achieve consistent performance across all systems.
These errors will be individually simulated using a magnet which has a diameter of 6 mm and a thickness of 3 mm. Sensor position will be 4 mm from the nearest magnet face for either in-plane or on-axis alignment. For off-axis alignment, the sensor will be placed immediately 4 mm below the outer diameter of the magnet. The magnet grade will be N52.
Errors involved with the orthogonality of the magnet installation on the motor shaft produce an alignment that is tilted when at rest.
This tilt follows the motor shaft during rotation causing a wobble behavior. The resulting non-linearity will depend on the severity of the tilt and the sensor location. For comparison Figure 4-2– Figure 4-7 show this impact and the resulting angle error from 2 degrees of magnet tilt for each alignment location. In each case, the displayed angle error resulting from amplitude mismatch or offset have already been corrected, and the residual error is the result of either non ideal phase or input distortion.
If the magnet is not centered about the rotation axis of the shaft, then a different sort of wobble will emerge.
FIGURE of Eccentricity
In this case, the magnet will oscillate within its own plane. The result is an angle dependent magnet location. This error may cause significant angle errors. An offset from center of 0.1 mm produces the following errors. In each case, the displayed angle error resulting from amplitude mismatch or offset have already been corrected, and the residual error is the result of either non ideal phase or input distortion.
Proper system alignment typically requires the sensor to be placed orthogonal to the rotating magnet.
This alignment may be impacted by tilt of the rotating shaft, or by tilt of the actual sensor. During solder reflow, many surface mount devices self-align to the PCB footprint and some variability may exist as the solder cures. Rotation by just a few degrees about each axis produces the following errors. In each case, the displayed angle error resulting from amplitude mismatch or offset have already been corrected, and the residual error is the result of either non ideal phase or input distortion.
Sensor placement offset is the result of the final sensor location not matching the intended design.
This may be the result of assembly challenges from the position the device aligns to during solder reflow to tolerances of system component locations within the larger system. An offset of 0.5 mm in both X and Y directions will produce the following errors. In each case, the displayed angle error resulting from amplitude mismatch or offset have already been corrected, and the residual error is the result of either non ideal phase or input distortion.
In addition to the various mechanical errors, signal chain errors may exist that further complicate angle measurements. These factors may play a direct role in the quality of the measurement how the data is used. For linear Hall-effect sensors such as TMAG5170 and TMAG5273 the following parameters should be understood when designing for angle measurements.
As discussed earlier, amplitude mismatch can result in output angle non-linearity. Even in cases where the sensor is perfectly located with an ideal input, it is possible that the sensitivity gain error for each channel may vary somewhat. Small errors between each channel should be corrected using the same method to correct for input amplitude mismatch. That is, a scalar sensitivity gain adjustment should be applied to normalize the two output channels to the same amplitude.
Input referred offset will present itself as a fixed DC offset to the device output. It will directly create angle error as described in Offset. It is typical to perform an initial sweep with any rotating magnet to correct for this error. Using peak measured values, both sensitivity gain error and input referred offset can be minimized for any system.
Another key parameter that may impact the angle accuracy is the noise. Considering an RMS input referred noise parameter, this will represent a 1 sigma value. When considering any measurement system, the signal to noise ratio (SNR) will impact the best case resolution possible. When plotting SNR vs peak angle error, the final accuracy will generally follow the trend shown in Figure 5-1
Unless the SNR meets or exceeds the value in this plot, the resulting error in angle calculation may create uncertainty which cannot be corrected for through calibration.
To combat limitations of SNR, a few options are available. Firstly, it is possible to use sample averaging to reduce the input noise by a factor of the square root of the number of samples. TMAG5170 and TMAG5273 offer up to 32x averaging which may be used to achieve a dramatic reduction in noise. This comes with the drawback of an increased sample time, which may cause undesirable delay that can limit maximum sample rates.
The other option would be to adjust the magnet strength or sensor proximity. Each of these options will increase the available magnetic field and improve the SNR of the measurement.
Quantization error occurs as a result of converting the analog Hall-voltage to a digital using an ADC. The number of available bits in the ADC will set a minimum measurement resolution available to the microcontroller. For any given sample the typical maximum error will be less than or equal to 1/2 LSB. For demonstration purposes, the angle error using a full scale input into an 8-bit ADC is compared to the angle quantization error of a 12-bit ADC in Figure 5-2 and Figure 5-3.
TMAG5170 has an integrated 12-bit ADC and is able to return averaged results using a 16-bit output word length.
For any magnetic sensing application to determine position of a moving target, it is important to consider propagation delay of the sensor. The feedback to the microcontroller will be received by the microcontroller after some time and motion will continue uninterrupted in that time. Because of this, the measured angle of the rotating magnet will have some fixed phase delay that varies based on the conversion time of the sensor.
When the speed of the motor is known, this information may be used along with the sample rate of the sensor to calculate the change of position of the magnet during the conversion.
TMAG5170 and TAMG5273 allows for a customizable sampling pattern as well as averaging. This creates a variable propagation delay. Complete timing information is located in the data sheet. As an example the expected delay for various averaging modes using the XYX sample pattern are shown in Figure 5-4
A critical step in establishing a quality measurement will be to use a deterministic measurement scheme. This can be accomplished using the trigger modes of TMAG5170 and TMAG5273. Triggering the conversion to start at a known time will allow for the most accurate association of the output result to the actual magnet position.
As was discussed in Temperature Drift the magnetic field of any magnet is subject to vary with temperature. This can create certain challenges for measurement. TMAG5170 and TMAG5273 both offer programmable temperature compensation to allow the sensor to adjust to these changes in the magnetic field strength. Settings of 0.12%/C, 0.2%/c, and 0 are available to help accommodate most magnet configurations.
When considering other magnetic solutions, it is additionally important to evaluate the impact of other error sources such as magnetic hysteresis and cross-axis sensitivity, which do not significantly affect TMAG5170 or TMAG5273. These factors tend to be more common in devices utilizing integrated magnetic concentrators or magneto-resistive sensors such as GMR or TMR.
Magnetic hysteresis is the result of having applied a magnetic field to a ferromagnetic material. Similar to the behavior shown in Figure 2-3, there will be some residual magnetization of the concentrator depending on the prior state of the magnetic field from the permanent magnet. As a result, angle measurements depend on the previous position of the magnet, and there will be differences to the observed input with a clockwise rotation of the magnet vs a counter clockwise rotation.
Cross-axis sensitivity is the result of some portion of one magnetic field channel being coupled into the measurement for another axis. This will produce some underlying non-linearity that is dependent on the state of the other channel. Removing this error from measurement requires a complex calibration routine.
To combat the non-linearities which are unique to any system, it is often necessary to implement calibration to ensure the highest precision results. While efforts to address mechanical or electrical errors prior to performing the arctangent calculation will produce the most linear results, often it is not practical to address each error source individually. Rather, a final profile may be created measuring against a known angle. The error is subtracted from the measured angle to minimize the final position error to be used by the microcontroller. Consider the possible angle error which results from combining the impact of each of the various mechanical error modes. While normally the On-Axis case shows little to no error, when these factors are combined a complex error pattern will emerge. It is worth noting in Figure 6-1 that the cyclical amplitude varies during one full rotation.
Two approaches are common for calibrating angle measurement errors such as this. The first uses a multi-point lookup table to generate a piecewise approximation of the error curve. As the number of data points increases, the resulting plot will quickly approach the actual system error. Consider this comparison of 8, 16, and 32 point calibrations of an example error curve.
This method requires a look-up table which is then used to approximate the error between the nearest data point using an assumption that the error varies linearly between these known values.
The other method attempts to approximate the error for all positions through an equation based solution. Since the error is cyclical in nature, it is possible to make an approximation using the sum of the combination of a sine and cosine value of each harmonic. This similarly will improve in accuracy as the number of data points increases. Using the same error profile from Figure 6-5, it is possible to reach a higher accuracy result after correcting the first 4 harmonics.
For more details regarding angle encoding using TMAG5170, and calibration examples captured in a lab environment, please review Absolute Angle Encoder Reference Design with Hall-Effect Sensors for Precise Motor Position Control.
TI PROVIDES TECHNICAL AND RELIABILITY DATA (INCLUDING DATASHEETS), DESIGN RESOURCES (INCLUDING REFERENCE DESIGNS), APPLICATION OR OTHER DESIGN ADVICE, WEB TOOLS, SAFETY INFORMATION, AND OTHER RESOURCES “AS IS” AND WITH ALL FAULTS, AND DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS. |
These resources are intended for skilled developers designing with TI products. You are solely responsible for (1) selecting the appropriate TI products for your application, (2) designing, validating and testing your application, and (3) ensuring your application meets applicable standards, and any other safety, security, or other requirements. These resources are subject to change without notice. TI grants you permission to use these resources only for development of an application that uses the TI products described in the resource. Other reproduction and display of these resources is prohibited. No license is granted to any other TI intellectual property right or to any third party intellectual property right. TI disclaims responsibility for, and you will fully indemnify TI and its representatives against, any claims, damages, costs, losses, and liabilities arising out of your use of these resources. |
TI’s products are provided subject to TI’s Terms of Sale (www.ti.com/legal/termsofsale.html) or other applicable terms available either on ti.com or provided in conjunction with such TI products. TI’s provision of these resources does not expand or otherwise alter TI’s applicable warranties or warranty disclaimers for TI products. |
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2021, Texas Instruments Incorporated |