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

    DWC Cancel print vs stop/cancel.g

    Scheduled Pinned Locked Moved Unsolved
    General Discussion
    2
    4
    151
    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.
    • janjohundefined
      janjoh
      last edited by janjoh

      Reading about M0/M1/M2 i see that they all list "The firmware finishes any moves left in its buffer." as the first step.
      Can that be overridden short of a M999?

      Or maybe I am doing things wrong.

      I've added a nozzle clean to my startup sequence. This sxtrudes a bit of filament, retracts it, and runs the tool over a wiper. Works kind of nice.

      But what I noticed was that when I got a filament sensor error during the extrude the following happened. (See https://forum.duet3d.com/topic/36278/completely-unreasonable-measured-per-revolution )

      Pause.g ran, moving the tool to X0Y0 (TIme to tweak that file by the way.)

      WHen I then pressed "cancel print" in DWC, the "wipe moves" were executed. (As I suppose they were in the buffer).

      What I would like to do is "Cancel print" to actually "Stop what you are doing, without executing remaining moves".

      I know that i currently do not have a "cancel.g" (never needed ut until now), but since I read the definition of M0/M1/M2 as the machine will always first work over the buffer and then execute cancel.g ... Not sure what the cancel.g could contain to purge the current queued moves?

      I am CERTAIN that this is just me mis-reading / mis-understanding some aspect of all this. But what?

      Cura config for "Start Gcode"

      M220 S100
      M98 P"0:/Macros/PreWipe.g"
      M140 S{material_bed_temperature_layer_0} ;Start heating bed
      M190 S{material_bed_temperature_layer_0} ;Wait for bed to reach temp before proceeding
      M104 S{material_print_temperature_layer_0} ;Start heating extruder;
      M109 S{material_print_temperature_layer_0}
      M98 P"0:/Macros/BambuWiper.g"
      G32
      G1 F500 E30
      

      PreWipe.g

      if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
        G28
      
      M564 S0
      G1 X0 Y-165 Z-0.0 F4000
      T0                         ; Select tool 
      M564 S1
      
      if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
        G28
      
      ;G1 Y-150 X0 Z10 F5000
      ;G30
      M564 S0
      
      
      G1 X0 Y-165 Z-0.0 F2500
      T0                         ; Select tool 
      G1 X48 Y-165 Z0.2 F500 E35 ; Start WIpe Locatioon (THIS IS THE MOVE THAT CAUSED THE pause DUE TO SENSOR ERROR)
      G1 E-30 F2000
      G91                        ; Relative Positioning
      
      while true
        if iterations = 22
          break
        G1 X40 Y0.2 F8000
        G1 X-40 Y0.2 F8000
      G90                        ;Absolute positioning
      
      G1 Y-150 X0 Z10 F5000
      M564 S1
      

      Pause/Stop/Resume.g are all untouched from the config tool.

      chrishammundefined 1 Reply Last reply Reply Quote 0
      • janjohundefined janjoh marked this topic as a question
      • chrishammundefined
        chrishamm administrators @janjoh
        last edited by

        @janjoh M0 from a file print executes stop.g. If you pause the print via M25 (or via Pause in DWC) and then cancel it using M0, cancel.g is executed. If cancel.g is not present, stop.g is executed as well AFAIR.

        Duet software engineer

        janjohundefined 1 Reply Last reply Reply Quote 0
        • janjohundefined
          janjoh @chrishamm
          last edited by

          @chrishamm

          Understood. Thanks. So, does that mean that whatever is in cancel.g supersedes whatever may be in the movement buffer?

          chrishammundefined 1 Reply Last reply Reply Quote 0
          • chrishammundefined
            chrishamm administrators @janjoh
            last edited by

            @janjoh Only pausing (via M25) may reduce the number of moves in the buffer. M0 and several other codes wait for all pending moves to finish first.

            Duet software engineer

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