View Single Post
  #27   Spotlight this post!  
Unread 16-04-2012, 14:59
dcherba dcherba is offline
Registered User
FRC #3234 (Red Arrow Robotics)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2000
Location: ada, mi
Posts: 32
dcherba has a spectacular aura aboutdcherba has a spectacular aura aboutdcherba has a spectacular aura about
Cool Re: High Speed Encoder Problem

the problem is the time between updates can vary. In our c++ program we execute every 20 to 100 millisec. That means if we were doing the count divided by time there could be a 1-5 range of counts. The best thing to do is get the period of the last cycle. That will be in seconds and will not depend on the cycle time of the calls to the actual program.

For those with good control they used a a custom painted code wheel with one or three cycles to get the longest possible period with the highest quality of timer counts to calculate the speed.
__________________
Dave Cherba
Mentor Team 3234
WZ8T