View Single Post
  #3   Spotlight this post!  
Unread 04-10-2008, 14:43
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: Encoder Oscillation Issues

How high of a frequency are you pushing in the input pins of the controller?

I don't see anything obviously wrong with your coding... though it could also be in the actual low priority interrupt handler vector (in user routines fast).

Also, if this is a signed integer type of some kind... the fact that your error starts occuring around 120 to 160 may be significant. Remember, the largest signed value you can store in one byte is 127, so at that point you're number is becoming a two byte integer... which is more complicated for the processor to handle and isn't just a single-instruction operation anymore. This little bit of extra process time may be pushing your ISR to be just a little too long at high frequencies....

Just a hunch... unfortunately I have to run or I'd examine it further. Good Luck!

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08