From 3f6d44d40b00fe0636c31a24feb00441ea748dd3 Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Tue, 11 Feb 2014 18:50:11 -0800 Subject: [PATCH 1/4] Keep FWRETRACT values in terms of millimeters when using M200 for volumetric E units --- Marlin/Marlin_main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b5e4e85193..1b213f9516 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -137,7 +137,7 @@ // 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] +// M207 - set retract length S[positive mm] F[feedrate mm/sec] 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/sec] // 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 @@ -1109,11 +1109,13 @@ void process_commands() destination[X_AXIS]=current_position[X_AXIS]; destination[Y_AXIS]=current_position[Y_AXIS]; destination[Z_AXIS]=current_position[Z_AXIS]; - current_position[Z_AXIS]+=-retract_zlift; - destination[E_AXIS]=current_position[E_AXIS]-retract_length; + current_position[Z_AXIS]-=retract_zlift; + destination[E_AXIS]=current_position[E_AXIS]-retract_length/volumetric_multiplier[active_extruder]; + float oldFeedrate = feedrate; feedrate=retract_feedrate; retracted=true; prepare_move(); + feedrate = oldFeedrate; } break; @@ -1124,10 +1126,12 @@ void process_commands() destination[Y_AXIS]=current_position[Y_AXIS]; destination[Z_AXIS]=current_position[Z_AXIS]; current_position[Z_AXIS]+=retract_zlift; - destination[E_AXIS]=current_position[E_AXIS]+retract_length+retract_recover_length; + destination[E_AXIS]=current_position[E_AXIS]+(retract_length+retract_recover_length)/volumetric_multiplier[active_extruder]; + float oldFeedrate = feedrate; feedrate=retract_recover_feedrate; retracted=false; prepare_move(); + feedrate = oldFeedrate; } break; #endif //FWRETRACT From 78e7654601f93638f32fed52b6b2d9bdb20845d7 Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Tue, 11 Feb 2014 19:05:35 -0800 Subject: [PATCH 2/4] Keep FWRETRACT values in terms of millimeters when using M200 for volumetric E units --- Marlin/Marlin_main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b567e2b093..985fde7dfd 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -137,7 +137,7 @@ // 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] +// M207 - set retract length S[positive mm] F[feedrate mm/sec] 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/sec] // 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 @@ -1128,10 +1128,12 @@ void process_commands() destination[Y_AXIS]=current_position[Y_AXIS]; destination[Z_AXIS]=current_position[Z_AXIS]; current_position[Z_AXIS]+=retract_zlift; - destination[E_AXIS]=current_position[E_AXIS]+retract_length+retract_recover_length; + destination[E_AXIS]=current_position[E_AXIS]+(retract_length+retract_recover_length)/volumetric_multiplier[active_extruder]; + float oldFeedrate = feedrate; feedrate=retract_recover_feedrate; retracted=false; prepare_move(); + feedrate = oldFeedrate; } break; #endif //FWRETRACT From d6c5c503d4d72a6d08314967f2996e83d1b05f4d Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Wed, 12 Feb 2014 12:59:50 -0800 Subject: [PATCH 3/4] correct feedrate units in comments for M207/M208 --- Marlin/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5f8f86f784..ab14f9907f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -137,8 +137,8 @@ // 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], stays in mm regardless of M200 setting -// 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 From 6e433985094874f3c3fbf70becd577b8ea2115eb Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Wed, 12 Feb 2014 13:01:19 -0800 Subject: [PATCH 4/4] G10/G11 bugfixes Previous version was broken by using G92 E0 between retract and recover. --- Marlin/Marlin_main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ab14f9907f..7c7a0b0442 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1114,7 +1114,9 @@ void process_commands() destination[Y_AXIS]=current_position[Y_AXIS]; destination[Z_AXIS]=current_position[Z_AXIS]; current_position[Z_AXIS]-=retract_zlift; - destination[E_AXIS]=current_position[E_AXIS]-retract_length/volumetric_multiplier[active_extruder]; + destination[E_AXIS]=current_position[E_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; retracted=true; @@ -1130,7 +1132,9 @@ void process_commands() destination[Y_AXIS]=current_position[Y_AXIS]; destination[Z_AXIS]=current_position[Z_AXIS]; current_position[Z_AXIS]+=retract_zlift; - destination[E_AXIS]=current_position[E_AXIS]+(retract_length+retract_recover_length)/volumetric_multiplier[active_extruder]; + destination[E_AXIS]=current_position[E_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; retracted=false;