From 31582caa078f6384f9dddacc26deec44347262ef Mon Sep 17 00:00:00 2001 From: studiodyne Date: Thu, 4 Jan 2018 06:18:27 +0100 Subject: [PATCH] 2.0 Fix for bad Pause extruder position resuming (#9029) --- Marlin/src/feature/pause.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 92f4f9d6b..ccdeb429d 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -37,6 +37,10 @@ #include "../module/printcounter.h" #include "../module/temperature.h" +#if ENABLED(FWRETRACT) + #include "../feature/fwretract.h" +#endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) #include "../feature/runout.h" #endif @@ -329,13 +333,26 @@ void resume_print(const float &load_length/*=0*/, const float &initial_extrude_l lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_RESUME); #endif - // Set extruder to saved position - planner.set_e_position_mm((current_position[E_AXIS] = resume_position[E_AXIS])); + // Intelligent resuming + #if ENABLED(FWRETRACT) + // If retracted before goto pause + if (fwretract.retracted[active_extruder]) + do_pause_e_move(-fwretract.retract_length, fwretract.retract_feedrate_mm_s); + #else + // If resume_position negative + if (resume_position[E_AXIS] < 0) do_pause_e_move(resume_position[E_AXIS], PAUSE_PARK_RETRACT_FEEDRATE); + #endif // Move XY to starting position, then Z do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], NOZZLE_PARK_XY_FEEDRATE); + + // Set Z_AXIS to saved position do_blocking_move_to_z(resume_position[Z_AXIS], NOZZLE_PARK_Z_FEEDRATE); + // 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]); + #if ENABLED(FILAMENT_RUNOUT_SENSOR) filament_ran_out = false; #endif