From 4caf671fd2bdd9a00c34f60199adeaf4db413e37 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 20 Feb 2020 12:16:24 +0000 Subject: [PATCH 01/12] Add switch to restore lost Z-axis position during power loss recovery If printer loses the Z-axis position during power loss, it needs to be recovered safely during the power loss recovery stage. 1) Safely home the Z axis (assumes print can be avoided) 2) Restore the Z position before XY --- Marlin/Configuration_adv.h | 1 + Marlin/src/feature/power_loss_recovery.cpp | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index ca4f86a834e8..29688ba3edb4 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1043,6 +1043,7 @@ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) //#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 //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss diff --git a/Marlin/src/feature/power_loss_recovery.cpp b/Marlin/src/feature/power_loss_recovery.cpp index aa7dff36e8c9..11dc92ab03b3 100644 --- a/Marlin/src/feature/power_loss_recovery.cpp +++ b/Marlin/src/feature/power_loss_recovery.cpp @@ -323,6 +323,9 @@ void PrintJobRecovery::resume() { #elif !IS_KINEMATIC "XY" #endif + #if ENABLED(POWER_LOSS_ZHOME) + "Z" + #endif #endif )); @@ -427,16 +430,9 @@ 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")); @@ -444,6 +440,13 @@ void PrintJobRecovery::resume() { #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); + // Un-retract #if POWER_LOSS_PURGE_LEN //sprintf_P(cmd, PSTR("G1 E%d F3000"), POWER_LOSS_PURGE_LEN); From 80f96dfdcd573ec8d27c0daf498ba23ed0553f5d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 24 Apr 2020 22:51:58 -0500 Subject: [PATCH 02/12] Fixup --- Marlin/src/feature/powerloss.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index a82afcf34cc6..b09e1f93a572 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -318,12 +318,9 @@ void PrintJobRecovery::resume() { "G28R0" #if ENABLED(MARLIN_DEV_MODE) "S" - #elif !IS_KINEMATIC + #elif !EITHER(IS_KINEMATIC, POWER_LOSS_ZHOME) "XY" #endif - #if ENABLED(POWER_LOSS_ZHOME) - "Z" - #endif #endif )); From a83e5d90925cbb271794a94e85be0ecaf195ab60 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 24 Apr 2020 22:54:21 -0500 Subject: [PATCH 03/12] Update powerloss.cpp --- Marlin/src/feature/powerloss.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index b09e1f93a572..2010a303017e 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -427,7 +427,7 @@ void PrintJobRecovery::resume() { // Move back to the saved Z dtostrf(info.current_position.z, 1, 3, str_1); - #if Z_HOME_DIR > 0 || ENABLED(POWER_LOSS_ZHOME) + #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")); From 632641a348d1de9e706f31e3fb56e20fe9ad1c01 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 24 Apr 2020 22:55:06 -0500 Subject: [PATCH 04/12] Update powerloss.cpp --- Marlin/src/feature/powerloss.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 2010a303017e..3b701f4bb1b1 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -318,7 +318,7 @@ void PrintJobRecovery::resume() { "G28R0" #if ENABLED(MARLIN_DEV_MODE) "S" - #elif !EITHER(IS_KINEMATIC, POWER_LOSS_ZHOME) + #elif NONE(IS_KINEMATIC, POWER_LOSS_ZHOME) "XY" #endif #endif From c547f8788a0cc7b6a79656ab01e5ee32da214cb8 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 6 Jun 2020 16:58:59 +0100 Subject: [PATCH 05/12] After home XY, Restore Z above print Standard resume now: 1) raises Z by POWER_LOSS_ZRAISE Added: 2) home XY 3) home Z 4) Raise Z to savedZ + POWER_LOSS_ZRAISE Standard resume then: 5) restores XY 6) drops Z back to savedZ 7) resumes print. --- Marlin/src/feature/powerloss.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 34b3d6228e33..25258f5726da 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -311,6 +311,15 @@ void PrintJobRecovery::resume() { char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16]; + #if ENABLED(POWER_LOSS_ZHOME) + // Restore the Z position as there is space to home Z safely without colliding with the print. + gcode.process_subcommands_now_P(PSTR("G28 Z\n")); + // Now move to ZsavedPos + POWER_LOSS_ZRAISE + dtostrf(info.current_position.z + POWER_LOSS_ZRAISE, 1, 3, str_1); + sprintf_P(cmd, PSTR("G1 F200 Z%s"), str_1); + gcode.process_subcommands_now(cmd); + #endif + // Select the previously active tool (with no_move) #if EXTRUDERS > 1 sprintf_P(cmd, PSTR("T%i S"), info.active_extruder); @@ -406,7 +415,14 @@ void PrintJobRecovery::resume() { sprintf_P(cmd, PSTR("G1 E%d F3000"), POWER_LOSS_PURGE_LEN - (POWER_LOSS_RETRACT_LEN)); 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 || ENABLED(POWER_LOSS_ZHOME) @@ -416,13 +432,6 @@ void PrintJobRecovery::resume() { 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); // Un-retract #if POWER_LOSS_PURGE_LEN From 104d9385beb608859ef68ab7901d557f7282a6ef Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 7 Jun 2020 11:16:32 +0100 Subject: [PATCH 06/12] Add settings for power loss Z home safe position --- Marlin/Configuration_adv.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 4c951dc35329..44aa79279cae 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1089,7 +1089,6 @@ #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 @@ -1100,6 +1099,12 @@ // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, // especially with "vase mode" printing. Set too high and vases cannot be continued. #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + + //#define POWER_LOSS_ZHOME // Home Z-Axis during recovery + #if ENABLED(POWER_LOSS_ZHOME) + #define POWER_LOSS_ZHOME_XPOS 0 // Safe X position for homing Z to avoid print + #define POWER_LOSS_ZHOME_YPOS 0 // Safe Y position for homing Z to avoid print + #endif #endif /** From f1be6af2589631aa59e542f924e2c7137326c57f Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 7 Jun 2020 11:18:07 +0100 Subject: [PATCH 07/12] Move to safe Z Home position on power loss recovery Settings added to specify a safe XY position to use for Z homing after power loss that avoids colliding with print. --- Marlin/src/feature/powerloss.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 25258f5726da..30866be398ba 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -312,8 +312,18 @@ void PrintJobRecovery::resume() { char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16]; #if ENABLED(POWER_LOSS_ZHOME) - // Restore the Z position as there is space to home Z safely without colliding with the print. + // If defined move to the safe Z homing position that avoids the print + #if POWER_LOSS_ZHOME_XPOS != 0 + gcode.process_subcommands_now_P( PSTR("G1 F1000 X" STRINGIFY(POWER_LOSS_ZHOME_XPOS)) ); + #endif + + #if POWER_LOSS_ZHOME_YPOS != 0 + gcode.process_subcommands_now_P( PSTR("G1 F1000 Y" STRINGIFY(POWER_LOSS_ZHOME_YPOS)) ); + #endif + + // Home and restore Z position now we are in a safe position gcode.process_subcommands_now_P(PSTR("G28 Z\n")); + // Now move to ZsavedPos + POWER_LOSS_ZRAISE dtostrf(info.current_position.z + POWER_LOSS_ZRAISE, 1, 3, str_1); sprintf_P(cmd, PSTR("G1 F200 Z%s"), str_1); From d1adcb630d73fa14fc9443129100ac878ff7067a Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 7 Jun 2020 12:35:36 +0100 Subject: [PATCH 08/12] Added test for POWER_LOSS_ZHOME Cannot be used when Z_SAFE_HOMING enabled --- Marlin/src/inc/SanityCheck.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 7313a140c3c2..5703069a1375 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2570,6 +2570,12 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #error "BACKUP_POWER_SUPPLY requires a POWER_LOSS_PIN." #endif +#if ENABLED(POWER_LOSS_ZHOME) + #if ENABLED(Z_SAFE_HOMING) + #error "POWER_LOSS_ZHOME cannot be used with Z_SAFE_HOMING." + #endif +#endif + #if ENABLED(Z_STEPPER_AUTO_ALIGN) #if NUM_Z_STEPPER_DRIVERS <= 1 #error "Z_STEPPER_AUTO_ALIGN requires NUM_Z_STEPPER_DRIVERS greater than 1." From 2282adf0581fa6a53ef47ade1366ffae1d28a7ad Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 29 Nov 2020 22:01:49 -0600 Subject: [PATCH 09/12] Followup to merge --- Marlin/Configuration_adv.h | 11 +++++------ Marlin/src/feature/powerloss.cpp | 24 ++++++++++-------------- Marlin/src/inc/SanityCheck.h | 4 ++-- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index f9766d891ffa..ad1f16fc84bc 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1219,7 +1219,6 @@ #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_RECOVER_ZHOME // Z homing is needed for proper recovery. 99.9% of the time this should be disabled! //#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 @@ -1231,11 +1230,11 @@ // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, // especially with "vase mode" printing. Set too high and vases cannot be continued. #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data - - //#define POWER_LOSS_ZHOME // Home Z-Axis during recovery - #if ENABLED(POWER_LOSS_ZHOME) - #define POWER_LOSS_ZHOME_XPOS 0 // Safe X position for homing Z to avoid print - #define POWER_LOSS_ZHOME_YPOS 0 // Safe Y position for homing Z to avoid print + + // Enable if Z homing is needed for proper recovery. 99.9% of the time this should be disabled! + //#define POWER_LOSS_RECOVER_ZHOME + #if ENABLED(POWER_LOSS_RECOVER_ZHOME) + //#define POWER_LOSS_ZHOME_POS { 0, 0 } // Safe XY position to home Z while avoiding objects on the bed #endif #endif diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index dd38980bc6dc..636582808522 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -369,28 +369,24 @@ void PrintJobRecovery::resume() { gcode.process_subcommands_now_P(PSTR( "G28R0" // No raise during G28 - #if IS_CARTESIAN && DISABLED(POWER_LOSS_RECOVER_ZHOME) && !defined(POWER_LOSS_ZHOME_POS) + #if IS_CARTESIAN && (DISABLED(POWER_LOSS_RECOVER_ZHOME) || defined(POWER_LOSS_ZHOME_POS)) "XY" // Don't home Z on Cartesian unless overridden #endif )); #endif - // Pretend that all axes are homed + #ifdef POWER_LOSS_ZHOME_POS + // If defined move to a safe Z homing position that avoids the print + constexpr xy_pos_t homepos = POWER_LOSS_ZHOME_POS; + sprintf_P(cmd, PSTR("G1 X%s Y%s F1000\nG28Z", dtostrf(homepos.x, 1, 3, str_1), dtostrf(homepos.y, 1, 3, str_2))); + gcode.process_subcommands_now(cmd); + #endif + + // Ensure that all axes are marked as homed set_all_homed(); #if ENABLED(POWER_LOSS_RECOVER_ZHOME) - #ifdef POWER_LOSS_ZHOME_POS - // If defined move to a safe Z homing position that avoids the print - constexpr xy_pos_t plr_zhome_pos = POWER_LOSS_ZHOME_POS; - sprintf_P(cmd, PSTR("G1 X%s Y%s F1000\nG28UZ", dtostrf(plr_zhome_pos.x, 1, 3, str_1), dtostrf(plr_zhome_pos.y, 1, 3, str_2))); - gcode.process_subcommands_now(cmd); - #else - gcode.process_subcommands_now(PSTR("G28Z")); - #endif - #endif - - #if ENABLED(POWER_LOSS_ZRAISE) // Now move to ZsavedPos + POWER_LOSS_ZRAISE sprintf_P(cmd, PSTR("G1 F500 Z%s"), dtostrf(info.current_position.z + POWER_LOSS_ZRAISE, 1, 3, str_1)); gcode.process_subcommands_now(cmd); @@ -505,7 +501,7 @@ void PrintJobRecovery::resume() { // Move back to the saved Z dtostrf(info.current_position.z, 1, 3, str_1); #if Z_HOME_DIR > 0 || ENABLED(POWER_LOSS_RECOVER_ZHOME) - sprintf_P(cmd, PSTR("G1 Z%s F200"), str_1); + sprintf_P(cmd, PSTR("G1 Z%s F500"), str_1); #else gcode.process_subcommands_now_P(PSTR("G1 Z0 F200")); sprintf_P(cmd, PSTR("G92.9 Z%s"), str_1); diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index debdcb9b229b..90471c242ed2 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2856,8 +2856,8 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(BACKUP_POWER_SUPPLY) && !PIN_EXISTS(POWER_LOSS) #error "BACKUP_POWER_SUPPLY requires a POWER_LOSS_PIN." - #elif BOTH(POWER_LOSS_ZHOME, Z_SAFE_HOMING) - #error "POWER_LOSS_ZHOME cannot be used with Z_SAFE_HOMING." + #elif BOTH(POWER_LOSS_RECOVER_ZHOME, Z_SAFE_HOMING) + #error "POWER_LOSS_RECOVER_ZHOME cannot be used with Z_SAFE_HOMING." #elif BOTH(POWER_LOSS_PULLUP, POWER_LOSS_PULLDOWN) #error "You can't enable POWER_LOSS_PULLUP and POWER_LOSS_PULLDOWN at the same time." #endif From 9a4c58d6633a3126d99315bc1b2420ae8a05e99d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Mar 2021 03:45:27 -0600 Subject: [PATCH 10/12] sanity check for POWER_LOSS_ZHOME_POS --- Marlin/src/inc/SanityCheck.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 6e417f38eb87..3f7931e0b6a5 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1641,7 +1641,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal * Allen Key * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis. */ -#if BOTH(Z_PROBE_ALLEN_KEY, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && (Z_HOME_DIR < 0) +#if BOTH(Z_PROBE_ALLEN_KEY, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && Z_HOME_DIR < 0 #error "You can't home to a Z min endstop with a Z_PROBE_ALLEN_KEY." #endif @@ -2920,6 +2920,8 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #error "POWER_LOSS_RECOVER_ZHOME cannot be used with Z_SAFE_HOMING." #elif BOTH(POWER_LOSS_PULLUP, POWER_LOSS_PULLDOWN) #error "You can't enable POWER_LOSS_PULLUP and POWER_LOSS_PULLDOWN at the same time." + #elif BOTH(IS_CARTESIAN, POWER_LOSS_RECOVER_ZHOME) && Z_HOME_DIR < 0 && !defined(POWER_LOSS_ZHOME_POS) + #error "POWER_LOSS_RECOVER_ZHOME requires POWER_LOSS_ZHOME_POS for a Cartesian that homes to ZMIN." #endif #endif From 22d96458c61e908165d030026b906b67977f7afd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Mar 2021 03:50:07 -0600 Subject: [PATCH 11/12] test --- buildroot/tests/rambo-tests | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/buildroot/tests/rambo-tests b/buildroot/tests/rambo-tests index d471f4201c80..02ecf5d3fc50 100755 --- a/buildroot/tests/rambo-tests +++ b/buildroot/tests/rambo-tests @@ -22,9 +22,11 @@ opt_add TEMP_CHAMBER_PIN 3 opt_add HEATER_CHAMBER_PIN 45 opt_set GRID_MAX_POINTS_X 16 opt_set FANMUX0_PIN 53 -opt_disable USE_WATCHDOG +opt_set Z_HOME_DIR 1 +opt_enable USE_ZMAX_PLUG +opt_disable USE_ZMIN_PLUG Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN USE_WATCHDOG opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \ - FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING PIDTEMPBED PROBE_TEMP_COMPENSATION \ + FIX_MOUNTED_PROBE CODEPENDENT_XY_HOMING PIDTEMPBED PROBE_TEMP_COMPENSATION \ PREHEAT_BEFORE_PROBING PROBING_HEATERS_OFF PROBING_FANS_OFF PROBING_STEPPERS_OFF WAIT_FOR_BED_HEATER \ EEPROM_SETTINGS SDSUPPORT SD_REPRINT_LAST_SELECTED_FILE BINARY_FILE_TRANSFER \ BLINKM PCA9533 PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \ @@ -38,7 +40,7 @@ opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TE SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \ BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \ FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ - PSU_CONTROL AUTO_POWER_CONTROL POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE \ + PSU_CONTROL AUTO_POWER_CONTROL POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE POWER_LOSS_RECOVER_ZHOME \ SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE EXTRA_LIN_ADVANCE_K \ HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL opt_add DEBUG_POWER_LOSS_RECOVERY From 9c5585e532a0fcc3ee70102b07996794be047fa2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Mar 2021 03:52:52 -0600 Subject: [PATCH 12/12] Fix compile warning --- Marlin/src/module/probe.cpp | 8 ++++---- Marlin/src/module/probe.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 7dcf1dff3103..7333aaa74859 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -340,7 +340,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { * - If a preheat input is higher than the current target, raise the target temperature. * - If a preheat input is higher than the current temperature, wait for stabilization. */ - void Probe::preheat_for_probing(const uint16_t hotend_temp, const uint16_t bed_temp) { + void Probe::preheat_for_probing(const int16_t hotend_temp, const int16_t bed_temp) { #if HAS_HOTEND && (PROBING_NOZZLE_TEMP || LEVELING_NOZZLE_TEMP) #define WAIT_FOR_NOZZLE_HEAT #endif @@ -351,17 +351,17 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { DEBUG_ECHOPGM("Preheating "); #if ENABLED(WAIT_FOR_NOZZLE_HEAT) - const uint16_t hotendPreheat = hotend_temp > thermalManager.degTargetHotend(0) ? hotend_temp : 0; + const int16_t hotendPreheat = hotend_temp > thermalManager.degTargetHotend(0) ? hotend_temp : 0; if (hotendPreheat) { DEBUG_ECHOPAIR("hotend (", hotendPreheat, ")"); thermalManager.setTargetHotend(hotendPreheat, 0); } #elif ENABLED(WAIT_FOR_BED_HEAT) - constexpr uint16_t hotendPreheat = 0; + constexpr int16_t hotendPreheat = 0; #endif #if ENABLED(WAIT_FOR_BED_HEAT) - const uint16_t bedPreheat = bed_temp > thermalManager.degTargetBed() ? bed_temp : 0; + const int16_t bedPreheat = bed_temp > thermalManager.degTargetBed() ? bed_temp : 0; if (bedPreheat) { if (hotendPreheat) DEBUG_ECHOPGM(" and "); DEBUG_ECHOPAIR("bed (", bedPreheat, ")"); diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index df7bdd23a198..b54bf00f0087 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -61,7 +61,7 @@ class Probe { static xyz_pos_t offset; #if EITHER(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING) - static void preheat_for_probing(const uint16_t hotend_temp, const uint16_t bed_temp); + static void preheat_for_probing(const int16_t hotend_temp, const int16_t bed_temp); #endif static bool set_deployed(const bool deploy);