Power Routing

Having decided whether you are using switches or relays, and the type of wire you need you can consider what the circuit diagram might look like.

If each section is either on or off, then it is simple - the switch or relay is in series with the track.

If each section can be fed from several throttles, perhaps each operator has a throttle and some sections can be fed from any of two or three operators then you need to select which throttle feeds the track.

throttle 1 -------o
throttle 2 -------o <---o
                     |    <----- track
throttle 3 -------o <---o
                --o rl1   rl2

Operating together two relays rl1 and rl2 can route one of three throttles to the track, or disconnect the track.

rl1 is a DPDT (double pole, double throw), rl2 needs to be only SPDT (single pole), but naturally you'll probably use a DPDT and ignore the second contacts.

Adding a QPDT relay you can extend the circuit to support 7 throttles.

A 'nice' user interface

might be for an operator console to have a button and lamp against each track he can control. Pressing the button causes his power to be fed to the specified track, and the lamp is lit. Pressing it again disconnects power and the lamp goes out. If another operator selects the same track then either he 'takes over' that track, or is refused (according to your requirements). A simple Tcc script could handle this (for a single track section, using the circuit diagram above):

Sensors:
        { the three operators 'requesting' a given track }
        button1, button2, button3
Controls:
        rl1, rl2        { the two relays }
        lamp1, lamp2, lamp3 { power indicator lamp for each operator }
Variables:
        currentOp       { 0=off, 1, 2, 3 = selected operator }
Actions:

WHEN currentOp = 0 DO rl1=0, rl2=0      { switch off when not in use }
     lamp1=0, lamp2=0, lamp3=0  
WHEN currentOp = 1 DO rl1=1, rl2=1      { route power from operator 1 }
     lamp1=1, lamp2=0, lamp3=0  
WHEN currentOp = 2 DO rl1=0, rl2=1      { route power from operator 2 }
     lamp1=0, lamp2=1, lamp3=0  
WHEN currentOp = 3 DO rl1=1, rl2=0      { route power from operator 3 }
     lamp1=0, lamp2=0, lamp3=1  
WHEN button1=1, currentOp<>1 DO currentOp=1 { operator 1 requests }
WHEN button2=1, currentOp<>2 DO currentOp=2 { operator 2 requests }
WHEN button3=1, currentOp<>3 DO currentOp=3 { operator 3 requests }
WHEN button1=1, currentOp=1
 OR  button2=1, currentOp=2
 OR  button2=1, currentOp=2 DO currentOp=0  { disconnect power }

Of course you could combine the WHEN button statements with the WHEN currentOp statements (thus halving the program), but I prefer to segregate GUI input handling (monitoring buttons), from driving the layout because it allows you to add other automatic logic later to change currentOp without worrying about what it drives. For example an automatic train routing program could decide which sections are to be controlled by which operator and then route the power automatically (if the operator was available).

Doing this type of user interface in hardware is quite possible, but it requires some logic gates. If you do it in logic it is of course harder to add an extra console later, whereas it is of course extremely easy to add one if a computer were acting as intelligent logic gates.

If the system is computer driven then the same relay diagram shown above can be used to route power from compter controlled throttles. You can route all your throttles to each section of track (for pure cab control). If you have plans for growth however that might get very difficult, so I use zone control where each throttle feeds only a few adjacent sections, and each section is fed from two or three throttles and the computer changes throttle as the train goes around the layout.

If you want to mix DC and DCC then one of the throttle inputs could of course be a DCC feed. The computer would have to be told which trains are DCC and which are DC, and then route appropriate power for each train. This sort of control would be no harder than the zone control that I do, or regular cab control. The only difference is that all DCC trains can share the same throttle feed to the relays. Ideally it would be possible to automatically detect whether a loco is DC or DCC, but I don't know of a method to do that.