diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index aeb03b369..09478af1a 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -900,39 +900,44 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - #define ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. + #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. + // This short retract is done immediately, before parking the nozzle. + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. + // For Bowden, the full length of the tube and nozzle. + // For direct drive, the full length of the nozzle. + // Set to 0 for manual unloading. + #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. + // 0 to disable start loading and skip to fast load only + #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. + #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. + // For Bowden, the full length of the tube and nozzle. + // For direct drive, the full length of the nozzle. + #define ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // (mm) Length to extrude after loading. + // Set to 0 for manual extrusion. + // Filament can be extruded repeatedly from the Filament Change menu + // until extrusion is consistent, and to purge old filament. - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. + //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. + #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. + #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change + //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. + //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) #endif // @section tmc diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1795d939c..72560c608 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6484,7 +6484,7 @@ inline void gcode_M17() { * * Returns 'true' if load was completed, 'false' for abort */ - static bool load_filament(const float &load_length=0, const float &purge_length=0, const int8_t max_beep_count=0, + static bool load_filament(const float &slow_load_length=0, const float &fast_load_length=0, const float &purge_length=0, const int8_t max_beep_count=0, const bool show_lcd=false, const bool pause_for_user=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT ) { @@ -6531,8 +6531,16 @@ inline void gcode_M17() { lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, mode); #endif - // Load filament - if (load_length) do_pause_e_move(load_length, FILAMENT_CHANGE_LOAD_FEEDRATE); + // Slow Load filament + if (slow_load_length) do_pause_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE); + + // Fast Load Filament + if (fast_load_length) { + float saved_acceleration = planner.retract_acceleration; + planner.retract_acceleration = FILAMENT_CHANGE_FAST_LOAD_ACCEL; + do_pause_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE); + planner.retract_acceleration = saved_acceleration; + } #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) @@ -6624,7 +6632,10 @@ inline void gcode_M17() { do_pause_e_move(FILAMENT_UNLOAD_RETRACT_LENGTH + FILAMENT_UNLOAD_PURGE_LENGTH, planner.max_feedrate_mm_s[E_AXIS]); // Unload filament + float saved_acceleration = planner.retract_acceleration; + planner.retract_acceleration = FILAMENT_CHANGE_UNLOAD_ACCEL; do_pause_e_move(unload_length, FILAMENT_CHANGE_UNLOAD_FEEDRATE); + planner.retract_acceleration = saved_acceleration; // Disable extruders steppers for manual filament changing (only on boards that have separate ENABLE_PINS) #if E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN @@ -6662,7 +6673,7 @@ inline void gcode_M17() { #if ENABLED(ULTIPANEL) if (show_lcd) // Show status screen lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - LCD_MESSAGEPGM(MSG_M600_TOO_COLD); + LCD_MESSAGEPGM(MSG_M600_TOO_COLD); #endif return false; // unable to reach safe temperature @@ -6693,8 +6704,8 @@ inline void gcode_M17() { #if ENABLED(NO_MOTION_BEFORE_HOMING) if (!axis_unhomed_error()) #endif - // Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos) - Nozzle::park(2, park_point); + // Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos) + Nozzle::park(2, park_point); // Unload the filament if (unload_length) @@ -6814,7 +6825,7 @@ inline void gcode_M17() { * - Send host action for resume, if configured * - Resume the current SD print job, if any */ - static void resume_print(const float &load_length=0, const float &purge_length=ADVANCED_PAUSE_EXTRUDE_LENGTH, const int8_t max_beep_count=0) { + static void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &purge_length=ADVANCED_PAUSE_EXTRUDE_LENGTH, const int8_t max_beep_count=0) { if (!did_pause_print) return; // Re-enable the heaters if they timed out @@ -6824,9 +6835,9 @@ inline void gcode_M17() { thermalManager.reset_heater_idle_timer(e); } - if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) { + if (slow_load_length && (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder))) { // Load the new filament - load_filament(load_length, purge_length, max_beep_count, true, nozzle_timed_out); + load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out); } #if ENABLED(ULTIPANEL) @@ -10231,6 +10242,10 @@ inline void gcode_M502() { #if ENABLED(ADVANCED_PAUSE_FEATURE) + #ifndef FILAMENT_CHANGE_SLOW_LOAD_LENGTH + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 + #endif + /** * M600: Pause for filament change * @@ -10290,8 +10305,11 @@ inline void gcode_M502() { const float unload_length = -FABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) : filament_change_unload_length[active_extruder]); - // Load filament - const float load_length = FABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : + // Slow load filament + constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; + + // Fast load filament + const float fast_load_length = FABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : filament_change_load_length[active_extruder]); const int beep_count = parser.intval('B', @@ -10306,7 +10324,7 @@ inline void gcode_M502() { if (pause_print(retract, park_point, unload_length, true)) { wait_for_filament_reload(beep_count); - resume_print(load_length, ADVANCED_PAUSE_EXTRUDE_LENGTH, beep_count); + resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_EXTRUDE_LENGTH, beep_count); } #if EXTRUDERS > 1 @@ -10442,10 +10460,6 @@ inline void gcode_M502() { // Z axis lift if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - // Load filament - const float load_length = FABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : - filament_change_load_length[target_extruder]); - // Show initial "wait for load" message #if ENABLED(ULTIPANEL) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, ADVANCED_PAUSE_MODE_LOAD_FILAMENT, target_extruder); @@ -10462,8 +10476,10 @@ inline void gcode_M502() { if (park_point.z > 0) do_blocking_move_to_z(min(current_position[Z_AXIS] + park_point.z, Z_MAX_POS), NOZZLE_PARK_Z_FEEDRATE); - load_filament(load_length, ADVANCED_PAUSE_EXTRUDE_LENGTH, FILAMENT_CHANGE_ALERT_BEEPS, true, - thermalManager.wait_for_heating(target_extruder), ADVANCED_PAUSE_MODE_LOAD_FILAMENT); + constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; + const float fast_load_length = FABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : filament_change_load_length[active_extruder]); + load_filament(slow_load_length, fast_load_length, ADVANCED_PAUSE_EXTRUDE_LENGTH, FILAMENT_CHANGE_ALERT_BEEPS, + true, thermalManager.wait_for_heating(target_extruder), ADVANCED_PAUSE_MODE_LOAD_FILAMENT); // Restore Z axis if (park_point.z > 0) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index e4f303788..db6962721 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -464,8 +464,10 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE." #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_LOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." + #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH + #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." + #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH + #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." #endif #endif diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index cb213093a..a6632a6bc 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -1874,7 +1874,7 @@ void MarlinSettings::reset() { #if ENABLED(ADVANCED_PAUSE_FEATURE) for (uint8_t e = 0; e < E_STEPPERS; e++) { filament_change_unload_length[e] = FILAMENT_CHANGE_UNLOAD_LENGTH; - filament_change_load_length[e] = FILAMENT_CHANGE_LOAD_LENGTH; + filament_change_load_length[e] = FILAMENT_CHANGE_FAST_LOAD_LENGTH; } #endif