From aab61e63c3ab3ff9db143009c8faf9a624abf650 Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Fri, 14 Mar 2014 14:52:48 -0700 Subject: [PATCH 1/7] 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 aed27c0796..044bd90582 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 4e9fed10ef..cc664b839e 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 2126f7fb5f..3593bdeed3 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 b0093a15134c1fd28a862d7489a1fb759cf4e670 Mon Sep 17 00:00:00 2001 From: David Forrest Date: Wed, 26 Mar 2014 23:41:10 -0400 Subject: [PATCH 2/7] thermistortables.h: Add comments that table 60 uses beta=3950. --- Marlin/Configuration.h | 2 +- Marlin/thermistortables.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index e18c98a437..714bb3e634 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -116,7 +116,7 @@ // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) // 10 is 100k RS thermistor 198-961 (4.7k pullup) // 20 is the PT100 circuit found in the Ultimainboard V2.x -// 60 is 100k Maker's Tool Works Kapton Bed Thermistor +// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k // (but gives greater accuracy and more stable PID) diff --git a/Marlin/thermistortables.h b/Marlin/thermistortables.h index 1d2b3ca65f..6120923f10 100644 --- a/Marlin/thermistortables.h +++ b/Marlin/thermistortables.h @@ -781,6 +781,14 @@ const short temptable_55[][2] PROGMEM = { #endif #if (THERMISTORHEATER_0 == 60) || (THERMISTORHEATER_1 == 60) || (THERMISTORHEATER_2 == 60) || (THERMISTORBED == 60) // Maker's Tool Works Kapton Bed Thermister +// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=3950 +// r0: 100000 +// t0: 25 +// r1: 0 (parallel with rTherm) +// r2: 4700 (series with rTherm) +// beta: 3950 +// min adc: 1 at 0.0048828125 V +// max adc: 1023 at 4.9951171875 V const short temptable_60[][2] PROGMEM = { {51*OVERSAMPLENR, 272}, {61*OVERSAMPLENR, 258}, From aeaf9b9312fb1eff68ed0ecbf42aca07cb9360f1 Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Sun, 30 Mar 2014 11:34:36 -0700 Subject: [PATCH 3/7] 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 9fe64119ff..d3a7862065 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2241,8 +2241,6 @@ void process_commands() SERIAL_ECHO_START; SERIAL_ECHO(MSG_M200_INVALID_EXTRUDER); } - SERIAL_ECHOLN(tmp_extruder); - break; } volumetric_multiplier[tmp_extruder] = 1 / area; } From a65564eef6fdcefcb95470f8332e732b598ff2bd Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Sun, 30 Mar 2014 11:34:36 -0700 Subject: [PATCH 4/7] 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 cc664b839e..67d7093962 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; } From 875950831991f17f8d3ad0fb96ef63d77d5f03f9 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 1 Apr 2014 09:26:19 +0800 Subject: [PATCH 5/7] fix bug for dual extruders not working some guy find that marlin not working good for dual extruders delta . when type T0 or T1 to active extruder and E0 or E1 move causing XYZ motion . so i locales the bugs and fix it , I have dry run the fix. --- Marlin/Marlin_main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d7397ac0c7..66ce22410b 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3051,7 +3051,16 @@ void process_commands() // Set the new active extruder and position active_extruder = tmp_extruder; #endif //else DUAL_X_CARRIAGE +#ifdef DELTA + + calculate_delta(current_position); // change cartesian kinematic to delta kinematic; + //sent position to plan_set_position(); + plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS],current_position[E_AXIS]); + +#else plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + +#endif // Move to the old position if 'F' was in the parameters if(make_move && Stopped == false) { prepare_move(); From dfb98101e4c6481c4a7f82d7ebf58d54882fa84a Mon Sep 17 00:00:00 2001 From: nothinman Date: Thu, 3 Apr 2014 18:05:48 +0100 Subject: [PATCH 6/7] Change CONTROLLERFAN_PIN for board 35 to -1, as it would conflict with board's 33 extruder pin, causing burnout (it's the same board, just different number of fans/extruders, therefore should be pin-compatible) --- Marlin/pins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/pins.h b/Marlin/pins.h index 9976d431d0..0811179858 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -502,7 +502,7 @@ #endif #if MOTHERBOARD == 35 - #define CONTROLLERFAN_PIN 10 //Pin used for the fan to cool controller + #define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller #endif #define PS_ON_PIN 12 From dca9790f421143790c84b91133aab4c695498e25 Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Fri, 4 Apr 2014 10:13:44 -0700 Subject: [PATCH 7/7] Update Readme descriptions for M200, M207 and M208 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e85be7c3eb..551c53075c 100644 --- a/README.md +++ b/README.md @@ -204,15 +204,15 @@ M Codes * M140 - Set bed target temp * M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling -* M200 - Set filament diameter +* M200 D- set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters). * M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) * M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! * M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec * 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 * 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 * M206 - set additional homeing offset -* M207 - set retract length S[positive mm] F[feedrate mm/sec] Z[additional zlift/hop] -* M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec] +* M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting +* M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/min] * 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. * M218 - set hotend offset (in mm): T X Y * M220 S- set speed factor override percentage