- Rotary encoder
A rotary encoder, also called a shaft encoder, is an
electro-mechanical device used to convert the angular position of a shaft or axle to an analog or digital code, making it an angletransducer . These devices are used in industrial controls,robotics , in top-of-the-linephotographic lens es, in computer input devices (such as optomechanical mice andtrackball s), and in rotatingradar platforms.There are two main types: absolute and incremental (relative).
Absolute rotary encoder
Construction
The absolute digital type produces a unique digital code for each distinct angle of the shaft. They come in two basic types: optical and mechanical.
Mechanical Absolute Encoders
A metal disc containing a set of concentric rings of openings is affixed to an insulating disc, which is rigidly fixed to the shaft. A row of sliding contacts is fixed to a stationary object so that each contact wipes against the metal disc at a different distance from the shaft. As the disc rotates with the shaft, some of the contacts touch metal, while others fall in the gaps where the metal has been cut out. The metal sheet is connected to a source of
electric current , and each contact is connected to a separate electrical sensor. The metal pattern is designed so that each possible position of the axle creates a uniquebinary code in which some of the contacts are connected to the current source (i.e. switched on) and others are not (i.e. switched off).Optical Absolute Encoders
The optical encoder's disc is made of glass with transparent and opaque areas. A light source and photo detector array reads the optical pattern that results from the disc's position at any one time.
This code can be read by a controlling device, such as a
microprocessor , to determine the angle of the shaft.The absolute analog type produces a unique dual analog code that can be translated into an absolute angle of the shaft (by using a special algorithm).
tandard binary encoding
An example of a binary code, in an extremely simplified encoder with only three contacts, is shown below.
|
The two output wave forms are 90 degrees out of phase, which is all that the quadrature term means. These signals are decoded to produce a count up pulse or a count down pulse. For decoding in software, the A & B outputs are read by software, either via an interrupt on any edge or polling, and the above table is used to decode the direction. For example if the last value was 00 and the current value is 01, the device has moved one half step in the clockwise direction. The mechanical types would be debounced first by requiring that the same (valid) value be read a certain number of times before recognizing a state change.
If the encoder is turning too fast, an invalid transition may occur, such as 00->11. There is no way to know which way the encoder turned; if it was 00->01->11, or 00->10->11.
If the encoder is turning even faster, a backward count may occur. Example: consider the 00->01->11->10 transition (3 steps forward). If the encoder is turning too fast, the system might read only the 00 and then the 10, which yields a 00->10 transition (1 step backward).
This same principle is used in old ball mice to track whether the mouse is moving to the right/left or forward/backward.
Rotary sensors with a single output are not encoders and cannot sense direction, but can sense RPM. They are thus called
tachometer sensors.Sine wave encoder
A variation on the Incremental encoder is the Sinewave Encoder. Instead of producing two quadrature square waves, the outputs are quadrature sine waves (a Sine and a Cosine). By performing the arctangent function, arbitrary levels of resolution can be achieved.
Encoder technologies
Encoders may be implemented using a variety of technologies:
* Conductive tracks. A series of copper pads etched onto a PCB is used to encode the information. Contact brushes sense the conductive areas. This form of encoder is now rarely seen.
* Optical. This uses a light shining onto aphotodiode through slits in a metal or glass disc. Reflective versions also exist. This is one of the most common technologies.
* Magnetic. Strips of magnetised material are placed on the rotating disc and are sensed by a Hall-effect sensor or magnetoresistive sensor. Hall effect sensors are also used to sensegear teeth directly, without the need for a separate encoder disc.See also
Analogue devices that perform a similar function include the
synchro , the resolver, therotary variable differential transformer (RVDT) and the rotarypotentiometer .A
Linear encoder is similar to a rotary encoder, but measures position in a straight line, rather than rotation. Linear encoders often use incremental encoding and are used in many machine tools.External links
* [http://www.smallformfactors.com/articles/id/?3039 "Choosing a code wheel: A detailed look at how encoders work"] article by Steve Trahey 2008-03-25 describes "rotary encoders".
* [http://embedded.com/showArticle.jhtml?articleID=166400808 "Encoders provide a sense of place"] article by Jack Ganssle 2005-07-19 describes "nonlinear encoders".
* [http://www.societyofrobots.com/sensors_encoder.shtml "Robot Encoders"] .
Wikimedia Foundation. 2010.