View Single Post
  #1   Spotlight this post!  
Unread 18-02-2007, 11:42
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: Gear Tooth Sensor Help

Quote:
Originally Posted by BLP View Post
I'm using the encoders code from his site but im only getting it to work on the first and second input and also only when rotating in one direction...
The GTS signal doesn't have a Phase B, so using it with code intended for quadrature encoders is not always going to work. Specifically, the first two inputs can deal with it because they only trigger on one edge of the signal, but the other four will trigger on both edges and think the encoder is moving slightly back and forth at one spot. Since there's no information on direction from the GTS, you'll always count up (or down, depending on defaults) no matter which way the gears are turning.

If you must use digital inputs 3-6, you'll have to remove a lot of the code in the interrupt service routine that deals with relationships between the two phases of a quadrature signal.
Quote:
I've wired the J2 part to the digital inputs and J1 to a circuit breaker for the 12V and still it doesn't work properly...
The digital inputs? There's only one digital signal from the GTS.