Close
0%
0%

DCC/Selectrix/analog railway model command station

DIY, PC-controlled multisystem central built from popular modules - no soldering required.

gbmgbm
Public Chat
Similar projects worth following
(Just starting, more details will follow.)
Multimode command station/controller/booster for railway model control, decoder programming and testing.
After designing few pieces of DCC-related hardware - decoders and command station/booster, I asked myself a question: would it be possible to make a command station solely from cheap, popular off-the shelf modules connected with a breadboard and/or jumper wires? Well, I finally did that. Thanks to flexible software design, the command station may use one of 4 popular microcontroller development boards, one of 3 H-bridge modules and one of 2 current sensor modules for DCC decoder programming feedback.
I am ready to share at least the binary code if there is any interest in reproducing my design.

The command station connects to a PC using USB cable and is controlled by command line interface using terminal emulator running on a PC.

Originally it was designed for ad hoc DCC decoder testing; later the software was extended to make it a fully-featured command station. Analog mode was added for playing with old analog locomotive models. Selectrix mode was added for fun of running Trix locomotive models in their native mode.

The station supports simultaneous control of 32 DCC devices, which may be easily extended to any number desired. The firmware implements the latest additions to NMRA and RCN standards, including functions up to F68 and combined speed/function packets. The set of DCC packets is configurable individually for each decoder. The command station may be configured to send multiple commands in a single packet (like speed with F0..4 or F0..4, F5..8 and F9..12 together).

The software design is purely event-driven and non-blocking - no event loops and no timing dependencies. Control signals for H-bridges are generated by hardware timers. The software is written in C and uses custom USB composite device module, capable of providing 2 USB VCOMs - one for terminal interface, another for future DCC++ or SRCP support.

The commands allow for:

- configuring the H-bridge type, operating mode - analog, DCC or Selectrix, analog mode PWM frequency and resolution,

- setting device properties - DCC addresses, speed steps, no. of functions, types of DCC packets sent to decoders

- controlling the speed, direction and function states of locomotives

- CV reading and programing in DCC service mode

- Programming On Main track for DCC decoders

- defining and executing automatic run sequences, like pendulum train operation with long stops at both ends

The plans for the nearest future include:

- analog locomotive control with BEMF, making it possible to set the desired speed instead of PWM duty, like it is done inside of a DCC loco decoder

- support of presence or distance sensors for autoruns

- autoruns in analog mode

- support for standard command interface - DCC++ and/or SRCP.

It should be easy to add Motorola/mfx support but I don't have any loco with mfx decoder for testing.

Stay tuned for more details and pictures.

  • 1 × BluePill, BlackPill, Nucleo or any other STM32F103 or F4x1-based board
  • 1 × IBT-2 (BTN8960), DRV8871 or TB6612 H-bridge module
  • 1 × INA219 or INA3221 voltage/current sensor
  • 1 × Breadboard and/or jumper wires

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates