Shop OBEX P1 Docs P2 Docs Learn Events
Speed Finder — Parallax Forums

Speed Finder

jakefjakef Posts: 6
edited 2011-12-13 20:29 in Robotics
Hello,

I'm a Senior in mechanical engineering at the University of Kansas. I'm in a class called microprocessors and we have to come up with a final project. My final project for this class is a bowling ball will be thrown down a lane and the processor will have to read its speed. I just need to know what I would need to order from your website. I know I need a ultra sonic range finder and EEPROM to store the data, but what else would I need. Another requirement for this project is having an D/A or A/D converter. I have already bought the basic stamp 2 starter kit from you guys. I can figure how to set it all up, I just need help on what items i would need. If you can just let me know, I would really appreciate it.

Thanks

Jake

Comments

  • SRLMSRLM Posts: 5,045
    edited 2011-11-28 09:41
    I'm not sure how well a Ping would work on a bowling ball: my guess is that the sound would be reflected in the wrong direction, and you wouldn't get a valid reading. Instead of a Ping I would use a Sharp IR detector (try acroname.com). These devices have an analog output, so you'll need a ADC of some sort. I'd use an MCP3204 or MCP3208.

    An easier solution, however, would be to have two points that the bowling ball passes. Since you know the (constant) distance between the points you simply have to time how long it takes the ball to pass between the points and the you can calculate the speed. For this dection you can use modulated IR beams, a light cell and lasers, or some other beam type solution.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-11-28 10:38
    Here's an off-the-wall -- but in-the-ball -- idea: Using a 2- or 3-axis accelerometer with analog outputs, an A/D converter, a microcontroller, an external EEPROM (or a micro that includes the A/D and internal, writable flash or EEPROM), and a small battery, design a sensor that can be poked into one of the ball's finger holes. Program it to record the accelerometer's outputs as the ball rolls down the alley. By analyzing the data it collects (and assuming the ball is rolling 100% and not skidding), you should be able to compute not only its average speed from the it's circumference and data oscillation period, but a bunch of other dynamical data as well. The latter might include things like whether the ball's axis of rotation changes as it rolls.

    -Phil
  • ercoerco Posts: 20,256
    edited 2011-11-28 14:59
    I'd go for the 2-sensor solution. You could use 2 IR sensors, 2 ultrasonic sensors, anything. You're just breaking an IR beam or looking for any ultrasonic reflection to detect. The speed is the distance between the 2 sensors divided by the time between the 2 sensors triggering. Or if you find two wide mylar panel switches you could tape down across the lane, that should work too.

    As an aside, there are inexpensive radar guns used to measure baseball and Hot Wheels car speeds:

    http://www.ebay.com/itm/Hot-Wheels-Toy-Radar-Gun-/190607253638?pt=Diecast_Vehicles&hash=item2c6113e086
    http://www.ebay.com/itm/BUSHNELL-CITATION-X-RADAR-SPEED-GUN-Nice-No-Reserve-/150708401162?pt=LH_DefaultDomain_0&hash=item2316ebb40a

    PS: check this older thread which popped up again today: http://forums.parallax.com/showthread.php?121902-X-band-motion-detector-as-a-quot-speed-gun-quot
  • jakefjakef Posts: 6
    edited 2011-11-28 15:12
    Here's an off-the-wall -- but in-the-ball -- idea: Using a 2- or 3-axis accelerometer with analog outputs, an A/D converter, a microcontroller, an external EEPROM (or a micro that includes the A/D and internal, writable flash or EEPROM), and a small battery, design a sensor that can be poked into one of the ball's finger holes. Program it to record the accelerometer's outputs as the ball rolls down the alley. By analyzing the data it collects (and assuming the ball is rolling 100% and not skidding), you should be able to compute not only its average speed from the it's circumference and data oscillation period, but a bunch of other dynamical data as well. The latter might include things like whether the ball's axis of rotation changes as it rolls.

    -Phil

    I first had that as my initial design but don't you have to worry about telemetry?
  • jakefjakef Posts: 6
    edited 2011-11-28 15:13
    SRLM wrote: »
    I'm not sure how well a Ping would work on a bowling ball: my guess is that the sound would be reflected in the wrong direction, and you wouldn't get a valid reading. Instead of a Ping I would use a Sharp IR detector (try acroname.com). These devices have an analog output, so you'll need a ADC of some sort. I'd use an MCP3204 or MCP3208.

    An easier solution, however, would be to have two points that the bowling ball passes. Since you know the (constant) distance between the points you simply have to time how long it takes the ball to pass between the points and the you can calculate the speed. For this dection you can use modulated IR beams, a light cell and lasers, or some other beam type solution.

    What does a Sharp IR detector do? I have never heard of one of those
  • jakefjakef Posts: 6
    edited 2011-11-28 15:15
    erco wrote: »
    I'd go for the 2-sensor solution. You could use 2 IR sensors, 2 ultrasonic sensors, anything. You're just breaking an IR beam or looking for any ultrasonic reflection to detect. The speed is the distance between the 2 sensors divided by the time between the 2 sensors triggering. Or if you find two wide mylar panel switches you could tape down across the lane, that should work too.

    As an aside, there are inexpensive radar guns used to measure baseball and Hot Wheels car speeds:

    http://www.ebay.com/itm/Hot-Wheels-Toy-Radar-Gun-/190607253638?pt=Diecast_Vehicles&hash=item2c6113e086
    http://www.ebay.com/itm/BUSHNELL-CITATION-X-RADAR-SPEED-GUN-Nice-No-Reserve-/150708401162?pt=LH_DefaultDomain_0&hash=item2316ebb40a

    PS: check this older thread which popped up again today: http://forums.parallax.com/showthread.php?121902-X-band-motion-detector-as-a-quot-speed-gun-quot

    So you think this is the best option? I feel like my professor would think of this of being easy, but I could be wrong. If I do go this way, will i still be able to use a A/D or D/A converter?
  • SRLMSRLM Posts: 5,045
    edited 2011-11-28 15:27
    Do a Google search for "sharp ir site:acroname.com"!

    As for whether or not it is easy, well it may be. But that's because this class of problems has been solved many times before.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-11-28 15:42
    jakef wrote:
    I first had that as my initial design but don't you have to worry about telemetry?

    Only if you want the data in real-time. My thought was to record it in EEPROM or flash and download it after the fact.

    -Phil
  • ercoerco Posts: 20,256
    edited 2011-11-28 16:44
  • ercoerco Posts: 20,256
    edited 2011-11-28 16:54
    Assuming your professor wants a more sophisticated, one sensor, radar-gun type implementation, you could use an array of several pings mounted on a bar straddling the bowling lane (BTW, you need to give some serious thought to how to avoid potential damage from a 20# bowling ball smashing your precious apparatus!) If you mount several pings side by side across the width of the lane, as low as possible, you may be able to get a reading off one of them, depending on exactly where the ball is. Whether or not you can get 2 readings from the same sensor for a speed measurement must be tested. For twice the cost, you could have another array of sensors behind. One watches the ball approach, one watches it depart. Would double your read opportunies! BTW, see cheap sensors at http://forums.parallax.com/showthread.php?135899-Four-Buck-Ultrasonic-Sensor
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2011-11-28 18:08
    erco wrote: »

    Thank you erco - no need to leave Parallax for this one SRLM!
  • PublisonPublison Posts: 12,366
    edited 2011-11-28 18:38
    I guess it wouldn't be the GP2D12 (from Parallax) anymore.

    It would be the current GP2Y0A21YK0F:

    http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/Sharp/List/0/SortField/4/ProductID/776/Default.aspx
  • SRLMSRLM Posts: 5,045
    edited 2011-11-28 20:02
    Ken Gracey wrote: »
    Thank you erco - no need to leave Parallax for this one SRLM!

    I was thinking of the long range IR sensor, which Parallax doesn't carry: http://www.acroname.com/robotics/parts/R316-GP2Y0A710YK.html

    The principles and code are exactly the same however.

    As a side note, if you know the diameter of the ball you can calculate the speed by using a single beam across the lane and timing how long the beam is broken.

    An important question to ask is which speed do you want to measure: the speed of the ball in one dimension going down the lane, or the absolute speed of the ball WRT the lane (it could be going diagonally, which adds a dimension to consider).
  • jakefjakef Posts: 6
    edited 2011-11-28 20:09
    Well, I got an email back from my teacher and he said the two sensor would be fine for my project. I kind of want to make the project simple since I still am working on my senior design. Is the following items correct of what I need for this project:
    • 2 IR beams
    • What A/D converter would I need?
    • To make the project nicer, I might get a LCD to show the speed of it
    Is that all I would need to buy since I already have the basic stamp?

    Thank you everybody for your help, I really appreciate it.
  • SRLMSRLM Posts: 5,045
    edited 2011-11-28 20:31
    I would use some CdS photoresistors (http://www.parallax.com/Store/Components/Optoelectronics/tabid/152/CategoryID/30/List/0/SortField/0/catpageindex/2/Level/a/ProductID/175/Default.aspx) and a laser to make the beam, and the appropriate RCTime hardware to satisfy your ADC requirement.
  • ercoerco Posts: 20,256
    edited 2011-11-29 01:47
    SRLM wrote: »

    As a side note, if you know the diameter of the ball you can calculate the speed by using a single beam across the lane and timing how long the beam is broken.

    That's gold, SLRM! Great concept. I think all bowling balls are the same diameter. Break one laser beam shining across the lane into a phototransistor, all mounted one ball radius AGL to hit the ball's max diameter. Measure the duration of the broken beam (PULSIN) and that's the time to move one ball diameter. Solved, no RCtime, no ADC required. Just use the Stamp's high/low transition voltage of 1.4V.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-11-29 08:36
    The catch is that he has to use an ADC. It's a condition of the assignment. SRLM's otherwise excellent idea is dependent upon the accuracy to which the height of the emitter and detector are placed. And you can't use a modulated sensor, either, to measure such a short-duration pulse, unless the modulation frequency is very high. But without modulation or extreme optical collimation, interference form ambient lighting -- which itself might be modulated at 60Hz -- will throw off the results.

    I would be more tempted to use a sensor with an analog output, and a non-modulated beam. That way, you can record both the ball's passing and any 60Hz ambient lighting that intrudes on the sensor. By subtracting a phase-locked version of the ambient light record, the leading and trailing edge locations of the ball can determined more accurately from the analog record.

    -Phil
  • ercoerco Posts: 20,256
    edited 2011-11-29 09:14
    Now Phil,
    jakef wrote: »
    Another requirement for this project is having an D/A or A/D converter.

    So our new friend is free to use the SLRM method for measurement, and get extra creative points for using a DAC to display the output. He could for instance, PWM an output which would be displayed on a big ol' analog voltmeter, calibrated for speed.

    It ain't da destination, it's da journey! :)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-11-29 09:39
    Oh, right: "or." I like the voltmeter idea. Maybe he could do both. Sometimes you have to do something that wakes up a jaded professor, who's given the same assignment more times than he can count. :)

    -Phil
  • jakefjakef Posts: 6
    edited 2011-11-29 11:45
    Ok so i think i have a solution. I will buy:
    • two - Sharp IR Sensor
    • two - ADC0831
    • Do i need one EEPROM or two
    I will use two sharp IR sensor and just time the difference between them and i'll know the distance between them to find the speed.

    Thanks for all your help guys.

    Jake
  • SRLMSRLM Posts: 5,045
    edited 2011-11-29 13:34
    Ok... You haven't answered most of the questions we've posted, but I'm going to guess that you want to do the method with two beams and time the difference?

    First, if you use the sharp IRs in that configuration make sure to spead them far apart since they aren't very fast (~25Hz, using 39ms update period)

    Secondly, why are you using those ADC chips? They seem rather complex for a simple use, and in any case you can use an RC time circuit (which is an ADC).

    I don't know why you would need an EEPROM. The BS2 has onboard EEPROM that you could use, but how much (and what) data do you want to store?
  • TheVigTheVig Posts: 41
    edited 2011-12-11 10:05
    Just some ideas while I drink some coffee...what about using sound. The ball hitting the alley and then the ball hitting the pins.

    There would be some variable data to average out for how far people throw the ball before it lands.

    I just wanted to put an "out-of-the-box" idea out there using different input. Of course this wouldn't work in a noisy bowling alley. You'd have to be alone.

    Perhaps putting something in the ball for an impact sensor to get the two points.

    This is just another idea, but how much could video be analyzed? Like setting up a camera a specific height and distance focused on the 1 pin. Then the ball rolling could be isolated and speed determined. I don't know where ADC would come in with video.



    -jim
  • John BoardJohn Board Posts: 371
    edited 2011-12-13 20:29
    I haven't fully read all the posts, however, I would use 2 IR sensors and then BS2 (For simplicity over the Prop). Then you would set up the code similar to this:
    ' {$STAMP BS2px}    'Your BS2 definition, mine is BS2px, yours is probably just a plain BS2
    ' {$PBASIC 2.5}
    
    
                                                'Please bare with me, I'm Australian, so all my mesurements are in Metric
    
    
    DEBUG "Bowling ball speed test v1.0",CR      'CR = Carrige Return (Go to next line)
    DEBUG "----------------------------",CR
    
    
    speed VAR Word                               'The end speed
    counter VAR Word                             'The time counter
    
    
    DIST_BETWEEN_SENSORS CON 2                     'Distance between sensors in meters.
    
    
    ir1 PIN 0                                    'Presuming that the IR sensor is on pin 0
    ir2 PIN 1                                    'Presuming that the IR sensor is on pin 1
    
    
    DO UNTIL ir1 = 1                             'Run nothing until ir0 senses something (Hopefully the ball!)
    loop
    
    
    DO UNTIL ir2 = 1                             'Count milliseconds until ir1 reads something
    counter = counter + 1
    PAUSE 1
    LOOP
    
    
    DEBUG "Millisecond speed: "+counter,Cr          'prints to the computer the ms between each reading
    
    
    speed = (counter/1000)/DIST_BETWEEN_SENSORS     'Calculates speed
    
    
    DEBUG "Meters per second: "+speed,CR            'prints to computer meters / second
    
    
    DEBUG "----------------------------"
    
    
    

    I'm not sure if this code is completely correct, I have just been programming in Python for a few hours, so I'm still trying to remember if this would work in PBASIC... but anyway, hope this helps, and feel free to ask questions!

    -John
Sign In or Register to comment.