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

    Problem with the "while" loop?

    Scheduled Pinned Locked Moved
    Gcode meta commands
    3
    6
    476
    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.
    • Anthovalundefined
      Anthoval
      last edited by Anthoval

      Hi,

      I've noticed something strange when using a while loop. After the first iteration, there's is a small waiting time. Is it normal ? Here's the code I used :

      while iterations < 4
      G1 X150 F10000 P0

      deckingmanundefined 1 Reply Last reply Reply Quote 0
      • deckingmanundefined
        deckingman @Anthoval
        last edited by

        @Anthoval I can't find any reference to a "P" parameter for G1 moves so that might be throwing it. https://duet3d.dozuki.com/Wiki/Gcode#Section_G0_G1_Move

        On the other hand, how long is the pause? Might it simply be that any move will start at zero speed and have an acceleration phase, then at the end of the move decelerate down to zero speed before starting the next move?

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

        1 Reply Last reply Reply Quote 0
        • Anthovalundefined
          Anthoval
          last edited by

          @deckingman the "P" parameter is used to trigger an output for the whole movement.

          The pause might be a "G4 P0" (wait the end of previous movement). When multiples movements are used in a row, there's no stop between every move. The acceleration occurs on the first G1 command, the deceleration only occurs on the last.

          I feel like this pause is specific to the while loop, when iteration goes from 0 to 1. Though I have not tried to start the loop at iteration = 1, instead of 0 (if that's possible).

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

            Are you running the Duet standalone or with attached SBC?

            Which Duet and which firmware version 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

            1 Reply Last reply Reply Quote 0
            • deckingmanundefined
              deckingman @Anthoval
              last edited by

              @Anthoval said in Problem with the "while" loop?:

              @deckingman the "P" parameter is used to trigger an output for the whole movement.

              Please explain how that works with your command (quote)

              G1 X150 F10000 P0.
              

              I can find no reference to that "P" parameter in the official documentation for G1 commands that I referenced.

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

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

                I thought the P parameter for G1 commands was documented, but it seems not to be. I have just [re-]added it.

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