瀏覽代碼

Improvements to M600

Kevin Lee 4 年之前
父節點
當前提交
25e84c42c3
共有 1 個文件被更改,包括 13 次插入3 次删除
  1. 13 3
      Firmware/Marlin_main.cpp

+ 13 - 3
Firmware/Marlin_main.cpp

@@ -3791,11 +3791,12 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
     //Not let's go back to print
     fanSpeed = fanSpeedBckp;
 
-    //Feed a little of filament to stabilize pressure
+    //Retract filament to prevent drooling
     if (!automatic)
     {
-        current_position[E_AXIS] += FILAMENTCHANGE_RECFEED;
-        plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED);
+        current_position[E_AXIS] -= FILAMENTCHANGE_LOADRETRACT;
+        plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST);
+        st_synchronize();
     }
 
     //Move XY back
@@ -3807,6 +3808,15 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
             FILAMENTCHANGE_ZFEED, active_extruder);
     st_synchronize();
 
+    //Restore filament 
+    if (!automatic)
+    {
+        current_position[E_AXIS] += FILAMENTCHANGE_LOADRETRACT;
+        plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], lastpos[Z_AXIS], current_position[E_AXIS],
+            FILAMENTCHANGE_EFEED_FIRST, active_extruder);
+        st_synchronize();
+    }
+
     //Set E position to original
     plan_set_e_position(lastpos[E_AXIS]);