MRBus on AVRs - An APB signaling implementation

This site is about the signal system I use on my FREMO americaN modules.

Ever since I started with model railroads, I have been fascinated by signals. There was no way I couldn't have had a signal system on my railroad! Where to start? Well, I actually do not own a complete layout, but rather some N-scale modules, which get assembled together with others at meetings we hold. While not regular meetings, we manage to set up a layout twice a year.

In 2006, I built a CTC-controlled lap siding, named Hazeltine according to the group's standards (you can find it on the americaN homepage over here). A suitable signaling system had already been found earlier:

The system is a modification of MRBus developed by Nathan Holmes, which can be found on his site here. Be sure to look through the project's description.

Nathan's original source code runs on PIC microprocessors. As I like the Atmel AVRs better, you can find a port onto the AVR plus avr-gcc platform on his site, on the project's Yahoo-Group (link on Nathan's site), or here in the download section below.

The migration to APB
The straight ABS initially used didn't satisfy me. I wanted something more powerful, and more interesting, operation-wise. And while the first official use of Hazeltine had the old signal logic, signaling engineer Carsten Stjernholm Lundsten helped me design an APB implementation.


What is APB?

APB stands for Absolute Permissive Block. It is a type of automatic block signaling in use in the United States, but derivatives can probably be found all over the world.
I strongly recommend you take a look at Carsten Lundsten's site here, where he explains the operational functionality of this automatic signal system. Another interesting source is BC Hellman's site The Rails. On this page he explains the function of the stick relay (look at the left menu for "Semaphore 7212 ... APB explained").

But to put it short, APB is a block signal system able to detect train direction on the line. This gives a huge advantage both in protection of opposing movements, and in line capacity.

The implementation of APB functionality

My version of the APB system is basically a digital copy of analog field circuitry. Signals are logically connected by a virtual four-wire interface per direction. At the very beginning, I planned to use four-wire cables to connect signal nodes. This would have improved simplicity when hooking up a modular arrangement, where logic connections are different at every meeting, as no configuration would have been necessary. But in the end, the four wires were virtualized using MRBus data packets, as I contemplate developing a software which allows putting together the modules graphically, and then writes a configuration file you can send over the MRBus system.

Either way, see how the APB system is made up by following this link.

PCBs

Fellow model railroader Oliver Hampel of Munich has produced some nice industrially-made PCBs for the signaling application. The board has two current sensing block detectors onboard (developed by Nathan Holmes, please see the Module pages), connection to IR sensor, four MRBus RJ45 jacks, auxiliary power connector, and an ATmega8 controller. (Insert photo of PCB here )

You can reach Oliver at olha (at) arcor.de.

These PCBs had been specifically designed for APB intermediate signals, but since then I've used them on a wide variety of applications, such as CTC control points, CTC dispatcher panel, Functional Keyboard and MRBus interface.



Downloads and links

Notes on controllers and compiler

The whole software of this project runs on 8-bit Atmel AVR devices. It is written in C and was compiled with avr-gcc, which is available for most OS platforms. It is also included in the WinAVR toolchain (available at http://winavr.sourceforge.net).
MRBus for AVR bus files: Version 1.1b[download]
ND Holmes MRBus project sitewww.ndholmes.com