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

Gregg Aug 25, 2015

  1. Peter Unger

    Peter Unger New Member

    7
    5
    1
    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

    6
    6
    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. Peter Unger

    Peter Unger New Member

    7
    5
    1
    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

    6
    6
    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. Peter Unger

    Peter Unger New Member

    7
    5
    1
    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. Peter Unger

    Peter Unger New Member

    7
    5
    1
    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

    16
    15
    3
     
    Scott Eric Catalano likes this.
  8. sachsr1

    sachsr1 TrainBoard Member

    33
    13
    3
    Are you using JMRI, or are you running the DCC++ directly?
     
    Scott Eric Catalano likes this.
  9. Peter Unger

    Peter Unger New Member

    7
    5
    1
    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

    33
    13
    3
    Scott Eric Catalano likes this.
  11. Jimbo20

    Jimbo20 TrainBoard Member

    50
    46
    3
    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
     
  12. Peter Unger

    Peter Unger New Member

    7
    5
    1
    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
     
  13. Jimbo20

    Jimbo20 TrainBoard Member

    50
    46
    3
    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
     
  14. Jimbo20

    Jimbo20 TrainBoard Member

    50
    46
    3
    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
     
  15. Pieter

    Pieter TrainBoard Member

    16
    15
    3
    " 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.
     
  16. Peter Unger

    Peter Unger New Member

    7
    5
    1
    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
     

Share This Page