DCC++ Hardware - Motor Shields

KE4NYV Jan 25, 2016

  1. sboyer2

    sboyer2 TrainBoard Member

    35
    41
    6
    Found another interesting looking moter shield, this one has a buzzer and pinouts for a bluetooth module, don't know if it's compatible with DCC++
    the ebay page does post some codeing example


    http://www.ebay.com/itm/L298P-DC-Mo...e-2-way-for-Arduino-Uno-Mega2560/121964163215
     
    Scott Eric Catalano likes this.
  2. sboyer2

    sboyer2 TrainBoard Member

    35
    41
    6

    here's another one with the Vertical chip for easy heatsink mounting, and no traces to cut, all are on dip-switches

    http://www.ebay.com/itm/New-V3-Driv...N-2A-2-Motors-Module-for-Arduino/231173809475
     
    Scott Eric Catalano likes this.
  3. BrentGlen

    BrentGlen TrainBoard Member

    10
    9
    16
    Hello, I am new to this, trying to get DCC++ working. I have the Arduino working and now I am trying to use this Generic Motor Shield. I have this motor shield that seems pretty common on ebay. It uses 2 of the L289 chips to run 4 motors. I am pretty ignorant of electronics and it doesn't seem to work with the posted pin connections. Looks like it uses different pin outs. It seems to be a clone of this one from AdaFruit:
    https://www.adafruit.com/product/81

    The pins are different but I don't know enough to figure out if it can be made to work.
     
    Scott Eric Catalano likes this.
  4. w8one

    w8one TrainBoard Member

    89
    109
    5
    Those are 283 chips not 289 they will not be big enough (1.2a max) to run a train.
     
    Scott Eric Catalano likes this.
  5. Pepijn

    Pepijn TrainBoard Member

    18
    23
    4
    This will allow you to run and program trains but there is no current sensing on the board. So, no feedback whilst programming and no short protection.
     
    Scott Eric Catalano likes this.
  6. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Hi Guys....... I went to order some additional motor shields and I have noticed that there is a lack of stackable motor shields available ... the new shields are coming without female headers ...... I.m at a loss. Does anybody have a reliable source for inexpensive Arduino/Deek-Robot style stackable motor shields.
    Thanks
    Steve F
    PS .... without the ability to stack a shield above the motor shield how are you adding functionality to the new design shields?
     
    Scott Eric Catalano likes this.
  7. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Scott Eric Catalano likes this.
  8. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Thanks Steve ........ this is why my search didn't find it, I think:
    This is a private listing. Sign in to view your status or learn more about private listings.
    Anyway ...... I ordered a couple ...... think I'll see them by August? :)
    Steve F
     
    Scott Eric Catalano likes this.
  9. NormHal

    NormHal TrainBoard Member

    138
    126
    12
    Hi All, I'm new to this forum, after having discovered the amazing work done by Gregg - and the other contributors:)

    I have acquired a couple of Arduinos and ordered a few of the recommended motor shields to play with. Unfortunately we are rather "geographically challenged" and need to wait between three and six weeks for goods to arrive from out the country. In the meantime I discovered a local supplier who stocks the dfRobot Motor Driver 2 x 15A Lite - contains two H-Bridges and is claimed to be able to supply 15A to each motor. Being impatient, I bought one and connected it to the Arduino running DCC++ Base Station. Because the board in question uses a single PWM signal for each motor, and the Enable input is used to change motor direction, there is no problem connecting the driver board to the Arduino, and generating the DCC track signal. IMHO this makes it THE ideal Driver Board for DCC++ :)

    The one problem is that it is not possible to shut down the generated DCC signal via the Base Station. I've looked at the code where the shutdown is executed and feel it might be possible to make a minor modification to stop the PWM signals being generated. I have so far found two places where the modification needs to be done - in the SerialCommand code, and the CurrentMonitor section.

    Neither C nor C++ being my strength, my question to you guys is - Do you think it feasible to make this change to the code? I was thinking of simply changing the PWM output pin to an input, when the shutdown is needed?

    I'd appreciate your thoughts and/or suggestions:)
    NormanH
     
    Scott Eric Catalano likes this.
  10. NormHal

    NormHal TrainBoard Member

    138
    126
    12
    Finger trouble:-(
     
    Last edited: Jun 8, 2016
    Scott Eric Catalano likes this.
  11. NormHal

    NormHal TrainBoard Member

    138
    126
    12
    Hi All, Well, being an impatient sod, I decided to give it a try anyway:)

    I added:
    pinMode(DCC_SIGNAL_PIN_MAIN,INPUT);
    pinMode(DCC_SIGNAL_PIN_PROG,INPUT);
    to CurrentMonitor.cpp in Case '0'

    and
    pinMode(DCC_SIGNAL_PIN_MAIN,OUTPUT);
    pinMode(DCC_SIGNAL_PIN_PROG,OUTPUT);
    to both CurrentMonitor.cpp Case '1' and SerialCommand.cpp

    Bingo - I can now turn the PWM On or Off on demand:)

    When the board powers up it seems to have the PWM initialized, so I might want to investigate the ramifications.

    Next step is to see if everything works. I'm not sure (yet) if the PWM signal on the Programming channel gets modified during programming, but we'll see.
    For the time being I left the SIGNAL_ENABLE_PIN_xxxx settings as is. I'm hoping that in time I can use this driver board as a Main Line and AutoReverser driver. The standard Arduino Motor Driver board I ordered will be used for the programming track.

    If all goes well, and for convenience, I'm going to try to add this board as an additional Motor Driver to config.h

    Will communicate results and/or further questions:)

    NormanH
     
  12. BrentGlen

    BrentGlen TrainBoard Member

    10
    9
    16
    I received my Dfrobot mother shields, hooked it up and everything works great! Iran 2 loco's (HO) at once with no problems. I wonder how many it would handle?

    Does this have short circuit protection? What happens with a short? Any indicator, flashing LED?

    Brent
     
    Scott Eric Catalano likes this.
  13. zephyr9900

    zephyr9900 TrainBoard Member

    34
    51
    2
    I have the MotoMama motor shield up and running. As I posted earlier, although it has the (to me, at least) desirable feature of the upright L298N H-bridge with a nice large heatsink, it has neither the input-inverting logic for the DIR functionality, nor the current-sense processing circuitry of the Arduino (and Deek-Robot-type clones) motor shield.

    I designed a daughterboard (shield-shield?) which supplies those two functionalities, as well as provision to mount the neat HC-12 radio board that Dave B recently described. This plugs into an unmodified (other than removing all the factory-installed jumpers) MotoMama.

    I have a small Nomad 883 desktop CNC milling machine, and have recently been experimenting with making single-sided circuit boards using "trace isolation routing", where one literally draws the traces in CAD and then machines away the copper around their perimeter using a small (in my case, 0.50mm) bit. My first functional board is a little stepper driver for the upcoming turntable on my upcoming switching layout, which I describe over at http://www.rmweb.co.uk/community/in...-controlled-peco-turntable-project/?p=2335261

    This daughterboard needed one jumper to bridge over a trace. For the input-inverting, I'm using a CD4069 hex inverter chip, and for the current-sense amplifying I'm using an LM358 op-amp, both garden-variety through-hole chips, together with a few resistors for the current-sense circuit. The current sensing picks up on pins on two headers on the MotoMama board, which is designed with almost all edge pins being mirrored on break-out headers.

    You'll notice that the CAD screenshot is titled "shield3.png". I won't even mention the first two prototype boards. ;)

    I had to slightly modify the DCC++ sketch. Mega pin 2 is still the Prog DCC signal, and 12 is still the Main DCC signal. The Main enable is changed (relative to the Arduino motor shield) from pin 3 to 11, the Prog enable from 11 to 10, and the Main and Prog current sense pins (A0 and A1) are swapped. I made the changes by defining a third motor shield (type=2) in Config.h, and adding a section in DCCpp_Uno.h configuring the MotoMama pins:

    #elif MOTOR_SHIELD_TYPE == 2

    #define MOTOR_SHIELD_NAME "MOTOMAMA MOTOR SHIELD"

    #define SIGNAL_ENABLE_PIN_MAIN 11
    #define SIGNAL_ENABLE_PIN_PROG 10

    #define CURRENT_MONITOR_PIN_MAIN A0
    #define CURRENT_MONITOR_PIN_PROG A1

    #define DIRECTION_MOTOR_CHANNEL_PIN_A 12
    #define DIRECTION_MOTOR_CHANNEL_PIN_B 8

    Now on to the retro-deco throttle! :)

    Randy
     

    Attached Files:

  14. NormHal

    NormHal TrainBoard Member

    138
    126
    12
    Hi Brent,
    The guys at dfRobot state the limitation of the output should be looked at as Watts - their spec of 15Amps at 13.8V = 207W. If you have a 16V Power Supply, that would mean your current limit would be 207/16= 12.9 Amps.
    Looking at the datasheet for the BTS7960, it looks like the device should be fairly robust and is likely to survive a lot of 'output abuse':). Numbers like 40-50 Amps are mentioned regarding the short circuit and over-current protection limits.

    IMHO though, these figures are way too high for our application - I feel a maximum of 5Amps for a booster output is the limit for HO, G perhaps up to 8Amps. Current capacity greater than these can easily become a fire hazard.
    For this reason I feel it is imperative to connect the current sense pins to the Arduino, and calibrate accordingly. The datasheet states that the sense voltage is (1A/8.5) V if the sense resistor is 1K (Refer to the schematic of the Motor Driver board). This works out at approx 117mV per AMP. 5 Amps through the bridge should thus yield a voltage of 585mV. I haven't yet personally done any tests nor reviewed the calibration value required, but will feedback as soon as I have. Somewhere around on this forum I read a post by Gregg where he describes the setting of the value - I'll need to do some searching to find it again:)

    Hope that helps,
    Norm
     
    HVT, Scott Eric Catalano and UK Steve like this.
  15. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Well put Norm,

    I wholeheartedly agree with your statement "I feel a maximum of 5Amps for a booster output is the limit for HO". People should take care to design their boosters within that limit (for the smaller scales anyway)
    I have made mention of this before as people go chasing beyond the 5Amps from high power chips.
    Take heed folks high currents can melt things or worse cause fires.
    I'm re-posting this link, it may be helpful for you guys https://sites.google.com/site/markg...scussions/boosters/choosing-the-right-booster

    Steve.
     
  16. BrentGlen

    BrentGlen TrainBoard Member

    10
    9
    16
    Sorry I miss-typed, the board I have is the Deek Robot board. I decided to check and see if it would protect against shorts, I very briefly touched the outputs together, and everything died. I don't know if I had a defective board or what, there was no magic smoke released, just an instant stop functioning, all the LED's went out and it will no longer work. Luckily I ordered 2 of these and the other one is working. But this isn't good since shorts always occur on a model railway, whether running switches or otherwise derailing.

    I can't seem to find much info on these boards but I believe they are a clone of the original Arduino motor shield and should have some sort of diode clamping protection. It happened instantly and that surprised me, if I burned something out I would have thought it would haven a second and there would have been some smoke. I can't seem to revive this board. Any ideas of what might have happened?
     
    Scott Eric Catalano likes this.
  17. BrentGlen

    BrentGlen TrainBoard Member

    10
    9
    16
    Further to this Deek Robot board, I had the second one running with 4 HO locomotives, but it did shut down on overload if I stalled one of the engines, so overloads seem to stop it, why didn't a short?
     
    Scott Eric Catalano likes this.
  18. zephyr9900

    zephyr9900 TrainBoard Member

    34
    51
    2
    I'm sorry if I'm misunderstanding, Brent, but that is the way my DeekRobot shield works. A short on either the main or programming track shuts down all track power (both main and programming), plus a warning message in the Controller window header. I need to re-enable the track power manually--it isn't self-clearing.

    Assuming I did misunderstand, see my post a couple pages back where I discovered that the L298 chip on my DeekRobot boards was not heatsinked to the PCB--I could slip a piece of printer paper underneath it. I ruined one of my boards trying to add solder, but the other one is functioning OK. But I can repeatedly short the output(s) without permanent damage to the board--I'm just concerned about long-term heating, which is why I'm switching to the MotoMama boards. Or buy a genuine Arduino R3 motor shield, or the alternate I also listed a while back, with visually obvious heatsinking of the L298 to the PCB.

    Randy
     
    Scott Eric Catalano likes this.
  19. BrentGlen

    BrentGlen TrainBoard Member

    10
    9
    16
    My board seems to be permenantly disabled. I tried the reset button, powered both it and the Arduino down but no luck, I can't get it to come back to life. Is there some other way to reset it, or is it dead?
     
    Scott Eric Catalano likes this.
  20. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    Thats why I use the Pololu motor shields...no problems with them at all
     
    zephyr9900, sboyer2 and esfeld like this.

Share This Page