Quadrature Encoder Basics Part 1: Theory
While some motion applications require little precision and no feedback. Others, mostly industrial, require a robust way to keep track of reliable and precise data for speed, position and direction.
Stepper, Brushed or brushless DC motors do not provide any kind of feedback except when they are equipped with an encoder or hall-sensor.
On industrial stepper motors like the one that igus Delta Robot and robolink D joint is powered from, we can see that the stepper motor is equipped with an incremental quadrature encoder (8-pin).
What is an encoder?
An encoder is an electro-mechanical device that is used to measure displacement.
Why is it used?
Encoders are used to convert the angular position of a motor or rotating equipment, into an analogue or digital signal.
Types of encoders:
When considering the types of encoders, we should distinguish the technologies that are being used for signal generation and the type of output they produce.
- Resistive (using hall-sensor or magneto-resistive sensor),
- Optical ( using a LED and a photo-sensor),
- Electromechanical (converting the analogue position of a shaft to analogue or digital signal, also known as shaft encoder)
- Encoder resolution measured in pules per revolution (PPR), is the number of counts being generated by the encoder in each turn. In the case of igus motors, the quadrature incremental encoders give out 2000 pulses out of 2 channels ( A,B) thus 500 counts/ full steps. (the inverted copies A/,B/, are discussed later).
- On absolute encoders, bits are used to describe the resolution as their output are binary words. For example, an 8bit encoder equal 2^8 counts, thus 256 counts and a 16-bit encoder 2^16= 65536 counts/ revolution.
Types of output:
- Incremental: A sequence of on and off signals that are generated by an optical disc, indicating movement from one position to another. This position is lost if power is cut.
- Absolute: Each position of the encoder produces a unique code/pattern/word that can be regained even after a power cut.
Image 2: Absolute encoder disc pattern
In our case, this measurement is achieved via optical means. Inside the encoder, there is a disc which has a specific pattern of opaque and transparent parts.
Image 3: Quadrature incremental encoder disc pattern (without index)
The light detector that is used to receive the signals through the disc, receives the light intermittently according to the pattern creating a square wave pulse output.
When having one code track on the encoder, thus one channel, we can measure position and velocity of a stepper motor in a relatively high resolution. This is also known as a tachometer/ speedometer, as this type of encoder is mainly capable of velocity feedback.
On the other hand, a quadrature encoder has a second code track with a 90degree displacement that allows us to determine direction on top of velocity and position. E.g. If channel A pulse output leads channel B then the motor is rotating clockwise and if channel B leads channel A the motor is rotating anti-clockwise. In other words, there is a leading/lagging phase relationship between the channels.
Having a high-resolution industrial-proof encoder means that, there is a double ended signal transmission + an index channel on top of channels A and B.
A/ and B/ are simply inverted copies of A and B, and they are there to provide better noise immunity in industrial environment applications.
In more detail, the differential signalling technology is being used, where each channel has its inverted copy. The receiver, (e.g. closed loop controller) detects the potential difference between the channel and its copy and balances them, to have an equal amplitude, always compared to a common voltage.
The advantages of this procedure are there is very low current flowing to the ground conductor and less supply voltage needed due to increased resistance to electromagnetic interference (EMI).
The N channel output is reference/ zero /index channel, it is mainly used for homing the system by providing precise feedback of a reference position.
In the next chapter, we will see how we can measure the steps produced by an encoder using an Arduino microcontroller.
Thank you for reading, please comment your thoughts/ questions at the comment section!
CommentsAdd a comment
Yes this is also a common method of measuring displacement, again the magnetic encoders offer both incremental and absolute options.
The digital measurement systems we use and offer work in the same principle.
Thanks for your comment @Workshopshed