H.U.D.

So a quick update… (after successfully battling a pretty sweet cold)
This last week I finally got around to repairing the damage done to the powerbase. If you missed it, we were having some power supply issues and, long story short… a car literally blew up and emitted some of that good ol’ fashioned magic electronic smoke, a somewhat frightening experience i might add. Apparently the interesting-looking slot car power supply I found in Steve’s vintage boxes of scalextric stuff wasn’t rated properly for our track (even though it was labeled so) and ended up doing some damage. Fortunately, it wasn’t anything more serious than a trip to radio shack and plugging in the soldering iron.

I’ve been working a lot on reviewing the code I wrote back in July and trying to get a hold on everything again. After a lot of thinking I’m pretty sure that the fixes I have made to the framework (Data retrieval and basic car variables) will be a hell of a lot more stable than it was in the past. I wanted to be sure of this because if something isn’t working right at this fundamental level, it could throw off everything I do from now on. I also came up with a new model for the entire system that I think will work quite well, utilizing a Server / Client relationship. The PowerBase is connected straight to a networked “server” that can feed as many client computers / monitors / projections as needed. Here’s a quick illustration:

The current run-down:
-Repaired PowerBase (New Resistor for Lap Sensor)
-Reworked Data Retrieval Algorithm to be more stable
-Data processing now runs on its own Thread:
  +Sends raw data to network clients over OSC
-Reworked car code to make use of all possible variables
-Working on rough HUD and text output for car variables
-Experimented briefly with race “recording”

Currently have access to:
+Reliable throttle (raw, smooth, and normalized versions)
+Both Lane and Brake buttons functional
  (No longer interfere with throttle numbers)
+PowerBase & Processing estimated Lap Times (Previous & Current)
+Reliable Lap Counting
+Approximated instantaneous and average speed (1:1 or 1:32 scale)
  (Likely needs tweaking)

TODO:
-Running Average Lap Time
-Running Average Speed
-Fastest Speed
-Fastest Lap

Will post some pics of the HUD output as it develops.

Sketches: Experiments

Here are some screenshots of ongoing sketches / concepts for visualizing data off of the track.

The first concept was to mimic the relationship of the car’s relative position on the track (in this case by drawing a continuous oval/spiral) and tie that in with the car’s current throttle. In this way we can get a sort of “histogram” of the entire race.

Oval concept using random data:

Using throttle input (changing colors per lap)

I tried something a bit different using strips of color, almost like a line graph. In this way it might be easier to visually distinguish a faster laptime based on the length of the color strip:






Video: Data Retrieval

*UPDATED*

Data Time.

After being sick for no explainable reason, I finally got around to posting some pictures of the progress I’ve made in getting information from the powerbase.

Testing Area, and pretty much the smallest track circuit you can set up with this kit

Testing Area, and pretty much the smallest track circuit you can set up with this kit

I set up a testing area in my room so that I could run some cars and still be close to my desk. A piece of plywood is pretty high-tech, I know..

PowerBase is powered-up and ready to unleash its magic

PowerBase is powered-up and ready to unleash its magic

I found a power supply in my basement that works great for the time being. The Aux Port is really just a typical phone jack outlet, so I wired a phone cable up to this:

Don\'t mind the shoddy looking tape... It\'s a Prototype!

Don't mind the shoddy looking tape... It's a Prototype!

Underneath the electric tape is a small fuse which should prevent me from blowing up our precious powerbase if there is any accidental mishaps/crossed wires. This is a 9-pin serial adapter that is typically found on PC’s. However, Mac computers don’t have these kind of connections (only USB/Firewire) and need this Serial-USB adapter:

This plugs into laptop USB port

This plugs into laptop USB port


I got this a while back from Amazon, and it works great!

Basic sketch that retrieves and plots data in real-time.

Basic sketch that retrieves and plots data in real-time.


I wrote a quick sketch that plots the data coming from the powerbase. This shows the input from the hand throttle and you can also see the strings of numbers on the bottom which is the data in its raw form. Now just have to figure out the interesting things we can do with this data!

Computer Controlled Slot Cars Anyone?

Computer Controlled Slot Cars Anyone?


I also finally received some electronic samples I ordered a while back. The black chip is called a “digital potentiometer” and acts as a digital version of a hand throttle. I hooked this up on a Basic Stamp II Development board I had lying around (Similar to Arduino). It receives data from processing and sends a signal through the plug I’ve wired up. Sweet.

Also got the beginnings of a network/internet controlled car basically running (still buggy). Things are finally moving along!

Good News

Lets talk about some good news…

Today, I continued some work on the simulation sketch. Currently it simulates four “cars” (rectangles) that have specific attributes (location, speed, laps remaining, race standing.. etc). The rectangle travels across the screen, simulating a lap completion when it reaches the far edge, and then cycling back to the beginning again. These “cars” are fed their speed data via an on-screen slider control. This allows you to modify the speed of the car in real-time much like what the physical hand throttle does on the track. The next thing to do on this is figure out issues such as lap timing and race standing, as well as a simple way to interface this sketch with others that will use the data.

Now for the REALLY good news!…

After playing around with the physical track & powerbase for a while, I figured it was time to get this thing to spit out some data. Although, I was missing a couple of pieces of hardware that would make the data stream more reliable (MAX233 Serial Driver), I figured “what the hell,” and attempt to see what it would give me anyways. I wired everything up… checked all connections… opened up processing… crossed my fingers… and flipped the power on.

The research on this thing finally payed off. I was seeing the numbers I needed to see. And after staring at the data for awhile, I managed to code a parser to organize the information into a usable form. A couple of hours of programming later, I now have instantaneous feedback on the hand throttle’s current position as well as a simple plot of its value over time. And I also decoded the elapsed lap time data that is triggered every time the cars pass over the finish line.

I have to admit… this is extremely cool and absolutely amazing, and only reinforces all that is nerd within me.

Pictures, Screencaps, and possibly video to follow…

It’s Here!

I was beginning to hash out some processing stuff, and then this arrives on my doorstep.

Tape + A Single Layer of Bubble Wrap = Internationally Shipped Package

Tape + A Single Layer of Bubble Wrap = Internationally Shipped Package

Needless to say, I was scared as hell at the very sight of this thing.
(please, please, please… don’t be broken…)

Exposing the Protective Layering

Exposing the Protective Layering

So Far, So Good.. And it\'s even the right one!

So Far, So Good.. And it's even the right one!

Everything looks good with the powerbase, and lets hope that everything is fine internally.

Silently preparing to unleash its glorious data.

Silently preparing to unleash its glorious data.

Pretty thankful that they included this...

Pretty thankful that they included this...

From what I can tell, this thing has an amazing amount of functionality… I really can’t believe that they stopped making these models. Instead of further developing the awesomeness that they had going for them they completely chopped these bases apart.

$%!# @#$#!!!..

$%!# @#$#!!!..

Of Course it’s always something… Although, this is something that I could have foreseen, but didn’t even cross my mind until I was staring right at the alien plug. (Yeah no matter what you do derek… that thing isn’t going into the wall socket today or any other day…)

Although this isn’t nearly as big of a problem as say… trying to find a discontinued product in the UK, it still puts a small damper in things for the time being. But I think I might have a quick solution lurking in the piles of electronics in the basement…. Otherwise I’m on a city-wide search for a 12 Volt 2.5 Amp power supply.

More news tomorrow.

So… Our First Problem.

Well, opening the box up was pretty fun for the first couple of minutes, before I immediately realized that something was askew…

I coulda sworn something important went there...

I coulda sworn something important went there...

You see… The “power base” that I have been researching which will eventually allow me to extract data has a pretty important piece of hardware that looks like this:

OH LOOK AN AUX PORT!

OH LOOK AN AUX PORT!

Pretty LCD...

Pretty LCD...

Apparently, Scalextric decided to UPDATE their Power Base’s… and by UPDATE they really meant cut out every USEFUL piece of functionality and cut costs…(No AUX Data, No Lap Counting/Timing, No Racing Modes…Nothing) The really bad news is that they even decided to discontinue the older line of feature-packed 6-car bases, making these things extremely rare. One of the only bases I’ve found in the US is here: Part of a Digital Conversion Kit. Buying this may be our last hope.

Another idea..
Being somewhat knowledgeable in electronics, and with the OK from Steve… I cracked open the 4-Car Power Base that came in our kit.

Surgery Prep

Surgery Prep

Under the Hood

Under the Hood

Hmmmm....

Hmmmm....

Wait... This Looks Promising... not..

Wait... This Looks Promising... not..

I studied this thing into the night… the only thing that looked as though it could be hooked up for data (and something that I spent a lot of time trying to figure out) turned out to be something that almost every micro-controlled hardware has: An initial programming port… I confirmed this by looking up the spec sheet for the PIC 16F819 microprocessor that sits on this board. I also checked the rest of the pins on this but didn’t find anything very usable.

The only half-solution I see right now to get any kind of usable data (in this case only from the hand throttles) is to tap directly into the throttles themselves. The throttle lines (which are actually just analog values) could be spliced into another microcontroller (Basic Stamp 2 or Arduino) processed into digital and sent via a serial connection to processing… this is definitely the long way around.

Otherwise we should really look into acquiring an older version 6-car Power Base with built-in Aux Port ASAP.