DCC++ EX - Arduino Uno & Adafruit motor shield Ver1

PhantomRC Apr 10, 2021

  1. PhantomRC

    PhantomRC New Member

    7
    4
    1
    Hi everyone,


    First, I’d like to mention that I haven’t been trained for electronic and programming.


    Recently I purchased a clone Arduino Uno and an Adafruit Motor Shield Ver 1 (https://learn.adafruit.com/adafruit-motor-shield) that I would like to use for DCC ++ EX.


    Using the installing software for DCC++ EX (https://dcc-ex.com/download/commandstation.html) I have been able to install it on my Uno but I have some issues:


    font-family:"Calibri",sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
    Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;
    mso-bidi-theme-font:minor-latin;color:#404040">1. I can’t select another Motor Shield than the Arduino Motor Shield or the Pololu MC33926 Motor Shield.

    So after installation I read the documentation on the site of DCC++ EX (https://dcc-ex.com/advanced-setup/motor-board-config.html) and tried the following lines in Config.h but with no results:
    #define MY_MOTOR_SHIELD F("MY_MOTOR_SHIELD"),\
    new MotorDriver(11, 13, UNUSED_PIN, UNUSED_PIN, A1, 2.99, 2000, UNUSED_PIN), \

    new MotorDriver(3, 12, UNUSED_PIN, UNUSED_PIN, A0, 2.99, 2000, UNUSED_PIN)

    #define MOTOR_SHIELD_TYPE MY_MOTOR_SHIELD


    2. I use a separate power supply (adjustable DC 9-24V 3A) for the Motor Shield (jumper removed on the board to avoid problems) and I set it to DC 15V.
    With a simple multimeter I have the confirmation that the shield is powered with DC 15V (LED on board goes On).
    Then I connected pin 5 & 13 and pin 10 & 12 as explained in
    Finally I connected the Main Track (not yet a Programming Track) to the shield


    3. Now using Arduino IDE I openend “CommandStation-EX.ino” and with the Serial Output I received:

    <* LCD0: DCC++ EX v3.0.11 *>
    <* LCD1:Starting *>
    <* MotorDriver currentPin=A1, senseOffset=337, rawCurentTripValue(relative to offset)=668 *>
    <* MotorDriver currentPin=A0, senseOffset=342, rawCurentTripValue(relative to offset)=668 *>
    <iDCC-EX V-3.0.11 / UNO / MY_MOTOR_SHIELD G-a7d0042>
    <* Signal pin config: normal accuracy waveform *>
    <* LCD1:Ready *>
    <* LCD2:Free RAM= 913b *>
    <* LCD2:Free RAM= 876b *>


    4. Using the throttle on https://dcc-ex.com/WebThrottle-EX/ I can connect it to the DCC++ EX , power it up and select a train.

    But then the story ends here. Nothing happens.
    I measured the voltage coming out of the shield and most of the time it gives me a zero value (I once or two got a 14,1 V)


    So, can anyone help me with this case? It’s not vital as I normally use a Roco Z21 Black DCC station but I would like to be able to make a small shuttle train with the use of DCC++ EX.

    I’m convinced that there may be a solution to this issue.

    Thank you in advance and please remember that I’m not a trained programmer or electronic guy.
     

    Attached Files:

  2. schufti

    schufti TrainBoard Member

    30
    3
    2
    unfortunately this motor board is not compatible with DCC++EX for several reasons:
    a) there is a substantial difference betwenn l298 and l293, look here at 3.
    so you need another output with inverted direction signal to combine two half-bridges to one full-bridge motor driver, I think it is the 3rd parameter in the motor driver definition.
    b) not all pins on l293 are accessible via gpio directly, so some additional hw modification would be required
     
  3. PhantomRC

    PhantomRC New Member

    7
    4
    1
    Shufti you opened my eyes ... all the time I was certain to use a 298 ... I now may officialy say that I'm stupid !!!
     
  4. BigJake

    BigJake TrainBoard Member

    3,310
    6,382
    70
    Whether or not you were stupid, you are certainly not stupid now!
     
    PhantomRC likes this.
  5. PhantomRC

    PhantomRC New Member

    7
    4
    1
    Earlier this week I received 2 new L298 Motor Shields.
    At last I succeeded with the installation of DCC++ on a Mega (on an Uno R3 too).
    This allowed me to make some further tests with JMRI; a small shuttle train on a 90 cm track (in fact my programming tack ;-) )

    Again many thanks for your help, all.
     
    FlightRisk likes this.

Share This Page