How to Resume Printing After Filament Jam

The other day I woke up and checked on my 48+ hour print only to find the print head zipping around about 10cm above the model failing to extrude filament! There was no sign of stringing or spaghetti on the part of the model that had printed, it had simply stopped extruding due to a jam in the print head (apparently due to excessive heat build-up in my enclosure).

So how to resume a print that failed halfway through???

I figured that it should be possible to manually edit the G-code file to tell the printer to simply start printing again at the layer that failed, so a bit of googling led me to the following solution.

Step 1: Stop the Printer

  • Assuming the printer is still running “printing air”, stop it using the touchscreen or Luban.
  • You should also manually set the bed temperature to the same value as the job to prevent it from cooling and possibly releasing the model or causing it warp.

Step 2: Fix the Problem

  • If you can fix it without turning the printer off, do so now. In my case the problem was excess heat in the enclosure softening the PPLA as it went through the gear of the extruder. I was able to unload it, cut off the damaged filament, and re-load it and clean any blobs off the nozzle.

It may be possible to recover if you have to turn it off to fix the problem, but I’m not sure what settings (e.g. calibration and offsets) survive power cycling…

Step 3: Determine the Last Successful Print Layer

  • Make sure the nozzle is clean (i.e. no plastic showing below the brass)
  • Use the manual controls on the touch screen to carefully lower the print head until it is just touching the model, then raise it just enough to clear the model.
  • Move the head across various sections of the model - if it touches, raise it a little more (.05 or .1mm) until the head can move over all of the model without touching.
  • Make a note of the Z axis value showing on the touchscreen

Step 4: Hack the G-Code file

  • Using a text editor, open the g-code file you were printing when it failed
  • Scroll down past the gibberish in the header that represents the encoded image of the model until you find the G-code commands:
;Header End

;G-code for 3dp engraving
...
  • Look for the section that defines Layer 0 - you’re going to delete the instructions from Layer 0 up to and including the last successful layer :
;LAYER:0
...
  • Find the section defining the last successful layer. E.g. if the Z axis value on the touchscreen from Step 3 is 29.59, search for “Z29” and find the layer with a Z value closest to the Z value - the extrusion height. In my case, extrusion height is .16, so the nearest layer is Layer 176 with Z=29.4
;LAYER:176
;MESH://Tmp/53864854_07257092.stl
G0 X159.027 Y175.891 Z29.4
;TYPE:WALL-OUTER
G1 F300 Z28.4
  • Go ahead and delete all the G-code for Layers 0 up to and including the last successful layer (this means deleting all commands from the line that reads “;LAYER:0” to the line “;LAYER:177”

  • It’s likely we’ve just deleted the line that turns the cooling fan on. Assuming you want part cooling, add the following line above the first “;LAYER:xx” line.

M106; turn on part cooling

  • We also need to reset the extrusion counter to what it should have been to start the next layer. Look at the g-code of what is now your first “;LAYER” - in my case it is Layer 177 - and find the first line in this section containing an “E” value.
;LAYER:177
;MESH:/Tmp/53864854_07257092.stl
G0 X158.991 Y175.78 Z29.56
;TYPE:WALL-OUTER
G1 F300 Z28.56
G1 F3600 E3143.51997       <<<====== This line contains the first "E" value
G1 F900 X158.639 Y174.845 E3143.54655
G1 X159.419 Y174.844 E3143.5673
  • Add the following line before the first “;LAYER:xx” line, using the E value you just found above.
G92 E3143.51997
;LAYER:177
  • Finally, to make sure we don’t crash the print head into the existing model, insert another line before the first layer to send the print head somewhere safe above the model. Use a Z value a few cm greater than the value you found at Step 3.
G0 X10 Y10 Z35
;LAYER:177
  • Save your g-code file, send it to the Snapmaker, and start printing it as if it were a new file.

Step 5 - Monitor first layer & tweak Z offset as needed

  • Watch the first layer closely - if the nozzle is bumping the model, use the touchscreen to increase the Z-offset slightly until the bumping stops. If the filament is not adhering properly to the model, try decreasing the z-offset slightly (0.05mm increments) until it does.
8 Likes

Was the printout .successful?

It was totally successful. If you look closely you can see the layers where I restarted (I had to restart twice - the filament jammed again before I realised what was causing the jam), but adhesion was fine, and the job completed successfully.