Sadly, I missed posting an update last month, as I continue to try to catch up to the present. Today's update is from March 2024:
Real ATP-Enabled Speedometer. This blog post shares what is almost a complete project itself: determining how ATP-enabled speedometers from UK trains I purchased work through careful detective work, then designing and building a controller PCB I can use with my CAN bus controller and interface to Train Simulator. As always, I have summarized
the blog post here, but I encourage you to read the original blog post (and as usual, it has videos!).
Real ATP-Enabled Speedometer for Train Simulator
I started this project by trying to
build my own speedometer, experimenting with a stepper motor used for automotive instruments that I later integrated into a
CAN-controlled air gauge. Thanks to UK eBay, I eventually got my hands not only real UK train speedometers, but a couple of speedometers that are fitted with the LEDs and alphanumeric display necessary for
Automatic Train Protection (ATP). This system uses green and amber LEDs to indicate speed limits: solid green LEDs at the appropriate speed on the dial for the current Maximum Authorized Speed (MAS), flashing green for an upcoming change in the speed limit, and flashing amber for the “release speed” under which the system will no longer make a brake application. Like
ACSES, it automatically applies the brakes if it judges the driver (engineer for us US folks) is not slowing sufficiently for an upcoming speed limit. The 3-character alphanumeric display is used in the prototype to display status messages, including about why the brakes were applied, but I wanted to use it to display the current speed and the speed trend (accelerating or decelerating), like the digital speedometer in the
Class 395.
One of these ATP-enabled speedometers with other instruments, before I worked out how to control it
Getting these real speedometers working with Train Simulator was a particularly fun proposition, because no documentation existed about how they are controlled that I could find on the public internet. Two terminals provide an obvious analog current-controlled input for the needle, but an opaque 35-pin DIN socket (a wider sibling of the now-thoroughly retired 25-pin PC parallel port) provides an interface to the LEDs around the face and to the three alphanumeric digits in the center. I didn’t want to send random voltages through what could be a sensitive driver circuit, so the clear next step was disassembly. I thoroughly documented the disassembly process to make sure I would be able to put it back together again, and when I got to the PCB, I took enough photos that I hoped I could follow traces from the 35-pin DIN socket to the ICs or LEDs they control.
I discovered that the LEDs around the perimeter to indicate speed limits are arranged into a conceptual LED matrix of rows and columns (more detail in
the blog post), with the alphanumeric displays being relatively smart units with internal character ROM and the ability to retain the latest character displayed.
I wanted to control both the speed LEDs and the alphanumeric display, and like all my other instruments, I wanted my CAN controller to be the brains behind the unit. I therefore resolved to design a new PCB I could “backpack” on my CAN controller, that would plug neatly into the DIN socket. To avoid wasted time, money, and parts, I started by sketching a design with four shift registers and all of the necessary support components that I laid out on a breadboard. The first image shows the beginning of assembly, the second image the completed prototype:
Planning and testing on a breadboard was a good choice: as I debugged the hardware and wrote the relevant firmware module for the CAN controller, I encountered a few bumps (this was supposed to say “Hel”, as in “Hello, World!”):
Finally, I got the hardware and software working, and was ready to turn the design into a PCB (videos in
the blog post). I designed and asssembled the PCB with generally smaller components that I have hand-soldered before, a necessity to fit the four shift registers, 12 LED-driving transistors with associated resistors, plus a trimmer for fine calibration of the analog speedometer needle. I also left holes for future screws to permanently secure this to the speedometer, and it stacks neatly with my CAN bus controller, connected via the 11-pin GPIO header on the controller. For future configurability and compatibility, it includes three 2-pin jumpers to set the type of speedometer to which the speedometer controller is connected. The completed PCB, then installed on the speedometer:
Finally, I could connect the speedometer to my setup (using the 120mph version), drive Class 80x trains around the UK railway network, and get digital and analog speed indications plus useful speed limit information!