View Single Post
  #61   Spotlight this post!  
Unread 11-02-2013, 18:48
Bunniy's Avatar
Bunniy Bunniy is offline
The Only Programmer
FRC #3337 (Panthrobotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Baton Rouge
Posts: 37
Bunniy is an unknown quantity at this point
Re: Photosensor as encoder for bang bang.

Quote:
Originally Posted by Ether View Post
To understand why, you have to do the math.

Using the "period" method, like Mark posted earlier in this thread, the FPGA samples the sensor at 153KHz and records the elapsed time between pulses with a 1MHz clock. For a one-per-rev sensor (like yours) on a wheel spinning at, say, 2000 rpm, that gives you a very accurate and hi resolution signal. See attachment.

The "count" method is very accurate for high speeds with high counts-per-rev sensors like a 360CP encoder. But for a one-per-rev sensor like yours, it's not very good. At a wheel speed of 2000 rpm and sampling every 20ms, you don't get enough counts to accurately determine what the speed is. Sometimes you'll get 1 count, and sometimes you'll get *no* counts. You can't convert that into a useable speed signal.
See attachment.


Do you have a good method to use the period method with desired rpm
__________________
Think Outside The Frame
Reply With Quote