Home - ejbergdk/loconet-routectrl3 GitHub Wiki
Intro
Route controller for a loconet-enabled model railroad.
This project is intended to help automating a model railroad, without having a computer attached. It can read feedback signals (from contact tracks on the layout, or other forms of input), and perform actions like setting signals and switches/turnouts/points.
The possibilities range from the simple, like setting a signal to red once a train passes it, to the complex, like queueing up routes from one place on the layout to another with interlocking, so conflicting routes can't be activated at the same time and trains won't collide. Well, at least in theory.
The requirements are a model railroad layout that uses Loconet, and the layout must have signals that can stop the trains. This controller does not control the locomotives directly, only through signals.
Some knowledge of AVR microcontrollers and C code is required.
Index
Hardware: Hardware needed for this project.
Software: Introduction to the software.
Library Reference: Technical description of the software library.
Examples: Implementation examples.
History
As you may have guessed from the project name (Route Controller v3), this is the third version of this controller. It all started in 2007.
I don't like to run my model trains with a computer, so I needed some other way to control my layout. After a couple of attempts using other methods, I ended up with Uhlenbrocks Track Control. This system has a "route memory", that can be used to call up routes either from the control panel or from feedback signals from the layout. However it seemed a bit limited for my taste. I don't remember exactly what was wrong with it, but I believe it had to do with delays. Once a delay was entered in a route, the module couldn't do anything else for as long as the delay was active. This may be fine for small 1-2 second delays, but not if the delay was, say, 30 seconds, as I would like to use for a train stopping at a station.
This prompted me to make this "Route Controller".
The first version was made back in 2007 in AVR assembler and running on an ATMega16. It was specifically written for the needs and demands of my model train layout.
Later that same year, I rewrote some of the code to be more generalized and reusable, and that was called version 2. It was still in assembler and a nightmare to maintain, especially after being away from it for some time.
Fast forward to 2022, where I started working on this project: Route Controller v3. It is a complete rewrite in C, using more modern hardware and the Loconet library I made a year earlier. Of course family, work and life in general always use up most of ones time, but in 2024 I believed this project was in a state where it could be published.
Now I "only" need to write up some documentation so you have a chance to find out how this stuff works.