SBOA200B September   2017  – December 2021 DRV5011 , DRV5012 , DRV5013 , DRV5013-Q1 , DRV5015 , DRV5015-Q1 , DRV5053 , DRV5053-Q1 , DRV5055 , DRV5055-Q1 , TMAG5110 , TMAG5110-Q1 , TMAG5111 , TMAG5111-Q1

 

  1.   TI Tech Note

TI Tech Note

Incremental rotary encoders translate rotational movement into electrical signals for more precise control of automated systems. Unlike absolute encoders that measure angle, incremental encoders produce alternating high and low pulses as rotation occurs, which may indicate speed and direction of the rotating object.

Applications include computer mouse wheels, flow meters, knobs, wheel speed sensors, stepper motor feedback for detecting missed steps, and brushed DC motor sensors for automotive windows, sunroofs, seats, and mirrors.

Output signals

When only one direction of rotation needs to be measured, use an encoder with a single toggling output similar to Single Output.

GUID-9D8E56C8-8752-4B00-98CE-0D104FFE2D2E-low.gif Figure 1-1 Single Output

If clockwise versus counterclockwise movement must be distinguished, use two encoder outputs with a phase offset. Then the order of 2-bit states describes the direction turned. From 2-Bit Quadrature Output it can be observed that as each complete pole pair passes by the encoder that there are 4 unique output conditions.

GUID-6425D8B1-E30B-40A1-A1E9-FF34AC77B57F-low.gif Figure 1-2 2-Bit Quadrature Output

Using a 90° phase offset (“quadrature”) maximizes the timing margin between each state, which prevents errors in the presence of mechanical tolerance, sensor mismatch, and signal jitter.

Technologies

A variety of technologies are available to enable incremental encoding:

  1. Contact: This relies on mechanical contacts to make or break electrical connections. Typically, a metal brush is drawn across periodic contact points on an adjacent stationary component about the center shaft. While this is a passive solution, it tends to be mechanically complex, requires debounce timing, is prone to wear, and cannot always perform in dirty environments.
  2. Optical: An optical encoder can be built using a disc with slits cut out to pass light in alternating patterns, along with an LED, and two photodiodes on the opposite side. When properly aligned, this arrangement produces a quadrature sequence. Optical encoders can provide very high resolution, but tend to be bulky in size, require the system to remain clean, and are limited by the LED lifetime (which is reduced at high temperatures).
  3. Inductive: Inductive sensors are capable of detecting nearby conductive targets due to the results of mutual inductance on a known inductive coil. Placing a metal target such as a rotating gear adjacent to a set of sense coils can produce a quadrature output which is immune to stray DC magnetic fields and dirt and grime. Additionally, this sensing option is contactless and may often use existing metal bodies in the mechanical design. See Related Technical Resources for more resources that explore this solution in greater detail.
  4. Magnetic: Magnetic incremental encoders use a circular magnet with multiple north and south magnetic poles. Standard Hall-effect latches are sensitive to only one component of the B-field vector. As a result, these devices require spacing that results in a 90° phase difference of the sensed component of this vector. This is accomplished by placing the two Hall-effect latches separated by any interval of n +1/2 poles to generate quadrature outputs as the magnet turns as demonstrated in Magnetic Incremental Encoder.
Figure 1-3 Magnetic Incremental Encoder
Figure 1-4 In-Plane Magnet Field Vectors

Magnetic encoders can be inexpensive, compact, and extremely reliable for these reasons:

  • There is no contact, and the sensors are solid-state electronics
  • Magnetic fields permeate through most contaminants (water, oil, dirt), and the PCB can be sealed from the environment
  • The input sensing and output signaling is effectively digital, giving high noise immunity
Additionally, using 2D Hall-effect latches, such as TMAG5110 or TMAG5111, simplify the design further. By integrating a second sensing element which is sensitive to an orthogonal component of the magnetic field vector, a single device can be used to measure the quadrature of the rotating magnet. This is possible due to the natural effect of the magnet to produce field components which are 90 degrees out of phase. To demonstrate this, a cross-sectioned view of the field vector lines of an 8 pole ring magnet are shown in In-Plane Magnet Field Vectors.

Increments Per Revolution

Based on the pole count of the magnet selected for the encoder, it produces a different number of output states per revolution, and there are tradeoffs to consider.

Motor systems that use closed-loop speed control require sufficiently fast feedback depending on the allowable speed tolerance, the possible changes in load torque, and the inertia of the motor. Since each pole pair has 4 possible output states, the output data rate can be used to determine what is needed from the encoder. Rotational speed is usually stated in RPM (Revolutions Per Minute) and can be used as shown in Equation 1 to help determine the system requirements.

Equation 1. f o u t p u t = R P M × n p o l e s 60   s e c × 4

In slow-turning applications, the primary concern is usually the number of degrees between each increment. If, for example, an event every 10° is needed, an encoder with 36 output states per revolution would be suitable. Since each magnetic pole pair results with 4 states, the required magnet would have 18 poles, or 9 pairs.

The downside of higher encoder resolution is that it requires tighter mechanical and sensor tolerances. As the pole pitch reduces, the magnetization depth of the ring magnet also decreases. This limits the magnitude of the field observed by the sensor. Latches with a low operating threshold are ideal for this purpose as they are able to detect weaker magnets and help reduce quadrature misalignment. However, if a magnet with too many poles is used, then the Hall-effect latch may not have sufficient input to trigger properly. Placing the sensor closer to the magnet may resolve this issue, but mechanical tolerances could prohibit this adjustment.

An alternative approach is to turn the magnet at a higher speed than the object being tracked using a gear ratio. In this way, the accuracy and resolution can be increased without sacrificing magnetic field strength. For instance, where one transition state occupies 10° of rotation at a 1:1 ratio, a 2:1 gear ratio means the same pole transition could now represent 5°. In either case is important to consider that for the sensors to detect each pole during transit, the sensor sampling rate should be greater than 2 times the number of poles per second, and ideally at least 3 times higher. Additional information is found in the DRV5012 Ultra-Low-Power Digital-Latch Hall-Effect Sensor data sheet Application section.

Using Linear Hall Sensors

Linear Hall sensors, such as DRV5055, may also be used for incremental encoding. Unlike latched devices which toggle about a predefined magnetic threshold, linear Hall sensors produce an analog output voltage proportional to magnetic flux density.

Using two sensing elements 90° out of phase results in sine and cosine outputs which may be used for absolute angle encoding (using a 2-pole magnet). More information on this method is found in the resources in Related Technical Resources.

Table 1-1 Alternate Device Recommendations
Device Characteristics Design Considerations
DRV5011 This device is offered in SOT-23, X2SON, DSBGA, and TO-92 packages with a maximum operating threshold of 3.8 mT A high sensing bandwidth of 30 kHz allows this device to be versatile in most rotary applications. Package variations accommodate most applications. The device operates from a 2.5-V to 5.5-V supply.
DRV5012 Low power consumption with pin-selectable bandwidth in a low-profile X2SON package. The maximum operating threshold is 3.3 mT. Higher sample frequency results with a higher average current. The device operates at 1.65-V to 5.5-V supply. Selectable sample rates are 20 Hz and 2500 Hz. This rate should be at least twice the expected input frequency.
DRV5013 Wide supply range of 2.5 V to 38 mV simplifies inclusion of this device in most designs This device has a typical supply current of 3 mA and a sensing bandwidth of 20 kHz. Automotive and commercial grades are available.
DRV5015 This device has a low 2-mT maximum threshold which helps improve overall quadrature accuracy Operating voltage is limited to 2.5 V–5.5 V with a typical ICC current of 2.3 mA. Typical sensing bandwidth is 30 kHz. Automotive and commercial grades are available.
TMAG5110 2D Hall-effect latch with dual outputs for direct monitoring of latch behavior with a low maximum threshold of 1.4 mT 2D latches offer design flexibility with a minimal component count. With direct outputs, the microcontroller needs to calculate speed and direction.
TMAG5111 2D Hall effect latch with dual outputs converted to speed and direction with a low maximum threshold of 1.4 mT Similar to TMAG5110, but dual outputs are formatted for speed and direction. This is particularly useful for rotary encoding, but does not provide latch behavior which can be useful in correcting alignment for optimal quadrature alignment.
DRV5055 Analog output linear Hall-effect sensor available in SOT-23 and TO-92 packages This device is best suited for absolute angle encoding. Multiple sensitivity options provide flexibility in sensor placement.
Table 1-2 Related Technical Resources
Name Description
Reducing Quadrature Error for Incremental Rotary Encoding Using Two-Dimension A design guide for 2D Hall latches which discusses incremental encoding and how to design for optimal quadrature alignment
3 common design pitfalls when designing with Hall-effect sensors – and how to avoid them A discussion about common magnetic encoder problems and how possible solutions to improve performance.
TMAG5110-5111 EVM A hands-on demonstration of rotary encoding using both TMAG5110 and TMAG5111 using both 10 and 20 pole magnets.
TIDA-01389 Small-Footprint Sunroof Motor Module Reference Design
TIDA-00480 Automotive Hall Sensor Rotary Encoder
TIDA-00828 Inductive Sensing 32-Position Encoder Knob Reference Design using the LDC0851
TIDA-00615 Inductive Sensing 32-Position Encoder Knob Reference Design using the LDC1312 or LDC1314
Absolute Angle Measurements for Rotational Motion Using Hall-Effect Sensors An application brief which discusses angle sensing further and provides links and details to other related content
TI Precision Labs - Using Hall-effect position sensor for rotary encoding A helpful video covering rotary encoding with Hall-effect sensors.
TI Precision Labs - Understanding 2D Hall Sensor Latches A helpful video covering 2D Hall-effect Latches.
TI Precision Labs - Magnetic sensors: System calculation for precise angle measurements A helpful video covering angle measurement with linear Hall-effect sensors.