SBAA512A july   2021  – may 2023 TMAG5170 , TMAG5170-Q1 , TMAG5170D-Q1 , TMAG5173-Q1 , TMAG5273

 

  1.   1
  2.   2

Introduction

The ability to monitor the position of a moving object and provide feedback to a microcontroller improves mechanical precision and adds to the overall utility and quality of any mechanism. Depending on the motion that is tracked and the format of the system feedback, a variety of sensing options are available.

When Hall-effect sensors are used for this purpose, position encoding becomes a contact-free solution capable of detecting motion of objects moving freely in almost any environment.

Of particular interest, 3D Hall-effect sensors offer a unique ability to provide information about the complete magnetic field, which enables absolute position detection for any 3D movement. This makes these devices particularly valuable for a wide variety of position sensing applications such as joysticks, linear position modules in automated systems, and gear shifters.

Magnet in Free Space

When considering a 3D Hall-effect sensor, any magnet moving in free space about the sensor can be detected and monitored. If the symmetry of the magnetic field about the pole of a magnet is considered, then it can be quickly deduced that there can be multiple positions that can produce the same input condition. As a result, this function requires careful planning to successfully determine absolute position.

Any dipole magnet can be used for this purpose, and efforts to manually position the magnet around a sensor produces changes along each axis. The challenge, however, is making sure that the change in magnetic flux density can be used to distinguish the motion of the magnet.

GUID-20210617-CA0I-WGNP-BVFT-32MM14C3Q3HW-low.svgFigure 1 Example Magnetic Fields

Inspecting the vector lines closely, two relative positions appear to solve this challenge. Placing the sensor centered on the axis of polarization provides an input to the sensor which is easily identified and unidirectional regardless of distance to the magnet. Similarly, placement coplanar with the pole boundary produces this same effect. At this location, the vector is parallel to the face of the magnet irrespective of the range to the sensor.

GUID-20210617-CA0I-RZRM-033T-WNPRS88S0BHH-low.svgFigure 2 Unidirectional Vector Locations

These two locations are the most aligned to the sensor and as a result, provide the simplest means to demonstrate this concept.

In the case where the sensor is oriented along the axis of the cylindrical magnet, the proximity to the magnet can be determined by examining the magnitude of the input field and calculating distance using Equation 1

Equation 1. Bz=Br2z+Tr2+z+T2-zr2+z2

Similarly, this can be done using a block magnet using Equation 2

Equation 2. Bz= Brπtan-1WL2z4z2+W2+L2-tan-1WL2T+z4T+z2+W2+L2

Where:

  • Br = the remnants of the magnet
  • W= the width of the block magnet
  • L = the length of the block magnet
  • T = the thickness of the magnet
  • z = the distance from the magnet surface along the axis of polarization.
  • r = the radius of the cylindrical magnet

Based on these calculations, the magnetic flux density can be determined anywhere along a line following the polarization of the magnet. This relationship can be used to track the magnet position as it moves away from or towards the sensor. The one requirement is, however, that the pole of the magnet is always oriented towards the sensor. When the magnet is aligned to the z axis of the sensor, this orientation is typical to what can be used with a one dimensional sensor. In many instances, adding a second degree of freedom is required. Rotating the magnet about the sensor at a fixed distance maintains a fixed magnitude of magnetic flux density, but the vector is pointing in another direction. Placing the magnet anywhere along the surface of an imaginary sphere about the sensor with the pole directed radially inward results in a constant magnitude vector when measured using a 3D Hall-effect sensor.

GUID-20210617-CA0I-KX1F-XR4N-FPH9TMJQFR7T-low.svgFigure 3 Constant Radius about Sensor

The total magnitude of magnetic flux density is shown in Equation 3

Equation 3. B= Bx2+By2+Bz2

Calculating backwards using Equations 1 and 3 it is possible to determine the radius,r, from the sensor. We can also use the relative magnitudes of X,Y, and Z components of the B field to determine both φ and θ to complete the position calculation in a spherical geometry as shown in Figure 3. This can also be transformed to a Cartesian reference as required.

As a demonstration of this motion, consider the orbital joystick pictured in TMAG5170 Orbital Attachment. Here the magnet can be mounted to a sliding screw which can be turned to adjust the range to the sensor. The slider guides the magnet up and down the curved arm in the θ direction. Additionally, the arm can rotate about the sensor 360° in the φ direction.

GUID-20210617-CA0I-551L-RHBT-L4P8SVVRSC37-low.svgFigure 4 TMAG5170 Orbital Attachment

As an example, data is captured as the magnet is rotated about the sensor and produce a plot of magnet location about the sensor. Figure 5 is a 3D plot showing the locations of samples captured as the magnet is moved about the sensor based on the input magnetic flux density. Slight variations in radius can occur due to mechanical flex of the plastic and assembly tolerances. Allowing for these variations, position of the magnet can be extracted from the output data to provide position tracking across a wide range of motion.

GUID-20210617-CA0I-R2K8-JNNM-95PMBQ4MLHVG-low.svgFigure 5 Orbital Attachment Example Data

This attachment is designed to connect to the TMAG5170EVM. 3D design files are available at Orbital Design Files.

Joystick

Hall-effect sensors are similarly designed to adapt to a joystick function. A 4-position joystick can be designed using a magnet at the end of a pivoting shaft shown in Figure 6. A simplistic design for this control can be set up using a Hall-effect switch, such as DRV5032, for each position to detect the tilt of magnet.

GUID-20210617-CA0I-QZTH-DWBH-7D1NDSC9HL9N-low.svgFigure 6 Four Direction Joystick

When carefully placed, each sensor only receives enough input magnetic flux density when the magnet is tilted in its direction. This way, each joystick position correlates only to a single sensor. The significant benefit of this over electro-mechanical systems is that the Hall-effect sensor is contact-free and reduces the total number of mechanical fail points.

A drawback of this configuration is that the position information is binary in nature. With each position either on or off, it is impossible to determine the degree of tilt. To maintain the 4 direction joystick, but to add magnitude as well, it is possible to replace each of the DRV5032 switches with a DRV5055 device. DRV5055 is capable of producing a linear output with respect to the magnitude of the magnetic field input. With this change, each sensor produces a variable output which can be used to determine how far the joystick has been rocked in any of the four directions.

To expand this concept further, a single TMAG5170 can determine both tilt and angle. If the magnet switches to a spherical shape, it can be possible to minimize the overall design size by using the magnet itself as a mechanical pivot. See Thumb Toggle Joystick Exploded View for an example.

GUID-20210518-CA0I-JJPW-CMXJ-T38CQ1VWV9XV-low.svgFigure 7 Thumb Toggle Joystick Exploded View

With the pole of the magnet directed down towards the sensor, the field is directed entirely along the z-axis. Then as the magnet tilts any direction, there is a resulting portion of the vector with x and y components. Determine the magnitude of the tilt by calculating magnitude using only the X and Y components.

Equation 4. B=Bx2+By2

Additionally, the angle can be calculated using the arc-tangent function using both the x and y components as inputs.

Equation 5. θ=tan-1ByBx

The further that this magnet is tilted, the greater the resulting magnitude for these axes. The end result is a mechanism which quickly and simply determines tilt magnitude and angle.

GUID-20210617-CA0I-F53B-PSBG-TT3305FJGH5P-low.svgFigure 8 B-Field Magnitude and Angle

This attachment is designed to connect to the TMAG5170 EVM. 3D design files are available at Joystick Design Files.

For more details and guides related to using linear Hall-effect sensors for absolute position measurements with either one dimensional or 3D position sensors, see Table 1 and Table 2.

Table 1 Alternative Device Recommendation
DeviceCharacteristicsDesign Considerations
DRV5055(DRV5055-Q1)Commercial (Automotive) single axis bipolar linear Hall-effect sensor with Analog output available in SOT-23 and TO-92 packages.Analog outputs are subject to electrical noise and calculations require MCU computations. Single axis sensitivity constrains the ability to track movement in free space.
DRV5056(DRV5056-Q1)Commercial (Automotive) single axis unipolar linear Hall-effect sensor with Analog output available in SOT-23 and TO-92 packages.Analog outputs are subject to electrical noise and require MCU computations. Positive value sensitivity on a single axis greatly constrains the ability to track movement in free space.
DRV5057(DRV5057-Q1)Commercial (Automotive) single axis bipolar linear Hall-effect sensor with PWM output available in SOT-23 and TO-92 packages.PWM outputs require conversion, but are less susceptible to coupled noise. Single axis sensitivity constrains the ability to track movement in free space.
DRV5032Unipolar or Bipolar single axis Hall-effect switch available in SOT-23, TO-92, or X2SON packages.Hall-effect switches are useful for discrete position tracking, such as the 4 direction joystick function. This device is a low power Hall-effect sensor is designed for battery powered applications.
TMAG5170-Q1Automotive grade linear 3D Hall-effect position sensor with SPI interface available in 8 pin DGK package.

Complete magnetic vector sensitivity. This device is able to track a wide range of magnet positions, though careful planning is still required to provide all input conditions map to a unique position.

TMAG5170D-Q1Automotive grade dual die linear 3D Hall-effect position sensor with SPI interface available in 16-pin TSSOP package.Is a dual device design capable of sensing all field components and integrates angle calculation and field normalization. Developed for functional safety with resources supporting design up to ASIL D.
TMAG5273Linear 3D Hall-effect position sensor with I2C interface available in 6 pin SOT-23 package.Similar to the TMAG5170, but operates over I2C with wider sensitivity tolerance specifications.
Table 2 Related Technical Resources
NameDescription
Linear Hall Effect Sensor Array DesignA guide to designing sensor arrays for tracking motion across long paths.
Intro to linear Hall effect sensors: Achieve contactless accurate position sensingA discussion on the differences between a linear output and switched output Hall-effect sensors.
What is a Hall-effect sensor?A discussion about the Hall-effect and how the sensor is used to create magnetic sensors.
Angle Measurement With Multi-Axis Hall-effect SensorsA guide to monitoring absolute angle position using a 3D Hall-effect sensor.
TMAG5170 EVMGUI and attachments incorporate angle measurement using a precise three dimensional linear Hall-effect sensor.
TMAG5170DEVMGUI and attachments incorporate angle measurement using both precise three dimensional linear Hall-effect sensors.
TMAG5273EVMGUI and attachments incorporate angle measurement using a three dimensional linear Hall-effect sensor.
TI Precision Labs - Magnetic SensorsA helpful video series describing the Hall-effect sensor and how the sensor is used in various applications.