Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Controlling RC Servos with the expansion board

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    3
    16
    1.9k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mcoleundefined
      mcole
      last edited by

      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.

      SolidWorks user, crazy inventer and they pay me too!

      1 Reply Last reply Reply Quote 0
      • mcoleundefined
        mcole
        last edited by

        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

        SolidWorks user, crazy inventer and they pay me too!

        1 Reply Last reply Reply Quote 0
        • dc42undefined
          dc42 administrators
          last edited by

          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.

          Duet WiFi hardware designer and firmware engineer
          Please do not ask me for Duet support via PM or email, use the forum
          http://www.escher3d.com, https://miscsolutions.wordpress.com

          1 Reply Last reply Reply Quote 0
          • mcoleundefined
            mcole
            last edited by

            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.

            SolidWorks user, crazy inventer and they pay me too!

            1 Reply Last reply Reply Quote 0
            • mcoleundefined
              mcole
              last edited by

              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.

              SolidWorks user, crazy inventer and they pay me too!

              1 Reply Last reply Reply Quote 0
              • dc42undefined
                dc42 administrators
                last edited by

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

                Duet WiFi hardware designer and firmware engineer
                Please do not ask me for Duet support via PM or email, use the forum
                http://www.escher3d.com, https://miscsolutions.wordpress.com

                1 Reply Last reply Reply Quote 0
                • T3P3Tonyundefined
                  T3P3Tony administrators
                  last edited by

                  @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?

                  www.duet3d.com

                  1 Reply Last reply Reply Quote 0
                  • mcoleundefined
                    mcole
                    last edited by

                    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.

                    SolidWorks user, crazy inventer and they pay me too!

                    1 Reply Last reply Reply Quote 0
                    • dc42undefined
                      dc42 administrators
                      last edited by

                      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.

                      Duet WiFi hardware designer and firmware engineer
                      Please do not ask me for Duet support via PM or email, use the forum
                      http://www.escher3d.com, https://miscsolutions.wordpress.com

                      1 Reply Last reply Reply Quote 0
                      • mcoleundefined
                        mcole
                        last edited by

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

                        SolidWorks user, crazy inventer and they pay me too!

                        1 Reply Last reply Reply Quote 0
                        • dc42undefined
                          dc42 administrators
                          last edited by

                          @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.

                          Duet WiFi hardware designer and firmware engineer
                          Please do not ask me for Duet support via PM or email, use the forum
                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                          1 Reply Last reply Reply Quote 0
                          • mcoleundefined
                            mcole
                            last edited by

                            @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)

                            SolidWorks user, crazy inventer and they pay me too!

                            1 Reply Last reply Reply Quote 0
                            • dc42undefined
                              dc42 administrators
                              last edited by

                              Thanks, I'll get it corrected.

                              Duet WiFi hardware designer and firmware engineer
                              Please do not ask me for Duet support via PM or email, use the forum
                              http://www.escher3d.com, https://miscsolutions.wordpress.com

                              1 Reply Last reply Reply Quote 0
                              • mcoleundefined
                                mcole
                                last edited by

                                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

                                SolidWorks user, crazy inventer and they pay me too!

                                1 Reply Last reply Reply Quote 0
                                • T3P3Tonyundefined
                                  T3P3Tony administrators
                                  last edited by

                                  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

                                  www.duet3d.com

                                  1 Reply Last reply Reply Quote 0
                                  • mcoleundefined
                                    mcole
                                    last edited by

                                    @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.

                                    SolidWorks user, crazy inventer and they pay me too!

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post
                                    Unless otherwise noted, all forum content is licensed under CC-BY-SA