Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,7 @@
#if ENABLED(POWER_LOSS_RECOVERY)
#define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss
//#define POWER_LOSS_ZHOME // Home Z-Axis during recovery
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS)
//#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
//#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
Expand Down
18 changes: 9 additions & 9 deletions Marlin/src/feature/powerloss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ void PrintJobRecovery::resume() {
"G28R0"
#if ENABLED(MARLIN_DEV_MODE)
"S"
#elif !IS_KINEMATIC
#elif NONE(IS_KINEMATIC, POWER_LOSS_ZHOME)
"XY"
#endif
#endif
Expand Down Expand Up @@ -407,23 +407,23 @@ void PrintJobRecovery::resume() {
gcode.process_subcommands_now(cmd);
#endif

// Move back to the saved XY
sprintf_P(cmd, PSTR("G1 X%s Y%s F3000"),
dtostrf(info.current_position.x, 1, 3, str_1),
dtostrf(info.current_position.y, 1, 3, str_2)
);
gcode.process_subcommands_now(cmd);

// Move back to the saved Z
dtostrf(info.current_position.z, 1, 3, str_1);
#if Z_HOME_DIR > 0
#if Z_HOME_DIR > 0 || ENABLED(POWER_LOSS_ZHOME)
sprintf_P(cmd, PSTR("G1 Z%s F200"), str_1);
#else
gcode.process_subcommands_now_P(PSTR("G1 Z0 F200"));
sprintf_P(cmd, PSTR("G92.9 Z%s"), str_1);
#endif
gcode.process_subcommands_now(cmd);

// Move back to the saved XY
sprintf_P(cmd, PSTR("G1 X%s Y%s F3000"),
dtostrf(info.current_position.x, 1, 3, str_1),
dtostrf(info.current_position.y, 1, 3, str_2)
);
gcode.process_subcommands_now(cmd);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bad idea. You don't want to do a sideways move when Z is at the lower height. Power Loss Recovery currently does the sideways move before lowering the Z axis in order to avoid knocking over the model.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had swapped the Z and XY resume moves, but a better option would be to restore Z above the print before moving back to resume printing.

// Un-retract
#if POWER_LOSS_PURGE_LEN
//sprintf_P(cmd, PSTR("G1 E%d F3000"), POWER_LOSS_PURGE_LEN);
Expand Down