Absolute Encoder Interfaces
In an earlier post to this blog, we introduced Absolute Encoders. We illustrated the differences between absolute and incremental encoders, and showed that an absolute encoder can give a unique report for each different position on the encoder disk. But we didn't talk about what that report looks like.
Looking back to incremental encoders for a moment, each part of their output waveform looks like every other part. (Except for the Index signal—that's unique). From one cycle to the next, we expect a high and a low… and then what looks like the same high and low, repeating… and repeating. What matters is the increment—the change from this cycle, to the next cycle, and so on.
Absolute encoders have a different requirement. The output waveform must change constantly and consistently, never repeating a position report until a full rotation is completed. What's the solution to this requirement for unique reports? There's not just one solution—manufacturers have come up with many.
In this post, we'll discuss the most frequently used output types. We'll start with the simplest, the analog voltage output. Then we'll move on to PWM (Pulse Width Modulation) outputs, and finish with serial communication interfaces.
More Information Must Mean More Pins - Right?
The outputs have to connect somehow to a motion control system. If we compare connections for an incremental encoder with those for an absolute encoder, we start to see the range of possibilities. The next table shows pinouts for several encoder types.
|Pin No.||Incremental - Single Ended||Incremental - Double Ended||Absolute - Analog Voltage||Absolute - PWM||Absolute - Bus Interface|
|2||Index||Ground||Analog Output||PWM Output||Busy +|
|3||Channel A||Index -||Ground||Ground||Busy -|
|5||Channel B||Channel A +||Data L|
|6||Channel A -||Data H|
|9||Channel B -|
|10||Channel B +|
At the simplest, an Analog Voltage or PWM output can be transmitted on a single pin. Surprising, considering how much information can be conveyed over that one pin. Even the more complex bus-based communication interface requires only six pins for power supply, data, and transmission synchronization.
Analog Voltage Output
Let's start with a picture. Here's what a typical analog voltage output waveform looks like. The drawing is for a single-turn magnetic absolute encoder.
For this type of output, 0 volts is the starting position, and represents position 0 at 0°. As the encoder disk turns, the output voltage rises, with each voltage increment representing a new position. The voltage will reach the maximum at 359°. As the disk rotates past 359° and reaches the zero position again, the voltage drops to zero. The output is a scaled ratio of the power supply voltage, from 0 - 5 VDC in this case.
Why choose an encoder with an analog voltage output? It's very simple to use. Many PLCs and motion controllers can accept analog voltage signals as inputs, and making connections is easy. Basic point to point wiring is often all that is needed.
PWM Output (Pulse Width Modulation)
Here's another way for an absolute encoder to tell you where it is. The encoder transmits a "pulse" - the output goes high. The width of that high, or pulse, corresponds to the position the encoder is reporting.
A picture helps. The next drawing shows some PWM output pulses for different positions as an absolute encoder rotates.
For example, a 10-bit encoder has a resolution of 1,024 codes per revolution. These codes are typically numbered 0 - 1023, for a total of 1,024 positions.
For starting position 0, the shortest pulse width is transmitted—1 microsecond is typical. As the disk rotates, longer and longer pulse widths are transmitted. Half way around, near 180°, the pulse width would be 512 microseconds. The longest pulses are transmitted when the disk has almost completed a full revolution.
It's that simple: short pulses at the starting position, longer pulses as the disk rotates, and the longest just before the disk reaches the starting position again. Count the microseconds; they correspond to the reported position.
Another way some controllers use the same information is to measure both timeon and timeoff (see the drawing above) and calculate the shaft angle from the duty cycle.
An absolute encoder that is equipped with a serial communication interface can be networked on a bus. PLCs or other motion controllers can then send commands to the encoder. The encoder executes those commands by sending position information back to the PLC.
Here is a typical pinout for a 12-bit optical absolute encoder.
The Data lines are bidirectional, and carry commands from the host computer or controller, and responses from the encoder. The Busy lines are used to control the flow when multiple devices are networked together. When an encoder receives a command, it drives the Busy+ and Busy- lines to acknowledge the command. The lines stay asserted until the encoder completes the command. While the encoder drives the busy lines, all other devices on the bus ignore the data flow.
A typical application might work like this. An encoder continuously reads and stores positions in its internal data register. When the encoder receives a command to report position, it asserts the busy lines, and then transmits the latest stored position to the controller, in the bits and bytes of digital words. When the transmission is complete, the encoder releases the busy lines, and goes back to reading and storing positions—until the next command is received from the controller.
Absolute encoders deliver many benefits when they're equipped with communication interfaces. They can be joined to a network via existing cabling, and avoid the expense and complexity of point to point wiring systems. Many encoders and other devices can be connected to a network, which increases system functionality and allows them to be programmed in the field.
If an encoder is not field programmable, then all variables must be set by the manufacturer when the encoder is ordered. With programmability, though, those variables can be changed in the field. For example, a 12-bit absolute encoder might arrive with its resolution set to 4,096 codes per position. If you need the encoder's resolution to be 3,600 codes per position (one code per tenth of a degree), you can program that resolution.
In another example, you can program the present position to be the new zero position. This is handy during system setup; you don't need to find the zero position on the encoder, and then coordinate that with the machine's position. Instead, position the machine where it needs to be, and program that as the zero position.
Which Communication Interface is Best to Use?
That's a trick question. There are many types of communication interfaces, used in a huge range of applications. Fieldbus development began in the 1980s, and has spawned many variations, such as Profibus, CANopen, DeviceNet, Modbus and so on. EtherNet started in the relatively tame office environment, but "hardened" Industrial Ethernet versions for use in more grueling industrial settings have been developed, such as Ethernet/IP, EtherCAT, ProfiNET and others.