View Single Post
  #8   Spotlight this post!  
Unread 28-03-2008, 16:40
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Question about Gear Sensor

Quote:
Originally Posted by beefy23 View Post
What are the meanings of quadrature encoder`s states, what does each of them tell me about?
The word "quadrature" refers to two signals which are out of phase with each other by one quarter of a cycle. The signals on a quadrature encoder are digital, and there are four possible combinations: 00, 01, 11, and 10. Notice that they don't "count" in binary; instead, only one of the signals changes for a transition between states. A change from 00 to 01 indicates the encoder is turning in one direction; a change fom 01 to 00 indicates it is turning in the other. Here's the full list of possibilities:

Code:
from to direction
 00  01 forward
 00  10 reverse
 01  11 forward
 01  00 reverse
 11  10 forward
 11  01 reverse
 10  00 forward
 10  11 reverse
A simple way to use quadrature encoders is to use interrupts to detect a transition from 0 to 1 on one signal (usually called Phase A), and look at the state of the other signal (Phase B) at that time to decide which direction the sensor is turning. That only uses two of the possible eight changes, but it's sufficient: 01 to 11 is forward, and 00 to 10 is reverse.