Skip to content

Instantly share code, notes, and snippets.

@foosel
Last active April 2, 2021 22:25
Show Gist options
  • Save foosel/1c09e269b1c0bb7a471c20eef50c8d3e to your computer and use it in GitHub Desktop.
Save foosel/1c09e269b1c0bb7a471c20eef50c8d3e to your computer and use it in GitHub Desktop.
pause/resume scripts for OctoPrint 1.3.0
{% if pause_position.x is not none %}
; relative XYZE
G91
M83
; retract filament, move Z slightly upwards
G1 Z+5 E-5 F4500
; absolute XYZE
M82
G90
; move to a safe rest position, adjust as necessary
G1 X0 Y0
{% endif %}
{% if pause_position.x is not none %}
; relative extruder
M83
; prime nozzle
G1 E-5 F4500
G1 E5 F4500
G1 E5 F4500
; absolute E
M82
; absolute XYZ
G90
; reset E
G92 E{{ pause_position.e }}
; 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 %}
@echowhisky
Copy link

Was having lots of problems getting this to work -- the extruder would not extrude after resume. I spent an entire evening on print fails until I found the comment in this thread by @c3r63ru5 . There is an issue in using the commands above with GCODE produced by Slic3r because it uses relative, not absolute extruder settings. I changed the resume code to the following and it worked perfectly.

{% if pause_position.x is not none %}
; relative extruder
M83
; prime nozzle
G1 E-5 F4500
G1 E5 F4500
G1 E5 F4500
; absolute XYZ
G90
; 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 %}

@themaire
Copy link

Thanks you for everyone.

@marcodagostino
Copy link

I've followed the entire process and sensor works fine when filament runs out but when I change the filament and press knob for resume print process hotend comes back to correct position for a second then quickly return to change filament position and extruder retract filament again... substantially I'm in a change filament loop!!! Why this happens??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment