by Joe Kimbrell, Product manager, Drives, Motors and Motion, AutomationDirect
How to select, apply and integrate the right encoder for your industrial automation application.
Encoders are used to determine the position, velocity and direction of motor shaft speed and other mechanical motion. They provide information required for the precise control of a variety of applications, such as positioning a rotary table, pick and place, machine assembly, packaging, robotics and more. Regardless of type, all encoders provide a type of orientation that’s used as a reference point for position control.
An encoder (for industrial controls) is a special sensor that captures position information and relays that data to other devices. The position information can be determined using one of three technologies: optical, magnetic or capacitive.
Optical encoders are the most accurate of the standard styles of encoders, and the most commonly used in industrial automation applications (Figure 1). When specifying an optical encoder, it’s important that the encoder has extra protection built in to prevent contamination from dust, vibration and other conditions common to industrial environments.
Magnetic encoders are more rugged than optical encoders, but have less resolution and accuracy. They are often used in environments with excessive dirt, steam, vibrations and other environmental factors that could interfere with optical encoder performance.
Capacitive encoders are relative newcomers to industrial automation. These encoders are as rugged as magnetic encoders, but also do not achieve the high resolution and accuracy of optical encoders.
Regardless of the sensing technology employed, the encoder’s electronics sense movement and translate that motion into industry-standard electrical signals.
Light duty, medium duty, and heavy duty are terms to differentiate encoders by indicating how much load can be applied to the shaft. A light duty encoder can handle some radial force on the shaft (for example, 10 N or 2.25 lbf); while a heavy duty encoder can accommodate much more radial force on the shaft (for example, 100 N or 22.5 lbf).
Environmental ratings also become more robust as the duty increases. Light-duty encoders are typically IP40 and IP50 (dust proof); whereas medium-duty and heavy-duty encoders are more rugged, and often rated up to IP65 (splash proof).
Rotary versus linear
Two basic geometries exist for encoders—linear and rotary. As implied by the names, linear encoders measure motion along a path, and rotary encoders identify rotational motion. Thus the application determines which encoder is best suited for the job.
A linear encoder typically consists of a scale (a coded strip) and a sensing head that reads the spacing between the scales’ coding to determine position. A linear encoder’s resolution is measured in pulses per distance (pulses per inch, pulses per millimeter, and so on). The scale (coded strip) has a set resolution with marks embedded into it or on it, which is read by the head. A linear encoder with a 100 ppi (points per inch) resolution would read 100 marks for every one-inch of movement.
Unlike linear encoder resolution measurement, rotary encoder resolution is measured in pulses per revolution (ppr). A rotary encoder is commonly comprised of an internal coded disc and a sensing head used to determine rotary position. A linear encoder is very similar to a tape measure, while a rotary encoder is more like a measuring wheel. A rotary encoder with a 100 ppr (points per revolution) resolution would have 100 marks on its coded disc.
Incremental versus absolute
Encoders come in incremental and absolute styles. Like linear and rotary encoders, incremental and absolute encoders have similarities, but differ in wiring and movement identification.
An incremental encoder only reads pulses to provide information about the relative motion of the shaft. It has no information about location when powered up because it can only show how far it has moved since being powered up. It reports back these position changes with electrical pulses. These pulse streams can either be single channel (one output wire from the encoder) or dual channel (two wires).
An incremental encoder is akin to a tape measure with no numbers on it, only tick marks. Such a device would indicate how far something has moved, but not initial position.
By contrast, a single-turn, rotary, absolute encoder can report back exactly what angle it’s at even when first powered up. These encoders are typically used for applications in industrial control and robotics that cannot quickly or easily perform a homing sequence. An absolute encoder is like a compass in that its exact position is shown as soon as it’s viewed.
A standard absolute encoder has a resolution similar to incremental encoders (ppr, ppi, and so on), but instead of an output of high-speed pulse streams, the output is specified in a binary format. The maximum encoder resolution = 2n where n = number of output wires of the encoder).
So, a 4 ppr absolute encoder has 2 outputs, an 8 ppr absolute encoder has 3 outputs, a 16 ppr absolute encoder has 4 outputs, and so on. If power is lost, the actual value of the position will be known when power is restored because each location in an absolute encoder’s revolution is a unique binary value.
There’s one drawback to single-turn absolute encoders: the exact angle of the encoder when powered up is evident, but the number of turns made before powering up isn’t. Multi-turn absolute encoders are used to solve this problem.
Multi-turn absolute encoders usually have a battery or super-capacitor that monitors how many revolutions the encoder has turned even while power is off. A multi-turn absolute encoder is similar to a measuring wheel that increments once per revolution. These encoders typically have serial communication and require special receivers to decode their position information.
In general, incremental encoders must be wired into high-speed inputs, although there are ppr encoders that don’t produce a high-speed pulse train. Single-turn absolute encoders, however, are designed to be wired to general-purpose industrial automation I/O.
Gray Code
There is one more consideration when selecting single-turn absolute encoders, and that is that many don’t count in standard binary code. Here is the way binary normally counts up:
Decimal Number |
Binary Code |
12 |
01100 |
13 |
01101 |
14 |
01110 |
15 |
01111 |
16 |
10000 |
17 |
10001 |
18 |
10010 |
Notice that in the transition from Decimal 15 to 16, all 5 digits change state at once. If the PLC is reading inputs at the exact instant when this transition occurs, a bad value could temporarily be decoded by the PLC for at least for one scan, since each output may not change state at the same exact instant.
If outputs on a machine are turned on and off based on encoder position, a big problem can occur. This may not happen very often, but considering the PLC updates its input image table with each scan (hundreds, if not thousands of times per second), any glitch in reading position can be problematic.
To combat this problem of reading multiple transitions at once, Gray Code was developed. Gray Code is a special kind of binary that only increments one bit at a time. Because only one bit changes each transition, a PLC is much less likely to decode erroneous position data.
Decimal Number |
Binary Code Gray Code |
0 |
0000 0000 |
1 |
0001 0001 |
2 |
0010 0011 |
3 |
0011 0010 |
4 |
0100 0110 |
5 |
0101 0111 |
6 |
0110 0101 |
7 |
0111 0100 |
The only drawback to Gray Code is that it’s not very intuitive to determine its value as the bits change state. However, the logic to decode gray code is very straightforward and can be accomplished with minimal ladder or other PLC programming methods.
Electrical outputs for incremental encoders
Different incremental encoders offer different kinds of electrical outputs: Line Driver, NPN Open Collector, or Push-Pull (Totem Pole), with users selecting the output type best suited to their application.
A Line Driver output is a differential signal and requires two unique output wires per channel (Figure 2). Typical wire designations are A, A- (A “not”), B, B- (B “not”), etc. When channel A is ON, there’s a positive voltage between A and A-. When channel A is OFF, there’s a negative voltage differential between A and A-. The magnitude of the voltage differential will be greater than 2.5 V. The same happens for the B and Z channels. Line Driver outputs provide a high quality signal and are fairly immune to electrical noise.
Line Driver encoders are very straightforward to wire to Line Driver-equipped PLC or motion controller inputs. Each output (A, B, Z) requires two wires, plus two wires for power supply (usually 5 Vdc).
A second output type is an Open Collector, or an NPN transistor (Figure 3). NPN Open Collector encoders “sink” current from sourcing (PNP) PLC or motion controller inputs. Sinking and sourcing inputs simply refer to the current flow in a transistor. A NPN encoder requires a PNP PLC or motion controller input, as the encoder sinks current that is sourced by the PLC or motion controller. NPN encoders require one power lead, one wire per channel (A, B, Z), and one 0 V (dc common) wire for all the current return.
An Open Collector encoder has A, B, Z, and 0 V wires (and a wire for +dc to power the electronics). NPN Open Collector (sinking) encoders require the master PLC or motion controller to have PNP (sourcing) inputs. Open collector encoders usually accept a wide range of voltage.
The third type of encoder output is a Push-Pull circuit, also known as a Totem Pole output (Figure 4). The Push-Pull output is a special circuit that can sink or source current to the PLC. The key to this encoder’s circuit is the pair of transistors in the encoder. When one transistor is ON, the other is OFF.
If the PLC or motion controller supplies current through sourcing or PNP inputs, the Push-Pull encoder can sink current through the lower transistor. If the PLC or motion controller sinks current through sinking or NPN inputs, the encoder will source current through the upper transistor.
What is quadrature output?
In a rotary encoder, quadrature output uses two different channels (A and B) separated by 90 degrees of phase shift to increase resolution. Each of these two outputs can either be ON or OFF, resulting in four different “states” for each segment of resolution:
Time slice “a”: A = OFF and B = ON
Time slice “b”: A and B both OFF
Time slice “c”: A = ON and B = OFF
Time slice “d”: A and B both ON
Therefore, a quadrature encoder with a resolution of 100 ppr (100 “slots” of an A channel or B channel) would actually produce 400 different states for each revolution of the encoder. That’s why quadrature encoders are sometimes referred to as ×4 (times 4) encoders.
The pattern of A and B turning ON and OFF also reveals which direction the encoder is turning. Each encoder defines the direction of the quadrature pattern. The encoder diagram in Figure 5 has A = ON, then B = ON when rotated in the clockwise direction. If this encoder were rotated counter clockwise, B would turn ON first, then A would turn ON.
Z-pulse or the Index Channel
Certain incremental encoders have another channel called the Index Channel or Z-pulse (zero position pulse). This output pulses once per revolution of the encoder, and it is used to indicate when the encoder disc crosses the fixed zero position inside the encoder (Figure 6).
The Z-pulse can be used to reset a counter, or it can be used for very precise homing. For example, consider a servo drive that uses an incremental encoder as a feedback device. The servo can home to an external signal (a proximity switch, mechanical limit switch, etc.), then proceed to the next occurrence of the encoder’s Z-pulse for extremely accurate positioning.
Typically, the encoder’s Z-pulse is factory set and cannot be moved. However, several families of encoders offer “servo mounting clamps” that allow the body of the encoder to be rotated, or “clocked,” after installation, so the Z-pulse signal occurs in the desired position relative to a machine function.
Speed limitations
Rotary encoders have both mechanical and electrical speed limitations. The mechanical speed limit is a fixed rpm value, which is the maximum speed that encoder can withstand without incurring possible damage. The electrical speed limit is imposed by the maximum switching speed (frequency response) of the electronics inside the encoder.
The electrical speed limit is determined by the formula Maximum Electrical Speed = (maximum frequency response/pulses per revolution) × 60 s/min. The maximum frequency response is a fixed number (in Hertz) for each encoder family, and it indicates how fast the electronics can physically switch from OFF to ON.
Since the Maximum Electrical Speed is dependent on ppr, each encoder resolution within a given encoder family has a different Maximum Electrical Speed. For example, a 3 ppr encoder spinning at 5,000 rpm produces pulses at 250 Hz, while a 1,000 ppr encoder spinning at 5,000 rpm produces pulses at a much higher rate of 83 kHz. The 1,000 ppr encoder therefore has a much lower maximum speed than the 3 ppr encoder, as the speed will be limited by the maximum frequency response for the encoder family.
If an application requires high speed or high resolution, both the mechanical and electrical speed limits of the encoder need to be considered. The lower of the two maximum speeds is the fastest an encoder is allowed to go.
For example, a 100 ppr encoder might have a maximum mechanical speed of 3000 rpm and a maximum frequency response (electrical speed) of 100 kHz. Thus, the fastest speed that this encoder could spin is limited by the mechanical limit of 3,000 rpm, as the speed of the electronics is a much faster (100 kHz/100 ppr) × 60 s/min = 60,000 rpm.
While the above information is mostly geared toward incremental encoders, the same calculations hold true for absolute encoders. One extra consideration for absolute encoders is that general purpose dc inputs are not high-speed inputs, so the OFF-to-ON and ON-to-OFF response times of general purpose PLC and motion controller dc input cards may limit an absolute encoder’s speed more than the encoder’s switching frequency.
For more information on encoders, visit the following manufacturers:
AutomationDirect
www.automationdirect.com
Autonics
www.autonics.com
Baumer
www.baumer.com
BEI Sensors
www.beisensors.com
Dynapar
www.dynapar.com
Encoder Products Co.
www.encoder.com
HEIDENHAIN
www.heidenhain.us
Nidec Avtron Industrial Automation
www.nidec-avtron.com
Renishaw
www.renishaw.com
US Digital
www.usdigital.com
Reprint Info >>
AutomationDirect
www.automationdirect.com
Filed Under: Encoders • linear, Encoders • optical, Encoders (rotary) + resolvers, Motion Control Tips