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

    Run async commands (G1 -> M106)

    Scheduled Pinned Locked Moved
    Gcode meta commands
    2
    7
    424
    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.
    • adistrundefined
      adistr
      last edited by

      Hello,
      Using Duet wifi application, I tried uploading the gcode file and starting printing.
      I would like some commands to be run in asynchronous mode.
      Execute travel (G1) and then start/stop fan (M106) directly, and don't wait until the travel command finish (G1).

      I successes in doing this from your UI manually, but not when I'm using my gcode file.
      Also, your Multiple motion systems command M596 is irrelevant because the fan is no motion system - am I right?

      Thanks a lot, and have a great day!
      Adi

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

        @adistr it should be possible to use the multiple motion system support to do what you want, because the secondary motion support extends to most non-motion commands including M106. However, we're not planning to support multiple motion systems on Duet 2 because of lack of enough flash memory and RAM.

        It's possible to use the daemon.g process or the trigger mechanism to execute some commands asynchronously, although in the case of daemon.g the time resolution would need to be quite poor (e.g. at least 1 second) to avoid using too much CPU time in the loop.

        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

        adistrundefined 2 Replies Last reply Reply Quote 0
        • adistrundefined
          adistr @dc42
          last edited by

          Hi @dc42 and thank you for the quick response.
          Could you please give me an example of how I can solve my situation using daemon.g or trigger mechanism?
          What files should I edit?
          What commands should I write in the code file?

          Thank you very much,
          Adi

          dc42undefined 1 Reply Last reply Reply Quote 1
          • adistrundefined
            adistr @dc42
            last edited by

            @dc42 I've one more question -
            What Duet version is support multiple motion systems and all duet 2 wifi capabilities?

            Thank you,
            Adi

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

              @adistr Duet 3 MB6HC, Duet 3 MB6XD, Duet 3 Mini Ethernet and Duet 3 Mini WiFi will support multiple motion systems. These boards support most Duet 2 WiFi features except:

              • No support for DueX expansion boards, or expansion breakout board
              • No support for SX1507B I/O expanders
              • Fan voltage is selectable between VIN as 12V (was VIN and 5V on Duet WiFi)
              • No endstop input LEDs
              • No WiFi except on Duet 3 Mini WiFi (the other have Ethernet)
              • The drivers on the Duet 3 Mini are less powerful (in terms of maximum current) than on the Duet 2. The drivers on the MV6HC are more powerful.

              HTH David

              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

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

                @adistr said in Run async commands (G1 -> M106):

                Hi @dc42 and thank you for the quick response.
                Could you please give me an example of how I can solve my situation using daemon.g or trigger mechanism?
                What files should I edit?
                What commands should I write in the code file?

                I think using a trigger would be best. In RRF 3.3 or 3.4 you would need to:

                • Identifier a free pin on the Duet that can be used as a dummy input. In the following I will assume that you do not have a DueX connected and you are using pin e2stop (which is on the expansion connector).
                • Use a M950 command with J parameter to create an input on that pin
                • Use a M581 command to configure a trigger on that port, with the polarity set to trigger in its default state. For example, I think this a should work:

                M950 J10 C"^e2stop" ; create GpIn port 10 ion input e2stop with pullup resistor enabled
                M581 T5 P10 S1 R0 ; trigger 5 is activated by a low-to-high transition on input 10

                To activate the trigger, use:

                M582 T5

                Suppose you want to execute a G1 command and then turn a fan on 2 seconds later. Your GCode file could do this:

                M400 ; wait for movement to stop so that we know when the G1 command will start
                M582 T5 ; activate trigger 5
                G1 X1000 F100 ; do the G1 move

                Your /sys/trigger5.g file could do this:

                G4 P2000
                M106 S1

                Notes:

                1. I have not tested this!
                2. Only one trigger can be executing at a time, apart from trigger 0 (emergency stop) and trigger 1 (pause) which can interrupt other triggers.
                3. In RRF 3.5 I will make it possible to set up a trigger with no associated I/O pin.

                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
                • adistrundefined
                  adistr @dc42
                  last edited by

                  @dc42 Thank you!

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