Saturday, December 28, 2013

Fully automated model train control

Santa visited our place this year as well, and brought a model railway to my son. How an earth the Santa got such a clever idea?

When watching the train running round and round the loop, I started to think about a full automatic control of model trains. Core of the problem is how to measure the exact position and speed of individual trains at any given time.

Little train engineer operating the new Christmas present and my old model train from the 80's.

When investigating the topic further, it look's like all the technology in use dates back to 80's. Digital Command and Control (DCC) is the most common digital control system of the day. DCC uses tracks to carry electrical signal, in form of pulse width modulation of alternating current provided to the locomotive. The technology makes it possible to instruct several individual trains running at the same track simultaneously. DCC is one-way only, thus control station can only instruct the locomotive - speed and direction - but does not get any feedback.

There are some hacks like Selectrix, which brings return channel, but that only enables identification of which locomotive is present at certain track section, not more. Recently, model train manufacturers have introduced entry-level battery powered train sets as well. As there is no galvanic contact through the tracks, such sets can use wireless control only. Earlier that was based on  Infra-Red, nowadays an RC of some sort. As the system is totally unaware where the train is going on, it's only up to the human operator to control each train - no chance for automation.

Traditionally control and signalling of trains - real ones - is based on fixed blocks of track, varying from kilometers to tens of kilometers in length. Only one train can occupy a block at a time, and one free block is required in between two occupied blocks. That's how it was 100 years ago, and that's how it is Today.

Moving block signalling is a newer system, which defines in real time a safe zone in front and back of a train, depending on the speed and location of the train. At the moment, the systems is use only in some subways and light rails, but no "real" railway uses it, much due to safety concerns, as the technology is not considered mature enough for trains traveling 200km/h or more.

Back to model trains. How the get the exact positions of a train? RFID is possibly the most obvious solution. It provides also identification of each train, and identification of each car also if necessary. However, that can recognize the location in certain spots only, and as such is only good for traditional style of reserved blocks type of signalling. Something more advanced is needed if moving block signalling is required.

Machine vision is one option to locate trains, and most likely it works well if all the tracks are running in the same level. However, in case of multi-layered rail systems with possible tunnels, it is very hard to arrange a proper configuration for vision systems to trace every train in real-time.

There is a solution. A model train can locate itself very easily by counting the sleepers (crosstie) it passes by. Fixed calibration points are needed of course, RFID can serve for that purpose. How to count the ties? It's rather easy with optical methods if there is enough contrast in between the tie and underlain material like ballast replica or plain plywood. If the top surface of the tie and the underlain surface are uneven, just a simple angle reflection detector is enough.

Well, it's not enough if the train by itself knows how many ties it has passed since previous calibration point (RFID). The train must somehow inform the control system as well, to let it know the overall situation. RF communication of some sort is needed to provide two-way communication. 2.4 GHz is a good choice. It is globally available frequency, and the RF characteristics are proper; the link length is adequate, and the data rate is well good enough for several trains to communicate simultaneously.

For the purpose, Zigbee, Wifi, Bluetooth and Bluetooh Low Energy are all equally good. Proprietary systems can work as well, but I'd prefer a standardized technology with several component vendors. The choice is only question of cost and energy consumption. Luckily, if trains are powered from tracks, the power consumption is not a major issue.

Now, it's all about the control software. All the existing model train control software, commercial or open source, are based on the traditional signalling system with reserved blocks of rail. Implementing a totally new control software with real-time location and speed control requires a group of talented people interested in the same topic, or someone seeing enough business potential on it. I really doubt the last one and count on only creating an open source community around the idea.

Anyone interested in the idea can contact me.

No comments:

Post a Comment