From aab61e63c3ab3ff9db143009c8faf9a624abf650 Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Fri, 14 Mar 2014 14:52:48 -0700 Subject: [PATCH 1/2] FWRETRACT in mm/s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Marlin/Configuration_adv.h | 4 ++-- Marlin/Marlin_main.cpp | 12 ++++++------ Marlin/language.h | 36 ++++++++++++++++++------------------ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index aed27c079..044bd9058 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -402,10 +402,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st #ifdef FWRETRACT #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_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_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 //adds support for experimental filament exchange support M600; requires display diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4e9fed10e..cc664b839 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1093,7 +1093,7 @@ static void homeaxis(int axis) { current_position[E_AXIS]+=retract_length/volumetric_multiplier[active_extruder]; plan_set_e_position(current_position[E_AXIS]); float oldFeedrate = feedrate; - feedrate=retract_feedrate; + feedrate=retract_feedrate*60; retracted=true; prepare_move(); 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]; plan_set_e_position(current_position[E_AXIS]); float oldFeedrate = feedrate; - feedrate=retract_recover_feedrate; + feedrate=retract_recover_feedrate*60; retracted=false; prepare_move(); feedrate = oldFeedrate; @@ -2291,7 +2291,7 @@ void process_commands() break; #endif #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')) { @@ -2299,14 +2299,14 @@ void process_commands() } if(code_seen('F')) { - retract_feedrate = code_value() ; + retract_feedrate = code_value()/60 ; } if(code_seen('Z')) { retract_zlift = code_value() ; } }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')) { @@ -2314,7 +2314,7 @@ void process_commands() } if(code_seen('F')) { - retract_recover_feedrate = code_value() ; + retract_recover_feedrate = code_value()/60 ; } }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. diff --git a/Marlin/language.h b/Marlin/language.h index 2126f7fb5..3593bdeed 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -150,10 +150,10 @@ #define MSG_KILLED "KILLED. " #define MSG_STOPPED "STOPPED. " #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_RECOVER "UnRet +mm" - #define MSG_CONTROL_RETRACT_RECOVERF "UnRet F" + #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" #define MSG_AUTORETRACT "AutoRetr." #define MSG_FILAMENTCHANGE "Change filament" #define MSG_INIT_SDCARD "Init. SD card" @@ -335,10 +335,10 @@ #define MSG_STOPPED "Zatrzymany. " #define MSG_STEPPER_RELEASED "Zwolniony." #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_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_FILAMENTCHANGE "Zmien filament" #define MSG_INIT_SDCARD "Inicjal. karty SD" @@ -520,10 +520,10 @@ #define MSG_STOPPED "STOPPE." #define MSG_STEPPER_RELEASED "RELACHE." #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_RECOVER "UnRet +mm" - #define MSG_CONTROL_RETRACT_RECOVERF "UnRet F" + #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" #define MSG_AUTORETRACT "Retract. Auto." #define MSG_FILAMENTCHANGE "Changer filament" #define MSG_INIT_SDCARD "Init. la carte SD" @@ -706,10 +706,10 @@ #define MSG_STOPPED "GESTOPPT" #define MSG_STEPPER_RELEASED "Stepper frei" #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_RECOVER "UnRet +mm" - #define MSG_CONTROL_RETRACT_RECOVERF "UnRet F" + #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" #define MSG_AUTORETRACT "AutoRetr." #define MSG_FILAMENTCHANGE "Filament wechseln" #define MSG_INIT_SDCARD "Init. SD-Card" @@ -888,10 +888,10 @@ #define MSG_KILLED "PARADA DE EMERG." #define MSG_STOPPED "PARADA" #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_RECOVER "DesRet +mm" - #define MSG_CONTROL_RETRACT_RECOVERF "DesRet F" + #define MSG_CONTROL_RETRACT_RECOVERF "DesRet V" #define MSG_AUTORETRACT "AutoRetr." #define MSG_FILAMENTCHANGE "Change filament" #define MSG_INIT_SDCARD "Iniciando tarjeta" @@ -1079,10 +1079,10 @@ #define MSG_KILLED "УБИТО." #define MSG_STOPPED "ОСТАНОВЛЕНО." #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_RECOVER "Возврат +mm:" - #define MSG_CONTROL_RETRACT_RECOVERF "Возврат F:" + #define MSG_CONTROL_RETRACT_RECOVERF "Возврат V:" #define MSG_AUTORETRACT "АвтоОткат:" #define MSG_FILAMENTCHANGE "Change filament" #define MSG_INIT_SDCARD "Init. SD-Card" @@ -1260,10 +1260,10 @@ #define MSG_KILLED "UCCISO. " #define MSG_STOPPED "ARRESTATO. " #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_RECOVER "UnRet +mm" - #define MSG_CONTROL_RETRACT_RECOVERF "UnRet F" + #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" #define MSG_AUTORETRACT "AutoArretramento" #define MSG_FILAMENTCHANGE "Cambia filamento" #define MSG_INIT_SDCARD "Iniz. SD-Card" @@ -1449,10 +1449,10 @@ #define MSG_STOPPED "PARADA. " #define MSG_STEPPER_RELEASED "Lancado." #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_RECOVER " DesRet +mm:" - #define MSG_CONTROL_RETRACT_RECOVERF " DesRet F:" + #define MSG_CONTROL_RETRACT_RECOVERF " DesRet V:" #define MSG_AUTORETRACT " AutoRetr.:" #define MSG_FILAMENTCHANGE "Change filament" #define MSG_INIT_SDCARD "Init. SD-Card" @@ -1633,10 +1633,10 @@ #define MSG_KILLED "KILLED. " #define MSG_STOPPED "STOPPED. " #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_RECOVER "UnRet +mm" - #define MSG_CONTROL_RETRACT_RECOVERF "UnRet F" + #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" #define MSG_AUTORETRACT "AutoVeto." #define MSG_FILAMENTCHANGE "Change filament" #define MSG_INIT_SDCARD "Init. SD-Card" From a65564eef6fdcefcb95470f8332e732b598ff2bd Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Sun, 30 Mar 2014 11:34:36 -0700 Subject: [PATCH 2/2] fix bug in M200 with multiple extruders --- Marlin/Marlin_main.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index cc664b839..67d709396 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2231,8 +2231,6 @@ void process_commands() SERIAL_ECHO_START; SERIAL_ECHO(MSG_M200_INVALID_EXTRUDER); } - SERIAL_ECHOLN(tmp_extruder); - break; } volumetric_multiplier[tmp_extruder] = 1 / area; }