Saturday, February 09, 2013

Block detection and automatic protection of trains

JMRI comes with a sophisticated signal system, including fully customizable logic. However, most of my panel work started before signal masts were available in JMRI. The simplified ABS (Automatic Block Signaling) used in JMRI also bugged me, since it left signals showing green if the following block is empty, while prototype practice in Germany is to default to Red (Hp0), and set the signal to green only in advance of an approaching train. I also wanted to combine setting routes and signals in my panels. Hence, I created my own signal logic using JMRI logix.

Today I finished block detection for the layout, which opens up resetting signals to Hp0 as a train passes through. I integrated this into my logics by simply adding another rule that triggers on the block detector at an interlocking, and invalidate all routes leading into this interlocking, which as a side-effect sets the signals guarding this interlocking to Hp0. As it turns out this was quite easy to integrate.

The video demonstrates how it all works.

We're following a Schienenbus from Prechtal (staging) to Emsingen, and Talheim, and off to Freiburg (staging). I tried to capture how the physical control panels are used, and especially how signals reset as the train passes through.
 

I'm using a Viessmann 5217 decoder for the area around Talheim, connected to the Intellibox via the S88 bus. On the upper level around Emsingen I use an Uhlenbrock 63350 decoder that communicates via LocoNet. Both units work well and detect both trains and cars reliably. In order to get a stable read it's important to enable the debounce settings in JMRI. I'm using a short enable and a long disable (200ms / 3000ms) in order to quickly detect when a train enters a block, but keep the block occupied for some time to facilitate JMRI's train tracking logic.

The LocoNet bus voltage used by the Intellibox is a bit unusual, so it's important to use only LocoNet devices with the Intellibox that are explicitly rated to be compatible.

No comments: