Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Incremental encoder

Description
Whenever mechanical rotary motions have to be monitored, the encoder is
the most important interface between the mechanics and the control unit.
Encoders transform rotary movement into a sequence of electrical pulses.
A number of bright/dark segments on a disc are photoelectrically scanned.
The number of segments determine the resolution of the movement and
hence the accuracy of the position. Because only increments of rotation
are detected with a single channel, an additional signal, phase shifted by
90 degrees, is generated by inserting a grid diaphragm. This 90 degrees
out of phase signal enables, together with the initial signal, the direction
of rotation to be determined. Once per revolution a reference signal may
also be generated

Signal output
Applications
An incremental encoder can be used to get three pieces of information
about a rotating shaft.
 First, by counting the number of pulses received and
multiplying the count by the encoder’s resolution, we can determine
how far the shaft has been rotated in degrees.

 Second, by viewing the phase relationship between the phase


A and phase B outputs, we can determine which direction the shaft
is being rotated.

 Third, by counting the number of pulses received from either


output during a fixed time period, we can calculate the angular
velocity in either radians per second or RPMs.

Notes
When an incremental encoder is switched on, it simply outputs a 1 or 0 on
its phase A and phase B output lines. This does not give any initial
information about the angular position of the encoder shaft. In other
words, the incremental encoder gives relative position information, with
the reference position being the angle of the shaft when the encoder was
energized. The only way an incremental encoder can be used to provide
absolute position information is for the encoder shaft to be homed after it
is powered-up. This requires some other external device (such as a slotted
disk) to provide this home position reference. Some incremental encoders
have a third output signal named home that provides one pulse per
revolution and can be used for homing the encoder.
Absolute Encoder

Description
 The absolute encoder is constructed similar to the incremental
encoder but the disk has a different pattern the encoder is
constructed so that there is one photo-transistor aligned with each
ring on the glass disk. As the shaft and disk are rotated, the photo-
transistors output the binary pattern that is etched into the disk and
the output will be as shown For a complete revolution there will be
2^4=16 out pattern divided by 360 degree so, (360 degrees) / 16 =
22.5 degrees.

Ex: if output was 1010 what is the angular position? Suppose 4 bit encoder
Sol) (360 degrees) / 16 = 22.5 degrees
1010= 10 decimal so angular position = 22.5*10=225 degree

When it changes from 7 (binary 0111) to 8 (binary 1000) notice that in this
case the state of all four of its output bits change value. If we were to
capture the output of the encoder while these four outputs are changing
state, it is likely that we will read an erroneous value. The reason for this is
that because of the variations in slew rates of the photo-transistors and any
small alignment errors in the relative positions of the phototransistors, it is
unlikely that all four of the outputs will change at exactly the same instant .
For this reason, all binary output encoders include one additional output line
called data valid (also called data available or strobe)
This is an output that, as the encoder is rotated, goes false for the very
short instant while the outputs are changing state. As soon as the outputs
are settled, the data valid line goes true, indicating that it is safe to read the
data
We can avoid this problem using gray code.

Gray code requires the same number of bits to achieve the same resolution
as a binary encoder equivalent; however, the counting pattern is
established so that, as the angle increases or decreases, no more than one
output bit changes at a given time. Many present-day PLCs include math
functions to convert gray code to binary, decimal, octal, or hexadecimal

Converting Binary to Gray:


1. Write the binary number to be converted and add a leading zero (on the
left Side).

2. Exclusive-OR each pair of bits in the binary number together and write
the
Resulting bits below the original number.
Example:
Convert 10011100102 to gray code.
Solution:
Step 1 - 01001110010 (add a leading zero)
Step 2 - exclusive-OR adjacent bits
0 1 0 0 1 1 1 0 0 1 0 binary
wwwwwwwwww
1 1 0 1 0 0 1 0 1 1 gray

Converting Gray to Binary:


1. Write the gray code number to be converted and add a leading zero (on
the left side).
2. Beginning with the leftmost digit (the added zero), perform a chain
addition of all the bits, writing the "running sum" as you go (discard all
carries).

Example:
Convert 1101001011 gray to binary.
Solution:
Step 1 - 01101001011G (add a leading zero)
Step 2 - 0
+1=1
+1=0
+0=0
+1=1
+0=1
+0=1
+1=0
+0=0
+1=1
+1=0
The equivalent binary number is 10011100102
 It may seem that gray code would have the same inherent problem
with read errors as binary code if data is read while the encoder
output is transitioning. However, remember that in gray code, any
two adjacent values differ by only one bit change. This means that
even if a PLC were to read the data while it is changing, the only
possible error will be in the single transitioning bit. Therefore, the
only possibility is that the PLC will read the number as one of the two
adjacent numbers, hardly a gross error. Therefore, it is unnecessary
to strobe the output of a gray code absolute encoder.

Example Problem:
A 10-bit gray code optical encoder is outputting the number 0011100101.
What is the indicated angle?

Solution:
First, find the resolution of a 10-bit encoder, which is 360 degrees / 210 =
0.35156 Degree. Then convert 0011100101G to binary using the method
described Previously. This will result in the binary number 0010111001.
Now convert this Number to its decimal equivalent, which is 185, and
multiply it by the resolution to Get 185 x 0.35156 = 65.04 degrees.

NOTE
4 bit absolute encoder is rarely used at least 8 bit encoder is used

Signal output

You might also like