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

Gregg Aug 25, 2015

  1. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    Hi Robert,

    "Bachmann 2-function decoder (36-552)" It is a function decoder and will only work with lights that is connected to it, hence your limited options. You have to select the address of the function decoder and then the F buttons you have set up for it on your throttle. If you have installed it as an additional decoder in an engine/ passenger car you should be able to link (consist) it to the one in the engine and the use one button to activate when you have selected the engine. 2 functions = 2 light/ 2 sets of lights.

    Pieter.
     
    Scott Eric Catalano likes this.
  2. rva1945

    rva1945 TrainBoard Member

    114
    39
    9
    Thanks. Now, I don't understand that thing about "consisting".

    Anyway, what puzzles me is the fact that when using the throttle from JMRI DecoderPro, it responds to the Light button, then it will always lit when in forward direction, even if it is the Arduino that sends the speed command.

    Now, if I manage to tell the decoder that Function 1 will turn the light on, then what I must do is send the F1 command? But in the program window the F1 to F8 functions are use for dimming, not turning the light on. I think I'm lost here.
     
    Scott Eric Catalano likes this.
  3. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    Hi Robert.

    Consist is where you link a second decoder to the first and then you control the second one via the first decoder . You slave the one to the other.

    Here is the link to the decoders manual"http://www.bachmann.co.uk/pdfs/36-552.pdf". Yes your option is limited to dim & bright. CV51 switch bright on or of and CV52 set the how bright (see it as dimmer switch) CV51 setting will determine which F1 to F8 you will use to activate the decoder on your throttle or in Decoderpro. Look in Decoderpro what address (basic tab) you have given the decoder. If 3, change it as 3 is the generic address (each of your decoder should have its own address applicable to your setup) used when making any decoders. Check the lights tab what function you have picked. If you want to use F1 - F8 you will have to select the one and save it to the decoder. If you now put your decoder's address in your throttle and press the F key you have picked the light should the come on. If you left the setting on dim it should light right away when you select the address. Just remember , as Decoderpro does some separate programming steps automatically in the back ground, with any decoder when you want to set it up, you start with CV29 as it control the activation of a few important setup features.

    "Now, if I manage to tell the decoder that Function 1 will turn the light on, then what I must do is send the F1 command? But in the program window the F1 to F8 functions are use for dimming, not turning the light on. I think I'm lost here." - In the lights tab if you have select eg F2 to activate the light you will then press F2 on the throttle to activate. 64 is the brightness of the light. The higher the brighter.

    Pieter
     
    Scott Eric Catalano likes this.
  4. Walt Scrivens

    Walt Scrivens New Member

    8
    1
    4
    Hi, folks. DCC newbie here, but 25+years with model railroading, and also with computers.

    I've installed the DCCpp_Uno sketch and am using an Arduino motor controller. My one DCC locomotive has 28-step speed control, and it doesn't respond to any commands. (Actually, the only commands that have any effect on the track are <0> and <1>. From what I've read a 28-step decoder will simply ignore a 128-step command. I've looked at the section in PacketRegister.cpp where the speed packet appears to be being built, but I can't reconcile that code with the only description of the packet structure I've been able to find, at http://trains4africa.co.za/?p=1451

    The simple version of my question is, can this software be used with 28-step locomotives, and what modifications would be needed?

    Thanks
    Walt
     
    Scott Eric Catalano likes this.
  5. crusader27529

    crusader27529 TrainBoard Member

    247
    167
    11
    Does DCC++ support programming on the main line?

    The reason I ask is that although it appears to function, I get timeout messages in JMRI.....I understand that I can't read CVs on the main to verify the write operation, but I'd assumed that The code wouldn't try (and get a timeout).....

    I have other issues with a new (to me) Digitrax SDH164K1B motor/sound decoder where it works after a reset mostly, but if I shut down track power (equivalent to removing a loco from the rails) and turn power back on, the decoder appears to be unresponsive......strange.
     
    Scott Eric Catalano likes this.
  6. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    the DCC++ google page says it can, but beyond that, I am not sure.

    ~Travis
     
    Scott Eric Catalano likes this.
  7. Curn

    Curn TrainBoard Member

    751
    497
    31
    Program on the main through JMRI doesn't work on my setup. Programming track works just fine. Haven't investigated any further than that. Not sure if it is a problem in DCC++ base station or the JMRI side but it does appear to be a real bug.

    Matt
     
    Scott Eric Catalano likes this.
  8. wvgca

    wvgca TrainBoard Member

    499
    305
    21
    Just wanted to say "Thanks" for the information in this thread ... I set up a UnoR3, Deek Robot shield, with JMRI, and it was pretty much painless, and functional .. :)
     
    Scott Eric Catalano likes this.
  9. rva1945

    rva1945 TrainBoard Member

    114
    39
    9
    DCC++ does support programming in the main track...but there are limitations. Some operations, like reading the brand and type of decoder, or changing its address, can only be done in the programming track. Plus I always get an error about problems in communicating with the decoder after changing some values when using the main track, but not in the programming track.

    In my layout, a section of it is the programming track; it is activated by a switch. In "normal" mode, all the layout is the main track, but in "PRG" mode, that section becomes the programming track, and the adjoining section becomes null (no signal at all) in order to prevent a short should a loco step on both tracks at the same time.

    I'm using the original DCCpp_Uno code with some modifications in order to accept input from 4 potentiometers (throttle), 4 direction switches and 4 emergency stop buttons.

    R.
     
  10. jbsorocaba

    jbsorocaba TrainBoard Member

    47
    33
    12
    I'm using the original DCCpp_Uno code with some modifications in order to accept input from 4 potentiometers (throttle), 4 direction switches and 4 emergency stop buttons.

    R.[/QUOTE]
    Hi rva1945
    Interesting alternative. Could you post here your project ..?
     
    Scott Eric Catalano likes this.
  11. rva1945

    rva1945 TrainBoard Member

    114
    39
    9
    Of course, just be patient and I'll post the code here.
    BTW, here I'm testing one of the throttles:



    Regards,
    R.
     
    sboyer2 and Scott Eric Catalano like this.
  12. jbsorocaba

    jbsorocaba TrainBoard Member

    47
    33
    12
    Hi rva
    I saw your video on YouTube. If you use slider potentiometer ( better the balance type ) you will not need the reversal switch
     
    sboyer2 and Scott Eric Catalano like this.
  13. rva1945

    rva1945 TrainBoard Member

    114
    39
    9
    In my first version, I didn't use a reversal switch because I took the center of the pot travel as the neutral zone, with forward and reverse direction at both ends from the middle; but after playing with a trains simulator for a while, I noticed that they have a reversal switch, or direction switch, with neutral in the middle position, and the throttle goes from 0 to 100%. In some electric locomotives, they use the throttle as the dyamic brake (by moving the lever backwards) when the direction switch is in forward position).
    So in order to make things as close to reality as possible, the throttles go from 0 to 100% and the direction is set by the direction swicth.
     
    sboyer2 and Scott Eric Catalano like this.
  14. rva1945

    rva1945 TrainBoard Member

    114
    39
    9
    And at the same time, is easier for freight ops (coupling and uncoupling) if you can leave the throttle at a given position and change direction quickly with the switch.
     
    Scott Eric Catalano likes this.
  15. jbsorocaba

    jbsorocaba TrainBoard Member

    47
    33
    12
    rva
    Make sense
    I would like to see the code when you have if possible.
     
    Scott Eric Catalano likes this.
  16. rva1945

    rva1945 TrainBoard Member

    114
    39
    9
    Well guys, I have just uploaded a zip file with all the files belonging to the project.

    I added some comments to my code ("// RVA1945's CODE"). You can ignore the comments in Spanish.

    Please feel free to ask me any question.

    Trains + Robotics: who can ask for more?

    Regards,
    Robert
     

    Attached Files:

    sboyer2 and Scott Eric Catalano like this.
  17. jbsorocaba

    jbsorocaba TrainBoard Member

    47
    33
    12
    Hi Robert

    Very interesting your code.!!

    I had mounted a throttle based on a Arduino Mini Pro, which sends commands to DCC++ via TX and RX, but your code incorporated these commands in the original code of the DCC ++.
    However I still do not understand how you select the addresses of the locomotives in use.
    Please do you have a scheme of these connections for better understanding.? Are you using Arduino Mega ?
    Sorry to bother you.
     
    sboyer2 and Scott Eric Catalano like this.
  18. rva1945

    rva1945 TrainBoard Member

    114
    39
    9
    If you analyze my code, you will see that I use arrays, and I just loop through the arrays to read the sliders, switches, send the commands to specific locos, etc.

    The (4) locos' addresses are hard-coded:

    int locoADDRESS[4] = {5952,5741,3,3};

    (so far there are two locos at home, a third way will arrive in minutes from the technician that installed a decoder in it), then I will replace one of the 3s with its new address.

    As for the connections I don't have it now but if you give me time I can do something.

    Regards,
    R.
     
    sboyer2 and Scott Eric Catalano like this.
  19. jbsorocaba

    jbsorocaba TrainBoard Member

    47
    33
    12
    Thank you for your prompt response. I would like to try to insert a LCD and a keypad to configure the locos addresses.
     
    sboyer2 and Scott Eric Catalano like this.
  20. crusader27529

    crusader27529 TrainBoard Member

    247
    167
    11
    Good job......more than 40 slots for locos possibly will max out the performance of an Arduino.

    I've been trying (I'm not a C++ programmer, but know C reasonably well) to get the code to compile on an Arduino NANO because if has 2 extra I/O pins (A6 & A7), but appears to be identical otherwise......I added code that interprets the return from the IDE so it SHOULD act just like an UNO, but it fails the compile at some point.

    Consider using the NANO instead of the UNO, because except for not having shield capability, it's the same and cheaper.....if you're ever going to use a different MD board, or more than 1 MD board, the NANO makes sense.

    I wrote some code for optical sensing of block detection, but never could figure out how to use github correctly....I don't blame you for not using it.
     
    Scott Eric Catalano and sboyer2 like this.

Share This Page