Save Z position when shutting down
Lem last edited by
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?
infiniteloop last edited by
Is any other way to do it?
Sure. Before shut-down, get to know the position from the object model, then, use
echoas 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.
Lem last edited by Lem
@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.)
infiniteloop last edited by infiniteloop
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.