SlotForum banner
1 - 12 of 12 Posts

·
Registered
Joined
·
34 Posts
Discussion Starter · #1 ·
I have been testing some components that I believe will work well for pit-in and pit-out sensors i would like to add to my HO slot car track. But I do have a question based on my test results. I made a "test fixture" with an overhead infrared light gantry, IR sensors (phototransistors) buried in the track, and a small section of powered track so I could run a car by the sensor at reasonably close-to-racing speed. The goal was to see the actual waveforms that would be presented to the Arduino inputs. The worst case for such a light-sensing setup to deal with is an open wheel car that has a gap between the front air dam in the front of the car and the back portion of the body -- as shown in this picture (the colored arrow points to the phototransistor):

Tire Automotive tire Motor vehicle Wheel Automotive design


The resulting oscilloscope trace of the IR detector circuit looks like this:
Black Rectangle Font Line Screenshot


You can see 2 pulses - the first pulse due to the front air dam blocking the IR light to the phototransistor, and the 2nd pulse caused by the main body of the car blocking the light. The first pulse is about 2 milliseconds long, and 2nd pulse is about 16 milliseconds long. Just to make sure there wasn't some other weirdness, I stuck black tape in the gap in the body and ran the test again:
Black Rectangle Font Line Screenshot


You can see in this case that now there is just one pulse around 22 milliseconds long.

Going back to the "2 pulse" oscilloscope picture, are there parameters in RC I can set so the software won't think that 2 events have happened, or won't think that this is an invalid event? I don't think that having to "tape up" cars would be realistic, so if RC doesn't like this input, I'll have to add some additional circuitry. Thanks in advance for any assistance.

Regards,
BBB
 

Attachments

·
Premium Member
Joined
·
200 Posts
Or, maybe something like this….

Interrupt trigger, mask interrupts, wait appropriate milliseconds to be in 2nd pulse area, check level, if ok, execute…
 

·
Registered
Joined
·
196 Posts
I have been testing some components that I believe will work well for pit-in and pit-out sensors i would like to add to my HO slot car track. But I do have a question based on my test results. I made a "test fixture" with an overhead infrared light gantry, IR sensors (phototransistors) buried in the track, and a small section of powered track so I could run a car by the sensor at reasonably close-to-racing speed. The goal was to see the actual waveforms that would be presented to the Arduino inputs. The worst case for such a light-sensing setup to deal with is an open wheel car that has a gap between the front air dam in the front of the car and the back portion of the body -- as shown in this picture (the colored arrow points to the phototransistor):

View attachment 309810

The resulting oscilloscope trace of the IR detector circuit looks like this:
View attachment 309811

You can see 2 pulses - the first pulse due to the front air dam blocking the IR light to the phototransistor, and the 2nd pulse caused by the main body of the car blocking the light. The first pulse is about 2 milliseconds long, and 2nd pulse is about 16 milliseconds long. Just to make sure there wasn't some other weirdness, I stuck black tape in the gap in the body and ran the test again:
View attachment 309813

You can see in this case that now there is just one pulse around 22 milliseconds long.

Going back to the "2 pulse" oscilloscope picture, are there parameters in RC I can set so the software won't think that 2 events have happened, or won't think that this is an invalid event? I don't think that having to "tape up" cars would be realistic, so if RC doesn't like this input, I'll have to add some additional circuitry. Thanks in advance for any assistance.

Regards,
BBB
I don't think you'll have any issues. I run all kinds if open wheel cars on my similar setup with no issues.

Also, the 4ms signal is way below RC Minimum Lap Time settings.
 

·
Premium Member
Joined
·
1,829 Posts
Odds are RC will work out of the box, but if it doesn't you have plenty of options. If you're using an arduino, setting the debounce higher is your best bet because RC won't even see the 2ms signal. If you're not using an arduino and/or that doesn't work, the min lap time will prevent double laps. You may have to disable the min lap time audio which means if a real false lap occurs (car crashing through the sensor or some such) you won't get an audio queue on it. But double laps are 100% avoidable.
 

·
Registered
Joined
·
34 Posts
Discussion Starter · #7 ·
Great, thanks for the response. I am using an Arduino. I want to use these as pit in and out sensors - do the debounce and min lap time settings apply to them as well?
 

·
Rich Dumas
Joined
·
4,123 Posts
I do not know anyone that uses an Arduino board, there is not a problem with Trackmate using sensors like you have shown. You can go into the software settings and include a minimum read time and there may be a debounce setting that can be changed as well. Another option is to put your sensors in the bottom of the slot.
 

·
Registered
Joined
·
34 Posts
Discussion Starter · #9 ·
Rich -

Thanks. On AFX HO track I’d prefer not to put the phototransistor in the bottom of the slot because there just isn’t much space. But at worst, adding a non-retriggerable one-shot to the output of each sensor would be pretty cheap and would guarantee a specific pulse width. In other words, I can fix it in hardware if it can‘t be fixed in software! :cool:

BBB
 

·
Registered
Joined
·
559 Posts
Yep i use an Arduino and RC, no problem at all, sensor debounce should sort that out in RC, assuming sensor debounce is enabled on the pit in/out pins, don't have the code handy to check.

I don't think trackmate is good advice here because I don't believe you can use trackmate for pit stops???? which is what you asked.

Hope that helped?
 

·
Premium Member
Joined
·
1,829 Posts
You can't use TM and setup a pit range but you can use TM within RC if you stop directly over the sensor.

For the arduino, the debounce setting affects all reads, that includes any sensor and the call buttons. For what you're trying to do, most likely you won't have to adjust it, but you'll have to test to know for sure.
 
1 - 12 of 12 Posts
Top