From 265c2c13f4db7cbd0c9c0d10fb99e24a8e7c89dd Mon Sep 17 00:00:00 2001 From: Paul Bone Date: Sat, 8 Feb 2025 22:30:08 +1100 Subject: [PATCH] feat: Avoid wiping the toolhead on the model when resuming When resuming the print the toolhead had a chance of wiping plastic on the outside of the model as it returned. This patch adds a move back to a point above where it started before resuming. With a suitable "dz" this elminiated branching (like stringing) for me. Signed off by: Paul Bone --- klipper_macro/timelapse.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/klipper_macro/timelapse.cfg b/klipper_macro/timelapse.cfg index c821f39..9341772 100644 --- a/klipper_macro/timelapse.cfg +++ b/klipper_macro/timelapse.cfg @@ -261,6 +261,9 @@ gcode: {% set restore = {'absolute': {'coordinates': printer.gcode_move.absolute_coordinates, 'extrude' : printer.gcode_move.absolute_extrude}, 'speed' : printer.gcode_move.speed, + 'pos' : {'x': printer.toolhead.position.x, + 'y': printer.toolhead.position.y, + 'z': [printer.gcode_move.gcode_position.z + park.coord.dz, printer.toolhead.axis_maximum.z]|min}, 'e' : printer.gcode_move.gcode_position.e, 'factor' : {'speed' : printer.gcode_move.speed_factor, 'extrude': printer.gcode_move.extrude_factor}} %} @@ -308,6 +311,7 @@ gcode: {% if tl.takingframe %} UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_TAKE_FRAME DURATION={tl.check_time} {% else %} + G0 X{tl.restore.pos.x} Y{tl.restore.pos.y} Z{tl.restore.pos.z} {tl.macro.resume} VELOCITY={tl.speed.travel} ; execute the klipper RESUME command SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=is_paused VALUE=False {% if not printer[printer.toolhead.extruder].can_extrude %}