Menu

Searchlight_Panel

TwinDad
Attachments
SLP_CoreBoard.png (25515 bytes)
SLP_InputBoard.png (33925 bytes)
SLP_OutputBoard.png (29061 bytes)
Sl_panel1.png (42847 bytes)
There is a newer version of this page. You can find it here.

Searchlight panel is a custom turnout control panel for a friend's layout.

Features

  • Remote, wall-mounted LED display
  • Support at least 32 turnouts or crossovers
  • Minimize cabling
  • CDU output drive for dual-coil solenoid switch machines
  • Expandability to larger layouts.

Discussion

Building a control panel for a large layout requires a lot of wiring. Each remotely controlled turnout requires at least 2 or 3 wires, plus wiring for the LED indicators. This rapidly multiplies into a "rats nest" for even moderately large layouts. My friend's layout has 27 individual turnouts and 4 crossovers, totalling 31 control points. Handling all 31 control points with a single CDU and a set of SPDT switches (using a common return bus wire) will require some 62 wires be run from the panel to the layout.

As an additional feature, my friend wants a wall-mounted LED track schematic display. This will require an additional 62 wires (or more) be run from the control panel to the display panel, if all is done the "simple" way.

There are probably more efficient ways of handling this, in terms of the wiring.

My solution is to introduce a microcontroller into the mix. The micro will use an addressing scheme and a time-multiplexed signal bus (or a set of them, really) to cut down the wiring being passed around. A second simple microcontroller in the display panel will manage the LED display.

The turnouts will be directly driven by small driver cards that handle eight turnouts each. Each card will have an assigned address, and will share an 8-bit control bus back to the micro. The driver cards could each contain their own local CDU (and I may design the board that way), but there will also be provision for a single master CDU for all the turnouts.

The control panel switches will be wired via a bus as inputs to the micro in groups of 8. The micro will poll each group of 8 switches in round-robin fashion to check the position of each switch. When a change in switch position is detected, the micro will address the correct driver card and turnout. This will trigger a FET switch that will direct the CDU output to the correct turnout. At the same time, the micro will send a message to the LED display controller to update the display.

At boot time, it is possible that someone may have manually changed a turnout position. To account for this, the display controller will keep track of which turnouts have been moved since the last time it was powered on. At boot time, for each turnout, it will either light both LEDs or neither, to indicate that the turnout position is unknown. Each time it receives a "turnout change message", it will update its status and light the correct LED for the turnout position. In this fashion the user will be warned of the unknown state at boot, and this will be automatically updated as operations progress.

Note that this is not foolproof. The system still cannot detect if someone manually changes a turnout while the system is active. This issue will have to be addressed in the operating rules for the layout, as without some form of feedback from the turnouts (which is not available at this time), run-time manual turnout moves cannot be detected.

Block Diagram

  • Blue = Switch input bus
  • Red = Output control bus
  • Turquoise = LED panel interface

none|600px

Bus Definitions

Here are proposed definitions for the various buses in the system

Cabling Standards

All defined bus cables are multi-wire flat ribbon cable with IDC headers. Standard spec is 24ga. but larger wire is allowable. Cable connectors are 0.10" dual row IDC female, mating to matching pin-headers on the boards.

Switch input bus

The switch input bus is a 16-pin ribbon cable that connects all of the switch input boards in parallel to the microcontroller. Each switch input board provides 8 inputs, and has a unique bus address (set by DIP switches on the board). The bus is an 8-bit data, 4-bit address bus allowing up to 16 boards, or 128 switches.

The bus is clocked, and operates in a simple master-slave relationship. The processor (master) sets the address and R/W bits, and pulses the CLK. At the CLK high, the input board either latches the value on the DATA lines (R/W == W) or drives the value of its input pins onto the DATA lines (R/W == R). When CLK falls, the input board reverts the DATA lines to a tri-state condition.

Pin Description

1
+5V

2
DATA_0

3
DATA_1

4
DATA_2

5
DATA_3

6
DATA_4

7
DATA_5

8
DATA_6

9
DATA_7

10
Addr 0

11
Addr 1

12
Addr 2

13
Addr 3

14
CLK

15
R/W

16
GND

Logic HIGH indicates diverging route (switch is thrown), LOW indicates main line route (switch is closed).

Output Control Bus

This bus runs from the microcontroller to the output modules. Each output module has an assigned address, and responds only if the address lines match its address. This bus is clocked. Changes are only made on the rising edge of the CLK line (which is really a latch enable).

The bus transaction appears as follows:

  1. Processor places Output Module address on BD_ADDR
  2. Processor places TO Number (encoded) on OP_ADDR
  3. Processor pulses CLK high.
  4. Output Module connects CDU to the selected switch output
  5. CDU pulse completes
  6. Output Module disconnects all switch outputs from the CDU

When CLK is driven high, the CDU output is routed to the appropriate turnout output. When CLK goes low, all outputs are disconnected from the CDU.

A "digital safe" version of the CDU pulse is returned to the processor via the CDU_FB pin, for timing. The processor will not issue another pulse until a specified recharge time after the previous pulse.

Alt: A "digital safe" version of the CDU pulse is routed as an input to the module logic, and the outputs are not disconnected until the pulse itself is finished. This makes the clock rising-edge-only.

Pin Description

1
+5V

2
CDU_POS

3
CDU_GND

4
OP_ADDR_0

5
OP_ADDR_1

6
OP_ADDR_2

7
BD_ADDR_0

8
BD_ADDR_1

9
BD_ADDR_2

10
BD_ADDR_3

11
Reserved

12
TO_POS

13
CLK

14
CDU_FB

15
GND

16
GND

BD_ADDR selects an output module from among all the modules on the bus. OP_ADDR selects one of the 8 outputs on the selected module. TO_POS contains the new turnout position for that specific output. CLK triggers the output change event, and CDU_POS/CDU_GND carries the CDU pulse. There is no memory on the output module.

LED Display Interface

The remote LED display board contains its own small microcontroller. This allows us to use a simple serial interface between the boards. Because of the possibly long cable routing, RS-232 +/-12V signaling will be used. We will evaluate whether a different, simpler interface could be used, since it is desirable to provide a LocoNet interface, and multiple UART microcontrollers are hard to find these days. Other options are SPI, I2C or CAN bus, or a simple clocked serial interface.

Pin Description

1
+5V

2
MC_TxD

3
MC_RxD

4
GND

MC_TxD and MC_RxD are defined from the perspective of the primary microcontroller. That is, the LED controller transmits on RxD and receives on TxD. This convention is indicated by the "MC_" prefix. +5V is supplied by the primary controller, and is optional. The LED controller need not use it.

Input Module Definition

The Input module provides the interface between the control panel switches and the main processor. Optionally, it will provide direct local LED feedback of the switch state.

Block Diagram

none | 100px

Functional Description

Blah

Output Module Definition

Block Diagram

none | 100px

Functional Description


MongoDB Logo MongoDB