Continuing a Stalled Print

Sometimes your printer will stop part way through a print (power cut, filament problems), and you don’t want to waste the part you’ve already printed. Here’s what I ended up doing.

You Will Need

  • The original gcode (eg. from the SD card or uploaded to OctoPrint)
  • Space to home all axis (can do each axis independently if we want)
  • Half printed model with clean top layer. Snap off down to where it’s all flat if you need to

1. Work out what layer you stopped on

To do this, home the Z axis, then raise it a bit higher than the needed height. Disable steppers and move the print head over the print. Using a bit of paper to test clearance (just like bed levelling), lower slowly until the print head is at the correct height to continue printing.

Note the Z height you’re at (this is in mm). Divide by the layer height (usually 0.2 mm/layer) - this gives you the layer that you stopped at. You may need to round to the nearest layer_height.

2. Find the layer in the gcode

You can do this by searching for LAYER:XXX where XXX is your layer number. Copy the last Z value from the second-last G0 code the layer before - this is where you will start from. Note the most recent extruder value from the last G1 from the layer before.

3. Start editing!

Remove all the commands above the LAYER:XXX line, up to the M107 at the start of the file.

Insert the following snippet in place of everything you deleted:

G28 X0 Y0 ; move X/Y to min endstops
G0 F180 X178 Y172 ; Send to safe spot for z homing         ### YOU NEED TO SET THIS
G28 Z0 ; move Z to min endstops
G1 Z15.0 F9000 ; move the head up 15mm
G92 E0 ; zero the extruded length
G1 F200 E3 ;extrude 3mm of feed stock
G0 Z76.8 ; Send Z to where it failed                       ### YOU NEED TO SET THIS
G92 E8627.12365 ; Set extruded length to where it failed   ### YOU NEED TO SET THIS
G1 F9000
M117 Trying again! ; Put printing message on LCD screen

4. Run it!

The first movements will run really slow so you can watch it and press the stop button if it starts doing anything wrong.

Good Luck!