This section of the documentation describes each major design element and its significant segments. The intent is to have all the design objectives, considerations and implementation in one place. Where useful links to other relevant sections of the documentation are included. This should avoid saying the same thing twice or presenting conflicting information.

The problem, control trains running around a track, is a process control problem which needs to control some things and receive information about changes in the state of the system. i.e. where the trains are and whether the switches are cleared or thrown. This has resulted in 18 things to control and 60 sensors to monitor. Adding the "may have" signals there are an additional 60 semaphore signals and 4 tri-color signals to control. See Interface Analysis for more details.

In addition there are two "because I can" functions:

  1. Monitor the traffic between the 4 processors; commands from the Laptop (4) and status returned to the Laptop.
  2. Suggest randomly assigned paths for each train and witch train to run. For reference display on the layout the assigned paths for each run of TrainThing.

In the following outline of this section the numbers refer to the numbers given to major elements in the Design section above.

  • 1. Layout
    • Track
    • Two isolated track blocks
    • Power distribution
    • Switches 
    • IR sensor
    • Signals
  • 2. Arduino
    • DCC++ Base Station Software
    • IR sensor monitor
    • Reversing relay control
  • 3. Raspberry Pi 4
    • Signal management between Raspberry Pi 3 (3A) and Arduino (2)
    • Process Signal control commands from the Lap Top (4) & return status
    • Control the 60 semaphore servos/signals
    • Control the 4 tri-color LED signals
    • Display all signal aspects on two Unicorn HAT HD LED arrays
    • Control Raspberry Pi 4 Fan custom board
    • Display Fan status on Unicorn HAT.
    • Traffic Monitor LEDs: to/from Arduino and to/from Raspberry Pi 3 onto Laptop
  • 3A. Raspberry Pi 3
    • Signal management between Lap Top (4) and Raspberry Pi 4 (3)
    • Process switch status commands from the Lap Top (4) and return status
    • Monitor/Report status of the switches on the Layout (1) 
    • Delay reporting status to mirror transit time of switches.
    • Traffic monitor LEDs: to/from Laptop 
    • Randomize Route Selection
  • 4. Laptop
    • Configure TrainThing Hardware
      • Configure Wabbits that control switches, part of the layout (1)
      • Configure Arduino (2)
        • IR Sensor Inputs
        • Relay Control Outputs
        • Train Addressing
      • Configure Raspberry Pi 4 (3)
        • Semaphore signal to Servo address
        • Semaphore signal aspect to servo angle
        • semaphore signal to Unicorn X,Y coordinates
      • Configure Raspberry Pi 3 (3A)
        • Associate sensor ID with Raspberry Pi GPIO pin
    • GUI to setup TrainThing run
      • Configure Graphic display
      • Assign routes to trains
    • Graphic display of TrainThing Status
    • Run TrainThing
    • GUI to end TrainThing run