From b6e69e71cec45b2d238c2e3097bb8dc702166440 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sun, 28 Feb 2016 15:50:50 +0100 Subject: [PATCH] Make stepper shutdown after inactivity dependent Make stepper shutdown after inactivity dependent on a new set of #defines. DISABLE_INACTIV_X DISABLE_INACTIV_Y DISABLE_INACTIV_Z DISABLE_INACTIV_E And make exemplaric Configuration. Names can be discussed. This makes the disabling of the steppers independent from the DISABLE_? settings witch shut down the steppers immediately. --- Marlin/Configuration.h | 2 +- Marlin/Configuration_adv.h | 10 ++++++++-- Marlin/Marlin_main.cpp | 8 ++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f2b5ba95e9..663bd76d38 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -349,7 +349,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Z_ENABLE_ON 0 #define E_ENABLE_ON 0 // For all extruders -// Disables axis when it's not being used. +// Disables axis stepper immediately when it's not being used. // WARNING: When motors turn off there is a chance of losing position accuracy! #define DISABLE_X false #define DISABLE_Y false diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index b57ec08b0f..9eb698677f 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -52,7 +52,7 @@ * The maximum buffered steps/sec of the extruder motor is called "se". * Start autotemp mode with M109 S B F * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by - * mintemp and maxtemp. Turn this off by excuting M109 without F* + * mintemp and maxtemp. Turn this off by executing M109 without F* * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ @@ -232,7 +232,13 @@ #define INVERT_E_STEP_PIN false // Default stepper release if idle. Set to 0 to deactivate. -#define DEFAULT_STEPPER_DEACTIVE_TIME 60 +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIV_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7e2ba0ed62..e841389452 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6956,16 +6956,16 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { if (stepper_inactive_time && ms > previous_cmd_ms + stepper_inactive_time && !ignore_stepper_queue && !blocks_queued()) { - #if DISABLE_X == true + #if DISABLE_INACTIV_X == true disable_x(); #endif - #if DISABLE_Y == true + #if DISABLE_INACTIV_Y == true disable_y(); #endif - #if DISABLE_Z == true + #if DISABLE_INACTIV_Z == true disable_z(); #endif - #if DISABLE_E == true + #if DISABLE_INACTIV_E == true disable_e0(); disable_e1(); disable_e2();