Train Control System

Published by theRod on Friday, August 22, 2008

piroen_treni.jpeg

I have been working for some time at a model train layout with a couple friends (see Piroen Model Layout). This layout is a fairly simple “8” style track plan with two stations, the upper one a “real” station and a lower one hidden.

piroen.jpg

We decided to make the hidden station fully automatic so trains could go on the lower level and stop there, automagically starting a new one from the other track. Quite a traditional operational model.

Generally the train position in the track is sensed measuring the current flowing through the locomotive’s motor while on the track. So you generally make short sections of track and when the loco reaches that section, it’s presence there can me sensed. The problem with this method is that only the loco is sensed (and perhaps coaches with internal lights or other electronics), so if you have very long trains a method to see if the whole train has passed totally in a certain point of the layout is useful.

The method we used is quite similar to the one used on real railroads: we count the axes of all the train in two different points, and when the count is equal it means the whole train has passed. In the prototipe this is accomplished by “pedals” who are activated by the train’s axes. Since H0 scale is small making such a mechanical pedal is difficult, and we decided to use an infrared LED and a photodiode: when the train passes every wheel interrupts the light and it gets counted.

The actual counting is done by a PIC micro, buffered by a couple of schmitt triggers. The various control signals (train start stop, turnout activation) are actuated all electronically. A nice LCD displays what is happening and a board selects if automatic or manual (via a control panel) is needed.

Index