DCC++ programming problems

ricky101 Sep 30, 2016

  1. ricky101

    ricky101 TrainBoard Member

    14
    10
    9
    Hi All,

    Myself and an email firend have just been trying out DCC++ but despite using slightly different equipment we both have the same programming problems.

    Our equipment W8.1 / W10 PC, Arduino Uno, motor shield /L298 module 12VDC power source 2Amp.
    I'm using Hornby 00 R8249 decoder, my friend Bachman N scale EZ decoder.
    The Command station is the DCC ++ and we have tried both the DCC++pp and JMRI front ends.

    Both the DCC++PP and JMRI will drive the locos ok.

    However , the DCC++pp will not read any CV from the loco, but if we write out CV01, though it returns a "Write Error" quickly, it does actually change the CV to the new value ok, as proven when returned to the main track.

    JMRI does the same, but it can take several minutes before returning the error message, again it does update the CV ok.

    To prove the error is not in the output cables, track or loco wheels etc, we have connected the decoder direct to the shield, but still get the same results.

    Have been reading some of the 75 pages of the big DCC++ thread but not seen any clear answers.

    Should add that my system is already using the MiniDCC controller V1 and it works fine, programming almost instantly.

    An advice greatly appreciated.
     
  2. Curn

    Curn TrainBoard Member

    752
    500
    32
    With DCC there are two types of communications. Base station to the decoder is handled through the DCC track signal. But decoder has no direct way to talk back to the base station. In order for the decoder to send data back to the base station, the decoder has to pulse the motor, and this creates a signal in the current draw. The base station reads the current draw to get any acknowledgement signals. This is why a engine will move a little bit forward when you are programming or trying to read a CV.

    DCC++ has a noise filter/smoother on the current signal to deal with system noise. With newer low current motors, sometimes the current draw is below the cut off. With Z scale I had to edit ACK_SAMPLE_THRESHOLD in PacketRegester.h to get it to read. I currently have it set to 15 from the default of 30. You could try playing with this setting. I’ve gone as low as 5 and had it work.

    JMRI seems to really hang up when it can't get an acknowledgement from a decoder.

    Matt.
     
    ricky101 likes this.
  3. ricky101

    ricky101 TrainBoard Member

    14
    10
    9
    Thank you for such a clear answer and solution, that explains a lot.
     
  4. rva1945

    rva1945 TrainBoard Member

    114
    39
    9
    Hi:

    I'm using DCC++ slightly modified to accept inputs from 4 slider potentiometers, direction switches and emergency stop buttons.

    I use JMRi for programming, and when using the Main Track, I always get the error messages but the CV are always written in the decoders, though it takes a while. When using the Programming Track, no error messages and the values are written in no time.



    Regards,
    Robert
     
  5. ricky101

    ricky101 TrainBoard Member

    14
    10
    9
    Hi,

    Your slider controls look very interesting and a lot more easier /realistic to use than the jmri screen throttles.

    Would you be intestested in saying how you have done this and sharing the relevant code ?
     
  6. rva1945

    rva1945 TrainBoard Member

    114
    39
    9
    Yes it is more realistic and easier to control more than one train at the same time instead of keying loco numbers and pressing buttons.

    At first I hade developed a code that read an IR sensor and I sent the commands with a remote control in hand, not realistic. Throttle levers is closer to the real thing. And the turnouts will be driven by servos, controlled by switches displayed on a map of the layout.

    In fact I have already uploaded the code a few days ago in another post. As for the schematics I don't have it but if you're familiar with those robotics boards (Arduinos) it's just a matter of connecting the appropriate wires to the corresponding pins.

    The three locos running at the same time:

     

Share This Page