Newsgroups: comp.robotics
Path: brunix!news.Brown.EDU!noc.near.net!howland.reston.ans.net!paladin.american.edu!gatech!concert!sas!mozart.unx.sas.com!sasrer
From: sasrer@unx.sas.com (Rodney Radford)
Subject: Re: Decoding Sine/Cos shaft encoders
Sender: news@unx.sas.com (Noter of Newsworthy Events)
Message-ID: <sasrer.738786585@cinnamon>
Date: Sun, 30 May 1993 18:29:45 GMT
References: <1993May29.155240.4648@jupiter.sun.csd.unb.ca>
Nntp-Posting-Host: cinnamon.unx.sas.com
Organization: SAS Institute Inc.
Lines: 27

r344@jupiter.sun.csd.unb.ca (Ravin Balakrishnan) writes:

>Does anyone know of an easy (i.e. read 'cheap', perhaps a single chip?) way
>to decode analog optical shaft encoders which output sine/cosine signals?
>Ideally I'd like it to feed a bidirectional counter so that I can determine
>the direction and magnitude of movement.  I know that some shaft encoders 
>output quadrature pulses, but I already have these sine/cosine devices 
>connected to themotors I want to use and don't really want to buy new 
>shaft encoders.

Why not just connect each sine/cosine output to one input of a quad 
comparator, with the other input tied to GND (0v), and then you have the
'traditional' digital quadrature pulses.

An easy way to handle these is to XOR the sine with a RC delay'ed version of
itself (giving a single pulse on every 0/1 and 1/0 transition), and feed that
to the CLK of a flip-flop. Then tie the cosine signal to the data in. If
you also tie the CLK to a CPU interrupt, you can just check the FF output
each time, either incrementing, or decrementing, depending on the FF value.

Good luck.
--
---
Rodney Radford          || Computer Graphics/Imaging
sasrer@unx.sas.com      || SAS Institute, Inc.
(919) 677-8000 x7703    || Cary, NC  27513

