SSZTCT0 april 2023 DRV5013-Q1 , DRV5033-Q1
Systems that have moving mechanical components often have a need to measure something rotating.
In a car, the speed of the wheels is used for the speedometer, traction control, anti-lock brakes, and cruise control. The engine’s RPM is monitored to control the transmission and stay under the redline. Power windows are often controlled by a small motor with closed-loop rotational sensing. And let’s not forget, when your favorite song comes on, the radio system needs to sense the volume knob as you turn it.
Outside of cars, rotational sensing has many other applications, being used on motor shafts, fans, gears, turbines, and computer mouse wheels. This picture shows an example of using it to measure fluid flow rate:
The name for this type of sensor is rotary encoder. There are two main categories: absolute encoders (which resolve the exact position, in degrees) and incremental encoders (which detect relative change). An easy example of an absolute encoder is a potentiometer.
Within the realm of incremental encoders, the two main types are “speed-only” and “speed and direction”. With the first type, the sensor simply pulses when any rotation occurs, and clockwise versus counter-clockwise are treated the same. The second type adds direction information, and it’s accomplished by adding a second sensor; then the controller in the system considers the order of transitions between the two sensors to know which direction is being turned.
3 of the most common technologies for incremental encoders are mechanical, optical, and magnetic.
Mechanical: These are contact-based, where metal brushes on the rotating piece selectively make contact with metal regions on the stator. On the PCB, a voltage can be applied to one terminal, and the presence of voltage can be measured on the toggling terminal as rotation occurs. This is the crudest method, and it comes with several disadvantages:
Optical: These typically involve a disk with holes cut out (a mask), an LED on one side, and two photodetectors on the other. Optical encoders can achieve the highest resolution of any encoder type, with thousands of pulses per revolution, but with that comes stringent manufacturing and alignment tolerances. Applications range all the way from computer mouse wheels to high-end semiconductor photolithography equipment. The general weakness is its lack of robustness in harsh industrial environments, since any physical contaminate will block light, and vibration can be a problem. Also, at high temperatures the LED’s lifetime will diminish.
Magnetic: A 3-pin Hall Effect IC matched with a small magnet on the rotating piece is a surprisingly simple and robust way to measure speed. The DRV5033-Q1 is suitable for this. The sensor can be fully enclosed and isolated from the environment, and the magnetic field from the magnet passes a distance, ignoring most types of contaminates in between.
To measure speed and direction magnetically, the standard solution is to use two Hall latch-type sensors and a magnet shaped in a ring with alternating north and south poles. For example, the DRV5013-Q1 and a magnet like this. As this next picture shows, when each sensor is close to a South pole, it outputs Low, and North poles cause a High output. The two sensors produce what’s called a quadrature output, a fancy name for signals 90° out of phase.
For any given 2-bit state, there’s a unique 2-bit state for a clockwise increment, and another unique 2-bit state for a counter-clockwise increment. So the microcontroller firmware is quite simple.
TI has made a reference design for this, TIDA-00480, and you can check out this whiteboard video on Youtube.
The benefits of TI’s Hall encoder solution include:
Thanks for reading! Comments are welcome.
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 © 2023, Texas Instruments Incorporated