From f456de73be6a621a2134c0c0f6bbe2739c9c3fee Mon Sep 17 00:00:00 2001 From: InsanityAutomation Date: Fri, 20 Mar 2020 13:53:09 -0400 Subject: [PATCH 1/3] Reduce waits during filament change --- Marlin/src/feature/pause.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 931ddb34a379..f5bf5c6b6671 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -119,7 +119,7 @@ fil_change_settings_t fc_settings[EXTRUDERS]; * * Returns 'true' if heating was completed, 'false' for abort */ -static bool ensure_safe_temperature(const PauseMode mode=PAUSE_MODE_SAME) { +static bool ensure_safe_temperature( const bool wait=true, const PauseMode mode=PAUSE_MODE_SAME) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) { @@ -134,7 +134,15 @@ static bool ensure_safe_temperature(const PauseMode mode=PAUSE_MODE_SAME) { UNUSED(mode); #endif - return thermalManager.wait_for_hotend(active_extruder); + if(wait) + return thermalManager.wait_for_hotend(active_extruder); + else { + do{ + idle(); + }while (thermalManager.degHotend(active_extruder) < (thermalManager.degTargetHotend(active_extruder) - TEMP_WINDOW) || thermalManager.degHotend(active_extruder) > (thermalManager.degTargetHotend(active_extruder) + TEMP_WINDOW)); + return true; + } + } /** @@ -156,7 +164,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l ) { TERN(HAS_LCD_MENU,,UNUSED(show_lcd)); - if (!ensure_safe_temperature(mode)) { + if (!ensure_safe_temperature(false, mode)) { #if HAS_LCD_MENU if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_STATUS, mode); #endif @@ -291,7 +299,7 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/, constexpr float mix_multiplier = 1.0; #endif - if (!ensure_safe_temperature(mode)) { + if (!ensure_safe_temperature(false, mode)) { #if HAS_LCD_MENU if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_STATUS); #endif @@ -498,7 +506,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e); // Wait for the heaters to reach the target temperatures - ensure_safe_temperature(); + ensure_safe_temperature(false); // Show the prompt to continue show_continue_prompt(is_reload); @@ -587,6 +595,8 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le // Unretract unscaled_e_move(PAUSE_PARK_RETRACT_LENGTH, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE)); + ensure_safe_temperature(); + // Intelligent resuming #if ENABLED(FWRETRACT) // If retracted before goto pause From 664d9c2dfd7f255a431b08bbd7852e63a18d87f8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jul 2020 22:56:50 -0500 Subject: [PATCH 2/3] Update pause.cpp --- Marlin/src/feature/pause.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index f5bf5c6b6671..9c8b21fef42c 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -134,15 +134,13 @@ static bool ensure_safe_temperature( const bool wait=true, const PauseMode mode= UNUSED(mode); #endif - if(wait) + if (wait) return thermalManager.wait_for_hotend(active_extruder); - else { - do{ - idle(); - }while (thermalManager.degHotend(active_extruder) < (thermalManager.degTargetHotend(active_extruder) - TEMP_WINDOW) || thermalManager.degHotend(active_extruder) > (thermalManager.degTargetHotend(active_extruder) + TEMP_WINDOW)); - return true; - } + while (ABS(thermalManager.degHotend(active_extruder) - thermalManager.degTargetHotend(active_extruder)) > TEMP_WINDOW) + idle(); + + return true; } /** From 215f0197ea52ccee3eb4126bdb0215548de72567 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jul 2020 22:57:13 -0500 Subject: [PATCH 3/3] Update pause.cpp --- Marlin/src/feature/pause.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 9c8b21fef42c..bc91d5784da9 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -119,7 +119,7 @@ fil_change_settings_t fc_settings[EXTRUDERS]; * * Returns 'true' if heating was completed, 'false' for abort */ -static bool ensure_safe_temperature( const bool wait=true, const PauseMode mode=PAUSE_MODE_SAME) { +static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=PAUSE_MODE_SAME) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) {