Accurate measurement of rotary shaft motion, including position, velocity, and acceleration, is crucial in numerous applications. This is typically achieved by incorporating a rotary encoder into the motor or shaft assembly. While “rotary encoder” is often abbreviated to “encoder,” it should not be confused with other electromechanical or electronic encoding devices used for data format conversion.
While it’s theoretically possible to use a brush-contact system similar to a DC motor commutator to detect shaft position, this approach lacks precision and long-term reliability. As a result, non-contact encoder technologies have become the preferred solution for modern applications, offering superior performance and durability.
Q: How are encoders implemented?
A: Optical and magnetic techniques are the two most common approaches to implementing the rotary encoder. Each approach has characteristics that make it a good fit (or not so good) in some situations. Both are “digital” in the sense that they generate pulses corresponding to the rotary motion rather than an analog signal, which is in some way related to the shaft angle.
Q: What are the functional elements of the optical encoder?
A: The optical encoder has an LED light source, a light detector, a “code” disc/wheel mounted on the shaft, and an output signal processor (Figure 1). The disc has alternating opaque and transparent segments and is placed between the LED and detector, intermittently interrupting the LED’s beam as it rotates. The detector responds to the series of light pulses it receives and sends that information to the processor, which extracts the motion information (both amount of rotation and direction).
Q: How is shaft direction determined?
A: The encoder uses the “quadrature” principle where the single light beam is split into two parallel beams called A and B. The beams are aligned, so their outputs differ by 90° as they pass through the encoding disk and are detected separately. The relative phase between the A and B outputs indicates which direction the encoder, and thus the shaft, is rotating (Figure 2). These two output signals determine the direction of rotation by detecting the leading or lagging signal in their phase relationship.
Q: What are the roles of the signal processor?
A: The two roles of the signal processor are to amplify and “square up” the quadrature outputs from the A and B photodetectors to produce digital output pules and to indicate their relative phase by controlling a direction output signal. The system can use these two signals – one for the rotation pulses on the code wheel and one for the direction determined by the quadrature phase — to determine both rotation speed and direction.
Q: What are the two most commonly used basic encoder classes?
A: Encoders come in two broad classes: incremental (relative) and absolute. In the incremental encoder, the output indicates only changes from one position to another; in the absolute encoder, the output indicates the actual shaft angle with respect to a “zero-degree” point. Some applications need absolute indication, but there are many where incremental indication is all that is required.
Q: What about the power-up situation?
A: An absolute encoder can indicate the shaft angle once power is applied. An incremental encoder can only report it after the “zeroing” operation is applied after power-up. You have likely seen and heard this sequence in action when powering up a device such as an inkjet printer: on power-up, the carriage slides all the way to one end to establish a zero reading and then uses incremental readings from that point forward.
Q: What resolution is achievable via the code wheel?
A: The code wheel determines the resolution of the encoder. In theory, the light/dark slots can be made thinner and spaced more tightly to increase the resolution, but light feeds through adjacent slots (crosstalk) and causes sensing errors. In practice, resolutions of 12 bits – one part on 4096 – are practical. Some very high-end, larger-diameter optical encoders can reach five times that resolution.
Q: Why are some other code wheel issues?
A: Glass can be used for the “cleanest” lines and highest stability, but it is fragile and costly (Figure 3). Some encoders use much lower-cost Mylar instead, but this material may not be able to hold the lines as well. Others use chemically etched metal, which is between Mylar and glass in cost but more rugged. Each code-wheel material has performance and cost tradeoffs.
The code wheel’s mechanical parameters are critical to encoder performance., Not only must it be dimensionally stable, but its inner diameter opening (which accepts the rotor shaft) and outer diameter (where the lines are sensed) must also be perfectly aligned and concentric. If not, the code wheel will not be balanced and thus will vibrate at higher rotational speeds, leading to early encoder failure. Also, the code wheel must fit without “slop” on that shaft for the same reasons.
Q: What are some other issues with the optical encoder?
A: Optical encoders are generally reliable (if used appropriately) but suffer some potential weaknesses. First, there is the well-known dimming of LEDs over time. Second, they are not sealed so dirt, grit, oil, and other contaminates can get between the layers of the LED/code wheel/photodetector assembly and affect reliability. Third, they are unsuitable for high-temperature operation due to the LED and photodetector. Finally, the code wheel is an issue if it changes dimensions with temperature.
Q: Can an optical encoder be used for absolute position information?
A: Yes, but it is complicated. Instead of a simple series of slots of the code wheel, the wheel has a set of binary patterns, usually using Gray code (a code where adjacent positions differ by only one bit), Figure 4, which avoids ambiguities in bit switching. Multiple sensors are then used to simultaneously read the pattern in a line radiating from the shaft outward.
Another approach is to use a separate track (called the Z track) on the code wheel, which only has one slot for indexing. This is sensed separately and used to generate a single pulse each time the index slot passes a separate photodetector. To use this scheme, the system must combine the knowledge of the index pulse and the incremental pulses. Note that with an absolute encoder, system design can be simplified because there is no need to perform a reference cycle or return to home function to determine the true machine position.
Q: What is the cost of an optical encoder? What power does it need?
A: Prices vary by resolution and ruggedness, but an approximate range is $1 to $5 each, including the fully conditioned quadrature outputs. Most optical encoders need a single DC supply, typically 5 V at about 50 mA.
Part 2 of the FAQ will look at the magnetic encoder, an alternative to the optical encoder.