SLYA063A august 2022 – may 2023 DRV5032 , TMAG5131-Q1 , TMAG5170 , TMAG5170-Q1 , TMAG5170D-Q1 , TMAG5173-Q1 , TMAG5273
Dials and knobs for user interfaces traditionally use a rotary encoder or potentiometer to determine the change of rotation or absolute angle. These methods have internal metal contacts that can wear out over time and provide a point-of-failure in long-life applications.
Reducing the number of electromechanical contacts in a system reduces the points of failure and results in a more reliable design. Dials that use electromechanical contacts may have a shorter life span compared to those that use other contactless implementations such as Hall-effect sensors and magnets.
There are different ways to implement a dial with a magnetic sensor, but using a sensor with an integrated coordinate rotation digital computer (CORDIC) calculation can provide angular position data through register reporting, reducing the need to process data externally and simplifying the design process while still providing accurate results. Otherwise, sensors that just provide the magnetic field strength must have an MCU perform calculations to determine the angle of the magnet. Hall-effect sensors also offer a variety of different full-scale measurement ranges to enable the use of various magnets.
This white paper briefly introduces magnetic sensors, describes their use in a contactless dial application, and explains the benefits of a contactless method.
A common way to implement a dial in a human machine interface (HMI) system is to use a potentiometer or rotary encoder. Both implementations may have internal contacts that change to provide the rotational output.
Potentiometers have a resistive element and a sliding contact that moves along the element. Depending on the rotation of the potentiometer, its resistance changes, which makes it possible to determine the rotational change. These are relatively cheap devices and generally only require three contacts to implement.
Rotary encoders either measure the absolute angle or the incremental angle change. Electromechanical rotary encoders are built using tracks on a printed circuit board and contact brushes that move as the encoder rotates. Rotary encoders can be implemented with both electromechanical and contactless based sensing, which leads to a variation in cost due to different technologies.
But both potentiometers and electromechanical rotary encoders have a significant problem: wear and tear. As the contacts move over other electrical elements, they can break down over time, leading to a change in performance or eventually a loss of operation altogether. Any loss in functionality can cause products with electromechanical rotary encoders and potentiometers to require repair or replacement. Performing rotational sensing using magnetic, inductive, or optical methods eliminates potential failure modes that can reduce product lifetimes but these implementations may cost more due to the additional components required. Magnetic rotational sensing requires a magnet and a sensor to determine the change in rotation. One option for this is a Hall-effect sensor that measures the strength of the magnetic field.
Hall-effect sensors measure the magnetic field strength of a magnet. There are three different types: switches, latches, and linear sensors.
Switches and latches provide a digital output based on the magnetic field strength. Switches provide an output when the field is above a certain threshold as shown in Figure 2-1; latches switch the output when the sensed magnetic field changes from north to south or from south to north as shown in Figure 2-2. These devices only provide the digital response but are cheaper than linear Hall sensors and come in low-power variants. These devices can provide information similar to a brushed rotary encoder where the incremental increase and direction depending on the implementation is known.
Linear Hall sensors express the strength of the magnetic field as a register output or analog output as shown in Figure 2-3. If sensing more than one axis of the magnetic field is needed, Hall-effect sensors such as the TMAG5170, TMAG5170D-Q1, TMAG5173-Q1, and TMAG5273 from Texas Instruments are sensitive to all three axes of the magnetic field, making it possible to determine the rotation of a magnet with only a single sensor. These devices include a CORDIC algorithm to easily obtain the angle of the magnetic field rather than calculating it based on separate field data. Linear Hall sensors cost more than a switch or latch but provide additional data about the rotation and can even be used to determine the absolute angle of the magnet.
Rotational encoding with a switch uses two sensors out of phase to measure the direction of change in the rotation.
It is possible to obtain rotational information from a single device with a latch when using a ring magnet. But using multiple latches provides even more information about the system and increases the number of positions that a given ring magnet can detect. For example, when using a 16-pole ring magnet, a single latch provides a high and low signal to determine a change in the rotation. But if two latches out of phase are used, as shown in Figure 2-4, now four different combinations of the switching outputs of the two latches are available to determine the rotational change. This configuration also gives a smaller rotational resolution since the number of state changes per rotation has increased.
The placement of the sensors is important to obtain a good quadrature output from the latches. The single-latch implementation cannot provide information about the direction of change, but the multiple-latch implementation can – by using the order of rising- or falling-edge changes.
A 3D linear sensor can determine the angle of a magnet using multiple axes of the magnetic field. Using a single diametrically polarized cylindrical magnet setup above the Hall-effect sensor, as shown in Figure 2-5, the X and Y components of the magnetic field changes in a sinusoidal pattern as the magnet rotates above the Hall-effect sensor. The fact that these two signals are out of phase makes it possible to calculate the exact angle of the magnet.
Some Hall-effect sensors have a built-in algorithm to determine the angle of the magnet so that the microcontroller only has to read a register instead of doing any post-processing on the magnetic field data. With a 3D Hall-effect sensor, the third magnetic field axis can implement stray field immunity or a push function on the dial. Additionally, the magnet does not need to always be directly above the Hall-effect sensor to accomplish rotational sensing. Since the sensor is sensing all three axes of the magnetic field, placing the magnet in plane or offset from the Hall-effect sensor still can still yield accurate rotation information.