瀏覽代碼

Merge pull request #768 from whosawhatsis/Marlin_v1

multiple FWretract fixes
daid 11 年之前
父節點
當前提交
816f0a678a
共有 1 個檔案被更改,包括 13 行新增5 行删除
  1. 13
    5
      Marlin/Marlin_main.cpp

+ 13
- 5
Marlin/Marlin_main.cpp 查看文件

@@ -137,8 +137,8 @@
137 137
 // M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2  also sets minimum segment time in ms (B20000) to prevent buffer underruns and M20 minimum feedrate
138 138
 // M205 -  advanced settings:  minimum travel speed S=while printing T=travel only,  B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk
139 139
 // M206 - set additional homeing offset
140
-// M207 - set retract length S[positive mm] F[feedrate mm/sec] Z[additional zlift/hop]
141
-// M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec]
140
+// M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting
141
+// M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
142 142
 // M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
143 143
 // M218 - set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>
144 144
 // M220 S<factor in percent>- set speed factor override percentage
@@ -1113,11 +1113,15 @@ void process_commands()
1113 1113
         destination[X_AXIS]=current_position[X_AXIS];
1114 1114
         destination[Y_AXIS]=current_position[Y_AXIS];
1115 1115
         destination[Z_AXIS]=current_position[Z_AXIS];
1116
-        current_position[Z_AXIS]+=-retract_zlift;
1117
-        destination[E_AXIS]=current_position[E_AXIS]-retract_length;
1116
+        current_position[Z_AXIS]-=retract_zlift;
1117
+        destination[E_AXIS]=current_position[E_AXIS];
1118
+        current_position[E_AXIS]+=retract_length/volumetric_multiplier[active_extruder];
1119
+        plan_set_e_position(current_position[E_AXIS]);
1120
+        float oldFeedrate = feedrate;
1118 1121
         feedrate=retract_feedrate;
1119 1122
         retracted=true;
1120 1123
         prepare_move();
1124
+        feedrate = oldFeedrate;
1121 1125
       }
1122 1126
 
1123 1127
       break;
@@ -1128,10 +1132,14 @@ void process_commands()
1128 1132
         destination[Y_AXIS]=current_position[Y_AXIS];
1129 1133
         destination[Z_AXIS]=current_position[Z_AXIS];
1130 1134
         current_position[Z_AXIS]+=retract_zlift;
1131
-        destination[E_AXIS]=current_position[E_AXIS]+retract_length+retract_recover_length;
1135
+        destination[E_AXIS]=current_position[E_AXIS];
1136
+        current_position[E_AXIS]-=(retract_length+retract_recover_length)/volumetric_multiplier[active_extruder]; 
1137
+        plan_set_e_position(current_position[E_AXIS]);
1138
+        float oldFeedrate = feedrate;
1132 1139
         feedrate=retract_recover_feedrate;
1133 1140
         retracted=false;
1134 1141
         prepare_move();
1142
+        feedrate = oldFeedrate;
1135 1143
       }
1136 1144
       break;
1137 1145
       #endif //FWRETRACT

Loading…
取消
儲存