Go to Post … it’s all good as long as the kids are inspired. - AdamT [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 18-01-2017, 07:37
AtomicBrawlers's Avatar
AtomicBrawlers AtomicBrawlers is offline
Registered User
FRC #5401
 
Join Date: Feb 2016
Location: Bensalem
Posts: 5
AtomicBrawlers is an unknown quantity at this point
Trying to count EVERY cycle of a photoelectric sensor in your program

My team wants to use a photoelectric sensor or photoswitch to measure and manage the rpm of a flywheel shooter. So there'd be something such as retro-reflective tape on the wheel that would trigger the sensor every rotation. The issue we don't see anyone else talking about is how to get 6,000+ readings per programming cycle. By this, I mean the ~20ms it takes for an FRC Robot to run through it's commands.

For example, if the wheels are rotating ~6,000 rpm, that means 100 rotations a second that must be counted. If a robot can only retrieve data every ~20ms (it's not consistently 20ms) , that means there's ~2 rotations every second.

However, the wheels are not at a constant 6,000 rpm and the data isn't processed at a constant 20ms, so how do you get around the issue of the wheels rotating too fast for the code to read?

One option is a hardware counter, something the photoelectric sensor connects to that keeps track of how many times it's triggered and then sends that number when the code asks for it every ~20ms. If this is your solution, do you have the name of the part you used to do this?

Does anyone know of any teams that have done this who's code is available to read?

Last edited by AtomicBrawlers : 18-01-2017 at 07:52.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi