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

    on-off control of router using M3 and M5 g-code commands

    Scheduled Pinned Locked Moved
    CNC
    4
    6
    373
    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.
    • woodcarverundefined
      woodcarver
      last edited by

      This is a very simple query which is that I need to find a way of switching the "e1heat" 24v output, which is connected to a relay with flyback diode, to switch a router spindle and dust collector at the beginning and end of a job using the M3 and M5 commands.
      I've looked but can't find any guidance specific to this- all the responses appear to be about driving a VFD!

      T3P3Tonyundefined o_lampeundefined 2 Replies Last reply Reply Quote 0
      • T3P3Tonyundefined
        T3P3Tony administrators @woodcarver
        last edited by

        @woodcarver Welcome to the forum

        M3 and M5 control a spindle, but first the spindle needs to be configured using M950:
        https://docs.duet3d.com/User_manual/Reference/Gcodes#m950-create-heater-fan-spindle-or-gpioservo-pin

        So most simply

        M950 R0 C"e1heat"

        you may need to invert the PWM logic in this manner:

        M950 R0 C"!e1heat"

        If you know the best PWM frequency for your motor this can be set with the Q value:

        similarly if you know the RPM of the motor at full power then using the L parameter allows you to set this.

        I am moving this thread to the CNC forum as there are people at lot more knowledgeable than me there that can help

        www.duet3d.com

        woodcarverundefined 1 Reply Last reply Reply Quote 1
        • T3P3Tonyundefined T3P3Tony moved this topic from General Discussion
        • woodcarverundefined
          woodcarver @T3P3Tony
          last edited by

          @T3P3Tony
          Thanks for your advice- however I've inserted that command line into the spindle setup file to no effect. (there's no need fo L and Q values) The G-code files I use all have M3 and M5 in the header and post script. Is there anything else I should be doing before looking for a hardware fault?

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

            @woodcarver

            Try setting that pin as a simple GPIO out and then using M42 to switch it to confirm if the hardware is working

            e.g.

            M950 P0 C"e1heat"

            then send
            M42 P0 S1 for full on, M42 P0 S0 for fully off, M42 S0.5 for 50% PWM

            if thats not working then check that the output of e1heat switches using a multimeter and the M42 command above. When its "on" e1heat should be close to GND, when "off" e1heat should be close to VIN.

            www.duet3d.com

            1 Reply Last reply Reply Quote 0
            • o_lampeundefined
              o_lampe @woodcarver
              last edited by

              @woodcarver I'm wondering if you have to switch the Duet to CNC-mode to allow M3 and M5 commands?

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

                @o_lampe said in on-off control of router using M3 and M5 g-code commands:

                @woodcarver I'm wondering if you have to switch the Duet to CNC-mode to allow M3 and M5 commands?

                That's correct in firmware 3.4.x and earlier. In firmware 3.5 you should be able to use M3 and M5 in FDM mode too.

                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