Rotary Encoder Explained
A Rotary Encoder
is used to provide angular position feedback. They come in "digital" or analog form, and the types of information they offer can be packaged in various ways.
One of the more popular types of encoders is called an optical rotary quadrature encoder. This type of encoder uses two LED emitter and receiver pairs that are slightly staggered in their orientation. Between both pairs of emitters and receivers, is placed a slotted disk that when rotated will either block or allow light to pass between the sensor/emitter pairs. As the slotted disk is rotated, the light sensors respond to fluctuations in light and causes them to output a "pulsed" voltage waveform that corresponds to the slot position on the rotating disk.
It turns out the two sets of the emitter & sensor pairs are offset by one half of the width of the wheels "slot", and thus depending on which sensor detects a change first in the voltage will determine the direction of rotation. Thus by looking at the feedback from the two sensors, we can determine the direction of rotation. Additionally by counting the amount of "pulses" or voltage transitions from high to low - we can also figure out how far the disk has rotated. Translating this into real-world measurements, by knowing how many slots are on the encoder disk (called resolution), we can determine the angle at which the disk has rotated from its original position.
Additionally, with a quadrature encoder having two identical sets of sensor pairs offset by exactly half the slot distance, we can use both sensors in unison to increase the positional accuracy by a factor of two.
Another type of encoder is a magnetic encoder. It works similarly to the optical encoder mentioned above, except that instead of using optical sensors, hall sensors are used to pick up the magnetic signature on a disk. The rotating disk has opposing positively and negatively orientated magnets that the robot can count to determine how much the disk has rotated.
Other types of encoders include linear encoders, which are similar in operation to the rotational type - except they are used to determine the linear position of something such as a robot's extension joint. Absolute encoders return unique strings of serial data based on disk angle. There are also analog encoders that return a voltage based on position. Potentiometers (adjustable resistors) can be used for this purpose and offer a cheap alternative for positional feedback.
Robots rely on encoders to determine Joint
position or other feedback that is essential for proper performance. For more information about encoders, take a look at the links below.