In this tutorial, we will study about one of the commonly used and accurate sensors used for position and speed measurement or control known as Rotary encoders.
Rotary Encoder is a sensor that generates an electrical (either analog or digital) signal in response to a rotational movement. This signal helps in determining or controlling the position or speed of a mechanical device. It is also known as a shaft encoder since it is mounted on a cylindrical shaft. A rotary encoder is often used to measure linear movement by combining with mechanical conversion devices. They are used in a variety of applications for precision and control of speed or position, including assembly machines, robotics, medical devices, testing equipment, etc.
A rotary encoder used for turn right, turn left and push to select functions in electronics devices
Types of Rotary Encoders
Rotary encoders are available in different types that are classified by output signal and sensing technology. Other types would also include single turn and multiple turn encoders. The classification of rotary encoders is as follows:
On the basis of Output Signal
Incremental encoder is the simplest position sensor to measure rotational movement which produces an output as a series of square wave pulses. Incremental encoder is also known as Quadrature encoder or Relative rotary encoder.
Incremental Encoder Disk
The incremental encoder consists of a photocell arrangement as a coded disk with evenly spaced dark and transparent segments on its surface. The disk rotates or moves past the light source generating a stream of square wave pulses that determine the angular position of the shaft.
Incremental encoders produce two channel outputs from channel A and channel B that are displaced at 90 degrees out of phase from each other. The output sequence determines the direction of rotation of the shaft. The resolution of the device is determined by dark and transparent segments, thus resolution per degree of rotation increases by increasing the number of lines in the pattern. Typical resolution of encoded discs is up to 8-bits per rotation or 256 pulses.
The angle of the shaft can be calculated in radians. For rotary encoder, the optical disk moves in circular motion, therefore the output resolution is given as follows for ‘n’ number of segments on coded disk;
The channel (either channel A or channel B) producing an output first determines the direction of rotation. The output of an incremental encoder is shown in figure below:
Incremental encoder output
Apart from the simplicity of incremental encoders, there is a disadvantage associated with them that they require external counters to determine the shaft rotation. In case of momentarily power shut off, the output will produce an error. It is possible to overcome this disadvantage by the use of absolute encoders.
Absolute encoders are rather complex and expensive than incremental encoders. They indicate both position and direction by providing a unique binary output code for every single position of rotation. Absolute encoders consist of coded disk with multiple concentric tracks of dark and transparent segments. Every track has a photo detector to determine each angle of movement simultaneously reading the position value with a unique code. The resolution is represented in bits that correspond to the number of tracks, such as a 12-bit absolute encoder has 12 tracks and same coded value appears once for every revolution.
Encoder Disk with dark and transparent segments
The main advantage of using an absolute encoder is its ability to retain the exact position even in case of power failure making it a non-volatile device.
On the basis of Sensing Technology
Rotary encoders are also classified in terms of sensing technology as:
- Optical encoders
- Magnetic encoders
Optical encoders are reliable and provide high operating speed, high resolution, and longer operating life in industrial environments. Magnetic sensing technology provides high operating speed, low resolution, maximum resistance to mechanical and thermal shock, dust and moisture, and is useful for rugged applications, such as in paper and steel mills.
Rotary optical encoders consist of a glass disk with deposited pattern of lines that is usually a metal or plastic disk with slots. The encoder produces an output as the light from an LED passes through the disk or slot to one or more photodetectors. It converts the position information of the machine into corresponding number of pulses or digital data by photoelectric signals. The basic advantage of an optical encoder over a magnetic encoder is that it can be used in a magnetic environment. Its basic components include code wheel/disk, motor shaft, light emitting element and light receiving element as shown in figure below;
For industrial environments, magnetic encoders are resistant to dust, moisture, shock, vibration and other contaminants. The main components of a rotary magnetic encoder are magnetized rotor and sensor circuitry. The sensor circuitry is either magneto-resistive using resistors sensitive to magnetic field change or Hall-effect to detect the voltage change. Speed and direction of the rotor is determined by the signal conditioning circuit.
Applications – Why We Use Rotary Encoders?
All applications that require monitoring of speed, direction, acceleration, and rotation rate can use rotary encoders. These sensors can be used in many mechanical engineering applications, such as material handling, packaging and conveyor industry.
Rotary encoders are used as sensors in automation for sensing speed, position, angle and acceleration. It is also possible to measure linear motion with the use of measuring wheels, gear racks or spindles. Rotary encoders produce electrical signals from a corresponding mechanical input. The output signals can be processed by tachometers, counters, industrial PCs and programmable logic controllers. Some common applications of rotary encoders are given as follows:
• Motor Feedback – a rotary encoder is used to provide feedback to a motor in terms of position or speed of the motor. It is either directly connected to the motor or indirectly through chain and sprocket or wheel arrangement. This motor feedback application is used in several applications ranging from conveyor belts for production to overhead cranes.
• Filling/Packaging – Filling and packaging industries need precise units that utilize rotary encoder to keep a machine tool at a preset position or direction. It requires determining the speed of tool head or table.
How to Measure with a Rotary Encoder?
In order to measure the output of a rotary encoder that is in the form of pulses, we need a counter. A typical counter will provide an output count of the number of edges, i.e. low to high transitions. Counters have three inputs including source, up/down, and gate. The registered events in the input source are counted by the counter. The count increments or decrements depending on the state of up/down input.
Simple Block Diagram of Counter
To connect an encoder to the instrument, you need to know that it usually has five wires that vary in color. These wires are used to provide power to the encoder and obtain its output. A typical incremental encoder has following connecting wires;
For a simplified counter, channel A of encoder is connected to the source terminal from which it will count the pulses. 5V DC and ground can be connected to any power source and Channel B is connected to the up/down terminal. When pulses are counted, it is required to convert the counted value to position which depends on the used type of encoding. Encoding is based on three basic types including X1, X2 and X4. These types are based on the phenomenon that the count increments on the rising edge as channel A leads B, and decrements on the falling edge as channel B leads A.
Typical waveform for X1 Encoding
After counting the pulses and setting the encoding type, you can use the formulas for converting ‘N’ number of encoder generated pulses and ‘x’ encoding type values into position;
Where, PPI is pulses per inch specific for each encoder.
We studied about rotary encoders, their types, applications, and how they are used to measure position or speed.