Need help with Quardatrue Encoder Theory

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
Posts: 18
Joined: Tue Dec 18, 2001 1:01 am

Need help with Quardatrue Encoder Theory

Post by jalbers » Wed Mar 27, 2002 6:47 am

To test my understanding of how a quadrature rotational encoder works, I set out to design a software simulator. To keep things simple, I decided to simulate a wheel with 8 evenly spaced holes. I should be able to get 4 times the resolution or a total resolution of 32. However I cannot figure out what the angular spacing of the photo detectors should be. I think there is some relationship between the size of the holes, disk radius and number of holes, but I can't figure it out. I am hoping that someone can play with the simulator and adjust everything so that the encoder starts giving the correct quadrature signals. Basically move any point that says "DRAG" to change the parameters.<p>The simulator was created using a program called Geometer's Sketchpad and the free evaluation copy can be downloaded at ... and the simulator file can be downloaded at ... oder44.gsp<p>Any help would be greatly appreciated. Thank You

Posts: 563
Joined: Thu Dec 06, 2001 1:01 am
Location: New Hampshire

Re: Need help with Quardatrue Encoder Theory

Post by russlk » Thu Mar 28, 2002 12:48 pm

It is not clear what you are trying to do. What is the function of the stationary disc? Are the sensors behind the stationary disc? If you are looking for 32 outputs per revolution, 4 sensors spaced 11.25 degrees will do it. What do you mean by quadrature?

User avatar
Posts: 885
Joined: Sun Jan 27, 2002 1:01 am
Location: Dallas Tx

Re: Need help with Quardatrue Encoder Theory

Post by Edd » Thu Mar 28, 2002 3:58 pm

Quadrature is the 90 degree offset referencing of the two outputs.Since this is optical derived
design you're referring to I referred to one co's
data that I had but they're no longer in biz. So
why don't you refer to this site for data:<p>73's de Edd

Posts: 340
Joined: Tue Dec 04, 2001 1:01 am

Re: Need help with Quardatrue Encoder Theory

Post by josmith » Thu Mar 28, 2002 4:05 pm

Each channel would be on for 22.5 degrees and off for 22.5 degrees out of phase by 11.25 degrees. You could use two sensors 11.25 degrees apart or 33.75 degrees apart etc. If you count edges you will get your 32 pulses per revolution. <p>Things start to get sticky in the real world when the encoder stops on an edge and it jitters up and down. If you want to count edges,detremine direction and ignore jitter you have your work cut out for you.<p>good luck

User avatar
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey

Re: Need help with Quardatrue Encoder Theory

Post by MrAl » Thu Apr 18, 2002 9:54 am

Hi there,<p>If you look at a simple case where you only
have two holes and two sensors, where the
holes are about twice the size of the sensor
detection pattern diameter, and if you space
the two holes 180 degrees apart and space the
two sensors 180 degrees minus their diameter
(slightly less then 180 degrees) then you create
a system that has four distinct states depending
on what sensor(s) are illuminated and what
sensor(s) are in the dark. If you call
illuminated '1' and in the dark '0', and
you use two bit positions to indicate the
state of the system, where position #1 is
the first sensor state and position #2 is the
second sensor state, then you come up with a
cyclic digital output bit pattern of:
00 01 11 10
for clockwise rotation and
00 10 11 01
for counter clockwise rotation
(or vise versa).<p>The computer 'ball' mouse uses two sensors and
quite a few 'holes', as well as a ratio between
ball and wheel, for each one of two dimensional
directions. The 'gearing' ratio increases the
resolution by spinning the discs more times then
the ball for every revolution of the ball, while
the above construction arrangement detects
direction.<p>Using a gear ratio of 4 to 1, even with 4 holes
and 2 sensors you'll get 32 state changes for
every revolution.
With 8 holes and 2 sensors, you'll get 64
state changes for every revolution.<p>Using the same idea, you should be able to get
some pretty good resolutions.
For ultra accuracy, you'll have to use high
quality gears, or perhaps another drive method
that also provides for a gearing ratio.<p>diagram:<p> ... m/meece.html<p>Note that although that diagram is correct, the
workings are slightly misrepresented in that you
dont really have to detect the 'edge' or the
'switching' transient. It's much more reliable
to simply detect the two possible distinct states
of a sensor: either fully on or fully off.
To do this, a schmitt trigger is used, which
eliminates any jitter (also mentioned by some
one else's post too i think). It's also
possible to change the shape of the hole too
in order to present the sensor with a cleaner
ramping illumination level as the disc spins
and the hole passes by. A wide diamond pattern
hole or something like that would work very well,
although a circular hole would probably suffice.
Some mice use a sawtooth edge instead of a hole,
which also provides a nice ramping illumination
level as the tooth passes by the sensor.
These wheels look like little saw blades :-)<p>Good luck with it,
Al<p>[ April 18, 2002: Message edited by: MrAl ]</p>
LEDs vs Bulbs, LEDs are winning.

Post Reply

Who is online

Users browsing this forum: No registered users and 47 guests