From 2d9b0a66fe8bbd417f6b1dfef9651667aef383c1 Mon Sep 17 00:00:00 2001 From: Sean Date: Tue, 20 Mar 2018 11:19:10 -0700 Subject: [PATCH] Add Filament Change accelerations --- Marlin/Configuration_adv.h | 63 ++++++++++--------- Marlin/src/config/default/Configuration_adv.h | 63 ++++++++++--------- Marlin/src/feature/pause.cpp | 42 ++++++++++--- Marlin/src/feature/pause.h | 4 +- Marlin/src/gcode/feature/pause/M600.cpp | 17 ++--- Marlin/src/gcode/feature/pause/M701_M702.cpp | 12 ++-- Marlin/src/inc/Conditionals_post.h | 4 ++ Marlin/src/inc/SanityCheck.h | 14 ++++- Marlin/src/module/configuration_store.cpp | 2 +- 9 files changed, 135 insertions(+), 86 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 73c25edf30..7aab802c54 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_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. + #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. + #define ADVANCED_PAUSE_PURGE_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 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/src/config/default/Configuration_adv.h b/Marlin/src/config/default/Configuration_adv.h index 73c25edf30..7aab802c54 100644 --- a/Marlin/src/config/default/Configuration_adv.h +++ b/Marlin/src/config/default/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_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. + #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. + #define ADVANCED_PAUSE_PURGE_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 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/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 0c5b742934..9666366544 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -137,7 +137,7 @@ static void do_pause_e_move(const float &length, const float &fr) { * * Returns 'true' if load was completed, 'false' for abort */ -bool load_filament(const float &load_length/*=0*/, const float &purge_length/*=0*/, const int8_t max_beep_count/*=0*/, +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*/ ) { @@ -184,8 +184,22 @@ bool load_filament(const float &load_length/*=0*/, const float &purge_length/*=0 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) { + #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 + const float saved_acceleration = planner.retract_acceleration; + planner.retract_acceleration = FILAMENT_CHANGE_FAST_LOAD_ACCEL; + #endif + + do_pause_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE); + + #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 + planner.retract_acceleration = saved_acceleration; + #endif + } #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) @@ -196,7 +210,7 @@ bool load_filament(const float &load_length/*=0*/, const float &purge_length/*=0 wait_for_user = true; for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count) - do_pause_e_move(1, ADVANCED_PAUSE_EXTRUDE_FEEDRATE); + do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE); wait_for_user = false; #else @@ -210,7 +224,7 @@ bool load_filament(const float &load_length/*=0*/, const float &purge_length/*=0 #endif // Extrude filament to get into hotend - do_pause_e_move(purge_length, ADVANCED_PAUSE_EXTRUDE_FEEDRATE); + do_pause_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE); } // Show "Purge More" / "Resume" menu and wait for reply @@ -233,7 +247,7 @@ bool load_filament(const float &load_length/*=0*/, const float &purge_length/*=0 #endif ); - #endif + #endif return true; } @@ -277,8 +291,17 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/, do_pause_e_move(FILAMENT_UNLOAD_RETRACT_LENGTH + FILAMENT_UNLOAD_PURGE_LENGTH, planner.max_feedrate_mm_s[E_AXIS]); // Unload filament + #if FILAMENT_CHANGE_UNLOAD_ACCEL > 0 + const float saved_acceleration = planner.retract_acceleration; + planner.retract_acceleration = FILAMENT_CHANGE_UNLOAD_ACCEL; + #endif + do_pause_e_move(unload_length, FILAMENT_CHANGE_UNLOAD_FEEDRATE); + #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 + planner.retract_acceleration = saved_acceleration; + #endif + // 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 disable_e_stepper(active_extruder); @@ -477,7 +500,7 @@ void wait_for_filament_reload(const int8_t max_beep_count/*=0*/) { * - Send host action for resume, if configured * - Resume the current SD print job, if any */ -void resume_print(const float &load_length/*=0*/, const float &purge_length/*=ADVANCED_PAUSE_EXTRUDE_LENGTH*/, const int8_t max_beep_count/*=0*/) { +void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_length/*=0*/, const float &purge_length/*=ADVANCED_PAUSE_PURGE_LENGTH*/, const int8_t max_beep_count/*=0*/) { if (!did_pause_print) return; // Re-enable the heaters if they timed out @@ -489,7 +512,7 @@ void resume_print(const float &load_length/*=0*/, const float &purge_length/*=AD if (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) @@ -503,6 +526,7 @@ void resume_print(const float &load_length/*=0*/, const float &purge_length/*=AD if (fwretract.retracted[active_extruder]) do_pause_e_move(-fwretract.retract_length, fwretract.retract_feedrate_mm_s); #endif + // If resume_position is negative if (resume_position[E_AXIS] < 0) do_pause_e_move(resume_position[E_AXIS], PAUSE_PARK_RETRACT_FEEDRATE); @@ -514,7 +538,7 @@ void resume_print(const float &load_length/*=0*/, const float &purge_length/*=AD // Now all extrusion positions are resumed and ready to be confirmed // Set extruder to saved position - planner.set_e_position_mm(destination[E_AXIS] = current_position[E_AXIS] = resume_position[E_AXIS]); + planner.set_e_position_mm((destination[E_AXIS] = current_position[E_AXIS] = resume_position[E_AXIS])); #if ENABLED(FILAMENT_RUNOUT_SENSOR) runout.reset(); diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index b2e9e27095..c920fd599f 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -71,9 +71,9 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u void wait_for_filament_reload(const int8_t max_beep_count=0); -void resume_print(const float &load_length=0, const float &extrude_length=ADVANCED_PAUSE_EXTRUDE_LENGTH, const int8_t max_beep_count=0); +void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, const int8_t max_beep_count=0); -bool load_filament(const float &load_length=0, const float &extrude_length=0, const int8_t max_beep_count=0, const bool show_lcd=false, +bool load_filament(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_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); bool unload_filament(const float &unload_length, const bool show_lcd=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT); diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index 2a34f5baa4..3fc4d70fc4 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -80,13 +80,13 @@ void GcodeSuite::M600() { #endif ); + // Lift Z axis + if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); + // Move XY axes to filament change position or given position if (parser.seenval('X')) park_point.x = parser.linearval('X'); if (parser.seenval('Y')) park_point.y = parser.linearval('Y'); - // Lift Z axis - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - #if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE) && DISABLED(DELTA) park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0); park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0); @@ -96,9 +96,12 @@ void GcodeSuite::M600() { 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) - : filament_change_load_length[active_extruder]); + // 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', #ifdef FILAMENT_CHANGE_ALERT_BEEPS @@ -112,7 +115,7 @@ void GcodeSuite::M600() { 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_PURGE_LENGTH, beep_count); } #if EXTRUDERS > 1 diff --git a/Marlin/src/gcode/feature/pause/M701_M702.cpp b/Marlin/src/gcode/feature/pause/M701_M702.cpp index 301890cc45..eeab8abff5 100644 --- a/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ b/Marlin/src/gcode/feature/pause/M701_M702.cpp @@ -60,10 +60,6 @@ void GcodeSuite::M701() { // 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); @@ -80,8 +76,12 @@ void GcodeSuite::M701() { 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); + // 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_PURGE_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/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 13f9d3d776..4f61dd1ec6 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1048,6 +1048,10 @@ #define QUIET_PROBING (HAS_BED_PROBE && (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0)) #define HEATER_IDLE_HANDLER (ENABLED(ADVANCED_PAUSE_FEATURE) || ENABLED(PROBING_HEATERS_OFF)) +#if ENABLED(ADVANCED_PAUSE_FEATURE) && !defined(FILAMENT_CHANGE_SLOW_LOAD_LENGTH) + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 +#endif + /** * Only constrain Z on DELTA / SCARA machines */ diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 8af08e09ce..8d25c9b53f 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -133,8 +133,12 @@ #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH. Please update your configuration." #elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE) #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_EXTRUDE_FEEDRATE. Please update your configuration." +#elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE) + #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." #elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) - #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_EXTRUDE_LENGTH. Please update your configuration." + #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." +#elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH) + #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." #elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT) #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT. Please update your configuration." #elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS) @@ -264,6 +268,8 @@ #error "[AXIS]_IS_TMC is now [AXIS]_IS_TMC26X. Please update your Configuration_adv.h." #elif defined(AUTOMATIC_CURRENT_CONTROL) #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration." +#elif defined(FILAMENT_CHANGE_LOAD_LENGTH) + #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH. Please update your configuration." #endif /** @@ -493,8 +499,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/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index ac64ccf37e..eb774d1539 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -1878,7 +1878,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { #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