Introducing DCC++ ---a complete open-source DCC station and interface

Gregg Aug 25, 2015

  1. HVT

    HVT TrainBoard Member

    74
    93
    15
    Dwayne,

    I could use extender boards but using multiple Megas will take the additional processing burden off the master Mega and more importantly will allow each section/module to be self-contained, no big bunches of wires between modules. Allows one module to be removed for maintenance and work on the underside.

    Dave
     
    Scott Eric Catalano likes this.
  2. HVT

    HVT TrainBoard Member

    74
    93
    15
    Dwayne,

    A simple handheld tactile controller is the objective. Simplicity is ideal, less is more. When the software can connect the throttle with the loco rather than trying to do that from the throttle (which would require additional components and circuitry) life would indeed be simple.

    Dave
     
    Scott Eric Catalano likes this.
  3. mayhaw9999

    mayhaw9999 TrainBoard Member

    27
    28
    5
    Gregg,
    You are indeed unbelievable! I'm sure you will be happy when folks like me are not bothering you with our problems. The new diagnostics program is great. I followed the steps, first with the Mega and then the UNO. The Mega failed the <D> test – serial did not recognize the command for either the main or programming pins.
    UNO passed all tests.
    Motor shield also passed with alternate blinking of the LED's as you described.
    Now I have the tracks hooked up and power to both. Can't explain what the problem was yesterday when I only had the programming track lit up. Must have been some gremlin in the system (more likely in my brain).

    Thanks again for your response to my problems and for this outstanding program. Only wish my programming skills were better.

    David
     
    Scott Eric Catalano likes this.
  4. mayhaw9999

    mayhaw9999 TrainBoard Member

    27
    28
    5
    Scott Eric Catalano likes this.
  5. Steve S

    Steve S TrainBoard Member

    95
    22
    8
    Here's a guy who made an Arduino DCC system controlled by a TV remote. Most remotes are pretty tactile. The volume and channel buttons could be used for speed and direction. One downside (I think) is that if you want to use more than one remote, they need to be from different manufacturers so their signals don't interfere with each other. I wonder if something like this would work with Gregg's DCC++.



    Steve S
     
    Scott Eric Catalano likes this.
  6. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    Hello All,

    Right now I have one Uno and one Pololu motor shield connected straight to the track which is the Bus line. I will be using separate Unos to control turnouts and signals...less is more....as in less on the Base station and more on the other Unos....your base station should be focusing on one thing....controlling the locomotives and programming. This is why the NMRA has introduced LCC as the current DCC bus is being bogged down with uneccesary stuff....when the DCC base station goes down so does everything else. Keeping things apart from each other will help things in the long run....on another note....having a hand held controller would be an awesome step.
     
  7. lnxlnx

    lnxlnx TrainBoard Member

    24
    20
    7
    @Steve S

    The guy in the video is @David Bodnar who is posting in this thread too so you never know he may feel like trying to implement it with DCC++ code ?
     
    Scott Eric Catalano likes this.
  8. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    I don't see a need to get JMRI in the middle of a "jump throttle" design.... the throttle box could connect directly to the DCC++ Base Station, and a fairly simple block of code could monitor the pins and translate changes in to DCC++ commands that are consumed internally.

    Likewise, using something like an Arduino Pro Mini, a somewhat fancier design could be made that connected via serial, rather than directly to IO pins.

    And if you wanted to spend the money on it, add an Ethernet interface.

    Having the Arduino send information to JMRI about throttle knob/button changes so that JMRI can send back proper DCC++ commands would be unnecessary over-complication.

    I like the TV remote thing! That is cool!
     
    Scott Eric Catalano likes this.
  9. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    I made one of these before Gregg got DCC++ started ..... it works but is severely limited in both function and speed of response. DCC++ is a far superior solution. Just sayin' No offense to Dave who was responsive and very helpful as I completed the project.
    Steve
     
    Scott Eric Catalano likes this.
  10. HVT

    HVT TrainBoard Member

    74
    93
    15
    TwinDad,

    The Moteino is essentially an Arduino Pro Mini with a wireless transceiver onboard. My thought was to have the loco selection done in JMRI/Controller leaving the handheld simply to send throttle speed/direction/horn.

    Does someone have a suggestion on how to select a loco for the wireless Arduino handheld using only JMRI and the DCC++ Base Station? It appears that i2c over wireless is not a good idea.

    Thank for all you do for this hobby.
    Dave
     
    Scott Eric Catalano likes this.
  11. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Hello Gregg and All,

    My first post on here, but I've been lurking with great interest for several days absorbing this fascinating thread.

    Outstanding work Gregg and many thanks for bringing your amazing work to the benefit of all.

    I've been out of model railroading for over 30 years but looking to get back in now with all this new technology.
    Understanding control systems and getting the build right from the start is my first priority.

    If I may make a suggestion that might interest users running larger scale (above N) regarding the current capacity of the output stages.

    A single high capacity stage would seem desirable. But not much seems available that would drop straight on top of the Mega 2560.

    I've been goggling around and wondered if this device http://www.ebay.co.uk/itm/Double-BT...057516?hash=item46425c52ec:g:ea8AAOSwHnFVg4W9 would be compatible with the Mega, albeit with the requirement for a simple interface board that would be easy to mock up. Note only looking to run this about 5 Amps max.

    Thanks for now

    Steve L
     
    Last edited: Jan 4, 2016
    Scott Eric Catalano likes this.
  12. w8one

    w8one TrainBoard Member

    89
    109
    5
    A quick look at the data sheet shows each chip is a 1/2 h bridge (the whole thing is 1 h bridge) each 1/2 has a current sense, pwm ,and a direction ( i assume high logic = positive, low logic negative ) you would need a invert circuit between r_en and l_en like this.
    I am not exactly sure how to combine the current sense lines, both pwm will go to one of the signal enable pins. you will need 2 of these boards 1 for main track, 1 for programming track.
     
    Scott Eric Catalano likes this.
  13. w8one

    w8one TrainBoard Member

    89
    109
    5
    I have also been thinking about a DCC++ HHT (Hand Held Throttle). If you were to connect it via serial the DCC++ Base Station you would only be able to use the HHT for all your layout. With DCC++ Base Station connected to JMRI and the HHT connected via jmri it should be able to be use the HHT as 1 throttle for 1 loco and let JMRI control the rest of your locos. I was thinking along the lines of using a network to network approach Base Station to HHT via a crossover cat5 cable to use as stand alone system, But when both are connected to a router and JMRI, the HHT (or multiple HHT,s) would control the Base Station via JMRI. If we used the DCC++ Base Stations Commands in the HHT it should make making it compatible with JMRI easier i would think.
     
    Scott Eric Catalano likes this.
  14. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    I think that the nature of connectivity of an HHT would in part be based on the scope of the functionality in the HHT. If the HHT has buttons that allows it to select the cab address and/or the register (in DCC++), and other sufficient functions so that it can be used on a standalone basis, then it can be connected directly to the serial port or via the Ethernet to Base Station. It would simply generate appropriate <t> throttle commands and control the trains.

    But if the idea is to create a limited HHT that is pre-programmed by some other interface for how it is configured, then to operate the railroad you would still need a separate "main" interface --- JMRI, WiThrottle, or DCC++ Controller. If DCC++ Base Station is configured to utilize the serial port, then other serial connections are blocked (but see caveat below***), and you would need to run the HHT through an independent connection to the main interface. That interface would be responsible for responding to HHT requests and funnel them to the Base Station. But if Base Station is configured for WiFi or Ethernet (through a router) than the HHT can connect directly to Base Station and a separate interface would not be needed to negotiate the HHT commands (though it would still be needed to provide full functionality to run the railroad). For example, when I connect Base Station using an Ethernet Shield through a wireless router, I can use two instances of DCC++ Controller on two different computers at the same time --- both interfaces automatically update based on the commands generated by either. But neither Controller is actually aware of the others existence. If an HHT were added to the mix, it could simply generate its own throttle commands, send them directly to Base Station, and the other interfaces would update accordingly.

    In this mode, the HHT would need to know the register of the throttle to be controlled and the IP address of the Base Station. If the HHT were based on a small Arduino board that had a serial connection, it could be directly configured with this information by a separate JRMI module (or simply a new function in DCC++ Controller). Once configured you'd remove the serial cable and would connect wirelessly to the Base Station.

    Such a minimalist HHT would probably need one slide switch for power, one push-button to trigger the wireless connectivity initiation, a tri-color LED to indicate connectivity is working (red=no, yellow=initiating, green=connected), a slide switch to control forward-reverse, a bi-color LED to provide visual feedback of the direction (optional since you can always look at the slide switch)...and some way of controlling the throttle. An easy method would be three push buttons: increase throttle, decrease throttle, and emergency stop. But buttons are not as fun as a rotating knob. One could use a pot and have the Arduino read a calibrated voltage to determine the position, but this would be problematic when used in conjunction with another interface if that other interface changed the throttle speed for the same train (since the pot has absolute positioning, it would physically be out-of-sync, or in conflict with the settings of the other interface). An infinitely rotating knob that could be tracked as it turned clockwise or counterclockwise would be ideal. They are a bit more expensive than a pot but the Arduino controlling the HHT would be able to read Base Station feedback commands and adjust its knowledge of the current throttle setting internally. A small LCD display could be added to indicate the speed, but that might break the "minimalist" feel of the HHT.

    ***caveat for serial connection --- the Mega has 4 serial ports, one of which is connected to the USB. Prior to using an Ethernet shield, I hooked up a Bluetooth chip to one of the Megas alternative serial ports and was able to control the Mega wirelessly via a Bluetooth connection. DCC++ Base Station on the Mega could in principle be updated to check for commands on multiple serial ports. But using the Ethernet is much easier.

    -Gregg
     
    Scott Eric Catalano likes this.
  15. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    The only downside I see to using Ethernet/WiFi for the throttle connection is finding a cost-effective WiFi module for the throttle. The Moteino board uses a different bad and doesn't have the protocol stack (as far as I can tell).

    It would be possible to use the Moteino transceiver. We would just have to hook up a matching transceiver to one of the other serial ports (or I2C or SPI or whatever it uses) on the Base Station, and the throttles and Base Station would just broadcast <t> commands and responses over that bus. There might be a problem with collisions between radios broadcasting on the band... some sort of CDMA algorithm would help this, but would require a bit of coding.

    Another idea that is a bit of a "hack" would be to create a dongle that could be attached to the plug on a Digitrax UT4 (for example) that would translate between LocoNet and DCC++. This would allow us to use a "pre-packaged" throttle that already has the speed, direction, function and address selection hardware.
     
    Scott Eric Catalano likes this.
  16. HVT

    HVT TrainBoard Member

    74
    93
    15
    Gregg,

    Is it plausible to use an external PWM signal connected to an analog input pin on the DCC++ Base Station and hard code the pin in the sketch (or assign it in the Serial Monitor) as a throttle setting for a specific loco, and a digital input high/low as the direction? 5 locos would require 10 pins. No input would be a zero throttle setting.

    Or am I trying to be too simplistic?

    Dave
     
    Scott Eric Catalano likes this.
  17. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    The dongle idea would be great this way you could use a Digitrax controller, NCE controller and others to communicate to the DCC++ base station thus making DCC++ base station a type of universal base station....or am I also looking at this to simplistic or complex?
     
  18. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    No, that's the idea... as long as the cab bus interface is publicly available (which at least the "personal use" version of LocoNet is), it should work... just needs someone to actually make it happen...
     
    Scott Eric Catalano likes this.
  19. KE4NYV

    KE4NYV TrainBoard Member

    219
    281
    17
    I would vote for a basic RS485 cab buss kind of configuration for the hand held throttles. A wireless system could be integrated down the line, after the cab buss was implemented and tested. Make it an open standard that others could use, private or commercial.
     
    Scott Eric Catalano likes this.
  20. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    For a DCC++ "proprietary" throttle system I would definitely agree... an open standard protocol over a simple wired (and later, wireless) interface.

    I only mentioned LocoNet because the original question was a way of directly interfacing commercial throttles (vs. building something custom).

    There's no reason the "Base Station End" of the bus couldn't be an Open protocol*, but the "dongle" (adapter) would still need to "speak LocoNet" (or whatever) to connect the commercial throttle.

    * The protocol is effectively already written, using the <t> and <f> commands...
     
    HVT and Scott Eric Catalano like this.

Share This Page