Choosing the right encoder

Direct Automation Pty Ltd
By Joe Kimbrell, Product Manager, Drives, Motors and Motion, Automation Direct
Tuesday, 10 June, 2014


Encoders are special sensors that capture position information and relay that data to other devices. They are used to determine the position, velocity and direction of a motor shaft or 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.

Encoders determine position using one of three technologies: optical, magnetic or capacitive.

The most accurate of the standard styles of encoders are the optical encoders. When choosing an optical encoder, it’s important that the encoder has extra protections built in to prevent contamination from dust, vibration and other conditions common to industrial environments.

Although more rugged than optical encoders - and often used in environments in which dirt, steam, vibration and other factors could interfere with optical encoder performance - magnetic encoders cannot achieve the resolution or accuracy of optical encoders.

Capacitive encoders are relative newcomers as an industrial sensing technology. These encoders are as rugged as magnetic encoders but also do not achieve the high resolutions of optical encoders. But regardless of the sensing technology an encoder employs, the encoder’s electronics sense movement and translate that motion into industry-standard electrical signals.

Encoders are also differentiated as light duty, medium duty, and heavy duty - indicating how much load may be applied to the shaft. A light-duty encoder may only handle 10 N radial force on the shaft. In contrast, a heavy-duty encoder may handle 100 N of radial force. 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 can be rated as high as IP65 (splash proof).

Encoder geometry

There are two basic geometries for encoders: linear and rotary. Although rotary and linear encoders work in similar ways, as the names imply, 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 (PPI), pulses per millimetre, etc). 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 100 PPI 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), also known as ‘line count’. A rotary encoder is commonly comprised of an internal coded disc and a sensing head used to read rotary position. A rotary encoder with 100 PPR resolution would read 100 marks on its coded disc for every revolution.

Incremental and absolute

Encoders come in incremental and absolute styles that 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; it can only show how far the shaft has moved since the encoder was 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).

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. A standard absolute encoder has a resolution similar to incremental encoders (PPR, PPI, etc), but instead of an output of high-speed pulse streams, the output is a specified in a binary format. The maximum encoder resolution = 2n where n is the number of output wires of the encoder. So, a 4 PPR absolute encoder has two outputs, an 8 PPR absolute encoder has three outputs, etc. 

Multiturn absolute encoders usually have a battery or super capacitor that monitors how many revolutions the encoder has turned even while power is off. A multiturn 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.

Quadrature output

Quadrature output utilises two different sets of ‘slots’ or channels (A and B) on the optical disc inside the encoder case, separated by 90 degrees of phase shift. These two outputs can either be ON or OFF, resulting in four different states for each segment of resolution. Figure 1 shows the four different states of the quadrature output.

Figure 1: The output timing diagram for a quadrature output shows A = ON, then B = ON when rotation is in a clockwise direction.

Figure 1: The output timing diagram for a quadrature output shows A = ON, then B = ON when rotation is in a clockwise direction.

A quadrature encoder with a resolution of 100 pulses per revolution would actually produce 400 different states for each revolution of the encoder. That’s why quadrature encoders are sometimes referred to as x4 (times 4) encoders.

The pattern of A and B turning ON and OFF also reveals which direction the encoder is turning. The encoder diagram above 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. Encoders may differ in their definition of direction based on quadrature pattern.

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 is used to indicate when the encoder disc crosses the fixed zero position inside the encoder (Figure 2).

Figure 2: This timing diagram is for a 5 PPR encoder. Notice that the Z pulse stays on for one entire cycle of output B.

Figure 2: This timing diagram is for a 5 PPR encoder. Notice that the Z-pulse stays on for one entire cycle of output B.

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.

Gray code

There is one more consideration when selecting single-turn absolute encoders: many don’t count in standard binary code. Table 1 shows an example of the way binary normally counts up. Notice the transition from decimal 7 to 8: all four lower digits change state at once. If the PLC is reading inputs when this transition occurs, a bad value could temporarily be decoded by the PLC (at least for one scan) since each output may not change state at the same instant (there could be nanoseconds of difference).

Gray code was developed to combat this problem of reading multiple transitions simultaneously. It is a special kind of binary that only increments one bit at a time. Since only one bit changes with each transition, a PLC is much less likely to decode erroneous position data.

Decimal 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
8 1000 1100

Table 1: Gray code versus standard binary.

The only drawback to Gray code is that it’s not very intuitive to recognise the value as the bits change state. However, the logic to decode Gray code is very straightforward and can be done with minimal ladder programming.

Electrical outputs for incremental encoders

Incremental encoders offer several types of electrical outputs: line driver, NPN open collector, or push pull (totem pole).

A line driver output is a differential signal and requires two unique output wires per channel (Figure 3). 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.

Figure 3: An incremental encoder line driver output requires two unique output wires per channel, and two corresponding inputs in the automation system I/O.

Figure 3: An incremental encoder line driver output requires two unique output wires per channel, and two corresponding inputs in the automation system I/O.

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 (NPN transistor) output (Figure 4). NPN open collector encoders sink current from sourcing (PNP) PLC inputs. Sinking and sourcing inputs simply refer to the current flow in a transistor.

Figure 4: An NPN (open collector) incremental encoder requires the automation system to have PNP (sourcing) inputs.

Figure 4: An NPN (open collector) incremental encoder requires the automation system to have PNP (sourcing) inputs.

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 5). 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 supplies current (the PLC has sourcing, or PNP inputs), the push-pull encoder can sink current through the lower transistor. If the PLC sinks current (the PLC has sinking or NPN inputs), the encoder will source current through the upper transistor.

Figure 5: An incremental encoder with totem pole output can sink from, or source current to, the automation system.

Figure 5: An incremental encoder with totem-pole output can sink from, or source current to, the automation system.

Speed limitations

There are two speed limitations when it comes to rotary encoders: mechanical and electrical. The mechanical speed limit is a fixed rpm value for each encoder, which is the maximum speed that encoder can withstand without incurring possible damage.

The electrical speed limit for each family of encoders is imposed by the maximum switching speed (frequency response) of the electronics inside the encoder.

The electrical speed limit is determined by the formula:

max electrical speed = (max frequency response/pulses per revolution) x 60 s/min.

The maximum frequency response is a fixed number (in Hertz) for each encoder family. This is how fast the electronics can physically switch from OFF to ON. Since the maximum electrical speed is dependent on PPR, each encoder’s resolution for a given encoder family has a different maximum electrical speed. For example, a 3 PPR encoder spinning at 5000 rpm produces pulses at 250 Hz, while a 1000 PPR encoder spinning at 5000 rpm produces pulses at a much higher rate of 83 kHz. The 1000 PPR encoder has a much lower maximum speed than the 3 PPR encoder.

A mechanical limit on speed is typical for many encoders, but 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 certain encoder might have a maximum mechanical speed of 3000 rpm. The maximum frequency response (electrical speed) could be 100 kHz. Thus, the fastest speed that this encoder could spin based on the speed of the electronics is (100 kHz/100 PPR) x 60 s/min = 60,000 rpm, which is much higher than the mechanical limit of 3000 rpm. This encoder should not be rotated faster than 3000 rpm (the mechanical limit).

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 DC input cards may limit an absolute encoder’s speed more than the encoder’s switching frequency.

Summary

There are many different considerations when determining what type of encoder to use in a particular application. This article has examined some of the basic structures and types of encoders with the goal of differentiating among the various types based on encoder properties. Selecting the right encoder is not a difficult process, but it’s definitely worthwhile to take time up-front to ensure all the different application criteria are considered.

Related Articles

ABB identifies new frontiers for robotics and AI in 2024

Accelerating progress in AI is redefining what is possible with industrial robotics.

The need for speed

The constant improvements by CPU manufacturers are providing new processing techniques that...

IPCs enhance warehouse automation

A Sydney distribution centre has enhanced its operational efficiency with an innovative system...


  • All content Copyright © 2024 Westwick-Farrow Pty Ltd