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

    RRF3 and servo

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    5
    11
    758
    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.
    • fmaundefined
      fma
      last edited by

      Hi!

      I'm trying to drive a servo with RRF3, on a Duet2Wifi. I configured the servo output as following:

      M950 S0 C"!fan0"  ; Servo 0 connected to 'fan0' pin (inverted)
      

      and I drive it using :

      M280 P0 S1500
      

      but I does not work. I triple checked my wiring, and it is correct (I'm using an external power supply, and ground are common). I inverted the output, as I used I1 in the M280 comand under RRF2.

      What am I doing wrong?

      Frédéric

      deckingmanundefined dc42undefined 2 Replies Last reply Reply Quote 0
      • deckingmanundefined
        deckingman @fma
        last edited by

        @fma I don't use any servos so may not be able to help. But just looking at the example here https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_M280 shows:

        M280 P0 S80 ; set 80deg servo position on GPIO port 0

        So going by that, your M280 P0 S1500 would be setting the servo position to 1500 degrees, which doesn't make any sense to me.

        Ian
        https://somei3deas.wordpress.com/
        https://www.youtube.com/@deckingman

        1 Reply Last reply Reply Quote 0
        • fmaundefined
          fma
          last edited by

          Nope, values above 200 are taken as µs, and below are taken as degrees.

          Anyway, I tried with values in degrees, like 0, 90 and 180, and I get the same (non) result.

          Frédéric

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

            hi @fma what was our old M280 code on RRF2. have you tried without inverting the pin just to check?

            www.duet3d.com

            1 Reply Last reply Reply Quote 0
            • fmaundefined
              fma
              last edited by

              The old M280 code has the I1 parameter, that's all. I'll try without inverting the pin; maybe using S in M950 already does that...

              Frédéric

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

                @fma said in RRF3 and servo:

                M950 S0 C"!fan0" ; Servo 0 connected to 'fan0' pin (inverted)

                Does that command return an error message if you send it from the command line?

                What does M950 S0 with no other parameters return?

                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

                fmaundefined 1 Reply Last reply Reply Quote 0
                • fmaundefined
                  fma @dc42
                  last edited by

                  @dc42 said in RRF3 and servo:

                  Does that command return an error message if you send it from the command line?

                  No, no error.

                  What does M950 S0 with no other parameters return?

                  I checked that, and it looks ok:

                  GPIO/servo port 0 pin !fan0 frequency 50Hz
                  

                  I tried without inverting, and I get the same result.

                  Frédéric

                  1 Reply Last reply Reply Quote 0
                  • fmaundefined
                    fma
                    last edited by

                    I also checked on fan1 output: same result.

                    Frédéric

                    1 Reply Last reply Reply Quote 0
                    • DIY-O-Sphereundefined
                      DIY-O-Sphere
                      last edited by DIY-O-Sphere

                      I had the same issue driving a servo on the fan output (Duet Maestro)
                      Connect a pullup resistor of around 1K between the servo control (Fan PWM) and +5V.
                      Servo Pull UP.jpg

                      (UTC+1)

                      1 Reply Last reply Reply Quote 0
                      • fmaundefined
                        fma
                        last edited by

                        You mean a pullup, according to your drawing.

                        I'll try that...

                        Frédéric

                        1 Reply Last reply Reply Quote 0
                        • fmaundefined
                          fma
                          last edited by

                          Bingo! In fact, it makes sens, as the pwm output only pulls the signal to ground... So, it has to be pulled up in order to have a high state voltage value!

                          I think I had this resistor with RRF2, but as I didn't use the servo since several months, I forgot that 😕

                          Thanks!

                          Frédéric

                          1 Reply Last reply Reply Quote 0
                          • DIY-O-Sphereundefined DIY-O-Sphere referenced this topic
                          • First post
                            Last post
                          Unless otherwise noted, all forum content is licensed under CC-BY-SA