DCC++ and LGB

Next Jan 3, 2019

  1. Atani

    Atani TrainBoard Member

    590
    528
    15
    Sounds like the shield has some built in "over current" logic and it is shutting down, as you found with 15VDC input. 15VDC should be sufficient for most scales but you are right that G scale it may not be sufficient. I'd suggest using 12VDC and add a booster to the track. A great one to look at is this one. Note that you *CAN* drive this motor driver board from DCC++ but it will require some modifications to the code and an additional circuit to split the single signal pin into two.
     
  2. Next

    Next TrainBoard Member

    24
    3
    2
    Looking at the specs for the Pololu board, I am going to give that a try. Tt claims up to 28V DC input.

    The DCC++ Github Docs have it listed as wirking with the DCC++ code.

    https://github.com/DccPlusPlus/Documentation/blob/master/Motor%20Shield%20Pin%20Mappings.pdf

    RCMan, you posted that you were using this on your test track. Do you have any other insights on it?

    Did you get to operate the locos and switches/points?

    Curious what power you gave it and what power it outputted to the track.
     
  3. Jimbo20

    Jimbo20 TrainBoard Member

    195
    152
    7
    According to the documentation for the a000079 R3 shield, although the normal operating input voltage is 7 - 12v, the max input limit is 18 Volts - providing the jumper is cut.
    I remember I had my supply set to 18volts and there wasn't a problem. (Although I only have n-gauge) My dvm reads around 7v ac for a 11volt input.

    Does it shut off if there is nothing on the track?

    The default setting of parameter CURRENT_SAMPLE_MAX in the file Currentmonitor.h is 300, which equates to approx 885 mA (300x2.95) so if the total current drawn by everything on the track exceeds 0.885 amps it will shut off.

    https://www.robotshop.com/content/ZIP/documentations-a000079.zip
     
  4. Next

    Next TrainBoard Member

    24
    3
    2
    Jim,

    Thanks for the post. It confirms what I thought was happening.

    "Does it shut off if there is nothing on the track?" Yes. Even though there is no current draw, I thing the voltag is triggering a shut off.

    Nonetheless, I will try the Pololu shield. It is rated up to 28V and 3 Amps.

    With the voltage drop on the Arduino Shield, there is not enough power to operate.
     
  5. Jimbo20

    Jimbo20 TrainBoard Member

    195
    152
    7
    I really think that there is another problem. There is no logic on a standard motor shield to cause an over voltage shut off.

    When you say it shuts off, does it reflect this in DCC++; does the DCC++ control panel show the power is switching off? If it does, I believe the arduino/motor shield current sense pin assignments are incorrect.
     
  6. Next

    Next TrainBoard Member

    24
    3
    2
    I use JMRI and it reflects there.

    FWIW, I have been unable to figure out how to open the DCC++ software. I viewed all the Youtubes and other than setting up the arduino code for the base station, I do not know how to invoke the other software or where it runs. If you could pointme to some documentation

    Regarding the current sensing pin, the only set-up I did with pins was to cut the traces (checked with continuity meter), jump 13 to 2, and insert the shield into the Arduino.

    I did errantly post that there was no current draw. I do have lights on the trains and a few houses. I will remove the cars with lights and disconnect the houses. My bad on that one.
     
  7. RCMan

    RCMan TrainBoard Member

    139
    83
    6
    I use the Pololu Shield mentioned and use it on G scale testing of decoders. Does not have the voltage restriction of the Arduino Shied.
     
  8. Next

    Next TrainBoard Member

    24
    3
    2
    Thanks for the post. I am going to order one this weekend.
     
  9. Next

    Next TrainBoard Member

    24
    3
    2
    I stripped down most the lights. I can get a small loco (handcar) to run. Start/stop accelerated/brake. When I put a regular loco on the track it wil run at low speeds. As soon as I up the throttle, the power shuts off. Input DC is 15V and the track is at 9V

    Looks like I gotta try the Pololu shield.

    LGB motors draw up to 1 AMP or more. No way I can have any kind of layout powered by the Arduino Shield.

    The pololu is rated at 3 AMPs. I can get by with that.

    I appreciate everyone's responses and help. Thanks much.
     
    Atani likes this.
  10. Next

    Next TrainBoard Member

    24
    3
    2
    Can someone point me to any documentation on how to invoke the DCC++ controller software. I have it downloaded but have not found any guidance on how and where it runs.

    I believe this is what people have been referring to:



     
  11. Atani

    Atani TrainBoard Member

    590
    528
    15
    It sounds like you are making the shield output and it is going into the over current code. You can increase the threshold a bit safely, the Arduino shields can go higher than 1A per channel. I read something in the spec as it is 2A per channel I believe. If that is the case you can adjust the limit in CurrentMonitor.cpp from 300 to 600 as a test. I'll dig up the reference specs for the shield to confirm and post them shortly.

    Sent from my ONEPLUS A5010 using Tapatalk
     
  12. Next

    Next TrainBoard Member

    24
    3
    2
    The code I have is below.

    do I change: long int CurrentMonitor::sampleTime=0; to long int CurrentMonitor::sampleTime=600;




    /**********************************************************************

    CurrentMonitor.cpp
    COPYRIGHT (c) 2013-2016 Gregg E. Berman

    Part of DCC++ BASE STATION for the Arduino

    **********************************************************************/

    #include "DCCpp_Uno.h"
    #include "CurrentMonitor.h"
    #include "Comm.h"

    ///////////////////////////////////////////////////////////////////////////////

    CurrentMonitor::CurrentMonitor(int pin, char *msg){
    this->pin=pin;
    this->msg=msg;
    current=0;
    } // CurrentMonitor::CurrentMonitor

    boolean CurrentMonitor::checkTime(){
    if(millis()-sampleTime<CURRENT_SAMPLE_TIME) // no need to check current yet
    return(false);
    sampleTime=millis(); // note millis() uses TIMER-0. For UNO, we change the scale on Timer-0. For MEGA we do not. This means CURENT_SAMPLE_TIME is different for UNO then MEGA
    return(true);
    } // CurrentMonitor::checkTime

    void CurrentMonitor::check(){
    current=analogRead(pin)*CURRENT_SAMPLE_SMOOTHING+current*(1.0-CURRENT_SAMPLE_SMOOTHING); // compute new exponentially-smoothed current
    if(current>CURRENT_SAMPLE_MAX && digitalRead(SIGNAL_ENABLE_PIN_PROG)==HIGH){ // current overload and Prog Signal is on (or could have checked Main Signal, since both are always on or off together)
    digitalWrite(SIGNAL_ENABLE_PIN_PROG,LOW); // disable both Motor Shield Channels
    digitalWrite(SIGNAL_ENABLE_PIN_MAIN,LOW); // regardless of which caused current overload
    INTERFACE.print(msg); // print corresponding error message
    }
    } // CurrentMonitor::check

    long int CurrentMonitor::sampleTime=0;
     
  13. Atani

    Atani TrainBoard Member

    590
    528
    15
    Next and Jimbo20 like this.
  14. Jimbo20

    Jimbo20 TrainBoard Member

    195
    152
    7
    If this problem is caused because you are drawing too much current (as now seems to be the case) you will need to change the setting of CURRENT_SAMPLE_MAX in the file Currentmonitor.h. As Atani says, you could double this to 600 which would give a cut out current of roughly 1.8 amps. (You will need to change this setting anyway when you install the Pololu shield as otherwise that will also show the same problem)
     
    Next and Atani like this.
  15. Next

    Next TrainBoard Member

    24
    3
    2
    Switch to 600 was an improvement . Thanks.

    I am now at 14 V input and 10.5 output.

    I'll try another supply this weekend and get it 20V input.

    I can at least use the Arduino shield for a test setup.

    Will likley have to go bigger for the full layout
     
    Atani likes this.
  16. Next

    Next TrainBoard Member

    24
    3
    2

    I figured it out.

    The Processing.Org environment is the key. I was unfamiliar with that
     

Share This Page