PiGraham
Posts: 3935
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Scalextric digital lap counter/timer

Tue Dec 30, 2014 9:16 am

P_Monty wrote:PiGraham, at 2200 packets per second, isn't that one per 450 microseconds, not milliseconds? If so (and as I'm currently full of snot due to a rotten cold my brain may not be working properly) then quite a few packets could be received...
Yes 454 us. Mea culpa.

On my assumed ~300ms there could be some 600 ID transmissions as a fast car passes the sensor. That makes sense now. Thanks

User avatar
aTao
Posts: 1093
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: Scalextric digital lap counter/timer

Tue Dec 30, 2014 9:26 am

I'm real not to sure about the 2,200 packets per second. I will need to see the Scalextrc (Hornb) specification. The people on the web site above dont seem to be top rate digital engineers.
AFAIK
The packet length (therfore the packet frequency) depends on the car ID (ID range = 1..6)
There is 1 start bit, 2 padding, then 1 bit per car#
Padding bits and car ID bits are opposite phase of start bit
If start bit = 0 then lane change is requested
If start bit = 1 then no lane change.
bit length seems to be 48uS
so 192uS <= packet time <= 432uS
2.3kHz <= packet frequency <= 5.2kHz

Again I think I would prefer to get the info from the horse's mouth since information so far is conflicting (mix ups between fixed mark/space ratio vs fixed start bit length vs fixed frequency)
>)))'><'(((<

PiGraham
Posts: 3935
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Scalextric digital lap counter/timer

Tue Dec 30, 2014 9:37 am

aTao,

Indeed, the only reference I have is that website and I have no way to verify the information they provide.

They show timing diagrams for ID 1 to 5 and that does suggest that low value ID may repeat more quickly than high value ID.
Image

OTOH it seems reasonable to use a fixed rate for all IDs and the diagrams may be wrong.

The lane change seems to be a complete inversion of the signal.

Image
Car with ID #3 signal - without Lane Change
Image
Car with ID #3 signalling lane change
Last edited by PiGraham on Tue Dec 30, 2014 9:39 am, edited 1 time in total.

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: Scalextric digital lap counter/timer

Tue Dec 30, 2014 9:39 am

iambenb wrote:I'd probably set it up so that the start line was directly after a corner, so the cars would not be going at full speed.
Just a note: I've heard it said that the timers and lane changers don't always register well there - because the tail might swing out a little after the bend. No idea if it's a myth or not...

Also the "All New Really Useful Technical Links" sticky on the slotforum site I linked above seems to have a lot of stuff... too much really.

One of the many projects I had in mind (but have not even started yet :( ) was to build a raspi onto a (slow moving) chassis so it can be driven around, perhaps using several controllers to do extra functions. Should be just enough track power on the standard digital sets...

PiGraham
Posts: 3935
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Scalextric digital lap counter/timer

Tue Dec 30, 2014 9:42 am

Ravenous wrote:
iambenb wrote:I'd probably set it up so that the start line was directly after a corner, so the cars would not be going at full speed.
Just a note: I've heard it said that the timers and lane changers don't always register well there - because the tail might swing out a little after the bend. No idea if it's a myth or not...

Also the "All New Really Useful Technical Links" sticky on the slotforum site I linked above seems to have a lot of stuff... too much really.

One of the many projects I had in mind (but have not even started yet :( ) was to build a raspi onto a (slow moving) chassis so it can be driven around, perhaps using several controllers to do extra functions. Should be just enough track power on the standard digital sets...
That sounds interesting. Are you aware of 'SSD Pro'?
http://www.electricimages.co.nz/Pro_Upgrades.ashx

What sort of extras did you have in mind that warrant a big board like a Pi?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26659
Joined: Sat Jul 30, 2011 7:41 pm

Re: Scalextric digital lap counter/timer

Tue Dec 30, 2014 9:50 am

aTao wrote:I'm real not to sure about the 2,200 packets per second. I will need to see the Scalextrc (Hornb) specification. The people on the web site above dont seem to be top rate digital engineers.
AFAIK
The packet length (therfore the packet frequency) depends on the car ID (ID range = 1..6)
There is 1 start bit, 2 padding, then 1 bit per car#
Padding bits and car ID bits are opposite phase of start bit
If start bit = 0 then lane change is requested
If start bit = 1 then no lane change.
bit length seems to be 48uS
so 192uS <= packet time <= 432uS
2.3kHz <= packet frequency <= 5.2kHz

Again I think I would prefer to get the info from the horse's mouth since information so far is conflicting (mix ups between fixed mark/space ratio vs fixed start bit length vs fixed frequency)
Easy enough to stick a scope onto a IR sensor and see exactly what the car is transmitting...
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: Scalextric digital lap counter/timer

Tue Dec 30, 2014 9:55 am

PiGraham wrote:What sort of extras did you have in mind that warrant a big board like a Pi?
I have an occasional daydream to do a Scaley version of the various train controllers people talk about (for some reason I fancy scalextric but not trains) - just for fun. It wouldn't be a racing car - it would be too heavy (and would need to reboot if it came off the track!) - just a simple cart that trundles around and maybe has a lifting arm or alternate lighting schemes.

It could be hard coded to use several controllers (I have an old digital set with 3 controllers) - one to drive the thing, one to set the brightness of the lights or lift a little crane arm... something like that.

No purpose, it was just a random idea I had of a project for the sake of it. And by the way, this isn't really what the original poster wants as it wouldn't use the LEDs, it would just pick up the electrical signals from the track somehow.

PiGraham
Posts: 3935
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Scalextric digital lap counter/timer

Tue Dec 30, 2014 10:34 am

Controller to car comms is covered:
http://www.electricimages.co.nz/SSD_Con ... hx#tab9703
The Pro extension provides light control and a spare output.
It looks like a good system, and fits any car that can take the standard SSD board.
If I had the spare time, space and money I'd be very tempted.

iambenb
Posts: 12
Joined: Mon Dec 29, 2014 2:09 pm

Re: Scalextric digital lap counter/timer

Tue Dec 30, 2014 11:45 am

So thinking this through further, and bearing in mind that I'll want to upgrade to the ability to run 6 cars anyway at some point, I think I'll buy the 6 car powerbase, and get the output from that.

That way the car detection part is already established and robust and I can use the output from that into the pi, and write my own race management program running on the pi.

iambenb
Posts: 12
Joined: Mon Dec 29, 2014 2:09 pm

Re: Scalextric digital lap counter/timer

Fri Jan 02, 2015 6:24 pm

OK, I bought the power base that has the signal output on a (I think) RJ45 connector.
Just need to try and find out which pin it outputs on to get that signal into the pi.

I'll start off simply - just logging the car ID every time it completes a lap, and I'll work up to having a proper race management program running with driver names, lap times etc.

Return to “Automation, sensing and robotics”