SBAA512B July 2021 – May 2024 TMAG5170 , TMAG5170-Q1 , TMAG5170D-Q1 , TMAG5173-Q1 , TMAG5273
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.
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.
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.
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
Similarly, this can be done using a block magnet using Equation 2
Where:
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 the magnet 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.
The total magnitude of magnetic flux density is shown in Equation 3
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.
As an example, data is captured as the magnet is rotated about the sensor and produce a plot of magnet location about the sensor such as TMAG5170 or TMAG5173-Q1. 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.
This attachment is designed to connect to the TMAG5170EVM. 3D design files are available at Orbital Design Files.
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 the magnet.
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 electromechanical 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 3D Hall-effect sensor such as TMAG5170 or TMAG5173-Q1 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 as a mechanical pivot. See Thumb Toggle Joystick Exploded View for an example.
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.
Additionally, the angle can be calculated using the arc-tangent function using both the x and y components as inputs.
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.
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.
Device | Characteristics | Design 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. |
DRV5032 | Unipolar 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-Q1 | Automotive grade linear 3D Hall-effect position sensor with SPI 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-Q1 | Automotive grade dual die linear 3D Hall-effect position sensor with SPI 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. |
TMAG5273 | Linear 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. |
TMAG5173-Q1 | Automotive grade Linear 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. |
Name | Description |
---|---|
Linear Hall-Effect Sensor Array Design | A guide to designing sensor arrays for tracking motion across long paths. |
Intro to Linear Hall-Effect Sensors: Contactless Accurate Position Sensing | A 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 Sensors | A guide to monitoring absolute angle position using a 3D Hall-effect sensor. |
TMAG5170 EVM | GUI and attachments incorporate angle measurement using a precise three dimensional linear Hall-effect sensor. |
TMAG5170DEVM | GUI and attachments incorporate angle measurement using both precise three dimensional linear Hall-effect sensors. |
TMAG5273EVM | GUI and attachments incorporate angle measurement using a three dimensional linear Hall-effect sensor. |
TMAG5173EVM | GUI and attachments incorporate angle measurement using a three dimensional linear Hall-effect sensor. |
TI Precision Labs - Magnetic Sensors | A helpful video series describing the Hall-effect sensor and how the sensor is used in various applications. |