Save Z position when shutting down
-
Hi!
I have a little bit strange construction of Z axis where I have to move up/down extruder for Z homing. Because of this I want to save Z position when printer shutting down and load it after turned on.
I tried with M911 command but it doesn't work when the printer doesn't have a job. I add macro to executed command in M911 but it works only for shutting down while printing too. Is any other way to do it?
Greetings!
-
@lem said in Save Z position when shutting down:
Is any other way to do it?
Sure. Before shut-down, get to know the position from the object model, then, use
echo
as described here to write a macro onto the SD card (just a one-liner with G92, followed by X/Y/Z …) which you call when you restart your printer.If you need more specific advice after you have studied the links: ask.
-
@infiniteloop Thans for reply. But I don't now one thing - which macro / file / command is executed while shutting down? I can't find this in built-in macros (start.g, pause.g, sleep.g, etc.)
-
@lem said in Save Z position when shutting down:
which macro / file / command is executed while shutting down?
Usually none. My printer has a separate PSU for the Duet, so that I can shut-off power for steppers and heaters with
M81
, but I can as well turn the mains switch or pull the plug.Either you save the positions in all situations you can think of - end.g, pause, resume, abort,
M911
… but you won't catch all possible events. Or you always invoke a macro before you plan to shut the printer off.A better way is to use some "auxiliary end switch" for Z so you have a known height before doing the "real" homing - this can be anywhere along the Z axis.