The Mad Scientist's Chronograph Needs your help Measuring time
Promagic
Posts: 17
I was wondering just how fast my BB gun fired at some of my homemade armor for a competition at mech-warfare.com
6 hours later I built a contraption that uses 2 bump switches 1 foot apart.
Formula:
T2 - T1 = Total time it takes to go from one bump switch to another
(Distance in feet) / (Total Time) = fps
Example:
19.29975 - 19.28540· = ·0.01435 seconds OR 14ms
3 feet / 0.01435· = 209fps
Hardware.....Check!
Electronics...Check!
Software..... Che...Wait, what?!?
Do you know of a some code that can help me solve my problem?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
···· -Devin
"I can only ask every question once."
6 hours later I built a contraption that uses 2 bump switches 1 foot apart.
Formula:
T2 - T1 = Total time it takes to go from one bump switch to another
(Distance in feet) / (Total Time) = fps
Example:
19.29975 - 19.28540· = ·0.01435 seconds OR 14ms
3 feet / 0.01435· = 209fps
Hardware.....Check!
Electronics...Check!
Software..... Che...Wait, what?!?
Do you know of a some code that can help me solve my problem?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
···· -Devin
"I can only ask every question once."
Comments
http://forums.parallax.com/showthread.php?p=732526
If you are using PULSIN to measure the time on a BS2, then the result in in units of 2 microseconds. For example, 14.35 milliseconds is 14350 microseconds, but the result returned by PULSIN will be b2b=7175 (µs*2). Then if distance is 3 feet (or was it 1 foot?), the formula to convert to feet per second is
3 * 1000000 / (b2b * 2) = 1500000 / b2b
Which includes the factor of 1000000 for microseconds and the factor of 2 for the PULSIN units. For example, 1500000 / 7175 = 209 feet per second
The math has a variable in the denominator, and on the Stamp, a binary division loop is the best way to deal with this, as follows:
The above works so long as the velocity is less than 1000 feet per second.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Post Edited (Tracy Allen) : 3/6/2009 8:05:48 PM GMT
Ok how am·I supposed to use one PULSOUT command with two push-buttons? Do·I wire them to the same pin? I tapped one of the push-buttons and it have me a reading of about 200 ft/s, which was awesome but how did it figure that out with only one tap?
My contraption at the moment is only 1' apart at the moment but·I can change it whenever·I want.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
···· -Devin
"I can only ask every question once."
PULSIN 8, 1, b2b ' <--- note that this command detects the duration of a 010 pulse
What exactly is a "bump switch" and how is that set up to detect the BB?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com