Shop OBEX P1 Docs P2 Docs Learn Events
Speedtrap project...need some help — Parallax Forums

Speedtrap project...need some help

moo2moo2 Posts: 17
edited 2007-08-31 18:09 in BASIC Stamp
For those of you who responded to my CMUCam post, thanks.· I'm not going to pursue it due to the complexity and cost involved though, considering there's still quite a bit of uncertainty involved.

Anyway, my next project is for the velodrome as well.
What I need to do is time riders on a 200M course on the velodrone.· I'd like to use electric eyes connected to the stamp.· When the rider breaks the "start" beam, the timer is started, and when he breaks the "finish" beam, the timer is stopped.· The time is then displayed.· So far I think I can handle this.· For the hardware gurus, I was wondering if it's feasible to locate the stamp at the finish line, and connect the "start" beam with about 100 feet of wire.· Would having 100' of wire skew the timing results at all?· Even though the stamp is going to be located at the finish line, should·I also connect the "finish" beam with an equal length of wire to approximately duplicate any wire resistance that exists in the "start" beam?· I know·this could be done wirelessly, but·I need to keep costs down.

The second phase of the project would add 2 more electric eyes to create 2 "speedtraps".· The first one would be placed exactly 1 meter beyond the "start" beam, and the second one would be placed exactly 1 meter before the "finish" beam.· By using 2 sets of beams,·I should be able to measure the rider's starting and finishing speed, as well as·his elapsed time.

I think I've worked out the math that will give reasonable results on a Basic Stamp.· I hope you math gurus can point out any mistakes I've made:

T = time in ms for rider to travel 1 meter
VM = 1000000 / T· (This should give meters per second, "shifted" for use without floating point math)
MPH = (3600000 * VM) / 1609344 (3600000 is the number of seconds in an hour, "shifted".· 1609344 is the number of meters in a mile, again the number is "shifted".)

For example, the rider crosses the speedtrap in 60ms.
With normal math, I can calculate like this:
T = 60ms
VM = 16.666 (1000ms / 60ms)
MPH = (3600 * 16.666) / 1609.344 = 37.28
MPH = 37.28

With the Basic Stamp's math,·I calculate like this:
T = 60ms
VM = 16666
MPH = (3600000 * 1666) / 1609344 = 3726
MPH = 37.26 (I will add the decimal place manually)

I've tried several examples, and it seems to work, but I'm worse with math than I am with hardware, so I may have made some mistakes.

Comments

  • cyplesmacyplesma Posts: 76
    edited 2007-08-29 00:31
    I guess what I'd be concerned with first off is how does the finish line sensor know which rider is crossing when and how does it know if a second rider is only 3 inches behind the first. The first breaks the line but the second crosses before the first ends, does the sensor "See" this type of change?

    If your sensor looked down at the riders instead of sideways and your light curtain worked in cells (bike width, triggered by the light trigged first then being the center of the cell) You could get away with catching who crossed first, second and so on no matter how close the race is.

    At this point you just need to know which rider is which as they cross the line.

    setting the speed traps at start if they start staggered shouldn't be too big of a hassle using side triggers. End speed traps would need to work like the finish line and you would need to know where the rider is at the finish line (if they changed lanes).

    otherwise they need some type of xmitter (ir, am,fm,whatever) to be used as an identifier. (There's always RFID, kind of a tight industry though, you may have to hire an RFID expert).

    Post Edited (cyplesma) : 8/29/2007 12:45:03 AM GMT
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-08-29 11:14
    Simplifying the math

    MPH=2237/T 'whole number

    MPHDec=2237//T*100/T 'decimal portion (mantissa)

    DEBUG DEC MPH,".",DEC2 MPHDec,CR 'output


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR

    Post Edited (TechnoRobbo) : 8/30/2007 1:39:12 AM GMT
  • moo2moo2 Posts: 17
    edited 2007-08-29 13:52
    cyplesma said...
    I guess what I'd be concerned with first off is how does the finish line sensor know which rider is crossing when and how does it know if a second rider is only 3 inches behind the first. The first breaks the line but the second crosses before the first ends, does the sensor "See" this type of change?
    This is not a factor. I'm timing 200M (and other distance) time trials. There will only be one rider on the track at any given time. Sorry, I should have mentioned this in my original post.
  • moo2moo2 Posts: 17
    edited 2007-08-29 15:24
    TechnoRobbo thanks for the simplified math. It works perfectly!

    Can anyone comment on the wire length for the electric eyes?
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-08-29 20:54
    Yes. 100' of wire will have quite a bit of capacitance associated with it, which will tend to 'round-over' any 0 to 5 volt 'TTL' signal.

    One solution to this would be to use an RS423 driver, along with a shielded twisted-pair cable, to an RS423 reciever at the BS2. The RS-423 driver has the current drive, and impedance matching, to send a nice sharp square wave 4,000 feet. So 100 feet should work great. You'll need to send power down the cable to the 'satellite module' which holds the RS423 driver and the 'beam-breaker' module. Probably Cat-5 cable would work well for both power and signal for this.
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-08-30 01:39
    I had accidentally omitted the DEC2 for the Decimal portion but you probably figured that out already:

    DEBUG DEC MPH,".",DEC2 MPHDec,CR 'output

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR
  • InteractInteract Posts: 79
    edited 2007-08-30 16:07
    Ok I've done this before. The beam won't work on the Velodrome I'm Guessing your not at the Indoor velodrome since they have a system so, daytime outdoor IR is not too useful since your beam needs to be at least 15 feet long. OK do it at night. Problem two, Bikes are too fast and the wheels too small for a IR beam over that distance for any kind of reliability. If you could get the beam narrow enough for the 15 foot gap then. when it didn't trigger on the front wheel it may trigger on the riders foot or back wheel etc, you would never know but have a faster 200 time. A laser would work if the sample rate was fast enough. Do the calculations on the 1" tire going 35 mph and see how long it's in the beam. The "real deal" uses a pressure sensor strip taped to the track. Most tracks I race on around the world have a short strip at the 200 and pursuit lines and a full-length strip at the finish.
  • PJMontyPJMonty Posts: 983
    edited 2007-08-30 16:36
    Don't try and use plain IR in the daytime. Use a low power laser instead, and shield the receiver by sticking it down a narrow black tube about 6 inches long. The inside of the tube should be non-reflective. This should work fine even in sunlight.

    Thanks,
    PeterM
  • FerretMK4FerretMK4 Posts: 11
    edited 2007-08-30 21:20
    In drag racing they place the "lights" near the track so the beam is blocked by the bottom of the wheel; this gives several inches of dark as the wheel passes. It also avoids the bodywork, but that's not the prime reason. For them this is also important during the staging for a start because they can't place the car exactly. Timing begins when the wheel leaves and the light is sensed and the run ends when the beam at the other end is broken.
    In any digital capture of events like this, the resolution of time is at best the length of one data sample;·the start sample occurs some time after the rider passes and you count sample intervals until the rider passes the finish: you get an even number of sample intervals. You don't know when within that sample time the event actually occurred... could have been the beginning of one and the end of the other.
    You don't have to worry about response time of the sensor if it's the same for starting and ending a lap: equal length wires, the same sensors, etc. You can use various means to make sure the analog signal lasts long enough to be detected, and you need to know how long the A/D is actually reacting to the input signal. You may sample at 1 kHz but be using an A/D that gets its value in 10 microseconds... it will miss any event during the 1000 microsecond sample window that doesn't occur while it's on. Your event has to be seen for the full sample period to be sure that the A/D picks it up.
    AP

    Post Edited (FerretMK4) : 8/30/2007 9:51:19 PM GMT
  • moo2moo2 Posts: 17
    edited 2007-08-31 01:12
    Thanks for all the great replies.· I really appreciate it.· Also, it's nice to meet someone else who's into both basic stamps and track racing!· I'm always trying to find ways to combine the two of them.

    Anyway, it is an outdoor track.· While most of the racing is at night, the system will need to be flexible enough to use in a day or night situation.· I think to start with I will ditch the electric eye system in favor of the force sensing tape method shown above.· It seems more reliable and easier to implement.

    Once I work out the other kinks in the system (and I'm sure there will be some), I'll think about upgrading to a laser type trap.

    Thanks again for all the suggestions everyone.· I'm sure I'll need your help in the future!
  • InteractInteract Posts: 79
    edited 2007-08-31 17:14
    Hey I don't know what track your at, but think about this..
    If you use the tape it is the same method used by ALL the world class velodromes. you can leave the tape on the track all-year and setting up will be just hooking up the wires in the infield, or if your lucky not to have people jumping the fence to goof on the track you could leave the wires.
    The laser would be subject to an extensive set-up tear-down, and spectators feet kicking the laser and guys riding (or crashing) into the sensor. The sensor would have to be right at the black line do to the apron being level and the 200 line at 30-40 deg. you would have to re-align that thing all the time and it would be dangerous for the rider if he hit it and flatted.
    Where is your home velodrome?
  • InteractInteract Posts: 79
    edited 2007-08-31 17:20
    PS at world championships I once did have the tape fail to pick up one of my qualifiers. If you happen to be yanking on your bars at the same time you cross the tape, it can miss you since there is no weight on the wheel. Of course your rear wheel will trigger it giving a false reading. I wasn't sure how they knew that happend, but my guess is that the timer has an audio cue to when the sensor strip is hit and can see if it was when the front wheel crossed.
  • moo2moo2 Posts: 17
    edited 2007-08-31 17:24
    Interact...Thanks for the great info. The more·I think about it, the more I think the tape is the correct solution.

    I'm at Brian Piccolo Velodrome in FL. It's an outdoor 333 with 28 degree banks.

    Do you (or anyone) have a source for this tape? As far as I can tell, what·I need is called "Ribbon Switch", but I can only find one company (TapeSwitch) that makes it. It's also rediculously expensive. A 50 foot roll costs about $473 - $618. At that price, I will not be able to do this project. I must be looking at the wrong stuff. I need about 120 feet to make 4 sensors (start and finish lines, incorporating 2 speedtraps). The switch doesn't need to activate with just a few oz of weight. The weight can certainly be about 7-10 lbs if that makes it cheaper.
  • InteractInteract Posts: 79
    edited 2007-08-31 18:09
    Yes, well, that looks like the stuff. Not too surprized at the price seems resonable.
    If you only want 200 times and a speed trap why not tape 3 feet at the bottom? that is how all the 200 lines are done. most finish lines are full length but you don't need it if you are only doing TT's and not the last 200 of a match sprint where guys are all over the track.
Sign In or Register to comment.