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.
This commit is contained in:
whosawhatsis 2014-03-14 14:52:48 -07:00
parent c43838bb1e
commit aab61e63c3
3 changed files with 26 additions and 26 deletions

View File

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

View File

@ -1093,7 +1093,7 @@ static void homeaxis(int axis) {
current_position[E_AXIS]+=retract_length/volumetric_multiplier[active_extruder]; current_position[E_AXIS]+=retract_length/volumetric_multiplier[active_extruder];
plan_set_e_position(current_position[E_AXIS]); plan_set_e_position(current_position[E_AXIS]);
float oldFeedrate = feedrate; float oldFeedrate = feedrate;
feedrate=retract_feedrate; feedrate=retract_feedrate*60;
retracted=true; retracted=true;
prepare_move(); prepare_move();
current_position[Z_AXIS]-=retract_zlift; current_position[Z_AXIS]-=retract_zlift;
@ -1111,7 +1111,7 @@ static void homeaxis(int axis) {
current_position[E_AXIS]-=(retract_length+retract_recover_length)/volumetric_multiplier[active_extruder]; current_position[E_AXIS]-=(retract_length+retract_recover_length)/volumetric_multiplier[active_extruder];
plan_set_e_position(current_position[E_AXIS]); plan_set_e_position(current_position[E_AXIS]);
float oldFeedrate = feedrate; float oldFeedrate = feedrate;
feedrate=retract_recover_feedrate; feedrate=retract_recover_feedrate*60;
retracted=false; retracted=false;
prepare_move(); prepare_move();
feedrate = oldFeedrate; feedrate = oldFeedrate;
@ -2291,7 +2291,7 @@ void process_commands()
break; break;
#endif #endif
#ifdef FWRETRACT #ifdef FWRETRACT
case 207: //M207 - set retract length S[positive mm] F[feedrate mm/sec] Z[additional zlift/hop] case 207: //M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop]
{ {
if(code_seen('S')) if(code_seen('S'))
{ {
@ -2299,14 +2299,14 @@ void process_commands()
} }
if(code_seen('F')) if(code_seen('F'))
{ {
retract_feedrate = code_value() ; retract_feedrate = code_value()/60 ;
} }
if(code_seen('Z')) if(code_seen('Z'))
{ {
retract_zlift = code_value() ; retract_zlift = code_value() ;
} }
}break; }break;
case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/sec] case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
{ {
if(code_seen('S')) if(code_seen('S'))
{ {
@ -2314,7 +2314,7 @@ void process_commands()
} }
if(code_seen('F')) if(code_seen('F'))
{ {
retract_recover_feedrate = code_value() ; retract_recover_feedrate = code_value()/60 ;
} }
}break; }break;
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. 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.

View File

@ -150,10 +150,10 @@
#define MSG_KILLED "KILLED. " #define MSG_KILLED "KILLED. "
#define MSG_STOPPED "STOPPED. " #define MSG_STOPPED "STOPPED. "
#define MSG_CONTROL_RETRACT "Retract mm" #define MSG_CONTROL_RETRACT "Retract mm"
#define MSG_CONTROL_RETRACTF "Retract F" #define MSG_CONTROL_RETRACTF "Retract V"
#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm" #define MSG_CONTROL_RETRACT_ZLIFT "Hop mm"
#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" #define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
#define MSG_CONTROL_RETRACT_RECOVERF "UnRet F" #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V"
#define MSG_AUTORETRACT "AutoRetr." #define MSG_AUTORETRACT "AutoRetr."
#define MSG_FILAMENTCHANGE "Change filament" #define MSG_FILAMENTCHANGE "Change filament"
#define MSG_INIT_SDCARD "Init. SD card" #define MSG_INIT_SDCARD "Init. SD card"
@ -335,10 +335,10 @@
#define MSG_STOPPED "Zatrzymany. " #define MSG_STOPPED "Zatrzymany. "
#define MSG_STEPPER_RELEASED "Zwolniony." #define MSG_STEPPER_RELEASED "Zwolniony."
#define MSG_CONTROL_RETRACT "Wycofaj mm" #define MSG_CONTROL_RETRACT "Wycofaj mm"
#define MSG_CONTROL_RETRACTF "Wycofaj F" #define MSG_CONTROL_RETRACTF "Wycofaj V"
#define MSG_CONTROL_RETRACT_ZLIFT "Skok Z mm:" #define MSG_CONTROL_RETRACT_ZLIFT "Skok Z mm:"
#define MSG_CONTROL_RETRACT_RECOVER "Cof. wycof. +mm" #define MSG_CONTROL_RETRACT_RECOVER "Cof. wycof. +mm"
#define MSG_CONTROL_RETRACT_RECOVERF "Cof. wycof. F" #define MSG_CONTROL_RETRACT_RECOVERF "Cof. wycof. V"
#define MSG_AUTORETRACT "Auto. wycofanie" #define MSG_AUTORETRACT "Auto. wycofanie"
#define MSG_FILAMENTCHANGE "Zmien filament" #define MSG_FILAMENTCHANGE "Zmien filament"
#define MSG_INIT_SDCARD "Inicjal. karty SD" #define MSG_INIT_SDCARD "Inicjal. karty SD"
@ -520,10 +520,10 @@
#define MSG_STOPPED "STOPPE." #define MSG_STOPPED "STOPPE."
#define MSG_STEPPER_RELEASED "RELACHE." #define MSG_STEPPER_RELEASED "RELACHE."
#define MSG_CONTROL_RETRACT "Retraction mm" #define MSG_CONTROL_RETRACT "Retraction mm"
#define MSG_CONTROL_RETRACTF "Retraction F" #define MSG_CONTROL_RETRACTF "Retraction V"
#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm" #define MSG_CONTROL_RETRACT_ZLIFT "Hop mm"
#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" #define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
#define MSG_CONTROL_RETRACT_RECOVERF "UnRet F" #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V"
#define MSG_AUTORETRACT "Retract. Auto." #define MSG_AUTORETRACT "Retract. Auto."
#define MSG_FILAMENTCHANGE "Changer filament" #define MSG_FILAMENTCHANGE "Changer filament"
#define MSG_INIT_SDCARD "Init. la carte SD" #define MSG_INIT_SDCARD "Init. la carte SD"
@ -706,10 +706,10 @@
#define MSG_STOPPED "GESTOPPT" #define MSG_STOPPED "GESTOPPT"
#define MSG_STEPPER_RELEASED "Stepper frei" #define MSG_STEPPER_RELEASED "Stepper frei"
#define MSG_CONTROL_RETRACT "Retract mm" #define MSG_CONTROL_RETRACT "Retract mm"
#define MSG_CONTROL_RETRACTF "Retract F" #define MSG_CONTROL_RETRACTF "Retract V"
#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm" #define MSG_CONTROL_RETRACT_ZLIFT "Hop mm"
#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" #define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
#define MSG_CONTROL_RETRACT_RECOVERF "UnRet F" #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V"
#define MSG_AUTORETRACT "AutoRetr." #define MSG_AUTORETRACT "AutoRetr."
#define MSG_FILAMENTCHANGE "Filament wechseln" #define MSG_FILAMENTCHANGE "Filament wechseln"
#define MSG_INIT_SDCARD "Init. SD-Card" #define MSG_INIT_SDCARD "Init. SD-Card"
@ -888,10 +888,10 @@
#define MSG_KILLED "PARADA DE EMERG." #define MSG_KILLED "PARADA DE EMERG."
#define MSG_STOPPED "PARADA" #define MSG_STOPPED "PARADA"
#define MSG_CONTROL_RETRACT "Retraer mm" #define MSG_CONTROL_RETRACT "Retraer mm"
#define MSG_CONTROL_RETRACTF "Retraer F" #define MSG_CONTROL_RETRACTF "Retraer V"
#define MSG_CONTROL_RETRACT_ZLIFT "Levantar mm" #define MSG_CONTROL_RETRACT_ZLIFT "Levantar mm"
#define MSG_CONTROL_RETRACT_RECOVER "DesRet +mm" #define MSG_CONTROL_RETRACT_RECOVER "DesRet +mm"
#define MSG_CONTROL_RETRACT_RECOVERF "DesRet F" #define MSG_CONTROL_RETRACT_RECOVERF "DesRet V"
#define MSG_AUTORETRACT "AutoRetr." #define MSG_AUTORETRACT "AutoRetr."
#define MSG_FILAMENTCHANGE "Change filament" #define MSG_FILAMENTCHANGE "Change filament"
#define MSG_INIT_SDCARD "Iniciando tarjeta" #define MSG_INIT_SDCARD "Iniciando tarjeta"
@ -1079,10 +1079,10 @@
#define MSG_KILLED "УБИТО." #define MSG_KILLED "УБИТО."
#define MSG_STOPPED "ОСТАНОВЛЕНО." #define MSG_STOPPED "ОСТАНОВЛЕНО."
#define MSG_CONTROL_RETRACT "Откат mm:" #define MSG_CONTROL_RETRACT "Откат mm:"
#define MSG_CONTROL_RETRACTF "Откат F:" #define MSG_CONTROL_RETRACTF "Откат V:"
#define MSG_CONTROL_RETRACT_ZLIFT "Прыжок mm:" #define MSG_CONTROL_RETRACT_ZLIFT "Прыжок mm:"
#define MSG_CONTROL_RETRACT_RECOVER "Возврат +mm:" #define MSG_CONTROL_RETRACT_RECOVER "Возврат +mm:"
#define MSG_CONTROL_RETRACT_RECOVERF "Возврат F:" #define MSG_CONTROL_RETRACT_RECOVERF "Возврат V:"
#define MSG_AUTORETRACT "АвтоОткат:" #define MSG_AUTORETRACT "АвтоОткат:"
#define MSG_FILAMENTCHANGE "Change filament" #define MSG_FILAMENTCHANGE "Change filament"
#define MSG_INIT_SDCARD "Init. SD-Card" #define MSG_INIT_SDCARD "Init. SD-Card"
@ -1260,10 +1260,10 @@
#define MSG_KILLED "UCCISO. " #define MSG_KILLED "UCCISO. "
#define MSG_STOPPED "ARRESTATO. " #define MSG_STOPPED "ARRESTATO. "
#define MSG_CONTROL_RETRACT "Ritrai mm" #define MSG_CONTROL_RETRACT "Ritrai mm"
#define MSG_CONTROL_RETRACTF "Ritrai F" #define MSG_CONTROL_RETRACTF "Ritrai V"
#define MSG_CONTROL_RETRACT_ZLIFT "Salta mm" #define MSG_CONTROL_RETRACT_ZLIFT "Salta mm"
#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" #define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
#define MSG_CONTROL_RETRACT_RECOVERF "UnRet F" #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V"
#define MSG_AUTORETRACT "AutoArretramento" #define MSG_AUTORETRACT "AutoArretramento"
#define MSG_FILAMENTCHANGE "Cambia filamento" #define MSG_FILAMENTCHANGE "Cambia filamento"
#define MSG_INIT_SDCARD "Iniz. SD-Card" #define MSG_INIT_SDCARD "Iniz. SD-Card"
@ -1449,10 +1449,10 @@
#define MSG_STOPPED "PARADA. " #define MSG_STOPPED "PARADA. "
#define MSG_STEPPER_RELEASED "Lancado." #define MSG_STEPPER_RELEASED "Lancado."
#define MSG_CONTROL_RETRACT " Retrair mm:" #define MSG_CONTROL_RETRACT " Retrair mm:"
#define MSG_CONTROL_RETRACTF " Retrair F:" #define MSG_CONTROL_RETRACTF " Retrair V:"
#define MSG_CONTROL_RETRACT_ZLIFT " Levantar mm:" #define MSG_CONTROL_RETRACT_ZLIFT " Levantar mm:"
#define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:" #define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
#define MSG_CONTROL_RETRACT_RECOVERF " DesRet F:" #define MSG_CONTROL_RETRACT_RECOVERF " DesRet V:"
#define MSG_AUTORETRACT " AutoRetr.:" #define MSG_AUTORETRACT " AutoRetr.:"
#define MSG_FILAMENTCHANGE "Change filament" #define MSG_FILAMENTCHANGE "Change filament"
#define MSG_INIT_SDCARD "Init. SD-Card" #define MSG_INIT_SDCARD "Init. SD-Card"
@ -1633,10 +1633,10 @@
#define MSG_KILLED "KILLED. " #define MSG_KILLED "KILLED. "
#define MSG_STOPPED "STOPPED. " #define MSG_STOPPED "STOPPED. "
#define MSG_CONTROL_RETRACT "Veda mm" #define MSG_CONTROL_RETRACT "Veda mm"
#define MSG_CONTROL_RETRACTF "Veda F" #define MSG_CONTROL_RETRACTF "Veda V"
#define MSG_CONTROL_RETRACT_ZLIFT "Z mm" #define MSG_CONTROL_RETRACT_ZLIFT "Z mm"
#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" #define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
#define MSG_CONTROL_RETRACT_RECOVERF "UnRet F" #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V"
#define MSG_AUTORETRACT "AutoVeto." #define MSG_AUTORETRACT "AutoVeto."
#define MSG_FILAMENTCHANGE "Change filament" #define MSG_FILAMENTCHANGE "Change filament"
#define MSG_INIT_SDCARD "Init. SD-Card" #define MSG_INIT_SDCARD "Init. SD-Card"