DIY Railcom+ Transmitter?

Glen Collins Mar 17, 2023

  1. Glen Collins

    Glen Collins New Member

    3
    1
    1
    Hello everyone. I'm new here and I've been looking for some information on Railcom+ and decided to join and see what I can find out.

    I'm interested in knowing if there are any plans out there where you can make your own DIY Railcom Transmitter. I'm interested in seeing if I can DYI my own rather than purchasing one. I've been thinking about using the smallest ESP32 but then I need to power it off the DCC rails and be able to not disrupt the DCC signal so I would need some kind of optocoupler or something like that for both power and getting the signal.

    This "package" of course needs to be small enough to fit in my rolling stock. I've looked into the ESU transmitter and I wanted to see if I can build one a little cheaper if that's even possible. But I consider it a challenge if I can do it or even find the information which is been hard to get. I see command stations built on the ESP32 but that's pretty much about it. With like the standard ESU transmitter I don't know if it's some kind of special processor or something like that. I can't find out that information or I just don't know what to look for.

    Does anyone know if that is even possible for a small footprint as rolling stock and doing it DIY? Any info you can supply would be greatly appreciated. I also looked into the Digitrax TL1 but it seems Railcom+ is much more functional when it comes to providing information on the loco/rolling stock. I'm not looking for any kind of multiple functions, just ID of the rolling stock.

    Thanks and happy railroading!

    Glen
     
    BigJake likes this.
  2. BigJake

    BigJake TrainBoard Member

    3,259
    6,172
    70
    Welcome aboard!

    What scale are you targeting? Z, N, HO, ...? That will make a difference in how much room you likely have in a loco or a railcar, and what options you have for implementation.

    First, you will need to build (most of) an ordinary DCC decoder, because you have to recognize the time period within the DCC command when RailCom does it's thing.

    Your post title indicates RailCom+, while your message mainly references RailCom. Which one do you want? What do you want to be able to do with it?
     
  3. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    So a fairly standard DCC decoder setup but with RailCom TX support. This is doable and the ESP32 can be used for this, but you will be hard pressed to fit it inside anything smaller than HO scale.

    I've designed an N scale decoder (using ESP8684 which is a QFN24 packaged ESP32-C3) supporting sound, WiFi control, DCC and RailCom. However, due to size constraints I ultimately set the design aside. It may return as an HO scale decoder and be a commercial product at some point.

    You likely saw my ESP32 Command Station project, it's not the only one out there now but it is the source for most other projects in generating the raw DCC signal. There are also a few commercial designs being worked on using ESP32 chips, I can't share too many details on these as they aren't publicly announced yet but what I can say is it's not limited to just command stations and they should be hitting the market in the next couple months.
     
  4. Glen Collins

    Glen Collins New Member

    3
    1
    1
    Yeah. I guess I should have probably mentioned what size I'm looking to design for, it's HO. I'm not sure of the exact differences between Railcom and Railcom+ but since I'm only looking for basic functionally as to tell me what car is where, I would says Railcom. I have not seen any specific sketches that deal with Railcom, most of them are for DCC functionally such a lighting and switch/servo control. I'm just looking to ID the railcar and that's it.

    I've looked into RFID and other types of identification systems but since I have an ESU controller, I figured Railcom would be the easiest to work with. For me it's just that pesky, how do I power and ESP32 from the rails while still reading the rails without disturbing the DCC signal or missing the Railcom packet.

    While it's been almost 30 years since I worked/designed any kind of electronics, I'm looking forward to the challenge.

    Glen
     
  5. Glen Collins

    Glen Collins New Member

    3
    1
    1
    Yes, that's kind of what I figured that fitting it in HO would be fairly easy for the most part. Some railcars more difficult than others but it's doable. I'm just having issue finding a design to power and grab the data from the rails. I figured for me a 2 board design would be for me. One board to have the optocoupler and rectifier to power and of course the other being the ESP32. I figured since I'm only looking for railcar identification, I could get away with a tinyesp and I would not need any kind of functional lights, sounds, etc. But that powering circuit and the Railcom code eludes me. I think I did find a circuit to power, I just have to see how much I can stuff onto a small prototype board to see if it's doable.

    Where is the one chip design that magically does everything you want. :)

    Glen
     
  6. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    If/When I find that I'll let you know :)

    You could take inspiration from designs such as https://github.com/nsm81/DCCLink_PCB. You will need to adjust the optocoupler output pin (pin 6) to pull-up to 3v3 instead of 5v.

    I have a design for a DCC/RailCom decoder but it is not fully tested and derives power from an OpenLCB / LCC connection rather than track connection, which can be easily be added via a bridge rectifier circuit. However, this hasn't been released publicly as it was an internal test tool primarily.
     
    Sumner likes this.
  7. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    I see ESU has a transmitter that can go in rolling stock but looks like it is about $60 (street price).

    I would think you could use ESU's 59826 LokPilot 5 Micro DCC Decoder ( HERE ) and not use the motor functions. Maybe not???

    It is really small and should fit even in some N scale rolling stock. Looks to be smaller than their RailCom Transmitter. At $30 not sure you could build something for much less.

    Sumner
     
  8. BigJake

    BigJake TrainBoard Member

    3,259
    6,172
    70
    On the tippy-top shelf, with a price tag that takes everything you have.

    The task of a product developer: Create a product that enough people need, at a price they are willing to pay, while turning a profit that will keep the the developer in business.
     
  9. olequa

    olequa TrainBoard Member

    15
    7
    18
    Can you or someone provide a link to that project please? Thanks.
    George
     
  10. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    https://github.com/atanisoft/ESP32CommandStation/

    There is also a very long thread on here. It's fairly stable now but there are a few rough areas still which are tracked via issues. I don't have nearly as much time to dedicate to this project (or many of my others) lately, mostly due to working on a couple commercial products that should hit the market in a few months. I can't share too many details on the products yet but what I can say is that the company that will be selling these products is quite well known in the model trains world and is overdue on announcing new products. RailCom is involved in at least two of the products.
     
    Sumner likes this.
  11. DCESharkman

    DCESharkman TrainBoard Member

    4,396
    3,025
    87
    ESU has cancelled that product
     
    Sumner likes this.
  12. murarduino

    murarduino New Member

    8
    3
    1
    I made a miniaturized (N-scale) EPS32 multi-function sound decoder that boasts an integrated solution like PICO. Making this decoder only 11mm*22mm in size, I'm trying to understand how RailCOM's CUTOUT and RailCOM transmit circuits are implemented. I hope we can discuss it together.
     

    Attached Files:

  13. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Unless this is double sided you are missing a few critical components for the ESP32 to operate successfully and to control the motor in the locomotive. I don't see the required 40Mhz crystal (connects to XTAL_P / XTAL_N with caps and current limit resistor), motor driver component(s), bulk cap(s) and decoupling cap(s), required pull-ups, programming interface.

    The cut-out period is exactly that, the DCC signal is "missing" for up to ~488 microseconds during which time decoder(s) are able to transmit over the rails to a RailCom detector (usually built into the command station). The transmit circuit uses stored energy (in bulk cap or similar) to transmit a UART signal (~250kbps) consisting of up to 2 4/8 encoded bytes in the first channel segment and up to six 4/8 encoded bytes in the second channel segment. Each channel is optionally transmitted.

    For an example TX circuit you can refer to S-9.3.2 (available on the NMRA website) or you can refer to the RCN specifications (which may be in German, but Google Translate does a reasonable job). There is an ongoing effort to bring both standards into alignment, some of which has already been completed and published on the NMRA website (S-9.1, S-9.2.1, S-9.2.1.1, TN-9.2.1.1). I'm aware of other updates in-progress but they haven't been published publicly yet and met with a few of the DCC standards / compliance members in January (primarily focused on CS compliance).
     
    BigJake and Sumner like this.
  14. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Forgot to include these photos on my response above... These are an early POC/Prototype for a WiFi enabled N scale decoder supporting sound:
    esp32loco.jpg esp32loco2.jpg
    These were sized to be a drop-in for SD40 (and similar) locos. It was not taken further due to space constraints and RF interference from the typical N scale metal loco frame. This was designed for WiFi (LCC) but has support for DCC signal capture as well. MCU is ESP32-C3 in QFN-32 package (5x5mm) but I had planned to swap for ESP8684H4 (4x4mm QFN ESP32-C3) but didn't make that change in this rendition.

    The only part missing in this render is the RailCom TX which was using 2x BC847BDW1 and three resistors.
     
    BigJake likes this.
  15. BigJake

    BigJake TrainBoard Member

    3,259
    6,172
    70
    Do any of those components require fiducials for automated component placement? Perhaps if assembly is performed at the panel level, the fiducials can be off-board.
     
  16. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Yes, fiducials would be required for successful automated placement. In the case of my render it would technically be possible to use the square copper pads but it is non-standard and likely would be rejected by most fabrication outfits. I could place them without round fiducials on my PnP machine but it would require a few adjustments in the vision pipelines.

    Submitting the rendered board as a panel would be required and also very likely rejected by most budget friendly fabrication outfits due to the narrow size (it's ~9.3mm wide). It can be done with mouse bites to widen it to double it's width but you would pay a premium on it. Even the 11x22mm PCB further up would likely be subjected to the same.
     
  17. BigJake

    BigJake TrainBoard Member

    3,259
    6,172
    70
    Wow, your own PnP machine!

    Actually it was Murarduino's post that piqued my concern. Your board seems to have the room, and I wasn't sure the view you rendered would have shown fiducials anyway.

    Thanks for the detailed response. I retired in 2019 after 33 yrs of PCB & FPGA development in embedded applications.
     
  18. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    They would render if I put them on the board (likely I would), but this current render is quite out of date now and would be a bit of a pain to route properly (considering current and cross-talk)

    Yup, I have a heavily modified Lumen PnP machine. I've extended the X gantry from 600mm to 800mm so the nozzles can reach the full width of the 600mm staging area, swapped from roller wheels to linear rails, swapped main control board from STM32 based to RP-Pico 2040 split config with stationary board controlling X/Y axis / feeders and a second mounted to the back of the nozzle assembly to control Z axis and nozzle rotation. I'm waiting on the PCBs to arrive for the 50 feeders.

    https://photos.app.goo.gl/KrKx7g7TuBC3qxWR7 shows the PnP machine in the middle of replacement of the mobile control board (broken TVS diode on the USB lines), to the left of the front leg is the original "all-in-one" control board. I'll also be building a new desk with a rubber ESD mat surface in the next few weeks, just need to finish the drawing of it so I know how much wood to pick up (3x7ft for the PnP, 2x5ft for rework / inspection, corner area where they meet up in L shape will be for reflow oven).
     
    Sumner and BigJake like this.
  19. murarduino

    murarduino New Member

    8
    3
    1
    In fact, there is an ESP32 chip that does not need external crystal, PSRAM and SPIFISH, it has integrated these components internally. In order to stabilize the power supply, only two 0402 MLCC capacitors need to be bypassed in front of the chip.
    I use this chip, the EPS32 PICO-V-02 (a high-end version of the current PICO series), which has a built-in 8 M SPI and 2M PSRAM, which, in addition to the space required for code, is close to 7M SPI for media files, making it a sound decoder (even if the PSRAM is not used).

    https://www.espressif.com/sites/default/files/documentation/esp32-pico-v3-02_datasheet_en.pdf



    It's because of this chip that I do it so small. Of course, the back of the PCB is not shown, the back is mainly the motor drive, MOSFET circuitry and now add RailCOM feedback system.
    RailCOM and CUTOUT I refer to Mr. Nagoden's Bi-DI Sender system.
    http://nagoden.la.coocan.jp/dcc/dcc57/dcc_57.htm


    At the same time, multisim simulation is used to build a RailCOM system powered by 3.3V. The simulation test shows that the above circuit is feasible.



    Below is my updated PCB 3D drawing, please correct me
     

    Attached Files:

  20. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Most of the SoCs can be ordered with flash/psram built in but very few have built in crystals. This seems to be an outlier in that it appears to include it. Note that it is an older generation of the ESP32 SoCs.

    You will also need a pull-up on EN, it is *NOT* included in the SoC itself. I'd also suggest a few more bulk capacitors to prevent brownout during cut-out periods, similar to a DCC keep alive but only for the logic side of things (you don't need / want the ESP32 to restart unintentionally).

    PSRAM on the older ESP32 models is not really very useful since you can't use it for DMA (which would be useful for I2S streaming of audio). But you can use it for LwIP and a few other things but there may be slight latency on access (though not much).

    I'd also highly recommend *AGAINST* storing data in SPIFFS / LittleFS / etc and instead embed it in the firmware binary itself. Using flash based filesystems *WILL* be slower and introduces flash access restrictions (ISRs will be blocked from running as example. When I was testing various parts of this setup I found around a 5x performance improvement with embedding the data files directly into the application binary rather than streaming from a flash based filesystem.

    I agree that the simulation looks good and should generate an acceptable pulse stream back to the detector. The concern I have is that it is only 3v3, you might need to boost it to track voltage with a transistor or similar setup.

    Can you send me the schematic / parts you are using? For the MosFETs, make sure the gate threshold voltage is sufficiently low for 3v3 logic. Did you also add a DCC ACK for PROG track usage?
     

Share This Page