Skip to content

Commit

Permalink
G28 H Z, home Z at the current X/Y independent of POWER_LOSS_RECOVERY
Browse files Browse the repository at this point in the history
"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.
  • Loading branch information
dfries committed Apr 8, 2023
1 parent ba25586 commit ceb2639
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@
* L<bool> Force leveling state ON (if possible) or OFF after homing (Requires RESTORE_LEVELING_AFTER_G28 or ENABLE_LEVELING_AFTER_G28)
* O Home only if the position is not known and trusted
* R<linear> Raise by n mm/inches before homing
* H Hold the current X/Y position when executing a home Z, or if
* multiple axes are homed, the position when Z home is executed.
* When using a probe for Z Home, positions close to the edge may
* fail with position unreachable due to probe/nozzle offset. This
* can be used to avoid a model.
*
* Cartesian/SCARA parameters
*
Expand Down Expand Up @@ -486,7 +491,12 @@ void GcodeSuite::G28() {
#endif

#if ENABLED(Z_SAFE_HOMING)
if (TERN1(POWER_LOSS_RECOVERY, !parser.seen_test('H'))) home_z_safely(); else homeaxis(Z_AXIS);
// H means hold the current X/Y position when probing, if not
// specified, move to the define safe X/Y position before homing Z.
if (!parser.seen_test('H'))
home_z_safely();
else
homeaxis(Z_AXIS);
#else
homeaxis(Z_AXIS);
#endif
Expand Down

0 comments on commit ceb2639

Please sign in to comment.