CTC Machine Build


Should anyone be curious, here is the CTC machine layout after Mike Burgett reviewed it. Not that much changed. Primarily, the blue POWER OFF lamps were removed, automatic dwarf signals added to locked turnouts entering an OS section, unlocked lamps changed from blue to red, and white lamps on the correspondence levers. Column 61 was moved to 59 to simplify cabinet construction.

A schematic track plan showing siding lengths and stations was added to the top of the model board. That’s about it.


Today I did a test build-out of the CTC machine short right side panel. There were a few annoyances but nothing insurmountable.

The cutout at the top is where the aluminum model board will attach. In the rear view, the top white connectors power occupancy lamps on the model board. There will be a bit of untidiness as individual model board LEDs may be a couple inches to one side or the other of the column board that provides power.

Wire management seems to be working out quite well. If we had used a conventional CMRI motherboard with DIN and DOUT boards, there would be over 500 point-point wires running all over the place behind this short panel and the 5 foot long main panel. With CMRI hardware, it is also necessary to solder LED resistors directly to the LEDs, as there is no home for them on the DOUT boards. Likewise, to “pulse stretch” a code button press, it is common to epoxy a large electrolytic capacitor to the panel next to the switch, and hang a resistor in the air between the switch and the pushbutton. Most of those wires would need to make a “home run” connection to the CMRI DIN or DOUT boards.

Thirty-two PC boards, one for each live column, eliminate about 300 of those wires. The remaining wires are short and connect directly above or below the boards. Along the bottom of each board is a currently unwired connector. For each set of 8 PC boards, a single CAT5 network cable will daisy-chain horizontally to carry power and an I2C communications bus. Essentially each of these cards acts as a wire “funnel” to the CAT5 cable. That cable then terminates at an Arduino-powered PC board that replaces the CMRI motherboard, DIN and DOUT cards. For 32 boards, I need 4 CAT5 cables.

The PC boards also carry all the LED resistors. By programming the Arduino to be notified by interrupt whenever a switch changes, there is no need for code button press stretching capacitors.

Because each board has 16 individually-programmable input or output pins, there is a maximum “capacity” of 512 switch inputs and/or LED outputs. That’s more than enough.

All-in-all, except for a few mistakes I made, I’m rather pleased with how this is shaping up. It looks particularly good when powered-up by a Sparkfun Arduino Redboard used as a test harness. In person the LEDs are many times brighter than in the photo. During an 8 second exposure they were illuminated for only about 1/2 second.


Mike -

About halfway through C++ coding of the CTC machine into a single, $20 “Teensy 3.1” ARM Cortex M4 embedded microcontroller, adding an explicit software model of the code line from the office to the field works very well. The DS can code any number of columns. The software prioritizes them according to distance along the code line, then receives automatic station recall indication codes and any delayed indication codes when power turnouts complete their moves. The MP3 player stays perfectly in synch although I only have one recording each for control codes and indication codes. There are, however, multiple “error” sounds, none of which are remotely prototypical.

Since I need to add an Arduino to control signals at the New River diamond where it crosses the A&O, I may as well add an MP3 player to that processor for office relay sounds and bell for the traffic levers at Willow Creek and opposite the aisle at CM Tower. These sounds should help the single operator of both of these stations to respond in a timely fashion without the DS always needing to call on the phone.

At a recent “Op 'till you drop!” road trip to Kansas City and Springfield MO, we learned that Joe Kasper refers to his new CTC machine as the “Great Wurlitzer.” That’s causing a number of strange ideas to spin around in my head, some involving a sound clip of Bach’s Toccata and Fugue in D Minor. :laughing:


We waited as long as we could before ordering MetalPhoto process model boards, as a hedge against changes to the track plan. And changes did happen, not long before awarding the contract to Metal Photo Service of Wall, PA! David moved the A&D interchange to the south side of Mount Union and repurposed the former A&D staging to the N&W.

The four 0.032" thick aluminum model boards arrived the week after after Christmas. These came un-drilled to save money.

Hole fabrication was a multi-step process consisting of center-punching, #52 pilot hole, a generous 6-32 clearance hole (for mounting screws), then an Irwin step drill to enlarge occupancy lamp holes to 1/2." A padded clamp prevented the panel from bending if a drill should catch and it certainly improved safety by eliminating the chance of a panel spinning violently and slashing the drill press operator. In the following photo, what appears to be a burr is actually a bit of a protective plastic lamination to be later peeled off.

After bolting the model boards to the steel panel it was time for wiring. This came out fairly neat since improved wire management was one of the design objectives for the per-column PC boards. The next photo was taken during model board wiring. Two sizes of heat shrink tubing were employed to dress and bundle wires from the LEDs. A few loops from the larger diameter tubing reel appear in the lower left.

Wiring went pretty quickly thanks to Craig’s prior work to attach and insulate lengths of CAT5 wire pairs to each LED. Thanks again, Craig! Here we see the LEDs installed in the bezels, each held in its bezel by a drop of CA glue. Ordinary Elmer’s rubber cement smeared on and around each bezel prevents mechanical rattles.


So… what does the front side look like? Here it is before adding the CTC Parts switch lever knobs. It looks like there are a couple maintainer call plates that need to be straightened. We are getting close!


I’m glad that I could help out Bob.

I must admit though…it was for selfish reasons…I’m so looking forward to being a dispatcher on the A&O! :slightly_smiling: This CTC is just plain amazing.

I can’t wait to see the code development portion Bob.

Ready and waiting to help on some troubleshooting!

(Ok…back to car cards on my pike).


The main CTC panel is ready for to be hooked up to the Teensy 3.1 based controller for software development and testing. During installation a couple plates be leveled. The short side panel is also complete.

Installation should be deferred until I attend to a backlog of fascia-mounted control panels.


Simply amazing, Bob, in all its aspects. Beautiful job. I can’t believe it (2.0) is finally to this point. When do we operate!! :stuck_out_tongue:



Wire management in the back of the main panel came out neater than hoped. The blue CAT5 cables carry four I2C buses and power. They are the only connections between the panel and a control board mounted in the base of the cabinet. A massive “spaghetti bowl” has been avoided.

The red and white LEDs in the aluminum panel at the top are track occupancy indicators in the model board.

A gratuitous photo.


On April 30th we mounted the panels into David’s wood CTC cabinet. Now he can install a Formica desktop and finish trim pieces.

Here’s the back side.

Not meant as a brag, but this might be the cleanest wiring behind any model CTC machine.

The round silver puck is an audio “exciter” that causes the steel panel to work as the speaker cone. The 4x4 inch control computer board sitting on the top shelf contains an MP3 player and audio amplifier, along with an integrated RS485 driver that connects to the layout’s CMRI bus. The processor is a Teensy 3.1 board from PRJC. It uses a 96 MHz ARM Cortex M4 32 bit processor programmed in C++.

I’ll shorten the four blue CAT5 cables when I decide where that control board will be located. A real US&S single stroke bell will be mounted below the top shelf.

Everything is powered by a single 12 volt wall wart.


Amazing Bob! When you said you didn’t want to deal with all of the wiring needed for CTC; you weren’t kidding! I believe you have set the bar for model CTC panels.


On May 14, 2016 the cabinet, finish work completed by David, was powered-up. Vince and I started confirming that SMINI inputs and outputs could be controlled by the machine’s computer, through a test program prepared for this purpose. Things generally went well with 2 SMINIs out of 5 partially tested, though there were some failures to be fixed.

Vince and I used the PBX system to communicate between the Dispatcher’s office and Vince’s location in the field.


Bob…I just gotta say every time that I see this CTC panel I’m just in awe! Fantastic work.

Sorry I didn’t get over to help out today. But good news is the weeds have been dealt with, and the a few of the honey do’s are done :slight_smile:


So, Craig… I still want you to have fun getting this beast up and running. You already have a lot of “skin in the game.” But we haven’t seen you in a while! Can you set aside a few Saturdays this spring and summer?

Vince and I had a lot of laughs (incompletely) testing the Bayfield and Glenn Forge SMINIs. At one point, Vince quoted the 3 Stooges: “We ain’t getting no place fast!” It turned out that I failed to connect the end of the CAT5 RS485 cable from the CTC machine to the input side of the Bayfield SMINI. There was a long cable spilling electrons directly on the floor… We swept them up as best we could then I punched down an IDC connector on the end of the 485 cable and plugged it in. Everything was “more better” in Missouri speak.

Anyway, of course you will get to dispatch! David doesn’t want to have a seniority system to let crew members preferentially choose operating positions, and I’m in total agreement. I look forward to sitting beside CTC trainees who soon become qualified dispatchers. And frankly, I’ll need to do that a lot when we start running, as I’m sure there will be a few bugs in the CTC software and I want to catch them as the dispatcher runs into them.


Hey Bob!!! You bet I want to get over to try that panel and the railroad out. Sadly, I’ve been spending every waking minute outside getting the yard/garden ready to go for the season. Spent the whole (I mean WHOLE) time last weekend working in the garden, but everything is in…so now it’s sit back and wait for the payback :slight_smile:

I should be open most of the weekends in June (at least as far as I know unless the Master Planner has other plans. heheheheh). Drop me a note when you’ll be working.

On a side note I’ve been getting the new track laid in Chama for the caboose track and I’ve also been working on the cross-over in Salida from the A/D to the Yard 1 track. Hoping to get that done in a few weeks, and then tackle relayout of a few other areas. But…after seeing all of the great photos of the scenery work, I’m itching to get back on that as well.



Here’s a quick look at the 4x4 inch single-sided controller board. Most of it is empty space.

The green board is a $20 Teensy 3.1 processor. It has a 96 MHz Arm Cortex M4 and enough horsepower to drive the signal system. The blue vertical board is a cheap MP3 player. To the left are two sets of RS485 interfaces, one to drive the layout and the second for debugging with an oscilloscope, if needed.

Along the right side of the board are four I2C buses. A PCA9545A 4-way MUX drives these buses and does 3.3V to 5V level translation. It also supports interrupts, so there is no need to constantly poll all the columns looking for code button presses as would be required if we used CMRI hardware inside the machine.

When the software is finished I estimate that it will take about 5 milliseconds to poll the 5 CMRI SMINI boards under the layout at 28,800 baud. Testing has shown that faster baud rates produce SMINI read errors, even with a 5 inch long RS485 bus. Signal integrity on the bus is fine; it is the SMINI itself that fails at higher baud rates.


On the Arduini Yahoo group, Chuck Catania asked about the LED bezels. I found a couple old drawings dating to the time I machined ones for the A&O. The first one has measurements I made from a US&S prototype loaned by Doug Geiger.

Next is an “intermediate” sketch of some possibilities. I ended up using the last one, slightly modified to use what I’ve annotated as “Final edge profile.” I was not able to find my “final” sketch which detailed the dimensions of that last profile. This was a lot easier to do than the radius of the prototype.


Today was a milestone.

Vince plugged-in most of the signals to see if we could control them through the CTC system, confirming the integrity of wiring from CMRI SMINI nodes to the signal LEDs. I don’t know why I didn’t take any photos, but almost every signal woke up just fine.

We found a couple of bad connections on IDC connectors and intermittent shorts inside signal heads and a cracked power trace on a SMINI “wing board.” There was also a bad CMOS chip on one of the SMINI boards, which was found instantly when Vince suggested swapping socketed output chips.

All-in-all, it was a very rewarding day to see the signal heads light up one by one. “I love it when a plan comes together…” This one was started in early 2008 when I ordered 60 degree switches for the CTC machine, and a few months later Vince placed a huge CMRI order and started stuffing detector and SMINI circuit boards.

“What a long, strange trip it’s been!” - Jerry Garcia


Here’s a short video of the machine. We first clear signal 42R on the main, but then change our minds and want to send the train into the passing siding. Vital field logic prevents throwing a switch when any signal in an interlocking displays an indication greater than stop, or a signal is running time, or the interlocking is occupied.



It is alive! Two weeks ago David announced that he wanted to hold a New Year’s Eve operating session for the guys who helped build the layout. That caused me to go into a “coding coma” for a week. Call on and field OS unlocking still need to be added, but everything else worked fine.

Here we see second trick dispatcher Craig pondering his next move. Vince dispatched the first half. Because these two guys did so much to get the signaling system running, I pulled a few strings with the Grand Poobah to get them first session dispatching jobs.

For those curious, the whole signaling system still runs on the one square inch $20 Teensy 3.1 processor board. The C++ code compiles to all of 41 Kbytes out of 256 K available. That will grow by a small amount when all functions are complete. At 72 MHz the software is able to detect and respond to a code button press in about 20 milliseconds worst-case.