View Single Post
  #7   Spotlight this post!  
Unread 03-02-2012, 08:02
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: I woke up...and discovered CAN

Absolutely horrible is a pretty strong sentiment to place on something. This is a good opportunity to practice troubleshooting the elements you are using and tracking down the issue.

If you were reading them as digital inputs and doing your own logic for advancing or reversing the position, that should work if done properly, but it will only work for a slow progression. I suspect you are reading the pulses every few ms at best, and probably more like every 20ms +/- 5. If you have a 1024 pulse encoder, the 20ms sampling rate would start to fail at something like 1/80 rpm I think -- not very fast. By comparison, the fpga reads the digital inputs at a rock steady 6.xxx microseconds. I don't remember the number, but that is actually limited by the bus access time for the module. With a faster module, it could go far higher.

My initial advice would be to make a small test project using just an encoder example. spin the encoder by hand. If it is flaky, make sure that the issue isn't with the wiring, the digital breakout, or the sensor. Being the programmer, you are often the first to see that the system doesn't work, and since the system is complex, the issue could be any number of places. Being able to isolate parts of the system and determine if they are at fault is a valuable technique, and is actually fun once you become good at it.

Greg McKaskle