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

Gregg Aug 25, 2015

  1. Ian Robins

    Ian Robins New Member

    5
    0
    1
    Thanks for the reply Jim. Sorry, the LED I was referring to was the one on pin 13. I'll have another try and let you know how I get on.
     
  2. Ian Robins

    Ian Robins New Member

    5
    0
    1
    Hi Jim. Thank you very much for your supply. Sorry I didn't make it clear which LED I was referring to. I was testing the Mega by putting a jumper between pin 13 and 3 which put the LED (L) next to pin 13 out. As I understand it, sending a <1> to the mega should then turn this back on. All that happens is that the LEDs L, TX and DX briefly flash.
     
  3. Jimbo20

    Jimbo20 TrainBoard Member

    214
    157
    7
    Hi Ian, I understand now that you are trying the Diagnostic routine, so I assume you don't have a motor board installed. (I didn't ever try this myself as I don't have a standard Arduino.)

    However, have you tried resetting the Arduino or sending <s> to it? You should get some legible status text returned on the serial monitor. E.G. something like:
    "iDCC++ BASE STATION FOR ARDUINO MEGA / ARDUINO MOTOR SHIELD: BUILD 23 Feb 2015 09:23:57"

    If you don't get this you may simply have the serial baud rate incorrectly set on the serial monitor.

    Jim

    EDIT: From memory I think the DCC++ sketch sets the serial baud rate at 115200, so you need to make sure this is what you have the serial monitor set to.
     
    Last edited: Sep 12, 2018
  4. Ian Robins

    Ian Robins New Member

    5
    0
    1
    Hi Jim, I have Sent <s> to the Arduino and got text returned similar to your example and I do have the baud rate set to 115200.

    The text I get is "iDCC++ BASE STATION FOR ARDUINO MEGA / ARDUINO MOTOR SHIELD: V-1.2.1+ / Sep 12 2018 13:58:54><N0: SERIAL><X><X>"

    Ian
     
  5. Ian Robins

    Ian Robins New Member

    5
    0
    1
    Also Jim, As I am new to TrainBoard, should I be starting this as a new post?

    Ian
     
  6. Diehard

    Diehard TrainBoard Member

    10
    0
    4
    Hello, I tried clicking on Master, but it does not display a choice for sample-layout. Can someone please verify if it works for them or have an other way of getting the info. Thanks.
     
  7. paulie77

    paulie77 New Member

    4
    4
    5
    I actually made some headway modifying Greg's (Incredible!) work. His Throttle was exactly what I was looking for. I intend to add switch (turnout) controls either on the map itself or in the section below it. I also intended to have buttons to control layout lighting and automation.

    I made heavy modifications to his code to suit my layout. I chose not to use any of the automation as my layout is a great deal larger than Greg's. In fact, I removed everything that had to do with automation. The good news is that I heavily commented everything I did. So while these files are basically useless to everyone but me for running. They may give you some insight into what needs to be done to make modifications for your layout.

    Just a couple of notes. 1) It has been 8 months since I worked on this, so it is truly doubtful that I will be able to answer any questions. Indeed, that is why I commented everything I did within the code. 2) Model Railroading is a winter sport for me, and it's not winter. I just happened to be in a hotel room and completely bored when I found David Jennex's post above in my email. 3) I only put this up on Github to learn how to use it. So please excuse any faux pas.

    I think the most important contribution I may have made are the comments in the "controllerConfig.pde". The comments here explain what most of the variables in the commands do to control your locomotives.

    The code can be found here: https://github.com/lpcia/Controller
    I am a pretty fair C programmer in my own mind, but in fact, I'm only a rookie. With Java, I had to do a LOT of reading. That may be encouraging to some, and something darker to others!

    I attached a screenshot of my layout with the current state of the code.

    IMPORTANT. You don't have to have this connected to your layout or an Arduino to snoop around or run it from Processing. Make hardware connections at your own risk.

    Best Regards,
    Paul
    Wisconsin, USA Go Brewers!

    PS Thank you Greg for all the work you did!
     

    Attached Files:

    Last edited: Oct 15, 2018
  8. jfcastiglia

    jfcastiglia TrainBoard Member

    18
    0
    2
    very nice i was just happy to get my loco programmed on the original lol I did DL Greg's to test my hardware seeing as I cant get jmri working so i wanted to see if something else would work and as soon as I figured how to get my loco in the sketch it worked!!!. still working out my jmri issues little stuck there thinking seeing if i can get this controller to run on a raz Pi to make it easier for one of my set ups.
     
  9. Onizukachan

    Onizukachan TrainBoard Supporter

    384
    289
    6
    Thanks to everyone for all the work invested in this project.
    I just got DCC++ base station working on a Mega with JMRI and withrottle.
    Only difficulty I had (besides waiting forever for the China motor hat) was that the pin has changed from the time of the videos.
    It is now #2 not #5, the other end is still #13. I hope that helps someone down the road.
     
  10. deHarry

    deHarry New Member

    2
    0
    1
    Hi Gregg!
    At first, my congratulations to you for your impressive work!

    I stumbeled over DCC++ on the search for digitizing my old TT size modeltrain and read through this thread for some days now.
    I'm not so far up til now, but I fear I have a problem in understanding how to model my own layout to get it into the controller app.

    Short info on my layout:
    Back in 2004 I reactivated my old TT model train and started to digitize it by means of MERG electronics. Unfortunately I was distracted by other, mor interesting projects at that time, so this idea got forgotten for some years. The layout still rests beneath the ceiling in our cellar room and waits for completion. You can have a look at it on my homepage (written in german).

    I work with windows, so I cannot use RailModeller.
    Is there any application around which runs on windows and allows to export to the RailModeller file format?
    Or is there another way to get the job done for me?

    Thanks!
    Harald
     
    Last edited: Nov 28, 2018
  11. deHarry

    deHarry New Member

    2
    0
    1
    Hello again!
    I just had a first look at the Controller software and realized that there is no need for using RailModeller or some other CAD program to get the layout into DCC++ Controller.
    If I get it right, I just have to define my layout by means of typing C++ code into "controllerConfig.pde".
    Is that right?

    Thanks, Harald

    [edit]
    ...and I just remembered that I read this on the GIT pages some days ago :)
    Have to fiddle out how those coordinates are to be read...
    [\edit]
     
    Last edited: Nov 28, 2018
  12. IronMan1963

    IronMan1963 TrainBoard Member

    17
    8
    2
    Is it possible to get the L298N motor controller to work with the Arduino Base Station in stead of one of the motor shields. I posted over on Model Railroad Hobbyist without much results so far other than it would be a headache. Attached is the controller I am talking about. I have several on hand. Help with the sketch and hook up diagram would be good. If it can be done.
    Thanks Richard
     

    Attached Files:

    vasilis likes this.
  13. mikegillow

    mikegillow TrainBoard Member

    117
    117
    13
  14. Atani

    Atani TrainBoard Member

    779
    566
    15
    Yes, it can be made to work *BUT* you will need to cut a couple pins on the main IC to add a resistor and wire for the current sense. You can see a diagram here: https://www.trainboard.com/highball...sp32-base-station.112634/page-13#post-1047918 at the top (red board and transistor circuit next to it). The transistor circuit is necessary to create an inverse logic signal for in1/in2 (or in3/in4) and you need to add the resistor for current sense, see this picture for a close up of how to cut/add it: https://www.trainboard.com/highball...sp32-base-station.112634/page-11#post-1046984

    A quick rundown of connections for the arduino to the L298N board like you show:
    SIGNAL_ENABLE_PIN_MAIN -> A Enable (remove the jumper)
    CURRENT_MONITOR_PIN_MAIN -> wire between resistor and pin 1 on IC
    DCC_SIGNAL_PIN_MAIN -> first transistor circuit and in1

    SIGNAL_ENABLE_PIN_PROG -> B Enable (remove the jumper)
    CURRENT_MONITOR_PIN_PROG -> wire between resistor and pin 15 on IC
    DCC_SIGNAL_PIN_ORIG -> second transistor circuit and in3
     
    vasilis likes this.
  15. IronMan1963

    IronMan1963 TrainBoard Member

    17
    8
    2
    Thanks Atani
    Ok I think i can work with that. I have 5 of these little devils so if I blow one up no big. Already blew a l293 motor shield on a different project. I should have everything on hand. What about the Sketch? Anything need changed there?
     
  16. Atani

    Atani TrainBoard Member

    779
    566
    15
    As far as I know, no changes to the code are required but you may need to adjust the current value in CurrentMonitor.cpp to increase it a bit for the higher amp support on this board
     
  17. Tosh

    Tosh New Member

    6
    0
    1
    Hi Gregg, Terry here, I have many questions on your DCC++ layout and wiring, could you contact me if your still into this and give me some direction as I am trying to duplicate your layout with an additional engine shed and turntable.
    Cheers
    Terry
     
  18. Tosh

    Tosh New Member

    6
    0
    1
    Hi, Terry here, can you share that code with me as I’ve been struggling to get my acceriors (switches) to work, under the simulator when you issue a T command it return a confirmation, don’t get that on the layout, thanks
     
  19. Ravindra

    Ravindra TrainBoard Member

    24
    52
    2
    I have been using dcc++ on my layout . I am having another arduino acting as a stationary decoder for turnouts and it works very well till the point the train is moving slowly let’s say 10 miles an hour. But after I increased the speed the turnouts don’t respond immediately. I have to push turnouts butoons in JMRI for several times and then it suddenly throws it. So as train moves faster the decoder lags in response. Any help on this situation will be helpful. Thanks
     
  20. Atani

    Atani TrainBoard Member

    779
    566
    15
    Are you powering the decoder from the track power? If so, are you feeding enough power to the track? It sounds like a lack of power issue.
     

Share This Page