Browse Source

FWRETRACT in mm/s

Firmware retraction now stores the retract and recover speeds in mm/s
instead of mm/min. This makes it match the units of the maximum
feedrate, and fixes problems with modifying the value via LCD control
panel. From gcode, the values are still taken in mm/min to match the
units of G1 and similar, and they are converted to mm/s before they are
stored.

I also lowered the default retract feedrate to make it less likely to
cause problems for geared extruders when the user hasn’t bothered to
set a reasonable maximum feedrate, though users should be setting both
of these values to suit their hardware.
whosawhatsis 10 years ago
parent
commit
aab61e63c3
3 changed files with 26 additions and 26 deletions
  1. 2
    2
      Marlin/Configuration_adv.h
  2. 6
    6
      Marlin/Marlin_main.cpp
  3. 18
    18
      Marlin/language.h

+ 2
- 2
Marlin/Configuration_adv.h View File

@@ -402,10 +402,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
402 402
 #ifdef FWRETRACT
403 403
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
404 404
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
405
-  #define RETRACT_FEEDRATE 80*60         //default feedrate for retracting
405
+  #define RETRACT_FEEDRATE 45            //default feedrate for retracting (mm/s)
406 406
   #define RETRACT_ZLIFT 0                //default retract Z-lift
407 407
   #define RETRACT_RECOVER_LENGTH 0       //default additional recover length (mm, added to retract length when recovering)
408
-  #define RETRACT_RECOVER_FEEDRATE 8*60  //default feedrate for recovering from retraction
408
+  #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
409 409
 #endif
410 410
 
411 411
 //adds support for experimental filament exchange support M600; requires display

+ 6
- 6
Marlin/Marlin_main.cpp View File

@@ -1093,7 +1093,7 @@ static void homeaxis(int axis) {
1093 1093
       current_position[E_AXIS]+=retract_length/volumetric_multiplier[active_extruder];
1094 1094
       plan_set_e_position(current_position[E_AXIS]);
1095 1095
       float oldFeedrate = feedrate;
1096
-      feedrate=retract_feedrate;
1096
+      feedrate=retract_feedrate*60;
1097 1097
       retracted=true;
1098 1098
       prepare_move();
1099 1099
       current_position[Z_AXIS]-=retract_zlift;
@@ -1111,7 +1111,7 @@ static void homeaxis(int axis) {
1111 1111
       current_position[E_AXIS]-=(retract_length+retract_recover_length)/volumetric_multiplier[active_extruder]; 
1112 1112
       plan_set_e_position(current_position[E_AXIS]);
1113 1113
       float oldFeedrate = feedrate;
1114
-      feedrate=retract_recover_feedrate;
1114
+      feedrate=retract_recover_feedrate*60;
1115 1115
       retracted=false;
1116 1116
       prepare_move();
1117 1117
       feedrate = oldFeedrate;
@@ -2291,7 +2291,7 @@ void process_commands()
2291 2291
       break;
2292 2292
     #endif
2293 2293
     #ifdef FWRETRACT
2294
-    case 207: //M207 - set retract length S[positive mm] F[feedrate mm/sec] Z[additional zlift/hop]
2294
+    case 207: //M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop]
2295 2295
     {
2296 2296
       if(code_seen('S'))
2297 2297
       {
@@ -2299,14 +2299,14 @@ void process_commands()
2299 2299
       }
2300 2300
       if(code_seen('F'))
2301 2301
       {
2302
-        retract_feedrate = code_value() ;
2302
+        retract_feedrate = code_value()/60 ;
2303 2303
       }
2304 2304
       if(code_seen('Z'))
2305 2305
       {
2306 2306
         retract_zlift = code_value() ;
2307 2307
       }
2308 2308
     }break;
2309
-    case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/sec]
2309
+    case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
2310 2310
     {
2311 2311
       if(code_seen('S'))
2312 2312
       {
@@ -2314,7 +2314,7 @@ void process_commands()
2314 2314
       }
2315 2315
       if(code_seen('F'))
2316 2316
       {
2317
-        retract_recover_feedrate = code_value() ;
2317
+        retract_recover_feedrate = code_value()/60 ;
2318 2318
       }
2319 2319
     }break;
2320 2320
     case 209: // 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.

+ 18
- 18
Marlin/language.h View File

@@ -150,10 +150,10 @@
150 150
 	#define MSG_KILLED "KILLED. "
151 151
 	#define MSG_STOPPED "STOPPED. "
152 152
 	#define MSG_CONTROL_RETRACT  "Retract mm"
153
-	#define MSG_CONTROL_RETRACTF "Retract  F"
153
+	#define MSG_CONTROL_RETRACTF "Retract  V"
154 154
 	#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm"
155 155
 	#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
156
-	#define MSG_CONTROL_RETRACT_RECOVERF "UnRet  F"
156
+	#define MSG_CONTROL_RETRACT_RECOVERF "UnRet  V"
157 157
 	#define MSG_AUTORETRACT "AutoRetr."
158 158
 	#define MSG_FILAMENTCHANGE "Change filament"
159 159
 	#define MSG_INIT_SDCARD "Init. SD card"	
@@ -335,10 +335,10 @@
335 335
 	#define MSG_STOPPED "Zatrzymany. "
336 336
 	#define MSG_STEPPER_RELEASED "Zwolniony."
337 337
 	#define MSG_CONTROL_RETRACT  "Wycofaj mm"
338
-	#define MSG_CONTROL_RETRACTF "Wycofaj  F"
338
+	#define MSG_CONTROL_RETRACTF "Wycofaj  V"
339 339
 	#define MSG_CONTROL_RETRACT_ZLIFT "Skok Z mm:"
340 340
 	#define MSG_CONTROL_RETRACT_RECOVER "Cof. wycof. +mm"
341
-	#define MSG_CONTROL_RETRACT_RECOVERF "Cof. wycof.  F"
341
+	#define MSG_CONTROL_RETRACT_RECOVERF "Cof. wycof.  V"
342 342
 	#define MSG_AUTORETRACT "Auto. wycofanie"
343 343
 	#define MSG_FILAMENTCHANGE "Zmien filament"
344 344
 	#define MSG_INIT_SDCARD "Inicjal. karty SD"
@@ -520,10 +520,10 @@
520 520
 	#define MSG_STOPPED "STOPPE."
521 521
 	#define MSG_STEPPER_RELEASED "RELACHE."
522 522
 	#define MSG_CONTROL_RETRACT "Retraction mm"
523
-	#define MSG_CONTROL_RETRACTF "Retraction F"
523
+	#define MSG_CONTROL_RETRACTF "Retraction V"
524 524
 	#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm"
525 525
 	#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
526
-	#define MSG_CONTROL_RETRACT_RECOVERF "UnRet F"
526
+	#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V"
527 527
 	#define MSG_AUTORETRACT "Retract. Auto."
528 528
 	#define MSG_FILAMENTCHANGE "Changer filament"
529 529
 	#define MSG_INIT_SDCARD "Init. la carte SD"	
@@ -706,10 +706,10 @@
706 706
 	#define MSG_STOPPED          "GESTOPPT"
707 707
 	#define MSG_STEPPER_RELEASED "Stepper frei"
708 708
 	#define MSG_CONTROL_RETRACT  "Retract mm"
709
-	#define MSG_CONTROL_RETRACTF "Retract  F"
709
+	#define MSG_CONTROL_RETRACTF "Retract  V"
710 710
 	#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm"
711 711
 	#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
712
-	#define MSG_CONTROL_RETRACT_RECOVERF "UnRet  F"
712
+	#define MSG_CONTROL_RETRACT_RECOVERF "UnRet  V"
713 713
 	#define MSG_AUTORETRACT      "AutoRetr."
714 714
 	#define MSG_FILAMENTCHANGE "Filament wechseln"
715 715
 	#define MSG_INIT_SDCARD "Init. SD-Card"	
@@ -888,10 +888,10 @@
888 888
 	#define MSG_KILLED "PARADA DE EMERG."
889 889
 	#define MSG_STOPPED "PARADA"
890 890
 	#define MSG_CONTROL_RETRACT  "Retraer mm"
891
-	#define MSG_CONTROL_RETRACTF "Retraer  F"
891
+	#define MSG_CONTROL_RETRACTF "Retraer  V"
892 892
 	#define MSG_CONTROL_RETRACT_ZLIFT "Levantar mm"
893 893
 	#define MSG_CONTROL_RETRACT_RECOVER "DesRet +mm"
894
-	#define MSG_CONTROL_RETRACT_RECOVERF "DesRet F"
894
+	#define MSG_CONTROL_RETRACT_RECOVERF "DesRet V"
895 895
 	#define MSG_AUTORETRACT "AutoRetr."
896 896
 	#define MSG_FILAMENTCHANGE "Change filament"
897 897
 	#define MSG_INIT_SDCARD "Iniciando tarjeta"
@@ -1079,10 +1079,10 @@
1079 1079
 	#define MSG_KILLED							"УБИТО."
1080 1080
 	#define MSG_STOPPED							"ОСТАНОВЛЕНО."
1081 1081
 	#define MSG_CONTROL_RETRACT					"Откат mm:"
1082
-	#define MSG_CONTROL_RETRACTF				"Откат  F:"
1082
+	#define MSG_CONTROL_RETRACTF				"Откат  V:"
1083 1083
 	#define MSG_CONTROL_RETRACT_ZLIFT			"Прыжок mm:"
1084 1084
 	#define MSG_CONTROL_RETRACT_RECOVER			"Возврат +mm:"
1085
-	#define MSG_CONTROL_RETRACT_RECOVERF		"Возврат  F:"
1085
+	#define MSG_CONTROL_RETRACT_RECOVERF		"Возврат  V:"
1086 1086
 	#define MSG_AUTORETRACT						"АвтоОткат:"
1087 1087
 	#define MSG_FILAMENTCHANGE 					"Change filament"
1088 1088
 	#define MSG_INIT_SDCARD 					"Init. SD-Card"	
@@ -1260,10 +1260,10 @@
1260 1260
 	#define MSG_KILLED               "UCCISO. "
1261 1261
 	#define MSG_STOPPED              "ARRESTATO. "
1262 1262
 	#define MSG_CONTROL_RETRACT      "Ritrai mm"
1263
-	#define MSG_CONTROL_RETRACTF     "Ritrai  F"
1263
+	#define MSG_CONTROL_RETRACTF     "Ritrai  V"
1264 1264
 	#define MSG_CONTROL_RETRACT_ZLIFT "Salta mm"
1265 1265
 	#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
1266
-	#define MSG_CONTROL_RETRACT_RECOVERF "UnRet  F"
1266
+	#define MSG_CONTROL_RETRACT_RECOVERF "UnRet  V"
1267 1267
 	#define MSG_AUTORETRACT          "AutoArretramento"
1268 1268
 	#define MSG_FILAMENTCHANGE       "Cambia filamento"
1269 1269
 	#define MSG_INIT_SDCARD          "Iniz. SD-Card"
@@ -1449,10 +1449,10 @@
1449 1449
 	#define MSG_STOPPED "PARADA. "
1450 1450
 	#define MSG_STEPPER_RELEASED "Lancado."
1451 1451
 	#define MSG_CONTROL_RETRACT  " Retrair mm:"
1452
-	#define MSG_CONTROL_RETRACTF " Retrair  F:"
1452
+	#define MSG_CONTROL_RETRACTF " Retrair  V:"
1453 1453
 	#define MSG_CONTROL_RETRACT_ZLIFT " Levantar mm:"
1454 1454
 	#define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
1455
-	#define MSG_CONTROL_RETRACT_RECOVERF " DesRet  F:"
1455
+	#define MSG_CONTROL_RETRACT_RECOVERF " DesRet  V:"
1456 1456
 	#define MSG_AUTORETRACT " AutoRetr.:"
1457 1457
 	#define MSG_FILAMENTCHANGE "Change filament"
1458 1458
 	#define MSG_INIT_SDCARD "Init. SD-Card"	
@@ -1633,10 +1633,10 @@
1633 1633
 	#define MSG_KILLED "KILLED. "
1634 1634
 	#define MSG_STOPPED "STOPPED. "
1635 1635
 	#define MSG_CONTROL_RETRACT  "Veda mm"
1636
-	#define MSG_CONTROL_RETRACTF "Veda F"
1636
+	#define MSG_CONTROL_RETRACTF "Veda V"
1637 1637
 	#define MSG_CONTROL_RETRACT_ZLIFT "Z mm"
1638 1638
 	#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
1639
-	#define MSG_CONTROL_RETRACT_RECOVERF "UnRet  F"
1639
+	#define MSG_CONTROL_RETRACT_RECOVERF "UnRet  V"
1640 1640
 	#define MSG_AUTORETRACT "AutoVeto."
1641 1641
 	#define MSG_FILAMENTCHANGE "Change filament"
1642 1642
 	#define MSG_INIT_SDCARD "Init. SD-Card"	

Loading…
Cancel
Save