At the heart of the incremental encoder is the quadrature encoder circuit. In this article I will explain what is meant by quadrature, and why it is needed in order for an incremental encoder to be able to track and report changes in position.
The article will start with a description of the major parts that go into the making of an incremental encoder. The operation of the optical encoder module will be introduced. An explanation of the concept of quadrature will be given. Then some practical applications for encoders will be touched upon.
This article will focus in on optical incremental encoders, but be aware that there are other types of incremental encoders available as well such as magnetic and mechanical contacting types.
Building Blocks Within An Optical Incremental Encoder
Optical incremental encoders work on the principle of using a light source to shine light on a light sensor and then inserting a round disk or a linear strip in between the light source and light sensor to interrupt the beam of light.
So the major parts or building blocks of these types of encoders are the light source and light sensor electronics, which are commonly packaged within a single module commonly referred to as an optical encoder module, the round disk or linear strip that passes in between the light source and light sensor of the optical encoder module, and the other mechanical portions of the encoder such as the shaft, bushings or bearings, slide rails, and the housing.
In the next sections of this article, the heart of the encoder, which is the optical encoder module, will be described.
The Optical Encoder Module – Beam Me Up Scotty
As was mentioned earlier, when both the light source and the light sensor electronics are packaged within a single unit, it is referred to as an optical encoder module. There are actually two types of optical encoder modules. There are transmissive types that are designed to pass light through a disk or linear strip, and reflective types that are designed to work with a disk or linear strip that reflects light back at the optical encoder module. For our discussion here, we will be dealing with the transmissive type of optical encoder module.
A simplistic explanation of what goes on inside of such an encoder module will be given first to facilitate gaining a basic understanding of how the module functions. Then the concept of quadrature will be introduced.
The transmissive type of module has a slot in it so that it can straddle a round disk or a linear strip. Inside the module on one side of the slot is the light source that shines a beam of light towards the opposite side of the slot where the light sensors are located.
Now if a clear disk with black lines on it is placed in the slot of the module, the beam of light will be interrupted by the black lines as the disk is rotated. The electrical output from the light sensor will toggle on and off or go high and low as the lines on the disk pass by. For example, if the disk has 360 evenly spaced black lines placed around its perimeter, the output of the light sensor will generate 360 electrical pulses per revolution of the disk. So each pulse would represent 1 degree of angular rotation of the shaft that the disk is mounted on.
This arrangement of having a single light source and a single sensor or light detection channel works great if speed of rotation is all that is needed to be measured. You just count up the number of electrical pulses that are being generated at the output of the module per second, and divided by 360 to get revolutions per second.
But how can disk or shaft position be accurately tracked and determined in situations where the shaft will be turning in both clockwise and counterclockwise directions? Or what if there is back and forth dithering or vibration of the shaft? In other words, what feature must we add to the optical encoder module so that direction of rotation can be determined? The answer will be covered in the next section where the concept of quadrature will be discussed.
Quadrature – Two Are Better Than One
In order to determine the direction that the disk in an optical incremental encoder is turning, it is necessary to add a second light sensing sensor to the optical encoder module. This second sensor must be offset in position physically from the first sensor by just enough spacing to make the electrical pulses coming out of the second sensor out of phase with those coming out of the first sensor by 1/4-cycle or 90 electrical degrees. The following diagram may help you to visualize this:
When there is this 1/4-cycle difference in phase between the pulses or square waves coming out of the first sensor (channel A) versus those coming out of the second sensor (channel B), it is said that the two channels are in a quadrature relationship to each other. That is where the term quadrature comes from.
So direction of rotation can now be determined because the lines on the disk will interrupt the light shining on the A sensor slightly before interrupting light to the B sensor when the rotation is in one direction. This would be like starting at the right side of the diagram above and moving to the left. And light shining on the B sensor will get interrupted before light shining on the A sensor when the disk is rotating in the opposite direction. This would be like starting on the left side of the diagram above and moving to the right.
If you think of the A and B outputs from the module as a 2-bit binary output, here is the 2-bit code sequence that will be generated when the disk is rotating in the direction that makes the A channel output change first:
A/B = 00, 10, 11, 01, 00, and so on, repeating that pattern as the disk rotates.
And when the disk rotates in the opposite direction, the B channel output changes first:
A/B = 00, 01, 11, 10, 00, and so on, repeating that pattern.
Converting Motion Into Electrical Signals – Gray Code
The 2-bit binary code generated from the A and B outputs of an optical encoder is referred to as a 2-bit Gray Code. This Gray Code output from an encoder can be interfaced to computers or digital displays to control or monitor the position of something.
For example, let us say that we wish to measure the direction that the wind is blowing. An optical incremental encoder could be coupled to the shaft of a wind vane, and the output from the encoder could be connected to a digital display that would show the direction in degrees that the wind vane is pointing.
To calibrate the system, the wind vane could be rotated by hand until it is pointing North, and then a reset button could be pressed on the display to set the reading to zero degrees. Now as the wind blows, the shaft of the wind vane will rotate and change position. The disk of the encoder will turn with the shaft, and the position counter within the display will count up or down based on the Gray Code sequence coming from the encoder. The count value is then converted into the actual position of the wind vane in degrees and displayed on the read out of the display.
Another common application for incremental encoders is to use them as a position feedback device on motor shafts so that a computer can control the position of the motor shaft.
Conclusion – Wrapping It All Up
After reading this article, it is hoped that you now have a better understanding of the quadrature encoder circuit and incremental encoders in general.
A description of the optical encoder module was given and then the concept of quadrature was introduced and shown to be necessary in order for the encoder to accurately report position information.
Some examples of practical applications for the incremental encoder were given by the wind vane example and as position feedback devices when controlling a motor with a computer.
If you have any questions or comments about this article, please feel free to leave them in the comments below.