Skip to content

Commit 6ee487e

Browse files
committed
G28 H Z, home Z at the current X/Y independent of POWER_LOSS_RECOVERY
"Fix, Improve Power-Loss Recovery (MarlinFirmware#22828)" enabled this H option, but only when POWER_LOSS_RECOVERY is defined. This is useful beyond power loss recover, such as printing from OctoPrint, or any time there may be a model at the normal safe x/y location and a Z home is needed. It is also more flexible in letting the user choose the location based on where the model was sliced for this print. Add comments to document H. In my latest recovery I first needed the model height, home XY, home Z (avoiding the model), move to the model, G30 to probe the model height. Then I could restart the print at that location. Printing from OctoPrint power loss recovery was not involved. Note the probe to nozzle offset means some locations next to the edge of the build plate will probe once, then fail because it sees the location as unreachable and fail the home Z.
1 parent 8d9a5a8 commit 6ee487e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Marlin/src/gcode/calibrate/G28.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@
195195
* L<bool> Force leveling state ON (if possible) or OFF after homing (Requires RESTORE_LEVELING_AFTER_G28 or ENABLE_LEVELING_AFTER_G28)
196196
* O Home only if the position is not known and trusted
197197
* R<linear> Raise by n mm/inches before homing
198+
* H Hold the current X/Y position when executing a home Z, or if
199+
* multiple axes are homed, the position when Z home is executed.
200+
* When using a probe for Z Home, positions close to the edge may
201+
* fail with position unreachable due to probe/nozzle offset. This
202+
* can be used to avoid a model.
198203
*
199204
* Cartesian/SCARA parameters
200205
*
@@ -486,7 +491,12 @@ void GcodeSuite::G28() {
486491
#endif
487492

488493
#if ENABLED(Z_SAFE_HOMING)
489-
if (TERN1(POWER_LOSS_RECOVERY, !parser.seen_test('H'))) home_z_safely(); else homeaxis(Z_AXIS);
494+
// H means hold the current X/Y position when probing, if not
495+
// specified, move to the define safe X/Y position before homing Z.
496+
if (!parser.seen_test('H'))
497+
home_z_safely();
498+
else
499+
homeaxis(Z_AXIS);
490500
#else
491501
homeaxis(Z_AXIS);
492502
#endif

0 commit comments

Comments
 (0)