From 5b4625f79c9f5176168fd101b1cae74e829f6d93 Mon Sep 17 00:00:00 2001 From: Bernhard Date: Fri, 9 Dec 2011 12:51:08 +0100 Subject: [PATCH] added a partial release option to "m84" aka "stepper release". If you do tiny layers, you might want to keep the z-axis powered to not loose height positioning after homeing. --- Marlin/Configuration.h | 1 + Marlin/Marlin.pde | 24 ++++++++++++++---------- Marlin/cardreader.pde | 2 +- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index e8b960f788..febc3bcca6 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -292,6 +292,7 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th //#define ULTRA_LCD //general lcd support, also 16x2 //#define SDSUPPORT // Enable SD Card Support in Hardware Console #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? +#define SD_FINISHED_RELEASECOMMAND "M84 X Y E" // no z because of layer shift. //#define ULTIPANEL #ifdef ULTIPANEL diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index ac42c15846..f3182a7d05 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -903,18 +903,22 @@ FORCE_INLINE void process_commands() } else { - #if ((E_ENABLE_PIN != X_ENABLE_PIN) && (E_ENABLE_PIN != Y_ENABLE_PIN)) // Only enable on boards that have seperate ENABLE_PINS - if(code_seen('E')) { + bool all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2]))|| (code_seen(axis_codes[3]))); + if(all_axis) + { + finishAndDisableSteppers(); + } + else + { st_synchronize(); - LCD_MESSAGEPGM("Free Move"); - disable_e(); + if(code_seen('X')) disable_x(); + if(code_seen('Y')) disable_y(); + if(code_seen('Z')) disable_z(); + #if ((E_ENABLE_PIN != X_ENABLE_PIN) && (E_ENABLE_PIN != Y_ENABLE_PIN)) // Only enable on boards that have seperate ENABLE_PINS + if(code_seen('E')) disable_e(); + #endif + LCD_MESSAGEPGM("Partial Release"); } - else { - finishAndDisableSteppers(); - } - #else - finishAndDisableSteppers(); - #endif } break; case 85: // M85 diff --git a/Marlin/cardreader.pde b/Marlin/cardreader.pde index 8355f6aeda..6ad04068e4 100644 --- a/Marlin/cardreader.pde +++ b/Marlin/cardreader.pde @@ -436,7 +436,7 @@ void CardReader::printingHasFinished() if(SD_FINISHED_STEPPERRELEASE) { //finishAndDisableSteppers(); - enquecommand("M84"); + enquecommand(SD_FINISHED_RELEASECOMMAND); } autotempShutdown(); }