How an absolute encoder works – Binary

productThmb_QD787A

Quantum Devices offers an 8 bit absolute encoder. Unlike incremental encoders that output a train of serial pulses, an absolute encoder provides a parallel data output as wide as the number of bits.

A QD-787 8 bit absolute encoder has eight data lines. Each data line has a different binary “weight”  allowing us to define 256 unique positions in rotation.

Below is a map of the binary pulse train coming out of each data line over one full rotation on a single turn absolute encoder.

8-bit-binary

The numbers on the left hand side of the signals indicate the value or weight that particular data line carries. Off to the right we see LSB and MSB, which stand for “Least Significant Bit,” and “Most Significant Bit”.  If the data line is low that bit is counted as a zero.  If the data line is high the bit is counted as a one.

Electrically this means that the wire or pin that corresponds to that bit will be at zero volts when low and at five volts when high.

Lets take a look at the first three bits to see how this works:

Bin-0The Blue line represents the real world position of the encoder. We will move the line to the right over the next few illustrations to represents encoder rotation.

I am starting at the zero position for ease of explanation.  In reality, the position at which any encoder would “wake up” is arbitrary. This is in fact the main benefit of an absolute encoder.  If encoder power is lost, position information is retained, and known instantly on power up.

At the start all of the data lines are low giving us a value of zero for each bit.

You can see by the math that we multiply the value of the data line by it’s weight, or significance.

Bin-1As we rotate the first 1/256th of the way around, our encoder see’s the LSB go high giving us a “one” for the first bit.

Bin-2Rotating another 1/256th of the way causes the first bit to fall low and the second bit to go high.  Notice that as we progress through the significance of bits each bit carries twice the weight of the one before it.

Bin-3Turning yet another 1/256th of the way around we see the first bit again goes high, but the second bit stays high as well.  We add the value of the two data lines together to get a number that is meaningful to us. “3” is more universally understood than a binary “110”.

Bin-4As we rotate, our encoder continues to count.  This time the first two bits turn off and the third bit valued at “four” turns on.

Bin-5We are a little over 7 degrees into our rotation and the encoder is at a count of five.  Each count represents 1.40625 degrees (360 degrees/256 counts) .

Bin-6

Rotating 8.4375 degrees in is a binary 011, or a value of Six.

Bin-7In the  final position of our three bit example, all bits are high giving us a value of seven.  In an eight bit encoder this 0 through 7 bit pattern repeats 45 times for these three bits over one rotation.

Absolute encoders are specified by the number of bits, the direction in which their count increments or decrements and the output bit pattern. Here we have covered Binary, but Absolute encoders can also output gray code.

Gray code is a binary like pattern that only allows one bit to change at a time.  This makes it easier to check for errors in the count.  It is a large enough topic that I will table it for discussion in a future post.

Advertisements

Reduce electrical noise in rotary incremental encoders with termination resistors

Cropped-termination-resisto

Since most electronics are set up to have high input impedance, in some situations the addition of a loading or “termination” resistor can help to reduce interference from electrical noise.

This can be of particular help when implementing an incremental encoder where there is a long cable run.  If the input impedance of the receiving device (often a controller or drive) is high, the current through the cable is very small.  The addition of a termination resistor where the encoder is connected to the controller/drive increases the current flowing through the cable.  This increased signal current is less susceptible to interference of any electrical noise that may be coupled into the cable.

The termination resistor is placed in parallel with the output in a single ended set up; this connection is from the encoder channel to signal ground. In a differential setup this connection is between the channel and it’s complement (A and A-, B and B-, etc.).

Values of termination resistors depend on the current capability ability of the encoder. Our standard incremental encoders can deliver up to 20 mA per channel, which at 5VDC means a maximum total termination load of 100 ohms.

When troubleshooting a noise burdened application we tell our customers to start with a value of around 1K ohm and go from there. Many times 1K is more than enough resistance to solve a noise interference issue.

I would also like to point out that this type of termination loading should be done on each channel as each channel is a separate circuit.

It is also good to keep in mind that low value termination resistors may attenuate the amplitude of the incremental encoder output signals and that too low of a value could damage an incremental encoder.

The 100 Ohm value spoke of above works for Quantum Devices rotary incremental encoders. Other  encoders may not have the ability to deliver current into such heavy loads.

Below is a pictorial example of how to add termination resistors to an incremental encoder that is set up  Single ended  (TTL).

SE-Termination

Below is an example of termination resistors wired into an Incremental Encoder that is set up  differentially (RS-422)

Diff-Termination