Newsgroups: comp.robotics
Path: brunix!news.Brown.EDU!agate!howland.reston.ans.net!torn!news2.uunet.ca!scilink!robohack!feline!gray
From: gray@feline.uucp (Kelly Gray)
Subject: Re: Shaft encoders for DC gearmotors
Message-ID: <1994Feb21.182123.1648@feline.uucp>
Sender: Kelly Gray <gray@feline.uucp> 
Organization: Humber College Technology Dept.
References: <17774.leex0248@student.tc.umn.edu>
Date: Mon, 21 Feb 1994 18:21:23 GMT
Lines: 46

In article <17774.leex0248@student.tc.umn.edu> "leex0248@student.tc.umn.edu" <leex0248@student.tc.umn.edu> writes:
> On Wed, 16 Feb 1994 18:29:11 GMT, Kelly Gray wrote:
> 
> >I'm working on building a micromouse myself, and have found an excellent
> >source of small optical encoders for position sensing. Find an old, dead
> >mouse, and use the encoders from that. The mouse I have has two encoders,
> >mounted on a shaft with a small roller. I plan to mount the encoders on
> >the micromouse so that the roller rides on the top of one of the drive 
> >wheels. This should give me a very accurate measurement of the movement
> >that that wheel has made.
> >
 ------snip----> >-- 

> This might be a stupid question, but... how can I find out about the 
> workings of these encoders in a mouse?  Any docs, manuals I can read?
> Samuel Y.  Lee


 Good question. I haven't seen anything like that myself, although I'd like to.
What I know about using these encoders I learned by playing with an industrial
position sensor.

Essentially, the pair of optical sensors are placed so that as the encoder disk is turned, a pair of square waves is generated at the photodetector outputs. These square waves are 90 degrees apart, which one is leading depending on the
direction that the disk is being turned.
 
I have found three ways to use this information.
 
 1) Sample one dectector output, and ignore the second. This provides one pulse
each time a slot goes past the optical sensor, but no indication of direction.

 2) Use one detector output as a "clock" and sample the second detector output
on either the rising or falling edge of the first detector. This provides
one pulse per slot in the encoder disk, and state of the second detector
output gives an indication of the direction.
 
 3) Treat the two detector outputs as the outputs of a two bit state machine.
Sample them each time either of the inputs change. Knowing the previous state
of the detectors and the new state, the direction of motion can be found. This
provides four position increments for each slot in the detector, but is much
harder to implement.

-- 

<o_o>    Kelly Gray
         gray@feline.uucp (preferred)
         gray@admin.humberc.on.ca
