Starting from:

$30

Challenge: Quadrature Encoders

Lab description updated 6/20/2020
ECE 206: Quadrature Encoders
Challenge: Quadrature Encoders
Encoders are a useful way to sense position and rotation. An
optical rotary encoder is shown in the figure to the right. A LED
shines light first through a slotted rotor disk, attached to the
shaft of rotation, then through a slit plate. Light which shines
through both a rotor slot and a slit plate slot is picked up by one
of two phase photo-transistors. Two photo-transistors generate
two square wave voltage signals, phase A and phase B, as shown
below. The number of periods tells us the rotation, the
frequency corresponds to the rotational speed, and the relative
orientation of A and B tells us the direction of rotation. The technique
of sending identical signals which differ only by phase is called
quadrature.
Prelab Deliverables:
NOTE: Responses to Pre-lab questions
are submitted checked off in class during
your lab session.
• Assuming the Phase A and B slits are oriented in the diagram as shown above, which direction
of rotation (either clockwise or counterclockwise) does the waveform to the right correspond
to? Assume that if the photodiode senses light, the output will read high. Assume sensor B is
spaced half a rotor slot apart clockwise from sensor A.
• Draw an equivalent waveform similar to the one above for the opposite direction of rotation.
Lab description updated 6/20/2020
Challenge: Design a circuit to read out the A and B waveforms using our quadrature encoder knob.
Capture waveforms for slow CW/CCW rotation, fast CW/CCW rotation
using the STEMTera plot tool. Design a flowchart (which will be used in a
following lab) for an algorithm with will keep track of the current
position on an absolute scale.
Note that our encoder is mechanical, so it makes and breaks contact as
opposed to optical, though the operating principle is the same. The
mechanical encoder has the advantage of being able to carry current,
through it is less reliable long term than an optical encoder. Make sure
your circuit has resistors, you will need at least two.
Your algorithm should start at a position of 0. Each tick in the clockwise
direction counts as +1, whereas each tick in the minus position counts as
1. The encoder has 24 ticks per rotation, so if we rotate a full rotation
clockwise and then perform a half rotation counterclockwise, the position should read as +12. The pinout for the encoder is shown on the left (use only the 3-pin side, the two pin side is for the push-in
switch, which is an independent circuit).
Hint: Note that the waveform above is broken up into four phases (1, 2, 3, and 4). The ordering of the
phases will be different depending on the direction of rotation. First, write a truth table (from ECE 205)
corresponding to each phase. Then use each phase as a state in your flowchart to detect the direction
and increment or decrement the position.
Report Deliverables:
• Include a diagram/sketch of your circuit and experimental setup
• Provide four screen-grabs: rotation in each direction at two differing speeds
• Obtain your TA signoff on the screengrabs
Important: You will need to use the screen grabs from this lab to complete Prelab 4 later on. You will
need to be able to measure the time between phase transitions to complete Prelab 4, so make sure that
the screen grabs are of sufficient resolution, and also that they include time scale information.
Report Element Value
Documentation of Lab Completion 40
Algorithm 15
Circuit Diagram 15
4 Screen Grabs 15
Report Quality and all other elements 15
Total 100

More products