Controlling RC Servos with the expansion board



  • Hi,

    I'm trying to control an external RC servo via the expansion board (which I'm using as I'm also wanting to drive some big steppers and am using external drivers).

    I disabled the heater circuit on Heater 6 using

    [[language]]
    M307 H6 A-1 C-1 D-1
    
    

    but when I try to move the servo using

    [[language]]
    M280 P6 S1
    
    

    I don't get any movement (changing the value of S1 obviously).

    I've borrowed an oscilloscope from a friend and am just seeing a sine wave rather than a square wave with a pulse moving, but that could be me as it's my first time using an oscilloscope beyond setting up the probes with the test signal. I have a screen shot but am not sure how to attach it.



  • This it the expansion board rather than the Duex2 or Duex5

    https://www.filastruder.com/collections/electronics/products/duet-expansion-board

    and this is hopefully the screen


  • administrators

    Looks like you are picking up 60Hz mains interference on channel 2, not a signal from the expansion board. I think you have pulses on channel 1, but you have the sensitivity on channel 1 set too high, so we can't see them properly.



  • That's what I thought too, but I've tried three different probes now, and get the same result. When I disconnect from Heater 6 PWM it flat lines, and when I connect to it I get a 60hz 5v signal.

    I'm using the ground connection next to the network port (this is a Duet Ethernet) for a ground on the probes.

    So I tried some other pins, and it came up the same. Disconnected everything but the expansion board - same result.

    Thought I would try another duet board (I've bought four for various projects this month), same result.

    Disconnected the positive power lead, hmm, still getting the same sine wave. Disconnected ground line, flat line.

    So try a different power supply, and bingo!

    [[language]]
    M280 P6 S1
    
    

    [[language]]
    M280 P6 S180
    
    ```![](http://eek.im/imghost/SDS00004.jpg)
    
    So after all that it looks like the Mean Well power supply has a dirty ground.
    
    Thanks David.


  • One other thing, I think the pin out's for Heater 6 PCM are wrong - I'm getting +5v on the middle pin and GND on the pin closest to the E2 connector.

    Almost fried a servo.


  • administrators

    The tab by the Ethernet port is for connecting shielding only. It is not connected to the board ground.


  • administrators

    @mcole:

    One other thing, I think the pin out's for Heater 6 PCM are wrong - I'm getting +5v on the middle pin and GND on the pin closest to the E2 connector.

    Almost fried a servo.

    I just checked a expansion breakout board and that pin out appears correct - ground on the pin closed E2, 5V on the middle, control on the pin closest the 50 way connector. Looking at the silkscreen that is what it is labelled as. Is your board silkscreen different?



  • Hopefully the attached image shows everything - I tried to fit everything relevant in.

    19v on power in to my Duet Ethernet

    Plug wired according to Duet expansion header wiki image (https://www.duet3d.com/wiki/File:ExpBreakoutv1.0_wiring.png)

    The DVM is showing -4.87 volts. If I swap the red and black leads on the Heater 6 PWM I get +4.87 volts.


  • administrators

    That's correct, +5V is on the centre pin. What makes you think it is incorrect? Perhaps you are using an Airtronics servo, which has the + and - connections swapped compared to everyone else, see https://www.princeton.edu/~mae412/TEXT/NTRAK2002/292-302.pdf.



  • The image on the wiki shows the center pin being GND and the end pin being 5v+


  • administrators

    @mcole:

    The image on the wiki shows the center pin being GND and the end pin being 5v+

    Which wiki page is that? Please provide a link.



  • @dc42:

    Which wiki page is that? Please provide a link.

    Here you go - https://www.duet3d.com/wiki/File:ExpBreakoutv1.0_wiring.png (please confirm so I know I'm not going mad)


  • administrators

    Thanks, I'll get it corrected.



  • Thank you.

    For anyone else interested in adding a servo (such as a Futaba for tool change) the 3 pin heater headers work. Details are in the wiki, but I know searching in the forum is the first place I turn to sometimes. Attach the servo so the red wire is +5v, black wire is GND, and the white wire connects to PWM.

    Disable the heater control using

    M307 H6 A-1 C-1 D-1
    ```(where H6 corresponds to the heater header being used) This can be in config.g
    
    You can then control the servo using the following g code
    

    M280 P6 S1


  • administrators

    I have corrected the wiki page, really sorry that slipped through. you must be the first person to read the documentation!
    https://duet3d.com/wiki/Expansion_breakout_board

    https://duet3d.com/wiki/File:ExpBreakoutv1.1_wiring.png



  • @T3P3Tony:

    I have corrected the wiki page, really sorry that slipped through. you must be the first person to read the documentation!

    I need all the help I can get! I'm a ME, not an EE.

    Thank you though, I'm constantly impressed by how good a job you and DC do with keeping us all happy.


Locked
 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.