Skip to content

Commit de2be74

Browse files
committed
PLR: XY home height
1 parent dc6f23e commit de2be74

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Marlin/Configuration_adv.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,10 @@
18081808
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail
18091809
#endif
18101810

1811+
// (ms) Absolute height for XY homing to prevent collision with printed objects.
1812+
// Zero means no raise above stored position
1813+
#define POWER_LOSS_XYHOME_HEIGHT 0
1814+
18111815
// Enable if Z homing is needed for proper recovery. 99.9% of the time this should be disabled!
18121816
//#define POWER_LOSS_RECOVER_ZHOME
18131817
#if ENABLED(POWER_LOSS_RECOVER_ZHOME)

Marlin/src/feature/powerloss.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,9 @@ void PrintJobRecovery::resume() {
439439

440440
// If Z homing goes to max then just move back to the "raised" position
441441
PROCESS_SUBCOMMANDS_NOW(TS(
442-
F( "G28R0\n" // Home all axes (no raise)
443-
"G1F1200Z") // Move Z down to (raised) height
444-
, p_float_t(z_now, 3)
442+
F( "G28R"), p_float_t(_MAX(POWER_LOSS_XYHOME_HEIGHT - z_now, 0), 3), // Home all axes with optional raise
443+
F("\nG1F3000X"), p_float_t(resume_pos.x, 3), 'Y', p_float_t(resume_pos.y, 3), // Return XY to original place to prevent collision while descending
444+
F("\nG1F1200Z"), p_float_t(z_now, 3) // Move Z down to (raised) height
445445
));
446446

447447
#elif DISABLED(BELTPRINTER)
@@ -463,8 +463,12 @@ void PrintJobRecovery::resume() {
463463
PROCESS_SUBCOMMANDS_NOW(TS(F("G1F600Z"), p_float_t(z_now, 3)));
464464
}
465465

466-
// Home XY with no Z raise
467-
PROCESS_SUBCOMMANDS_NOW(F("G28R0XY")); // No raise during G28
466+
467+
PROCESS_SUBCOMMANDS_NOW(TS(
468+
F( "G28XYR"), p_float_t(_MAX(POWER_LOSS_XYHOME_HEIGHT - z_now, 0), 3), // Home XY with optional Z raise
469+
F("\nG1F3000X"), p_float_t(resume_pos.x, 3), 'Y', p_float_t(resume_pos.y, 3), // Return XY to original place to prevent collision while descending
470+
F("\nG1F1200Z"), p_float_t(z_now, 3) // Move Z down to (raised) height
471+
));
468472

469473
#endif
470474

0 commit comments

Comments
 (0)