View Single Post
  #6   Spotlight this post!  
Unread 25-01-2006, 01:46
eugenebrooks eugenebrooks is offline
Team Role: Engineer
AKA: Dr. Brooks
no team (WRRF)
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Livermore, CA
Posts: 601
eugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond repute
Re: Speed Sensor for Ball Shooter

Quote:
Originally Posted by Justin Stiltner
Does anyone have and idea for a speed sensor for the ball shooting wheels, I don't really want to use encoders
<snip>
Use an optical sensor, such as a banner sensor with reflective tape, that generates one interrupt per rotation of the wheel. Use this interrupt to measure the amount of time that it takes for the wheel to go around with one of the hardware timers, preferably a 16 bit one (timer 1 or timer 3). Use the interrupt from the overflow on the timer to increment a "high word" maintaining a 32 bit result for the time in clock ticks that it takes for the wheel to go around. You can get very high precision for the wheel speed this way with only one interrupt per rotation and any additional interrupts associated with overflow of the timer. The "period" of the wheel is then maintained by the interrupt setup, to be read in the user loop by the PID control for the wheel power, any time it needs to be read.

<edit>
There is a race condition in this scheme that you must be careful about.
<edit>

Have fun,
Eugene

Last edited by eugenebrooks : 25-01-2006 at 12:22.