DCC-EX Programming Track

ScottyB Feb 21, 2021

  1. ScottyB

    ScottyB TrainBoard Member

    14
    7
    16
    Hello all,

    We have been successfully running the "original" DCC++ on our N scale layout using an authentic Arduino Uno and Motor Shield for many years.

    We recently changed the software to the latest DCC-EX software (3.0.0) and all works well except our programming track. We always get the error "no acknowledgment from locomotive (308)" on every locomotive (we own seven.)

    Edit -- updated to 3.0.3 with the same results.

    The locomotives "pulse" while JMRI tries to read CV 8 and CV 7. But we get the above error every time.

    The wiring is correct. The locos do "pulse." And we get the same error for every locomotive, so it's not the decoder.

    Programming worked fine with the original DCC++ and we changed nothing other than the software.

    Any help is greatly appreciated!
     
    Last edited: Feb 21, 2021
  2. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    Maybe use the installer to try Classic just as an experiment. I found the opposite to be true where I had more problems with the original DCC++ vs the new Classic or EX. The other day I went to program an engine though after not doing one for a few months on my short section of programming track and started getting the 308 error. I wiped the short track down with an electrical contact cleaner and the 308 problem went away.

    Post back when you find the answer and hopefully one of the guys working on the new version will check in,

    Sumner
     
  3. Ash

    Ash TrainBoard Member

    106
    66
    8
    Did you remove the jumpers? One of the changes for DCC-EX is that jumpers are not needed. The documentation addresses how to assemble a new setup; perhaps a transition guide is needed for those who have been using DCC++ Classic.

    Run the diagnostics. You might be able too see where adjusting the ACK LIMIT will help. The default is 60mA.
    https://dcc-ex.com/reference/software/diagnostic-d-ack-command.html

    Using the Arduino serial monitor, issue these commands:

    <D ACK ON>
    <R 8 1 1>

    I use <D ACK LIMIT 42> or <D ACK LIMIT 75>, depending on which locomotive I'm programming.

    I also use <1 PROG> to keep the programming track power on while programming. I was advised that it should leave the Keep Alive charged.

    These changes may not be needed with the standard motor shield.
     
  4. ScottyB

    ScottyB TrainBoard Member

    14
    7
    16
    Well, I still need help.

    I cleaned the track with contact cleaner, no change.

    I removed the jumpers. Only noted change is that when the locomotive is "reading" it doesn't jump as much as it did before. With the jumpers on, it was a jackrabbit jumping forward. Now it acts normally. However, I still have the same error message.

    In JMRI, I get the following result in the DCC++ Traffic Monitor when trying to program:

    Prog Read Cmd:
    CV: 8
    Callback Num: 0
    Callback Sub: 82
    Program Reply:
    Callback Num: 0
    Callback Sub: 82
    CV: 8
    Value: -1

    Everything else with DCC-EX works just fine. Running trains, etc.

    Thanks.

    EDIT -- Serial monitor results in next post.
     
    Last edited: Feb 22, 2021
  5. ScottyB

    ScottyB TrainBoard Member

    14
    7
    16
    Ack diag on

    Auto Prog power on
    ACK baseline=24/71mA Threshold=44/131mA Duration: 2000us <= pulse <= 8500us
    V0 cv=8 bit=7
    NO-ACK after 142mS max=16/47mA pulse=0uS
    V1 cv=8 bit=7
    ACK after 100mS max=195/583mA pulse=8476uS
    V0 cv=8 bit=6
    NO-ACK after 145mS max=214/639mA pulse=8536uS
    V0 cv=8 bit=5
    ACK after 100mS max=219/654mA pulse=8476uS
    V0 cv=8 bit=4
    NO-ACK after 144mS max=16/47mA pulse=0uS
    V0 cv=8 bit=3
    NO-ACK after 146mS max=16/47mA pulse=0uS
    V0 cv=8 bit=2
    ACK after 99mS max=231/690mA pulse=8480uS
    V0 cv=8 bit=1
    ACK after 101mS max=238/711mA pulse=8476uS
    V0 cv=8 bit=0
    NO-ACK after 144mS max=17/50mA pulse=0uS
    VB cv=8 value=217
    NO-ACK after 144mS max=17/50mA pulse=0uS
    Auto Prog power off
    Callback(-1)
    <r1|1|8 -1>
    Ack limit=42mA

    Auto Prog power on
    ACK baseline=15/44mA Threshold=29/86mA Duration: 2000us <= pulse <= 8500us
    V0 cv=8 bit=7
    NO-ACK after 141mS max=17/50mA pulse=0uS
    V1 cv=8 bit=7
    NO-ACK after 145mS max=197/589mA pulse=8532uS
    Auto Prog power off
    Callback(-1)
    <r1|1|8 -1>
    Ack limit=75mA

    Auto Prog power on
    ACK baseline=15/44mA Threshold=40/119mA Duration: 2000us <= pulse <= 8500us
    V0 cv=8 bit=7
    NO-ACK after 141mS max=16/47mA pulse=0uS
    V1 cv=8 bit=7
    NO-ACK after 144mS max=193/577mA pulse=8532uS
    Auto Prog power off
    Callback(-1)
    <r1|1|8 -1>
     
  6. KC Smith

    KC Smith TrainBoard Member

    109
    111
    12

    ScottyB,

    We've pulled this Thread information over to DCC++EX Support on Discord server and are taking a closer look at it.

    Please give us some time to get it into the support pipeline for some clarification, testing & feedback.

    Regards,
    Kevin
     
  7. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    It is frustrating to see the number of devices that completely ignore the NMRA spec! That's just the engineer in me venting. I love to gripe about things I can't change and then fix it on our end anyway ;) Just for reference, the spec states:

    Ack must be at least 60mA for 6ms +/- 1ms (so 5000-7000 microseconds are allowed)

    Despite this, we check for pulses as short at 2000us and as long at 8500us, a full 1500us out of spec on the upper end. This decoder is exceeding even that extra fudge factor. I'll look at what we can do and if we should up that in the next version. For now, using a text editor or the Arduino IDE, open the DCCWaveform.h file in the CommandStation-EX sketch folder and find this line at the very bottom:

    Code:
    unsigned int maxAckPulseDuration = 8500; // micros
    Change 8500 to 8600. Save the file and then upload the sketch again. That should do it based on what is being reported.
     
    KC Smith likes this.
  8. ScottyB

    ScottyB TrainBoard Member

    14
    7
    16
    Flightrisk,

    That did it! I haven't tested every loco, but on the one I'm trying to program, that was the solution.

    Just for reference, on this layout we have 7 Kato N scale locomotives. ALL have the TCS drop in decoders; some factory installed, some installed by me. Model numbers are all TCS K0D8 or K1D4. JMRI 4.20, authentic Arduino Uno and authentic Arduino Motor Shield. All run from a Raspberry Pi 2 running a slightly modified version of M Steve Todd's JMRI image. (Modified only to remove unused items.)

    Many thanks!

    ETA -- even reading a full sheet of CVs, I still get random timeouts at 8600. About 5 of every 100 CV reads shows the 308 error. I wonder if the RPi2 is the bottleneck?
     
    Last edited: Feb 23, 2021
    KC Smith likes this.
  9. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    We have new feature where users can create a file called mySetup.h Then you can put commands you want to set at runtime. So to fix this without going into code, you would add a line <D ACK MAX 9000>. We have a lot of settings and overrides that you can change this way, such as start with power on, change ACK settings, add a custom motor board, etc. We have to document these features. It is in our Master branch and will be in the 3.1 release very soon. So for now, you can change the line of code again and make it bigger, like 9000.

    I don't think it''s the Pi. Our routines are much faster than DCC++ and we don't block code like it did. So we wouldn't miss important events. We even check for the response in between packets now instead of waiting for all the packets and repeats to get sent. That is another reason why DCC++ Classic can miss ACKs.

    The controller (Pi) sends a string command and we process it. For CVs, that all happens with EX and the loco. JMRI (or another controller/cab) sends the command, the decoder obviously got the instruction if we see pulses back, and then we report success or failure to JMRI. But it has to poll the CV; "are you a one or a zero? Ok, next, are you a one or a zero? It goes through they entire byte, then verifies it. EX is also faster because once it gets an ACK, it stops sending repeat packets. If the decoder/motor combination, or dirtly track when it jumps a bit, or any number of things goes wrong, it can miss even with repeated commands. While it is possible JMRI on a computer could miss a response when parsing all the things it is seeing fed to it on the serial line, it is usually a missed acknowledgement because of timing, too little current, or the loco/decoder/track. We will continue to add things we find from particular decoders. We even thought of having specific changes that we provide in an example "mySetup.h" file to tweak settings for decoders that need more settle time or have longer ack pulses like this one.


    Thank you for sharing your configuration. That is always helpful and tells us what people are using. I have a DC Kato Silver Streak I promised myself to convert it to DCC and sound. Hopefully that will happen by summer :)
     
    KC Smith and Sumner like this.
  10. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    I looked some and couldn't find the 'new feature'. Is it somewhere that we can get to it? A link?

    Thanks,

    Sumner
     
  11. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    You need version 3.0.3 or higher. The master branch will work, latest is in nanoEvery2 (complicated, but part of that was making the nano work, hence the name ;) ) I would try nanoEvery2, here is the zip link:

    https://github.com/DCC-EX/CommandStation-EX/archive/nanoEvery2.zip

    Make sure your config.h is the way you want, then create a filed called "mySetup.h". "S" has to be capitalized. In that file, put your setup commands. Examples:

    SETUP("1") // startup with both tracks on instead of the default off "1 MAIN" would start with just MAIN on
    SETUP("D ACK MAX 9000") // allow ACK pulse durations up to 9000us

    Compile and upload. Major internal changes, also we removed most of the library requirements so new users won't have to install DIO2.h or the LCD and OLED libraries if they use a display
     
    Sumner likes this.
  12. ScottyB

    ScottyB TrainBoard Member

    14
    7
    16
    To throw in another question. The layout has been operating very well.

    But, I have two HO Broadway Limited Paragon 3 locomotives that do not work with the programming track. All I get is "No acknowledgement from locomotive (308)" Other non-BLI lokes program just fine so it's not the wiring. I am aware that BLI programming required different current or something like that. Can someone point me in the right direction as to how to fix this? Much appreciated!

    As a side note, we have two small layouts in my basement; my son's N and my own On30. (So why am I asking about HO? Long story.) Both have DCC-EX with the Wifi interface. A desktop computer elsewhere in the house can connect to either to use JMRI. Very sleek. I am considering just getting a USB keyboard/mouse and cheap monitor to hook up to my RPi2 to not have to go to the other room to program, but it's pretty rare.
     
  13. Ash

    Ash TrainBoard Member

    106
    66
    8
    Run some diagnostics. Some decoders can require tuning of the ACK parameters.
    https://dcc-ex.com/reference/software/diagnostic-d-ack-command.html#more-detail

    For example, the default pulse length is 4000 to 8500uS. If you see pulse length is outside the defaults, there are commands to modify the parameters. One of my decoders pulsed around 8700uS, so I added a line in mySetup.h
    Code:
    // sample mySetup.h file
    SETUP("<D ACK MAX 9200>");  // Set ACK detection to allow pulses up to 9200 microseconds long
    SETUP("<D ACK LIMIT 60>");  // default, but displays on LCD
    SETUP("<0>");
    SETUP("<D CMD 0>");
    The commands can be sent from the serial monitor and can also be used in the JMRI 'Send DCC++ Command' screen.
     
    Mark Ricci likes this.
  14. ScottyB

    ScottyB TrainBoard Member

    14
    7
    16
    OK, so same issue as above. I'll tweak that again. Thanks!
     

Share This Page