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

    Turning off servos and M42 interrupting the last pulse

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    3
    12
    346
    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.
    • pfnundefined
      pfn
      last edited by

      Re: Install Servo
      @dc42 re:

      Alternatively, after sending each M280 command, use G4 to delay a short while, then I think sending M42 P# S0 (where # is the same port number as you use in M280) will turn off the PWM and the servo may stop driving the motor. Please test this thoroughly before you rely on it in case M42 can interrupt an output pulse.

      I am having this problem where M42 does interrupt the output pulse and sends the servo out of position. What can be done to mitigate this? Can M42 be made more robust such that it does not interrupt the last pulse when shutting off the servo output?

      chrishammundefined dc42undefined 2 Replies Last reply Reply Quote 0
      • chrishammundefined
        chrishamm administrators @pfn
        last edited by

        @pfn Do you operate the servo from a Duex as well?

        Duet software engineer

        pfnundefined 1 Reply Last reply Reply Quote 0
        • pfnundefined
          pfn @chrishamm
          last edited by

          @chrishamm no, mine is run off the vfd/laser/out6 port on duet3mini5+

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

            @pfn you can also turn off the servo output using M280 Pnn S0 although you may find that it has the same issue.

            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

            pfnundefined 1 Reply Last reply Reply Quote 0
            • pfnundefined
              pfn @dc42
              last edited by

              @dc42 thanks, my concern is actually how to avoid the truncated last pulse. (For that matter, sending M280 S0 rather than M42 S0 seems to send a 500us pulse as the servo always goes to the 500us position when I use M280 S0)

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

                @pfn which version of RepRapFirmware are you using?

                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

                pfnundefined 1 Reply Last reply Reply Quote 0
                • pfnundefined
                  pfn @dc42
                  last edited by

                  @dc42 3.4.5

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

                    @pfn that's odd because I checked the code to confirm what I thought, which is that M208 Pnn S0 should turn the pin off, just like M42. I'll log this as a potential bug.

                    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

                    pfnundefined 1 Reply Last reply Reply Quote 0
                    • pfnundefined
                      pfn @dc42
                      last edited by

                      @dc42 I have this macro: https://github.com/pfn/voron2-rrf-config/blob/master/sys/mmu/lib/engage.g where mmu_servo_engage is set to 0 and it reliably sets the servo position to that of the 500us value.

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

                        @pfn said in Turning off servos and M42 interrupting the last pulse:

                        @dc42 I have this macro: https://github.com/pfn/voron2-rrf-config/blob/master/sys/mmu/lib/engage.g where mmu_servo_engage is set to 0 and it reliably sets the servo position to that of the 500us value.

                        Do you mean it does that if you uncomment the M42 line and change M42 to M208 ?

                        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

                        pfnundefined 1 Reply Last reply Reply Quote 0
                        • pfnundefined
                          pfn @dc42
                          last edited by

                          @dc42 the macro is just a link to how I have everything setup, if I use M280 P2 S100 and subsequently run M280 P2 S0, the servo 100% reliably goes back to the 500us position.

                          If I use M280 P2 S100 and subsequently run M42 P2 S0 most of the time the servo stays in place, sometimes it will go to a position between S100 and 500us.

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

                            @pfn thanks for the clarification.

                            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
                            • First post
                              Last post
                            Unless otherwise noted, all forum content is licensed under CC-BY-SA