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

Parallel tasking

Scheduled Pinned Locked Moved Solved
Gcode meta commands
4
11
576
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.
  • undefined
    Anthoval
    last edited by 8 Sept 2020, 13:26

    Hi,

    Is there any way to execute a command during a G0/G1 insruction?

    I'd like to do a specific action when the X axis has reached a defined position, while the X axis motor is traveling at full speed.

    I am using a Duet 2 Wifi board, firmware version 3.1.1.

    Is it possible ?

    1 Reply Last reply Reply Quote 0
    • undefined
      chrishamm administrators
      last edited by 8 Sept 2020, 13:42

      It really depends on the type of command. What action do you have in mind?

      Duet software engineer

      1 Reply Last reply Reply Quote 0
      • undefined
        Anthoval
        last edited by 8 Sept 2020, 13:51

        I will use the G0 command to travel from X = 0 to X = 100 (millimeters) . When X has reached 50 millimeters, I'd like to turn on the Fan 2.

        1 Reply Last reply Reply Quote 0
        • undefined
          dc42 administrators
          last edited by 8 Sept 2020, 16:12

          is there any reason why you can't split the G0 command into two commands and put the M106 command between them?

          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
          • undefined
            Anthoval
            last edited by Anthoval 9 Sept 2020, 08:19 9 Sept 2020, 07:49

            I'm doing a 3-axis stapler with an electric trigger. The electric trigger needs a pulse in order to work. I want to staple the paper block every 100 millimeters during the G0 command (while the stapler is moving at full speed).

            undefined 1 Reply Last reply 10 Sept 2020, 05:56 Reply Quote 0
            • undefined
              gnydick @Anthoval
              last edited by 10 Sept 2020, 05:56

              @Anthoval if your kinematics are solid, you can configure high jerk and acceleration and you'll barely notice any pause.

              1 Reply Last reply Reply Quote 0
              • undefined
                dc42 administrators
                last edited by dc42 9 Oct 2020, 07:23 10 Sept 2020, 07:17

                Even without high jerk and acceleration, the motion should be continuous provided you don't have a M400, G4 or similar command between the two G1 moves.

                To generate a pulse without using G4 you could use something like this:

                G1 X100 F4000
                M42 P0 S1
                G1 X101
                M42 P0 S0
                G2 X200
                M42 P0 S1
                G1 X201
                M42 P0 S0

                and so on.

                Another way would be to set up the port using M670, then you can do this:

                G1 X100 F4000 P0
                G1 X101 P1
                G2 X200 P0
                G1 X201 P1

                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
                • undefined
                  Anthoval
                  last edited by Anthoval 9 Oct 2020, 08:20 10 Sept 2020, 08:18

                  If the motion is continuous bewteen two G1 commands, it should be fine. I'm going to try what has been suggested.

                  From what I understand, there's no way of doing any parallel tasking with the Duet boards, only a very quick series of commands.

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    dc42 administrators
                    last edited by 10 Sept 2020, 09:47

                    There is a small amount of parallel tasking that can be done using the daemon.g file, but I don't think it's appropriate for this purpose. There is another form that allows the Z axis to move independently (height following mode), but again that's not appropriate here.

                    We have plans to implement multiple independent but synchronised GCode streams on Duet 3 in the future, but that won't be implemented for some time.

                    Motion is as continuous as possible between adjacent G1 commands. If the G1 commands are in the same direction, then motion should be continuous provided that the print head is up to speed at the end of the first one, and the second one does not require more deceleration that is possible in the length of the move. If you put other commands between the two G1 commands, then motion may stop depending on the command. M42 commands will not cause a stop.

                    I just thought of another way to operate your stapler: put the machine in laser mode using M452, configure the laser output to operate the stapler, then do this:

                    G1 X100 F4000 S0
                    G1 X101 S1
                    G2 X200 S0
                    G1 X201 S1

                    and so on.

                    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
                    • undefined
                      Anthoval
                      last edited by 11 Sept 2020, 07:42

                      I'll try it and give a feedback afterwards. Thanks!

                      1 Reply Last reply Reply Quote 0
                      • undefined
                        Anthoval
                        last edited by Anthoval 24 Sept 2020, 08:04

                        After running multiples tests at a reasonnable speed (Feedrate : 15000 mm/min), I can tell that the motion is continuous between multiple G0/G1 commands!

                        By the way, I don't understand how the "T" parameter from the M670 works (when using the "P" parameter in a G1 command). I thought at first that is was the delay between the beginning of the movement and the beginning of the output being set to '1'. But when testing with multiple values for "T", the output was always set to '1' immediatly after the beginning of the G1 command.

                        Edit : The "T" parameter appears to be important when using the P1 parameter with a G1 command on a very short distance. Reduce the "T" value if you're looking to trigger an output to '1' on a short distance and high speed (30 mm and 15000 mm/min).

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