From 3d043976f7899cbd979c1e06c2cc078c3e2f25ff Mon Sep 17 00:00:00 2001 From: Jim Brown Date: Wed, 14 Jun 2017 22:06:34 -0400 Subject: [PATCH] Add option to disallow filament change without homing first --- Marlin/Configuration_adv.h | 1 + Marlin/Marlin_main.cpp | 8 ++++---- Marlin/SanityCheck.h | 2 ++ .../example_configurations/Cartesio/Configuration_adv.h | 1 + Marlin/example_configurations/Felix/Configuration_adv.h | 1 + .../FolgerTech-i3-2020/Configuration_adv.h | 1 + .../example_configurations/Hephestos/Configuration_adv.h | 1 + .../Hephestos_2/Configuration_adv.h | 1 + Marlin/example_configurations/K8200/Configuration_adv.h | 1 + Marlin/example_configurations/K8400/Configuration_adv.h | 1 + Marlin/example_configurations/M150/Configuration_adv.h | 1 + .../example_configurations/RigidBot/Configuration_adv.h | 1 + Marlin/example_configurations/SCARA/Configuration_adv.h | 1 + Marlin/example_configurations/TAZ4/Configuration_adv.h | 1 + .../example_configurations/TinyBoy2/Configuration_adv.h | 1 + Marlin/example_configurations/WITBOX/Configuration_adv.h | 1 + .../delta/FLSUN/auto_calibrate/Configuration_adv.h | 1 + .../delta/FLSUN/kossel_mini/Configuration_adv.h | 1 + .../delta/generic/Configuration_adv.h | 1 + .../delta/kossel_mini/Configuration_adv.h | 1 + .../delta/kossel_pro/Configuration_adv.h | 1 + .../delta/kossel_xl/Configuration_adv.h | 1 + .../gCreate_gMax1.5+/Configuration_adv.h | 1 + Marlin/example_configurations/makibox/Configuration_adv.h | 1 + .../tvrrug/Round2/Configuration_adv.h | 1 + Marlin/example_configurations/wt150/Configuration_adv.h | 1 + 26 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index c8e30fffe..088554ebb 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -807,6 +807,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 69296edda..dd6ec521f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -9265,10 +9265,10 @@ inline void gcode_M503() { */ inline void gcode_M600() { - // Don't allow filament change without homing first - if (axis_unhomed_error()) { - home_all_axes(); - } + #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE) + // Don't allow filament change without homing first + if (axis_unhomed_error()) home_all_axes(); + #endif // Initial retract before move to filament change position const float retract = parser.seen('E') ? parser.value_axis_units(E_AXIS) : 0 diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index de4f550d2..ee25709af 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -321,6 +321,8 @@ #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE." #elif ENABLED(PARK_HEAD_ON_PAUSE) && DISABLED(SDSUPPORT) && DISABLED(NEWPANEL) && DISABLED(EMERGENCY_PARSER) #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller." + #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT) + #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT" #endif #endif diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 8dfb65a36..81cf8e290 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -800,6 +800,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index a5940d456..ac5bdb51c 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -800,6 +800,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h b/Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h index 4174cba82..282fdf006 100644 --- a/Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h +++ b/Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h @@ -809,6 +809,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 3e7f6416d..e2ed21f47 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -800,6 +800,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 26af260c3..c70eb7c28 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -783,6 +783,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 4cad884b7..82d8adbad 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -813,6 +813,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 34ccc3aeb..a49c7d51b 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -800,6 +800,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/M150/Configuration_adv.h b/Marlin/example_configurations/M150/Configuration_adv.h index c2c1c0c3f..a8379526f 100644 --- a/Marlin/example_configurations/M150/Configuration_adv.h +++ b/Marlin/example_configurations/M150/Configuration_adv.h @@ -807,6 +807,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 027e63318..2bfdef25f 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -800,6 +800,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 9ea1a60bd..14fb68220 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -800,6 +800,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 23b616ad5..c11677a8b 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -800,6 +800,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h index ba0eae98a..20c2e79f8 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h @@ -803,6 +803,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 3e7f6416d..e2ed21f47 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -800,6 +800,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h index 1ca156d9b..a8a30eabd 100644 --- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -805,6 +805,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h index dc5c04e2e..3e27eab9d 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -804,6 +804,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 49a550fae..f7d78f310 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -802,6 +802,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 49a550fae..f7d78f310 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -802,6 +802,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 3922a31a7..7f5248117 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -807,6 +807,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 9b403edb1..41ceff382 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -802,6 +802,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h b/Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h index ba963dd06..4354d717a 100644 --- a/Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h +++ b/Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h @@ -809,6 +809,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index c16680356..f6517a6c1 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -800,6 +800,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index e218c85ca..a6ab735e5 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -800,6 +800,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc diff --git a/Marlin/example_configurations/wt150/Configuration_adv.h b/Marlin/example_configurations/wt150/Configuration_adv.h index 09f94b226..171f4c3b7 100644 --- a/Marlin/example_configurations/wt150/Configuration_adv.h +++ b/Marlin/example_configurations/wt150/Configuration_adv.h @@ -803,6 +803,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc