[Request] On Pause raise Z axis

Is there anyway to implement that on a pause the Z-axis is raised and then on resume it returns the z-axis to the correct position? On my ender 3 V2 if I pause a print, the nozzle will sit on the part that it was printing and melt it. A quick solution would be to raise the z axis slightly so the nozzle isn't that close to the part that is printing.

there are gcode scripts in octoprnt's settings that you can utilize for this...

How would I do that via G code. Isn't G0 and G1 absolute coordinates... how would I move up +1 and then down -1 in the print job is paused and print job is resumed?

You switch between relative and absolute movement. So for example your on pause script could be

G91 ; relative positioning
G0 Z10

and then in your resume script you could have this.

G0 Z-10
G90 ; absolute positioning

and it should go back to putting the nozzle in the right place. Of course you could also add in some retraction in pause and prime in resume, etc.

1 Like

Thanks! That should hopefully solve my issue.

Following on from that, in Octoprint doc there is an example of a Pause script ie

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

; retract filament, move Z slightly upwards
G1 Z+5 E-5 F4500

; absolute XYZE

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

What does "{% if pause_position.x is not none %}" mean?

There is an option in the settings to save pause position, by sending an M114 command as it is paused. This can slow down the pausing time, so it is configurable.

In that particular script, the pause position is not used. But in the beforePrintResume script this is used. So it is not necessary if the script doesn't require pause position, but if it does it provides an extra safeguard.

The syntax is Jinja, a Python templating engine which is also used to construct the web UI.

I suspect that "none" means no value? If thats so, does it mean if position is saved do this up to endif?

Yes, exactly that.

Hi all. I searched the forums for this and would like to reiterate the suggested improvement to octoprint for a setting to automatically raise z axis on pause and return to correct position on return. For peeps like me who aren't script savvy, a settings option (with adjustable height config) would be great. Cheers

This is what GCODE Scripts are for...


There are examples there.