Jmri, dccpp, motor shield, and address of servo motors

Christopher Warren Jul 31, 2018

  1. Christopher Warren

    Christopher Warren TrainBoard Member

    12
    0
    2
    I have now got dccpp working with Jmri and the arduino. And can run trains through the Throttle.
    I have now set my eyes to control the servo point motors (turnout) that are available on the motor shield and i am finding difficulty to establish the hardware address of each servo motor port.
    I am using the following:
    Arduino Uno,
    Generic motor shield 298 chip,
    Raspberry pi.
    Dccpp,
    JMRI panel pro

    Even though i tried to follow the Jmri wiki I still cannot find what is the address of the servo.

    How can I establish this address?

    Your help is greatly appreciated
     
  2. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Hi,
    As far as I know a standard motor shield does not have a servo output?
    I've had a quick look and it seems that you can get a motor shield which has a couple of 'servo output' sockets, but all they seem to do is pass pwm pins 9&10? straight out from the arduino.

    If this is what you have then those servo outputs would not be suitable for your purpose because dccpp does not have the neccessary code to generate the pwm servo signals.

    You really need to use an accesory decoder (connected to the track) with servo outputs to drive your points. I built one using an arduino nano and based on Geoff bunza's design and it works very well, -though even then addressing with dccpp is a bit confusing:
    http://www.trainboard.com/highball/index.php?threads/dcc-and-g-bunza-decoder.114116/
     
  3. Christopher Warren

    Christopher Warren TrainBoard Member

    12
    0
    2
    Hi,

    Thank you for your reply. Yes the motor shield I have had 4 3pin connections which I assumed were servo outlets. This also explains why when searching on YouTube I only found methods as you built.

    Thank you again.

    Chris
     
  4. sv1iw

    sv1iw New Member

    9
    0
    3
    Chris, some motor shields do have servo control with 3 pin headers. The problem is that some of the Arduino pins used are taken by DCC++. Just for he benefit of knowledge have a look at this instructable and associated video: https://www.instructables.com/id/Arduino-How-to-Control-Servo-Motor-With-Motor-Shie/
    If you have a few servos perhaps your motor shield and a second, uno, nano etc could be used as an acc decoder.
    Regards
    Manos SV1IW
     
  5. Christopher Warren

    Christopher Warren TrainBoard Member

    12
    0
    2
    Manos,
    Thank you for the information yes you are right you can run a servo from a motor shield, as your video shows, but not with dccpp as I have been informed by other posts.
    I have found an other YouTube by Rudys but he is using a separate uno to run the servo point motors, connecting to the dcc via an opto coupler. .

    73s
    Chris de 9H1BW
     
  6. sv1iw

    sv1iw New Member

    9
    0
    3
    Hi again Chris
    I also think that a separate uno (or any other board) is the best and safer approach if you have the space. There is a pdf which shows the mapping of arduino pins and dcc++. With this you can see which pins are free for other uses. I am experimenting with ir sensors and outputs for the moment to keep a small n scale layout tight. So far I can have two sensors and two relays through jmri, still considering an uno for serial acc work.
    P.S. An old friend from Thessaloniki SV2AEL is now living in Malta as 9H1AE...
    73
     
  7. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Hi Chris,
    I just realised you're a 'ham' in Malta; My late father was stationed there in 1945/7 and operated I think it was either ZB1AE or ZB1AF....
     

Share This Page