The most recent version of this article can be found at this link.
Introduction
In all but the simplest of systems there is a need to have feedback about the motion of certain moving parts. Encoders provide the feedback necessary to control individual components as well as the overall system.
What is an encoder?
An encoder is a device that produces signals that indicates several aspects of a motor such as position, direction and speed. These parameters are communicated back to the control system so they can be used to control other aspects of the system. Encoders are typically found on motors, but they can also be found in use with parts like linear actuators. Encoders can use several different types of technology to achieve the same effect. Examples of technologies used are magnets, optics and induction as seen in Hall Effect systems.
Encoder Applications
The most common application of encoders is to indicate position, direction and speed of a motor. These parameters can then be used in a feedback system to control the values sensed or be used to control other aspects such as distance. A robot, for example, can use encoders to know exactly how far it has moved or in turn be instructed to move a specific amount. With a feedback system in place encoders allow a robot to maintain a consistent wheel speed despite outside factors like slope and load.
Incremental/Quadrature Encoders
Incremental encoders also provide speed and position data, like absolute encoders. However they can also provide data on the direction of rotation. Unlike absolute encoders they do not provide the exact position of the shaft without first moving to a “home” position and do not do so immediately on start-up. Also, any changes of the shaft position while powered down are not noted when the system is powered up. However, they often have a much more fine grained ability to determine position than absolute encoders. The output from an incremental encoder is a pair of square wave pulse streams. The two series of pulses are 90 degrees out of phase, hence why they are called quadrature encoders. An example application for quadrature encode is in the drive wheels of a robot. Here one would like to know all three aspects of the motor shaft: direction, speed and position.
Inside an incremental or quadrature encoder is a disk with two tracks of identical markings. As the encoder internals rotate the marks pass by a sensing unit that produces a pulse for each mark sent. Each internal track is offset from each other and this produces a pulse train that is also offset by 90 degrees from each other. This is what allows a quadrature encoder to determine the direction of rotation. The offset is in a different direction based upon the direction of rotation. Also note that quadrature encoders typically contain a larger number of marks than absolute encoders. This allows quadrature encoders to have a more fine-grained resolution.
Figure 2
Photo by Sidehack / Public Domain
Absolute Encoders
Absolute encoders provide data on a motor’s position and speed. What is special about them is that they provide an absolute position. This means that there is a unique code inside the encoder for each position of the motor shaft. The position is not based off of an arbitrary starting point. There is also no need to start the motor from a “home” position to find the exact position of the shaft. The position output always corresponds to the real-life shaft position. Absolute encoder used in hobbyist robotics typical output an analog voltage or pulse train that is proportional to position. They are useful for systems where precise positioning is an important factor. An example application of this type of encoder is in a robotic arm where the position of each part must be known without seeking a “home” position.
Internally absolute encoders contain a track of unique values for each possible shaft position. A sensing unit detects these values and in turn outputs a value corresponding to the shaft position. These unique codes are what allow an absolute encoder to always know the exact shaft position.
Figure 1
Photo by Mike1024 / Public Domain
Conclusion
We’ve discussed that encoders are typically used to sense the position, speed and direction of a motors. Absolute encoders provide an absolute shaft position, while quadrature encoders provide a relative position but can also provide data on the direction of rotation unlike an absolute encoder. Each is suitable for different applications and have different pros and cons. However, both types of encoders are suitable for use with the RoboClaw motor controllers.