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

Gregg Aug 25, 2015

  1. w8one

    w8one TrainBoard Member

    89
    109
    5
    For two reverse loops

    If you need 2 reversing loops you could use a second stacked Motor shield by using the dcc++ signal coming out of the Main motor shield on the base station to power the second motor shield (vin already has the dcc information) set both pwm pins to 100% and use the dir pins to flip the loops.
     
    Scott Eric Catalano likes this.
  2. KC Smith

    KC Smith TrainBoard Member

    109
    111
    12
    Gregg and All,

    Just a thought,

    I know we have quit a few DCC++ Support Threads going but I was thinking of one that might help New people finding this DCC++ site from either YouTube, Google, Trainboard etc and Currently being routed to Introducing DCC++ ......

    We edit those entry point to Point to point to a new forum Thread "DCC++ Arduino Uno and Mega 2560 Startup and Support".

    Gregg could write a into and maybe copy the best FAQ we've already covered in the previous four months.

    Then maybe mention that by clicking on the DCC++ tab above they can see the other forum of DCC++ Developmental Support Threads.

    This should help get newer people up to speed quicker while lowering overall questions across all the treads. They wouldn't have to read 860+ threads in the Introducing DCC++ Thread.

    And as we gain experience others can help offload Gregg, TwinDad, Steve, Dave, Mike, Jason etc. from some of the easier questions in the in the DCC++ Startup and Support Thread.

    Your Thoughts,
    Kevin

    P.S.
    Or we leave the pointers pointing to Introducing DCC++ and edit that thread as described above, as a "Introducing DCC++ Uno and Mega Startup and Support"thread, then just Cut all 860+ threads out and past to a Archive "DCC++ Initial Development" thread same result different approach.
     
    Last edited: Feb 1, 2016
  3. w8one

    w8one TrainBoard Member

    89
    109
    5
    Scott Eric Catalano likes this.
  4. HVT

    HVT TrainBoard Member

    74
    93
    15
    W8ONE,
    Is it possible to add a link on the DCC++ website to the wiki? And from the GitHub repository page to the wiki?

    Thanks for considering this request.
    Dave
     
    Scott Eric Catalano likes this.
  5. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Would be cool if members carried links in theirs sigs.

    Like below for example

    Best thing is it should be auto retrospective and appear on all your previous posts (y)

    Edit; can't seem to make it stay in large font though
     
    Last edited: Feb 2, 2016
    Scott Eric Catalano likes this.
  6. w8one

    w8one TrainBoard Member

    89
    109
    5
    It probably is but Gregg will have to do that. I just make some of the wiki pages.
     
    Scott Eric Catalano likes this.
  7. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    Well, you can pick up the "WiThrottle" branch from my GitHub account: https://github.com/msunderwd/BaseStation-Uno

    ... but right now it's broken and won't compile... and I'm a little bit tied up with day-job work stuff, not sure when I'll get to clean it up. And my hardware still isn't working (haven't had time to try and fix it). But feel free to dive in and have a go.
     
    Scott Eric Catalano likes this.
  8. rniefert

    rniefert TrainBoard Member

    15
    14
    3
    I seem to have the system up and running properly since I can program locomotives and read the CVs back with no problems. I only have one track a t a time hooked up. When I hook the track to the operations track the headlight comes on so I'm getting power, however I cant get the locomotive to respond to JMRI. any advice?
     
    Scott Eric Catalano likes this.
  9. mikegillow

    mikegillow TrainBoard Member

    116
    117
    13
    Suggest you post this in the JMRI thread. Please include version of JMRI you are using and interface settings.
    Are you running the Arduino IDE on the same machine? Using the Arduino serial monitor can you get the loco to respond? If not then the problem is more basic than the JMRI interface. (FYI, you can't run both the Arduino serial monitor and JMRI interface over serial at the same time.)
     
    Scott Eric Catalano likes this.
  10. Jordi

    Jordi New Member

    1
    1
    1
    Hello, sorry for my language, can be used for digital Arduino Nano plant?, Which shield use? thanks.
     
    Scott Eric Catalano likes this.
  11. in2tech

    in2tech TrainBoard Member

    2,705
    7,639
    78
    Just beginning although I have an Arduino but want to try things out before jumping slowly into this. I have download both the Arduino Sketch Software as well as the Processing software, java, and have it running in emulation mode, but can not figure out how you would add your layout diagram or make your layout diagram to the DCC++ Controller Software?

    Any help appreciated!
     
    Scott Eric Catalano likes this.
  12. mikegillow

    mikegillow TrainBoard Member

    116
    117
    13
    Jordi - you may want to check out the Github site. The sketch is written for the Uno or Mega. Not sure if a Nano would work but at the very least you would have to modify the code to try it. Two motor shields known to work and documented on the GitHub site are the Arduino Motor Shield R3 and the Pololu MC33926. A 'genuine' R3 shield may be hard to find but clones are available on ebay. You may want to look at the Motor Shields thread in this forum.
     
    Scott Eric Catalano likes this.
  13. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    According to the Arduino.cc specs, the Nano itself is based on the same processor (Atmega328) as the Uno, so the same software should work. However, the Nano is not designed for use with a shield -- it has no plug-in pins. Rather, it is designed to be placed into a bread-board (at least that's the case for the versions on the Arduino.cc web site). You could do that, and then use jumper wires from the breadboard to connect to the pins of the Arduino Motor Shield. The mappings of the DCC Logic Signals and current sensing circuits may be slightly different -- you would need to compare the names of the signals outputs on the Nano schematic to that of the Uno schematic. In other words, pin D5 on the Nano may or may not be the same as pin D5 on the Nano. Perhaps it is pin D7 on the Uno. But once you know the translation from Uno pin to Nano pin you should be able to modify the configuration file in Dccpp_Uno.h and wire the Nano to the Motor Shield accordingly.

    -Gregg
     
    Scott Eric Catalano likes this.
  14. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    The layout diagram is hard-coded into the interface but can be readily modified by changing the code. The layout definition begins on line 375 of controllerConfig. The best way to start is probably by modifying some of the parameters for a given track --- you can then see how the curvature, direction, and length can be changed. On the to-do list for a rainy weekend (well, probably more than just one weekend) would be to add a layout-builder to DCC++ Controller so that you don't need to modify the actual software.

    -Gregg
     
    Scott Eric Catalano likes this.
  15. in2tech

    in2tech TrainBoard Member

    2,705
    7,639
    78
    So I tried opening it up with the Arduino sketch software and the Processing software and then realized I needed to try Komodo Edit for the Mac (or a code editor program for html, php, etc...) and now I see it. Will make a backup and try modifying your code and see what happens. Good thing I mess around with coding websites a little bit :)

    Here goes nothing. I just need to make a simple oval track with one switch to start out. As you stated I am just going to try to adjust your code and see what happens for now.

    Code:
    // CREATE MAIN LAYOUT AND DEFINE ALL TRACKS
      
        layout=new Layout(325,50,1000,80*25.4,36*25.4);
      
        Track bridgeA = new Track(layout,20,450,62,90);
        Track bridgeB = new Track(bridgeA,1,348,-90);
        Track bridgeC = new Track(bridgeB,1,399);
        Track t5A = new Track(bridgeC,1,126);
        Track loop3A = new Track(t5A,1,682);
        Track loop3B = new Track(loop3A,1,381,-180);
        Track loop3C = new Track(loop3B,1,124);
        Track t20A2 = new Track(loop3C,1,126);
        Track t20B2 = new Track(loop3C,1,481,15);
        Track t20B1 = new Track(t20B2,1,481,-15);
        Track loop2A3A = new Track(t20A2,1,120);
    
    Just a snippet of your code. Gotta say I am confused at this point. Can you give a rough example of an small oval to get me started. With a little help I should be able to figure this out. I did change the second or third line to -180 and it flipped the entire layout, but not sure why?
     
    Last edited: Feb 25, 2016
    Scott Eric Catalano likes this.
  16. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    An example of an oval is a great idea. Might also add a single turnout by way of example. I'll try to do this over the next few days and will post something on GitHub. Just curious - what is the Komodo editor for? You should be able to edit the Processing code directly in the Processing environment.

    -Gregg
     
    Scott Eric Catalano likes this.
  17. in2tech

    in2tech TrainBoard Member

    2,705
    7,639
    78
    When I try to edit in the Processing environment I only see to line 198. Don't know why. Oval and one turnout would be great.

    Sent from my SGH-T399 using Tapatalk
     
    Scott Eric Catalano likes this.
  18. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    Hmm. What version of Processing are you using? I'm running on a Mac (OS 10.11.3) with Processing 3.02. Was using 3.01, which worked fine, but just upgraded to 3.02 when you said you were having problems. But 3.02 seems to work fine as well.
     
    Scott Eric Catalano likes this.
  19. in2tech

    in2tech TrainBoard Member

    2,705
    7,639
    78
    Processing 3.0.2, Mac OS 10.11.3 El Capitan, not sure and I even look in the Processing preferences. Screen shot below. Any ideas!
     

    Attached Files:

    Scott Eric Catalano likes this.
  20. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    Ah- wrong tab. Each file is in a different tab within the Processing IDE --- the configController file is in the second tab. The tab labels do not appear if the window is too small. If you expand the window you'll see some of the tabs will be labeled. In any case, click the second tab and you should be in the correct module.

    -Gregg
     
    Scott Eric Catalano likes this.

Share This Page