From: Ian Jackson Date: Sat, 6 Feb 2016 16:49:05 +0000 (+0000) Subject: pauseAtZ plugin: Support re-homing X and Y before restarting X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=be72c9ccd6157845f2b358cbca6a241aa172210b;p=cura.git pauseAtZ plugin: Support re-homing X and Y before restarting In a two-colour print, the operator has to mess about with the X carriage to swap the filament in the print head, which can disturb the X position. In other applications of pauseAtZ, the operator needs to interact with the workpiece, perhaps disturbing the Y position. So support homing the X and/or Y axes just before resuming. The default head park position of [150,0,] is suitable for use for swapping filament, and moves the printbed out of the way. So make the default by to home X but not Y. In both cases we travel fast to nearish the endstop (within 25mm), and then do the home (which is slower). This gets us going as quickly as possible (which is helpful to avoid ooze). Signed-off-by: Ian Jackson --- diff --git a/plugins/pauseAtZ.py b/plugins/pauseAtZ.py index a4118a00..fa9a3aed 100644 --- a/plugins/pauseAtZ.py +++ b/plugins/pauseAtZ.py @@ -8,6 +8,8 @@ #Param: moveZ(float:5) Head move Z (mm) #Param: parkMinZ(float:15) Minimum head park Z (mm, abs) #Param: retractAmount(float:1) Retraction amount (mm) +#Param: homeX(bool:true) Re-home X on restart +#Param: homeY(bool:false) Re-home Y on restart __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License" import re @@ -109,6 +111,20 @@ with open(filename, "w") as f: f.write("M84 E0\n") #Wait till the user continues printing f.write("M0\n") + + #Re-home the axes, in case the operator has perhaps jostled the printer + if homeX or homeY: + g1 = "G1" + g28 = "G28" + if homeX: + if parkX > 25: g1 += " X25" + g28 += " X" + if homeY: + if parkY > 25: g1 += " Y25" + g28 += ' Y' + f.write(g1 + " F9000\n") + f.write(g28 + "\n") + #Push the filament back, and retract again, the properly primes the nozzle when changing filament. f.write("G1 E%f F6000\n" % (retractAmount)) f.write("G1 E-%f F6000\n" % (retractAmount))