DCC++ Hardware - Motor Shields

KE4NYV Jan 25, 2016

  1. BrentGlen

    BrentGlen TrainBoard Member

    10
    9
    16
    Mystery continues...

    I hooked up the mis behaving motor shield to a different Arduino and loaded a motor test sketch. The thing worked on both motor outputs, so I hooked it back up to the DCC++ system and now it works again! I have no idea why or what happened to reset it, I don't see anything special in the motor sketch that would reset it. I did find some documentation that says these boards are only good for 12 volts, but it seems to run ok on 15. Since I have 2 of them, can I piggyback them to increase the current? I don't really need any more current since it drives a couple of engines just fine and that is all I plan to use it for since I already have a Digitrax system.

    Brent
     
    Scott Eric Catalano likes this.
  2. zephyr9900

    zephyr9900 TrainBoard Member

    34
    51
    2
    I am using a Pololu DRV8880 on the turntable stepper drive board to which I linked above. The DRV8880 is a very nice driver, and has software-selectable (through two digital inputs) current of 25%, 50%, 75% and 100% of the pot-set current. I am only using it at 140mA though.

    Randy
     
    Scott Eric Catalano likes this.
  3. BrentGlen

    BrentGlen TrainBoard Member

    10
    9
    16
    Just finished playing around with the system again. I decided to hook up a meter to the power supply to get an idea of the current draw. With 3 HO scale locomotives running, with sound, I was reading 0.46 amps. Last weekend on the club layout with 4 trains running with multiple units on each, plus a bunch that were parked and idling we were drawing 1.38 amps. So you don't really need much current in HO with newer locomotives.

    My motor shield was getting warm with 3 engines running for 45 minutes or so, but seems to be OK for this service.

    Brent
     
    Scott Eric Catalano likes this.
  4. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    Also depends on the type of motor shield you are using too. I am using the Pololu shield which can handle a good bit. I had it running on a Christmas demo layout for about 8 hours and it did not get warm....also it wasn't enclosed like most DCC command stations are which include a fan to keep it cool.
     
  5. crusader27529

    crusader27529 TrainBoard Member

    247
    166
    10
    I have a question.....

    I need to set/verify/calibrate the current limits on 2 motor drivers boards that are not the 'standard' boards in use. Can anyone tell me how to setup DCC++ to work correctly with other MD boards? The boards are functional, but I need to set the current limits. How do others do it?
     
    Scott Eric Catalano likes this.
  6. lnxlnx

    lnxlnx TrainBoard Member

    24
    20
    7
    sboyer2 and Scott Eric Catalano like this.
  7. crusader27529

    crusader27529 TrainBoard Member

    247
    166
    10
    Well, that explanation works for the standard MD board, but not for all board types.

    The standard MD board uses a 15ohm resistor in series with the load to develop a voltage that can be used to determine current. BUT, that signal is at least buffered (how it affects the signal, I'm not sure) by an OPAMP. On other MD boards that also use the same h-bridge chips (L298) the adjustments might work as described, but not is the resistor value is different (maybe) or if it doesn't use the opamp for buffering.

    Other boards sense current completely differently, so the instructions may or may not be correct. What's needed is the detail of how the current limits work related to the actual voltage being sensed. The sophisticated software basically smoothes out the sensing so spikes aren't causing a shutdown, but that's not what I need to calibrate/set the current limits on MD boards that sense current differently.

    I guess that I need response from the DCC++ author.....GREGG!!! are you listening??? I need some technical details about current sensing and volts/amp and other technical details.....HELP!
     
    sboyer2 and Scott Eric Catalano like this.
  8. Mdwildcat04

    Mdwildcat04 TrainBoard Member

    30
    30
    6
    I got a cheap uno clone and a l298p based board. the motor board is marked YFROBOT MOTOR SHIELD V3.1. Looking at it, it looks like the pinout is different. It looks like Dir A is on pin 4, PWMA is on 5, PWMB on 6, and DIRB on 7. Will this shield still work? I assume that the code will need a little tweaking because of the different pinout.
     
    sboyer2 and Scott Eric Catalano like this.
  9. MCJOHNS117

    MCJOHNS117 New Member

    1
    1
    1
    Has anyone tried the Vellemen VMA03 motor shield? I have one but can't seem to get it to work.
     
    Scott Eric Catalano likes this.
  10. Jirka

    Jirka TrainBoard Member

    32
    38
    3
    According to the documentation does not support current sensing. You could not read CVs from program track and would not have short circuit protection.
     
    Scott Eric Catalano likes this.
  11. Mdwildcat04

    Mdwildcat04 TrainBoard Member

    30
    30
    6
    So, i made these changes to the DCCpp_uno.h file to make it work with my controller board,

    #define DCC_SIGNAL_PIN_MAIN 10 // Ardunio Uno - uses OC1B
    #define DCC_SIGNAL_PIN_PROG 3 // Arduino Uno - uses OC0B

    #define SIGNAL_ENABLE_PIN_MAIN 5
    #define SIGNAL_ENABLE_PIN_PROG 6

    #define DIRECTION_MOTOR_CHANNEL_PIN_A 4
    #define DIRECTION_MOTOR_CHANNEL_PIN_B 7

    on start up, the LEDs for A+ and A- light up, and connecting them to a DCC engine causes the engine to make a humming noise. turning the track power off then on causes the A+, A-, and B- to light up, and the DCC engine on A acts normally.

    what did I mess up? bad shield?
     
    Scott Eric Catalano likes this.
  12. Mdwildcat04

    Mdwildcat04 TrainBoard Member

    30
    30
    6
    I also jumper-ed 10 to 4 and 3 to 7
     
    Scott Eric Catalano likes this.
  13. Jirka

    Jirka TrainBoard Member

    32
    38
    3
    Without seeing the shield circuit diagram it is impossible to say whether it can be used at all - for example: does it contain invertors of the DIR signal? (Example sketch of the shield at eBay rather indicates that not.) You would have to do so vast hardware changes that it makes no sense.
     
    Scott Eric Catalano likes this.
  14. Mdwildcat04

    Mdwildcat04 TrainBoard Member

    30
    30
    6
    there is a chip on the board, and both DIR signals are going to it, and i thought that was the inverter. Problem is, I cant read the markings on it. I assumed that if it didn't have the inverter, it wouldn't work at all
     
    Scott Eric Catalano likes this.
  15. Jirka

    Jirka TrainBoard Member

    32
    38
    3
    Besides of the questionable functionality of the motor shield: you cannot change the definitions of the DCC_SIGNAL_PINs.
    This is given by the chip hardware - timer T1 simply has outputs OC0B and OC1B at pins connected to Arduino Uno pins 5 and 10 respectively.
     
    Scott Eric Catalano likes this.
  16. Atani

    Atani TrainBoard Member

    1,335
    1,030
    27
    From a quick look at eBay I would say this is not a usable board for DCC++. You might be able to use it but you would need to remap a number of pins via hardware as some of the pins used for inputs are not in alignment with what DCC++ outputs on.
     
    Scott Eric Catalano and sboyer2 like this.
  17. Mdwildcat04

    Mdwildcat04 TrainBoard Member

    30
    30
    6
    at this point, I'm not against doing that.
    what all pins need connecting?
    looks to me, like 5v, ground, A0 and A1,
    pwmA needs to go to pin 3
    pwmB to 11
    DirA to 10 and 12
    DirB to 5 and 13

    would that work?
     
    Scott Eric Catalano likes this.
  18. Atani

    Atani TrainBoard Member

    1,335
    1,030
    27
    You can try:
    • Uno +5, gnd, A0, A1 to MB same pins.
    • Uno 3 to MB 5
    • Uno 11 to MB 6
    • Uno 10 to MB 4
    • Uno 5 to MB 7
    Use a breadboard or similar and not connecting the shield directly to the Uno.

    I don't know for sure that the A0/A1 lines are mapped correctly, we would need to see a schematic or be able to trace the pins on the board to figure out for sure.

    On startup the LEDs for the A/B outputs should remain OFF. Turning on track power should turn them all ON. Entering <D> via console to the base station make them blink as ON OFF ON OFF -> OFF ON OFF ON...
     
    Scott Eric Catalano likes this.
  19. Jirka

    Jirka TrainBoard Member

    32
    38
    3
    Yes, I confirm that Atani's instructions are correct. Just do not forget to revert the changhes you did in DCCpp_uno.h file!
     
    Scott Eric Catalano likes this.
  20. Mdwildcat04

    Mdwildcat04 TrainBoard Member

    30
    30
    6
    well, that worked a treat. main track is working 100% as expected, and programming track lights are acting as expected.
    w00t!!!
    Thanks
     
    Scott Eric Catalano and Atani like this.

Share This Page