From e2823c3c35a57cc8d5ba1413558b30f0d72e3465 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 13 Mar 2024 15:05:18 +0100 Subject: [PATCH] Reset EEPROM_UVLO after recovering Undo PP Z lift --- Firmware/Marlin_main.cpp | 2 +- Firmware/power_panic.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 3c4b1f08d..0cc029c23 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -11067,7 +11067,7 @@ void restore_print_from_ram_and_continue(float e_move) set_destination_to_current(); restore_print_file_state(); - + eeprom_update_byte((uint8_t*)EEPROM_UVLO, PowerPanic::NO_PENDING_RECOVERY); lcd_setstatuspgm(MSG_WELCOME); saved_printing_type = PowerPanic::PRINT_TYPE_NONE; saved_printing = false; diff --git a/Firmware/power_panic.cpp b/Firmware/power_panic.cpp index 653b84655..ccb2e6c30 100644 --- a/Firmware/power_panic.cpp +++ b/Firmware/power_panic.cpp @@ -315,8 +315,13 @@ void recover_print(uint8_t automatic) { // Recover position, temperatures and extrude_multipliers bool mbl_was_active = recover_machine_state_after_power_panic(); - // Lift the print head 20mm, first to avoid collisions with oozed material with the print, - // and second also so one may remove the excess priming material. + // Undo PP Z Lift by setting current Z pos to + Z_PAUSE_LIFT + // After a reboot the printer doesn't know the Z height and we have to set its previous value + if(eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::PENDING_RECOVERY_RETRY) { + current_position[Z_AXIS] += Z_PAUSE_LIFT; + } + + // Lift the print head ONCE plus Z_PAUSE_LIFT first to avoid collisions with oozed material with the print, if(eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::PENDING_RECOVERY) { enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + Z_PAUSE_LIFT);