A review of Quadrature encoder.
A quadrature encoder, also known as an incremental rotary encoder measures the speed and direction of a rotating shaft. Quadrature encoders can use different types of sensors, optical and hall effect are both commonly used. No matter what type of sensors are used the output is typically two square waveforms 90° out of phase as shown below.
If you only wish to monitor the speed of rotation then you can use either output and simply measure the frequency. The reason for having two outputs is that you can also determine the direction of shaft rotation by looking at the pattern of binary numbers generated by the two outputs. Depending on the direction of rotation you will get either
00 = 0
01 = 1
11 = 3
10 = 2
or
00 = 0
10 = 2
11 = 3
01 = 1
By feeding both outputs into an XOR gate (exclusive OR) you will get a square wave with twice the frequency regardless of direction. This can be useful as it allows one interrupt pin to monitor both encoder inputs.
41
No comments:
Post a Comment