G-code snippets for pause/resume - filament not extruded after resume

I asked about this on the Prusa forums but got no replies so I'm also trying here:

I am trying to use octoprint's "@pause" dummy gcode. In PrusaSlicer I use the "custom g-code" at-layer feature to insert @pause. That does pause the print, and I can resume it through octoprint's web UI.

With just the @pause command, the problem is that the hot nozzle stays in place and melts whatever area of the print it's at.

So now I am trying to add two G-code snippets in octoprint's "after pause" and "after resume" scripts. I found a starting point in octoprint's docs here:


Using those, the behavior is improved, the nozzle moves away from the print and to a location that lets me access the print area to insert things.

However I have two remaining problems:

1.) When the printer pauses and the nozzle moves up, it leaves behind a vertical strand of melted filament. I have to cut that off with a side-cutter. I thought the retraction for the E axis would prevent that.

2.) More importantly, when the print resumes, it seems that no filament is extruded. It just goes through the motions but no more filament is built up.

I previously (before using octoprint) used a manual filament change event instead of pause, and I did not have either of these issues, so I know the printer is capable of cleanly pausing and resuming the print, given the right g-code.

I tried various changes to the snippet, for example I tried to add a few mm more extrusion at resume than retraction at the pause (with a dwell and manual cleanup of the resulting gunk at the nozzle after the extrusion) to make sure the filament is really at the tip of the nozzle.

I tried to capture the issues in a video (sorry for the quality):

You can hopefully see that no filament is extruded when it resumes. Ignore the fact that it's a bit messy because I didn't clean the nozzle this time and cut off the extra vertical strand, I did that in other attempts and it made no difference. The main problem is that the nozzle doesn't seem to be extruding filament after the resume.

I wonder if anybody has experience with this and can help me come up with some g-code that does the right thing.

In this case, a picture is NOT worth a thousand words.

Rather than make us guess (most likely incorrectly), please provide the gcode snippets you are using and a sample gcode file that contains the pause (something simple like a 2x2x2mm cube with a pause at Z=1mm). Enable the OctoPrint serial.log, print the above file, and provide the log here.

1 Like

Thanks Brad, following this suggestion I created a test model, 0.8m high, sliced to four 0.2mm layers in PrusaSlicer. The @pause occurs between layers 2 and 3 (i.e. at 0.4mm).

Attached here is the gcode file I loaded into Octoprint as well as the log files.

For this test, I reverted the pause/resume gcode snippets back to the ones from the documentation:


serial.log (163.2 KB) octoprint.log (13.7 KB) pause test_0.2mm_PLA_MINI_2m.gcode (37.4 KB)

As I suspected, the gcode produced by the slicer uses M83 ; extruder relative mode and the pause and resume snippets contain:

; absolute E

which leaves the extruder in the wrong mode when the object gcode resumes. Remove the M82 commands from the snippets and things should work better.

Thanks again Brad, very interesting. I removed them and did a quick test, unfortunately the result was the same. I'll keep experimenting a bit more like I did initially, but this time with the M82 instructions removed.