View Single Post
  #2   Spotlight this post!  
Unread 06-01-2007, 23:43
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Help for Better Understanding of Shaft Encoders

See Kevin Watson's code on quadrature encoders http://www.kevin.org/frc/. FAQ at http://kevin.org/frc/encoder/. Nice in-depth description at http://www.chiefdelphi.com/media/papers/1490. A ChiefDelphi thread on encoders at http://www.chiefdelphi.com/forums/sh...ad.php?t=48756. Wikipedia article http://en.wikipedia.org/wiki/Rotary_encoder.

Quite simple to use. All digital input. Connect Phase A signal wire to an interrupt pin, Phase B signal wire to a Digital Input pin. Configure the interrupt and catch it in user_routines_fast.c. Phase A pulses on each tick, Phase B pulses earlier or later than Phase A, depending on direction. When interrupt occurs, interrupt service routine checks the Digital Input for HI or LO and that gives you the direction.

You don't get any counts out - you have to count 'em yourself.

There are other types of encoders (absolute positioning?) that may provide encoded information about the precision position, without you having to count.

The trickiest thing about them is probably choosing one that is suitable and determining the method of attaching to your robot.

Last edited by mluckham : 06-01-2007 at 23:48.