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

Gregg Aug 25, 2015

  1. Shaydriver

    Shaydriver TrainBoard Member

    18
    14
    5
    Hi everybody, This looks like an answer to an ongoing thread, though it isn't....
    That said I could be writing this in the wrong place, may have to learn better.
    I have set up Gregg Bermans Base Station program on an Arduino Mega with motor board,
    and also built Dave Bodnar's handheld controller. If you havent seen that item it's a Pro Mini-based
    controller with a rotary encoder for speed, and a keyboard for loco selection and such; all in a neat package.
    I hope to expand this into controlling turnouts too.
    My question is this; how does the base station respond to shortcuts (if it does)? I haven't seen any information about that.
    I realise it would probably be possible to measure voltage over a shunt, or something like that, but I do want to use an existing solution if there is one.
    Any information on this is appreciated.
    Peter
     
    Scott Eric Catalano likes this.
  2. HansB

    HansB New Member

    8
    8
    1
    The Arduino motor shield comes with a current detector feature that the DCC++ base station uses for shortcut detection.
     
    Scott Eric Catalano likes this.
  3. Shaydriver

    Shaydriver TrainBoard Member

    18
    14
    5
    HansB, thanks for a fast response ! I kind of suspected there was something like this. So, the base station code is reading the current detector and shutting Power ? Will have to check motor shield data, and base station code then.
    Peter
     
    Scott Eric Catalano likes this.
  4. HansB

    HansB New Member

    8
    8
    1
    Yes, it measures the current, detects the short circuit and turns power off. Then you need to send a power on command to start it up again.
     
    Scott Eric Catalano likes this.
  5. Shaydriver

    Shaydriver TrainBoard Member

    18
    14
    5
    OK, again, will have to address this; my handheld throttle send Power on when a speed command occurs...... Should probably change this so that, following a shortcut, Power-on is blocked until manually requested. Or, simply have Power-on only at startup, plus a button for restart. Either way, I guess an on-off button is useful. /Peter
     
    Scott Eric Catalano likes this.
  6. Shaydriver

    Shaydriver TrainBoard Member

    18
    14
    5
    Here we go again; First of all I'm impressed by the efforts many of you make to further develop DCC++. I am new to this forum, and also to DCC++, though I have set up a base station, and built Dave Bodnars controller,both working fine.
    To go further I have come up with questions (the answers are most likely on the forum, but going through it all is a Project in itself):
    So, activating sensors and outputs are described in the instruction set, but not how to handle results. What I mean is this:
    Let's say I push a button connected to a sensor input. The base station(Mega for me) sees this, and, what ? I simply haven't found how to connect inputs to responses, or vice versa.
    I read somewhere on the forum that Gregg came up with the idea to activate servo outputs for turnouts directly from the base station, but didn't see any responses to that idea(and it would need the response I mention above). I am today using Geoff Bunza's great 17-pin decoder for turnouts, but may run out of outputs. So, ideas about this are welcome !
    Peter
     
    Scott Eric Catalano likes this.
  7. Pieter

    Pieter TrainBoard Member

    152
    46
    10
     
    Scott Eric Catalano likes this.
  8. sachsr1

    sachsr1 TrainBoard Member

    60
    23
    5
    Are you using JMRI, or are you running the DCC++ directly?
     
    Scott Eric Catalano likes this.
  9. Shaydriver

    Shaydriver TrainBoard Member

    18
    14
    5
    Pieter, of course I could use another Bunza decoder, and save some cable length in the process, but what I really want is
    button control, close to the resp. turnout, hence my interest in commands through the base station directly.
    Sachsr1; I don't have JMRI, the decoder is connected directly to DCC++.
    Peter
     
    Scott Eric Catalano likes this.
  10. sachsr1

    sachsr1 TrainBoard Member

    60
    23
    5
    Scott Eric Catalano likes this.
  11. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    One possibility is as follows (This assumes you have Dave Bosnar's controller hard wired to the DCC++ base station):

    If you add the return data lead between the base station and the controller (base station Tx to controller Rx), this will give you two way comms between them. Then you can write code in the controller that would look for the base station sensor signals (eg <Q1>, <q1>, etc) and react accordingly by operating the turnouts, which you say you are going to add the code for anyway.

    An advantage of doing this is that you don't have to change any base station code. I have done something similar to this except rather than hard wiring, I have used ESP8266 WiFi modules between the controller and base station.

    A disadvantage is that the controller would need to be turned on for the turnout buttons to work...

    Jim
     
    Scott Eric Catalano likes this.
  12. Shaydriver

    Shaydriver TrainBoard Member

    18
    14
    5
    Thanks Jimbo20 for suggestions. Two-way Communication is doable, I have a free wire in the connecting cable for my controller. I assume you mean I should then add switches to BS sensor inputs in order to throw turnouts; still doable(I have a Mega as BS, so there are many free pins). Finally the BS will simply read the sensor inputs (Turnout commands) and respond as serial data to be read by my Bodnar-controller ?
    If I have gotten this right it means connecting every TO to the BS, and then sending DCC commands back and forth to activate them, but as you point out, no code changes to the BS; Good, I'm much more comfortable with modifying the controller. And almost no need for H/W changes, great. Will have a go at this !
    Peter
     
    Scott Eric Catalano likes this.
  13. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Peter, I too am much more comfortable modifying the controller as there is less risk in upsetting anything... My turnouts don't have feedback so I don't have any wiring from them to the BS. I too use servos operated by a Geoff Bunza decoder. I only have 4 turnouts (a very small layout).

    Jim
     
    Scott Eric Catalano likes this.
  14. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Peter, just an addition thought, you will need to consider the type of switches you use to operate the turnouts. The BS will only send a sensor packet (eg <Q2>, <q2> etc) when a change in sensor state occurs, so unless you specifically send a status request to the BS, you will not know the state of any toggle switches on power up. Therefore push buttons or centre sprung toggle switches would probably be a better way to do this.

    Jim
     
    Scott Eric Catalano likes this.
  15. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    " but what I really want is button control, close to the resp. turnout, hence my interest in commands through the base station directly."

    Most of the button control (TCO) and LED control I came across so far is base around Xpressnet. There is even a few good hand controllers that include accessory control & CV programming. The way you want to use your TCO will determine if you will use toggle or push button switches. A while ago somebody was busy in one of the posts here to include max485 (Xpessnet) in DCC++.
    http://www.sam95.fr/?p=1029
    http://modelisme58.free.fr/index.php/arduino.html (first up a hand controller & halfway down TCO)
    http://www.dccmm.cz/index.php/dcc-modely/arduino-tco-ovladaci-pult-s-arduinem-na-xpressnet (done like a Arduino shield)
    http://www.locoduino.org/spip.php?article42.
     
    Droler and Scott Eric Catalano like this.
  16. Shaydriver

    Shaydriver TrainBoard Member

    18
    14
    5
    Jim, that's a good point, I will probably use centre-sprung switches, for a neat installation close to the turnouts(I have a rather narrow layout around two walls). Close to the switches will be status LED's. Just need to make a suitable little panel for that.
    FYI status LED's are quite easy, just connect an LED between one rail and the switch point, and another LED from the other rail. The switch point acts as a one-pole switch, showing which way the TO is set, without any other wires. I don't even have resistors for this. So your remark about status on startup is correct, but perhaps not a problem.
    Pieter, Thanks for the links, for now I will try the solution lined up above. With fascia-buttons my Bodnar controller will be sufficient to just run trains, or train, just a small layout.
    All-in-all a forum like this is fantastic, I have been here not so many hours and already have a number of comments and suggestions, thank you all !
    Peter
     
    Scott Eric Catalano likes this.
  17. andiatbaden

    andiatbaden New Member

    3
    1
    1
    Hello Dani,

    thank you for your work and the articles here and in your blog.

    I like to use the dcc++ controller with Märklin K-Tracks for the locos and the turnouts with dcc. My problem is, with DCC there is no option for detecting occupied blocks. For this, i think, i have to use the loconet interface. As Software i will use rocrail.

    I have some questions:

    - What are two units that are connected to track and programming track?
    - Have you implemented the PC interface, as written in your blog entry, so that the modified dcc++ station can be used with rocrail?

    Thanks for your answer
     
    Scott Eric Catalano likes this.
  18. Rick Camden

    Rick Camden New Member

    2
    3
    2
    I was looking for different ideas to automate loco stops and starts and I came across DCC++. Wondering if it could be used as a braking district, I've downloaded it and started checking it out. I was hoping to be able to use the Program track to broadcast zero speed packets. (higher cost DCC boosters have this ability) Got no response to <t 0 0 0 0> so obviously the program track won't accept throttle commands. It was worth a try.
    So, I tried it for the Main output. <t 1 0 0 0> . I got a response of <T1 0 0>. Great, that's a good sign. I wrote a line of code in the main loop. Serial.println("<t 1 0 0 0>"); delay (150000); // the delay is just a quick and easy way to slow the monitor down only for testing the response.
    I then installed a loop back jumper from pin 1 to pin 0 (transmit to recieve) and I get lots of zero speed responses. I believe I can use this as a stand alone adruino to run DCC++ and generate the zero speed packets. If I use another arduino running DCC++ with a shield, and switch between main and zero speed DCC signals and send it to the program track, I believe I'll have a braking district. Switch to the zero speed signal to stop a loco and back to the main to restart it . I do see a couple of drawbacks though. While functions such as lights and sound would be maintained by the loco, no new function commands could be recieved by the loco while it is stopped. Also, the difference in phases between the two signals may cause problems. But if standard power district track wiring methods are used I believe phasing won't be a problem. I don't have a motor shield so I can't do any testing yet. It will be a while before I get one. In the mean time I'll download the Arduino based DCC sniffer and see what packets are actually being sent. This is only a first step. I have other ideas on how to overcome the function control drawbacks. A "minion" Arduino with a DCC packet repeater may be a possibility. If anybody is interested and would like to experiment with this, lets hear some results and ideas.
     
    Scott Eric Catalano likes this.
  19. v64

    v64 TrainBoard Member

    21
    19
    3
    Can someone please confirm that the Pololu driver board is compatible with using an Arduino Ethernet Board on a Uno host

    Thank-you
     
    Scott Eric Catalano likes this.
  20. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    I use the pololu motor shield with an uno...and it should with theethernet shield... I have wanted to do this but not got around to it...as long as the pwm pins arent used with the ethernet shield it should work fine
     

Share This Page