ElectricImages.co.nz

Scalextric Digital Control

Modified: 26 Aug 2009 21:03 by Ian - Categorized as: Scalextric Digital
ImageIf you just want to build your own powerbase, go to Build a Digital Powerbase page

Table of Contents [Hide/Show]


   Overview
      Track Signal
   Signal Encoding
      Packet Encoding
      Packet Data
         Packet Command
         Packet Checksum
         Car Data
   Data Output
      Usual State
      Programming State


Edit

Overview

The powerbase provides both power and digital commands to the cars via the track. The power sent to the track is not like the older analogue systems, in that it is no longer DC (‘direct current’) but now a type of AC (‘alternating current’). What happens with SSD digital is that the AC signal on the track actually carries the digital commands from the throttle to the car.

Edit

Track Signal

The signal sent to the track is balanced and in anti-phase – in other words, when one rail is at 0v, the other is at about 12v – and vice versa. By switching the rails, the digital command can be sent to the car, while power can be constantly supplied for the motor. The chip within the car decodes the signal and (using a simple bridge rectifier) provides power to the motor.

Edit

Signal Encoding

If we look at just half of the signal on the track we will see that it’s sending a signal which is very similar to that used within the model train industry – Digital Command Control, ‘DCC’.

This signal uses a bit time multiple to distinguish between a one bit (nominal cycle time of 116 μS) and a zero bit that is twice that (nominal cycle time of 232 μS). However, whereas the DCC protocol refers to ‘bit stretching’ there is no evidence that the SSD powerbases perform this.

Edit

Packet Encoding

The packet structure follows the basic DCC protocol – that is lead-in, data bytes, terminator. There are always exactly 8 data bytes (inc the packet checksum)

BitsFunction
10 or more '1' bitspacket lead-in
9 bitslead bit always '0', 8 bits for packet command
9 bitslead bit always '0', 8 bits for car 1 data
9 bitslead bit always '0', 8 bits for car 2 data
9 bitslead bit always '0', 8 bits for car 3 data
9 bitslead bit always '0', 8 bits for car 4 data
9 bitslead bit always '0', 8 bits for car 5 data
9 bitslead bit always '0', 8 bits for car 6 data
9 bitslead bit always '0', 8 bits for packet checksum
1 or more '1' bitsend of packet indicator

The packet end mark can be immediately followed by the packet lead-in of the packet following.

Data bytes are always sent with Most Significant Bit (MSB) first (directly after the '0' marker bit) through to the Least Significant Bit (LSB) which is sent last.

A packet will have a minimum (nominal) duration of 10.7 mS, while the longest duration will be 18.1 mS. This provides a packet refresh time of between 93 and 55 packets per second.

Edit

Packet Data

Packet Command

The packet command byte will be one of the following values
0Reset packet – all car values will be set to a car ID
1Program packet – set the ID of car(s) on the track
2Speed packet – individual car throttle values

Packet Checksum

The checksum is created as a bitwise Exclusive-Or of all prior 7 data bytes in the packet, with an initial value of $ff.

Car Data

The car throttle values are broken down into the following format
MSbit1 bitBrakes on
1 bitLane Change selected
6 bitsSpeed: $3f maximum, $00 power off

Edit

Data Output

The powerbase sits in one of two states - Race control, the usual state; or Programming, to set the car IDs.

Edit

Usual State

The powerbase is normally sending out Speed packets. The base reads the values of each speed controller, converts the throttle, brake and lane-change buttons into suitable codes and bundles it into a type 2 - Speed Packet.

When a throttle is unplugged, or a 4-way powerbase is being used, the empty slots are filled with zero bytes (this is not the optimum value - a value of $ff is better, as it takes less time to transmit, allowing more packets per second.)

Edit

Programming State

When a car is being programmed - by holding down the relevant button on the 4-car powerbase, or by selecting the option on the 6-car powerbase - the system sends out a specific reprogramming sequence. This 3 packet sequence commands the car(s) to set their internal ID to the value sent.

The car IDs are always 1 based - therefore valid ID values are 1..6

  1. Send one or more Speed packet(s) with all cars set to stopped with brakes on
  2. Send a Reset packet with all car slots set to the desired new car ID
  3. Send a Program packet with all car slots set to the desired new car ID
  4. Send one or more Reset packet(s) with all car slots set to the desired new car ID

Car ID programming is complete.

Ian Harding, Christchurch, New Zealand
"Patriotism is often an arbitrary veneration of real estate above principles." - George Jean Nathan