From 8a5eaa3c9b53548337306f34077d27aed0a69391 Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Sun, 19 Jan 2014 19:11:51 -0800 Subject: [PATCH 1/3] Fix crash after home bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a bug in the Extruder Runout Prevention feature that caused the extruder to move back to “current_position” after a move if it was activated while the move was in progress. For long home moves (which are longer than the dimensions of the machine’s working area), this would cause the machine to crash into the far end of its travel after homing. This usually occurred on the Z axis, which could result in damage to the machine if you don’t hit the reset button in time. --- 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 26bc66f7de..920aed00c4 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3298,8 +3298,8 @@ void manage_inactivity() enable_e0(); float oldepos=current_position[E_AXIS]; float oldedes=destination[E_AXIS]; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], - current_position[E_AXIS]+EXTRUDER_RUNOUT_EXTRUDE*EXTRUDER_RUNOUT_ESTEPS/axis_steps_per_unit[E_AXIS], + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], + destination[E_AXIS]+EXTRUDER_RUNOUT_EXTRUDE*EXTRUDER_RUNOUT_ESTEPS/axis_steps_per_unit[E_AXIS], EXTRUDER_RUNOUT_SPEED/60.*EXTRUDER_RUNOUT_ESTEPS/axis_steps_per_unit[E_AXIS], active_extruder); current_position[E_AXIS]=oldepos; destination[E_AXIS]=oldedes; From b1f8f492c6908c62604833c4062e101f2490ebd6 Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Sun, 19 Jan 2014 19:22:08 -0800 Subject: [PATCH 2/3] Remove previous_millis_cmd update from extruder runout prevention code This seems to defeat the purpose of previous_millis_cmd, preventing the time elapsed from previous_millis_cmd from ever reaching max_inactive_time or stepper_inactive_time while the heat was on. --- Marlin/Marlin_main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 920aed00c4..524b82161d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3304,7 +3304,6 @@ void manage_inactivity() current_position[E_AXIS]=oldepos; destination[E_AXIS]=oldedes; plan_set_e_position(oldepos); - previous_millis_cmd=millis(); st_synchronize(); WRITE(E0_ENABLE_PIN,oldstatus); } From f08bb8bb6a587b326222af9b678dae3922619493 Mon Sep 17 00:00:00 2001 From: whosawhatsis Date: Sun, 19 Jan 2014 22:06:45 -0800 Subject: [PATCH 3/3] Previous commit borked. --- Marlin/Marlin_main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 524b82161d..920aed00c4 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3304,6 +3304,7 @@ void manage_inactivity() current_position[E_AXIS]=oldepos; destination[E_AXIS]=oldedes; plan_set_e_position(oldepos); + previous_millis_cmd=millis(); st_synchronize(); WRITE(E0_ENABLE_PIN,oldstatus); }