Sunday, October 02, 2011

Interlocking now working in Talheim

I finally completed the interlocking in Talheim, including working semaphore signals.

Here's a rough overview of how I implemented it with Logix in JMRI.

1) The panel: I built an actual panel with push buttons. All approach tracks as well as the station tracks in Talheim have a button. A route is requested by first pressing the origin, then the destination push button. The panel is built using a Team Digital SRC16 and connected to LocoNet.

2) Button state: When a push button is pressed, it causes a Loconet Sensor (LS) message and a respective Internal Sensor (IS) in JMRI is set to active, as well as a IS for "button pressed".

3) Route Selection: When the second button is pressed, the IS of the first button, the "button pressed" IS, and the LS of the button just pressed, uniquely identify the route being requested. For each route I wrote a Logix with the precondition of the respective sensor combinations. In the action part of the Logix, I trigger a JMRI route to line the switches, reset the "button pressed" IS, and set the interlocking internal sensors.

4) Interlocking: Each route through Talheim potentially conflicts with another route. There is an Internal Sensor for each valid route. When the respective Logix for a route is triggered, it sets the Internal Sensor for this route to active, and all conflicting routes to inactive.

5) Route Execution: The JMRI routes selected in 3) trigger the switch machines and line the switches. When the route is set, an Internal Sensor becomes active that indicates the route is set.

6) Signals: Each valid route has associated signals. When both the IS for the route is active, as well as the JMRI route sensor is active, the signal allowing a train to enter that route is set to Green. Since the interlocking sets routes to inactive, another Logix rule triggers on the IS of a route becoming inactive, and sets the signal to red.


The logic works very well, and since the flow always originates with the panel and goes "downhill" from there, I don't think there are loops or races in the logic.

I have not yet implemented setting the signals to Red once a train passes, since I don't have the respective track sections wired up.

No comments: