Encoders are widely used to help control machine position and speed. Typical encoder output, a series of quadrature signals, consists of two full square waves, offset by 90° in phase. The number of quadrature cycles an encoder generates per revolution determines its resolution — the smallest positional change it can measure.

Particularly for position feedback, it's common practice to specify an encoder resolution higher than an application requires. This combats the inherent 60.5-count uncertainty shared by all digital measurement systems. Values of two to ten times the minimum resolution should be considered, depending on the accuracy required and the error budget.

Encoder resolution isn't the only thing that affects overall system resolution, however. A quadrature signal can be decoded in one of three modes, differing in the number of edges used to resolve position changes. The mode is determined by the system receiving encoder signals. In 1X mode, position is decoded from a single edge of the quadrature cycle. In 2X and 4X modes, position is decoded from two and four edges, respectively. An encoder producing 360 signal cycles per revolution, for example, reports 360, 720, or 1,440 positions per revolution, depending on the decoding method.

Q & A

What affects positional accuracy?

In a perfect world, quadrature signals would be evenly spaced. In reality, spacing variations from cycle to cycle contribute to absolute position error. The largest source of position error is typically caused by code pattern eccentricity, relative to the center of the rotation of the code disc. Adding more cycles to the code disc may increase your ability to read this variation, but does not improve it. That's why higher resolution doesn't necessarily mean higher accuracy.

The good news is that repeatability and signal stability over time, inherent to encoders, are typically most important. In addition, cycle-to-cycle variations on a typical encoder disc tend to be small and uniform. Velocity feedback (if not position) is usually insensitive to these anomalies.

What is signal bandwidth?

It is the maximum rate at which an electrical system can change a signal state (from low to high or high to low). It affects both position and speed. Say a 2,000-cycle encoder has a maximum bandwidth of 100,000 Hz. If we take the bandwidth and divide it by the number of cycles per revolution, we get the maximum speed at which the encoder can run electrically — in this case, 100,000/2,000 for 50 rev/sec.

In most cases, you wouldn't want to specify this particular encoder into a system that normally runs at 3,000 rpm. Why not? If the system malfunctions (for example, if its shaft breaks) the encoder can reach speeds exceeding its maximum bandwidth. The resulting quadrature signals may then make it look as though the encoder is moving slowly or has stopped, causing the controller to command an even faster speed. For this reason, it is always a good idea to design additional margin into encoder feedback systems, and failsafe logic into controllers.

The bandwidth of the system receiving encoder signals should also be considered. Just as all encoders have a maximum rate at which they can generate quadrature signals, all control systems (PLCs, motor controllers, counters) have a maximum rate at which they can process them. Many controllers have dedicated quadrature input circuitry with bandwidth higher than most encoders. However, some have bandwidth limitations. In these cases, either encoder resolution or the maximum speed of the system must be adjusted.

What else can botch signals?

A properly grounded encoder is generally not affected by electrical noise, but the cable that connects it to a controller can act like a big antenna, picking up noise from various sources along its path. The longer the cable, the more noise vulnerability exists. Electrical noise on a quadrature signal can cause false counts in position feedback and speed glitches in a velocity feedback system.

Some encoder output types are more susceptible than others. The two main output types are push-pull and open collector. Open-collector circuits actively drive signals low, relying on resistors to passively pull (undriven) signals back to the high state; push-pull circuits, by contrast, actively drive signals in both directions (high and low). Open-collector outputs are more susceptible to noise, particularly when implemented with weak pull-up resistors, allowing noise to be more easily injected into the signal.

Encoder outputs also vary in their physical form. Single-ended outputs employ a single output wire for each signal A, B, and Z. The controller receiving this signal then compares it to a certain threshold voltage to determine whether the signal is high or low. This can cause problems in noisy environments when voltage spikes cause signals to cross this threshold, creating a false transition. One way to help mitigate this problem is to run the signals at higher voltages.

A more effective way to solve noise issues is to invert each signal and send both the signal and its inverse or complement (on separate wires) to the controller. This is what's knows as a differential output. If signal A is high, its complement  (pronounced “A not“) is low and the difference between the two (rather than a voltage threshold) represents the signal state. This signaling method is nearly immune to common-mode noise because (for standard twisted-pair cabling) the noise is identical on both A and  and is effectively cancelled out.

This month's handy tips provided by Alex Stephens, engineer and programmer at BEI Industrial Encoder, Goleta, Calif. Visit beiied.com.