Browse Source

2.0 Fix for bad Pause extruder position resuming (#9029)

studiodyne 7 years ago
parent
commit
31582caa07
1 changed files with 19 additions and 2 deletions
  1. 19
    2
      Marlin/src/feature/pause.cpp

+ 19
- 2
Marlin/src/feature/pause.cpp View File

@@ -37,6 +37,10 @@
37 37
 #include "../module/printcounter.h"
38 38
 #include "../module/temperature.h"
39 39
 
40
+#if ENABLED(FWRETRACT)
41
+  #include "../feature/fwretract.h"
42
+#endif
43
+
40 44
 #if ENABLED(FILAMENT_RUNOUT_SENSOR)
41 45
   #include "../feature/runout.h"
42 46
 #endif
@@ -329,13 +333,26 @@ void resume_print(const float &load_length/*=0*/, const float &initial_extrude_l
329 333
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_RESUME);
330 334
   #endif
331 335
 
332
-  // Set extruder to saved position
333
-  planner.set_e_position_mm((current_position[E_AXIS] = resume_position[E_AXIS]));
336
+  // Intelligent resuming
337
+  #if ENABLED(FWRETRACT)
338
+    // If retracted before goto pause
339
+    if (fwretract.retracted[active_extruder])
340
+      do_pause_e_move(-fwretract.retract_length, fwretract.retract_feedrate_mm_s);
341
+  #else
342
+    // If resume_position negative
343
+    if (resume_position[E_AXIS] < 0) do_pause_e_move(resume_position[E_AXIS], PAUSE_PARK_RETRACT_FEEDRATE);
344
+  #endif
334 345
 
335 346
   // Move XY to starting position, then Z
336 347
   do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], NOZZLE_PARK_XY_FEEDRATE);
348
+
349
+  // Set Z_AXIS to saved position
337 350
   do_blocking_move_to_z(resume_position[Z_AXIS], NOZZLE_PARK_Z_FEEDRATE);
338 351
 
352
+  // Now all extrusion positions are resumed and ready to be confirmed
353
+  // Set extruder to saved position
354
+  planner.set_e_position_mm(destination[E_AXIS] = current_position[E_AXIS] = resume_position[E_AXIS]);
355
+
339 356
   #if ENABLED(FILAMENT_RUNOUT_SENSOR)
340 357
     filament_ran_out = false;
341 358
   #endif

Loading…
Cancel
Save