From e93510f37331e82db8b50cce04fd7023e6873f29 Mon Sep 17 00:00:00 2001 From: DerAndere <26200979+DerAndere1@users.noreply.github.com> Date: Tue, 27 Aug 2024 23:28:33 +0200 Subject: [PATCH 1/6] Sanity check for Z_CLEARANCE_FOR_HOMING --- Marlin/src/inc/SanityCheck.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 0fda662d23a4..bf3ecc95c653 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1771,6 +1771,9 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i */ #if HAS_Z_AXIS static_assert(Z_CLEARANCE_FOR_HOMING <= Z_MAX_POS, "Z_CLEARANCE_FOR_HOMING must be smaller than or equal to Z_MAX_POS."); + #if ENABLED(Z_HOME_TO_MAX) && defined(HOME_Z_FIRST) + static_assert(Z_CLEARANCE_FOR_HOMING <= 0, "Z_CLEARANCE_FOR_HOMING must be smaller than or equal to 0."); + #endif #endif // Check Safe Bed Leveling settings From 79910b0579d7f419cf34d20ee3c62da6e762c072 Mon Sep 17 00:00:00 2001 From: DerAndere <26200979+DerAndere1@users.noreply.github.com> Date: Tue, 27 Aug 2024 23:49:42 +0200 Subject: [PATCH 2/6] prettier --- Marlin/src/inc/SanityCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index bf3ecc95c653..f0c72edca243 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1771,7 +1771,7 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i */ #if HAS_Z_AXIS static_assert(Z_CLEARANCE_FOR_HOMING <= Z_MAX_POS, "Z_CLEARANCE_FOR_HOMING must be smaller than or equal to Z_MAX_POS."); - #if ENABLED(Z_HOME_TO_MAX) && defined(HOME_Z_FIRST) + #if Z_HOME_TO_MAX && defined(HOME_Z_FIRST) static_assert(Z_CLEARANCE_FOR_HOMING <= 0, "Z_CLEARANCE_FOR_HOMING must be smaller than or equal to 0."); #endif #endif From 7795e1f182724af97c227ea6c942cf59424007ed Mon Sep 17 00:00:00 2001 From: DerAndere <26200979+DerAndere1@users.noreply.github.com> Date: Wed, 28 Aug 2024 00:39:30 +0200 Subject: [PATCH 3/6] exclude DELTA and TPARA --- Marlin/src/inc/SanityCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index f0c72edca243..eabb4e0a74ef 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1771,7 +1771,7 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i */ #if HAS_Z_AXIS static_assert(Z_CLEARANCE_FOR_HOMING <= Z_MAX_POS, "Z_CLEARANCE_FOR_HOMING must be smaller than or equal to Z_MAX_POS."); - #if Z_HOME_TO_MAX && defined(HOME_Z_FIRST) + #if Z_HOME_TO_MAX && ENABLED(HOME_Z_FIRST) && NONE(DELTA, TPARA) static_assert(Z_CLEARANCE_FOR_HOMING <= 0, "Z_CLEARANCE_FOR_HOMING must be smaller than or equal to 0."); #endif #endif From 6b3b68cfcdbc34503e826781014c364a6b6a7929 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 2 Sep 2024 14:58:16 -0500 Subject: [PATCH 4/6] can't think of < 0 safe case --- Marlin/src/inc/SanityCheck.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 081c244cb2e0..a300e795b029 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1776,9 +1776,9 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i * Make sure Z_CLEARANCE_FOR_HOMING is below Z_MAX_POS */ #if HAS_Z_AXIS - static_assert(Z_CLEARANCE_FOR_HOMING <= Z_MAX_POS, "Z_CLEARANCE_FOR_HOMING must be smaller than or equal to Z_MAX_POS."); - #if Z_HOME_TO_MAX && ENABLED(HOME_Z_FIRST) && NONE(DELTA, TPARA) - static_assert(Z_CLEARANCE_FOR_HOMING <= 0, "Z_CLEARANCE_FOR_HOMING must be smaller than or equal to 0."); + static_assert(Z_CLEARANCE_FOR_HOMING <= Z_MAX_POS, "Z_CLEARANCE_FOR_HOMING must be less than or equal to Z_MAX_POS."); + #if ALL(Z_HOME_TO_MAX, HOME_Z_FIRST) && NONE(DELTA, TPARA) + static_assert(Z_CLEARANCE_FOR_HOMING == 0, "Z_CLEARANCE_FOR_HOMING must be 0."); #endif #endif From 7e23dec3467150d924abbe7855bc24bf1c8303e5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 2 Sep 2024 15:28:43 -0500 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=AA=A0=20Granular=20sub-options=20(2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #27373 --- Marlin/src/inc/Conditionals-1-axes.h | 148 +-------------------------- 1 file changed, 3 insertions(+), 145 deletions(-) diff --git a/Marlin/src/inc/Conditionals-1-axes.h b/Marlin/src/inc/Conditionals-1-axes.h index 1d1b21e0fd1b..2fd1bf54797d 100644 --- a/Marlin/src/inc/Conditionals-1-axes.h +++ b/Marlin/src/inc/Conditionals-1-axes.h @@ -521,24 +521,7 @@ #define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V) #define ARRAY_BY_HOTENDS1(v1) ARRAY_N_1(HOTENDS, v1) -/** - * Extruders have some combination of stepper motors and hotends - * so we separate these concepts into the defines: - * - * EXTRUDERS - Number of Selectable Tools - * HOTENDS - Number of hotends, whether connected or separate - * E_STEPPERS - Number of actual E stepper motors - * E_MANUAL - Number of E steppers for LCD move options - * - * These defines must be simple constants for use in REPEAT, etc. - */ -#if EXTRUDERS - #define HAS_EXTRUDERS 1 - #if EXTRUDERS > 1 - #define HAS_MULTI_EXTRUDER 1 - #endif - #define E_AXIS_N(E) AxisEnum(E_AXIS + E_INDEX_N(E)) -#else +#if !EXTRUDERS #undef EXTRUDERS #define EXTRUDERS 0 #undef TEMP_SENSOR_0 @@ -563,121 +546,8 @@ #undef DISABLE_OTHER_EXTRUDERS #endif -#define E_OPTARG(N) OPTARG(HAS_MULTI_EXTRUDER, N) -#define E_TERN_(N) TERN_(HAS_MULTI_EXTRUDER, N) -#define E_TERN0(N) TERN0(HAS_MULTI_EXTRUDER, N) - -#if ANY(SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_EXTRUDER) - #define HAS_SWITCHING_EXTRUDER 1 -#endif -#if ANY(SWITCHING_NOZZLE, MECHANICAL_SWITCHING_NOZZLE) - #define HAS_SWITCHING_NOZZLE 1 -#endif - -/** - * Multi-Material-Unit supported models - */ -#ifdef MMU_MODEL - #define HAS_MMU 1 - #define SINGLENOZZLE - - #define _PRUSA_MMU1 1 - #define _PRUSA_MMU2 2 - #define _PRUSA_MMU2S 3 - #define _PRUSA_MMU3 4 - #define _EXTENDABLE_EMU_MMU2 12 - #define _EXTENDABLE_EMU_MMU2S 13 - #define _EXTENDABLE_EMU_MMU3 14 - #define _MMU CAT(_,MMU_MODEL) - - #if _MMU == _PRUSA_MMU1 - #define HAS_PRUSA_MMU1 1 - #elif _MMU % 10 == _PRUSA_MMU2 - #define HAS_PRUSA_MMU2 1 - #elif _MMU % 10 == _PRUSA_MMU2S - #define HAS_PRUSA_MMU2 1 - #define HAS_PRUSA_MMU2S 1 - #elif _MMU % 10 == _PRUSA_MMU3 - #define HAS_PRUSA_MMU3 1 - #endif - #if _MMU == _EXTENDABLE_EMU_MMU2 || _MMU == _EXTENDABLE_EMU_MMU2S - #define HAS_EXTENDABLE_MMU 1 - #endif - - #undef _MMU - #undef _PRUSA_MMU1 - #undef _PRUSA_MMU2 - #undef _PRUSA_MMU2S - #undef _PRUSA_MMU3 - #undef _EXTENDABLE_EMU_MMU2 - #undef _EXTENDABLE_EMU_MMU2S - #undef _EXTENDABLE_EMU_MMU3 -#endif - -#if ENABLED(E_DUAL_STEPPER_DRIVERS) // E0/E1 steppers act in tandem as E0 - - #define E_STEPPERS 2 - #define E_MANUAL 1 - -#elif HAS_SWITCHING_EXTRUDER // One stepper for every two EXTRUDERS - - #if EXTRUDERS > 4 - #define E_STEPPERS 3 - #elif EXTRUDERS > 2 - #define E_STEPPERS 2 - #else - #define E_STEPPERS 1 - #endif - -#elif ENABLED(MIXING_EXTRUDER) // Multiple feeds are mixed proportionally - - #define E_STEPPERS MIXING_STEPPERS - #define E_MANUAL 1 - #if MIXING_STEPPERS == 2 - #define HAS_DUAL_MIXING 1 - #endif - #ifndef MIXING_VIRTUAL_TOOLS - #define MIXING_VIRTUAL_TOOLS 1 - #endif - -#elif ENABLED(SWITCHING_TOOLHEAD) // Toolchanger - - #define E_STEPPERS EXTRUDERS - #define E_MANUAL EXTRUDERS - -#elif HAS_PRUSA_MMU2 || HAS_PRUSA_MMU3 // Průša Multi-Material Unit v2/v3 - - #define E_STEPPERS 1 - #define E_MANUAL 1 - -#endif - -// Default E steppers / manual motion is one per extruder -#ifndef E_STEPPERS - #define E_STEPPERS EXTRUDERS -#endif -#ifndef E_MANUAL - #define E_MANUAL EXTRUDERS -#endif - -// Number of hotends... -#if ANY(SINGLENOZZLE, MIXING_EXTRUDER) // Only one for singlenozzle or mixing extruder - #define HOTENDS 1 -#elif HAS_SWITCHING_EXTRUDER && !HAS_SWITCHING_NOZZLE // One for each pair of abstract "extruders" - #define HOTENDS E_STEPPERS -#elif TEMP_SENSOR_0 - #define HOTENDS EXTRUDERS // One per extruder if at least one heater exists -#else - #define HOTENDS 0 // A machine with no hotends at all can still extrude -#endif - // At least one hotend... -#if HOTENDS - #define HAS_HOTEND 1 - #ifndef HOTEND_OVERSHOOT - #define HOTEND_OVERSHOOT 15 - #endif -#else +#if !HOTENDS #undef MPCTEMP #undef PIDTEMP #undef PREVENT_COLD_EXTRUSION @@ -685,19 +555,7 @@ #endif // More than one hotend... -#if HOTENDS > 1 - #define HAS_MULTI_HOTEND 1 - #define HAS_HOTEND_OFFSET 1 - #ifndef HOTEND_OFFSET_X - #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder - #endif - #ifndef HOTEND_OFFSET_Y - #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder - #endif - #ifndef HOTEND_OFFSET_Z - #define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder - #endif -#else +#if HOTENDS <= 1 #undef HOTEND_OFFSET_X #undef HOTEND_OFFSET_Y #undef HOTEND_OFFSET_Z From a7acea7e56d384afc1ef2402fbc14c261ead2b60 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 2 Sep 2024 15:55:43 -0500 Subject: [PATCH 6/6] fix rambo test --- buildroot/tests/rambo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo index 16b88dda2cd5..698765f263d4 100755 --- a/buildroot/tests/rambo +++ b/buildroot/tests/rambo @@ -52,7 +52,8 @@ opt_set MOTHERBOARD BOARD_RAMBO \ MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ AXIS_RELATIVE_MODES '{ false, false, false }' \ BED_TRAMMING_LEVELING_ORDER '{ LF, RF }' \ - X2_DRIVER_TYPE A4988 Y2_DRIVER_TYPE A4988 + X2_DRIVER_TYPE A4988 Y2_DRIVER_TYPE A4988 \ + Z_CLEARANCE_FOR_HOMING 0 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER REVERSE_ENCODER_DIRECTION SDSUPPORT EEPROM_SETTINGS \ S_CURVE_ACCELERATION X_DUAL_ENDSTOPS Y_DUAL_ENDSTOPS \ ADAPTIVE_STEP_SMOOTHING CNC_COORDINATE_SYSTEMS GCODE_MOTION_MODES \