CTC control point with APB block interfaces

This module is a CTC control point with all connecting tracks featuring an APB interface (take a look at the description).

The logic is completely based on tables. This allows to have generic safety routines, which are easily maintained. More important, the logic connections between elements are not hardcoded, so the adaption to a new specific application requires the user only to change the tables. The generic safety processes also allow to separate logic and input/output. The latter is very specific to single installations, and must be programmed by the user, as there is no convenient way to automate this (what if you use another controller with fewer pins, ...).

The logic is not documented by now, but the source code is commented. Basically, the module SafetyProcesses incorporates all functions that run automatically. This is handling the APB interfaces, and everything related to CTC route unlocking. The module CTCCmdProcesses, as the name says, provides functions for changing the state of signals, throw turnouts, and so on. The main module handles input, calls the SafetyProcesses and CTCCmdProcesses, then performs output, and finally starts over.



The installation

This version of the CTC control point software derives from the fact that Oliver Hampel of Munich had made some PCBs for me, that are used for automatic intermediate signals (see APB intermediates for the original schematics). Now, what to do with 20 pieces and only four intermediates to build? Right, use them in some other place, too! Thus I started to develop a control point software, where two controllers on two APB PCBs share the work to operate one control point. As I had the boards already at hand, this was much more cost-effective than designing new dedicated boards. Ah yes, this is where it had started: the first CTC modules had bee hand-wired, and not very well I must admit, so I had decided I wanted industrially made PCBs with also the current-sensing block detectors onboard.

The two controllers are ATmega8. The main controller handles the safety logic, MRBus communication and with the rest of its pins connects to some input/output elements. The secondary, peripheral controller only handles input and output, and is connected to the main controller via TWI. TWI (or I2C) allows multiple devices to be connected, so you have an optimal interface for future expansion. For instance, my Hazeltine Center installation uses two peripheral controllers.

View of Hazeltine East control point from below
View of CTC East Hazeltine from below, with turnout motor and the two PCBs.
Close view of the main controller
A closer view of the main controller.

In case you wonder why there is only one wire controlling the turnout instead of two (one for each position), I use the Turnout Controller (see the menu on the left).

As for PCBs, I can really recommend Oliver's, which he sells at production cost. You can contact him at olha (at) arcor.de. They are very useful, especially the block detectors. I found hand-wiring one to be a real pain, but populating the PCBs with the right resistors is just a walk in the park, so to speak.


Documentation and source code for the installation

Source code

Version 1.4 - current [download]
Version 1.2[download]

Schematics

Schematics for current version[download]


Shared documents

Command and data output structure[download]