OctoPrint Pause and Resume Settings for the Ender3

This isn’t anything particularly earth shattering here, the point here is to make a kind of “CubicleNate bookmark” for me and to be openly criticized by those that know more than me on this subject. The problem I had was pausing and resuming properly using OctoPrint on my Ender3 Printer. I messed up more than one print by trying to do it and I really think this should be the default behavior but here we are.

I have been making some 24hour plus prints and I will run into a situation where I will need to swap out the roll of filament because what I have is going to run out before the print is through. So, I did some searching and found this solution for properly pausing and resuming a print. It is based on this:

https://www.yirco.me/octoprint-pause-change-filament/

In reading through the entirety of the the article, I read some comments about whether or not M82 absolute or M83 relative mode is proper. In order to determine for absolute certainty, what would work with my setup using Prusa Slicer along with my Ender3 running OctoPrint on a Raspberry Pi3, I read through this as well:

https://www.sublimelayers.com/2017/10/to-extruder-relative-or-not-to-extrude.html

This prompted me to investigate for absolute certainty whether the Prusa Slicer is using M82 or M83 when producing gcode for my printer. I opened up the latest file I am getting ready to print and on line 16 I see that the printer is indeed using M83, relative mode.

Configuring OctoPrint

After some other checking and verification I have am at the conclusion that the solution for me, with my specific setup is what is presented in the first article I read. In order to make the changes in OctoPrint, here is what needs to be done. First go into the Settings.

Next is to go into the GCODE Scripts

Scroll down to find the sections titled, “After print job is paused” and “Before print Job is resumed.” The GCODE for the “After print job is paused” will move the print head away from the work to allow you to change the filament without upsetting the work on the print bed. The code for “Before print job is resumed” will bring the print head back to the last point it deposited filament onto the part.

I put these bit of code in their respective locations:

After print job is paused

{% if pause_position.x is not none %}
; relative XYZE
G91
M83

; retract filament of 0.8 mm up, move Z slightly upwards and 
G1 Z+5 E-0.8 F4500

; absolute XYZE
M82
G90

; move to a safe rest position, adjust as necessary
G1 X0 Y0
{% endif %}

Before print job is resumed

{% if pause_position.x is not none %}
; relative extruder
M83

; prime nozzle
G1 E-0.8 F4500
G1 E0.8 F4500
G1 E0.8 F4500

; absolute E
M82

; absolute XYZ
G90

; reset E
G92 E{{ pause_position.e }}

; WARNING!!! - use M83 or M82(extruder absolute mode) according what your slicer generates
M83 ; extruder relative mode

; move back to pause position XYZ
G1 X{{ pause_position.x }} Y{{ pause_position.y }} Z{{ pause_position.z }} F4500

; reset to feed rate before pause if available
{% if pause_position.f is not none %}G1 F{{ pause_position.f }}{% endif %}
{% endif %}

Save the changes.

Final Thoughts

This code should be default with OctoPrint or at the very least, some kind of a quick setting to make it something you don’t have to hunt the web to find an answer. Regardless, I am glad there is an answer and I am able to make the modification to the settings in OctoPrint so that I can effectively pause and resume prints for whatever the reason may be but importantly, for filament changes.

Thankfully, OctoPrint is a fantastic bit of software that I am glad I have on my Ender3 Printer. I hope for many long years of use of my 3D printer ensemble as the various improvements have made to it since its initial acquisition has made this a fantastic bit of machinery.

References

OctoPrint.org
Ender3 Printer
https://www.yirco.me/octoprint-pause-change-filament/
https://www.sublimelayers.com/2017/10/to-extruder-relative-or-not-to-extrude.html

4 thoughts on “OctoPrint Pause and Resume Settings for the Ender3

  1. thanks a lot! i’m going to try this out, but i’m sure this will be super cool.

    1. I hope it works well for you. I have had a few isolated incidences where it didn’t act as expected but I cannot repeat the error.

  2. Thanks this is what I was looking for, I will need to play with it a bit because when I un-paused a print the extruder stopped trying to extrude (retractions as normal just extruder motor not turning during normal printing). I’m guessing this might have something to do with the last M82/M83.

  3. Yup! Cura apparently puts out M82 all works great now. Thanks for this =)

Leave a Reply