diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index ba7a862ea..c8dacd335 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -34,9 +34,28 @@ #define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS)) #define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS)) #define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS)) - #define X_CENTER float((X_MIN_POS + X_MAX_POS) * 0.5) - #define Y_CENTER float((Y_MIN_POS + Y_MAX_POS) * 0.5) - #define Z_CENTER float((Z_MIN_POS + Z_MAX_POS) * 0.5) + + // Defined only if the sanity-check is bypassed + #ifndef X_BED_SIZE + #define X_BED_SIZE X_MAX_LENGTH + #endif + #ifndef Y_BED_SIZE + #define Y_BED_SIZE Y_MAX_LENGTH + #endif + + #if ENABLED(BED_CENTER_AT_0_0) + #define X_CENTER 0 + #define Y_CENTER 0 + #else + #define X_CENTER ((X_BED_SIZE) / 2) + #define Y_CENTER ((Y_BED_SIZE) / 2) + #endif + #define Z_CENTER ((Z_MIN_POS + Z_MAX_POS) / 2) + + #define X_MIN_BED (X_CENTER - (X_BED_SIZE) / 2) + #define X_MAX_BED (X_CENTER + (X_BED_SIZE) / 2) + #define Y_MIN_BED (Y_CENTER - (Y_BED_SIZE) / 2) + #define Y_MAX_BED (Y_CENTER + (Y_BED_SIZE) / 2) /** * CoreXY, CoreXZ, and CoreYZ - and their reverse @@ -87,11 +106,11 @@ #if ENABLED(DELTA) #define X_HOME_POS 0 #else - #define X_HOME_POS ((X_MAX_LENGTH) * (X_HOME_DIR) * 0.5) + #define X_HOME_POS ((X_BED_SIZE) * (X_HOME_DIR) * 0.5) #endif #else #if ENABLED(DELTA) - #define X_HOME_POS (X_MIN_POS + (X_MAX_LENGTH) * 0.5) + #define X_HOME_POS (X_MIN_POS + (X_BED_SIZE) * 0.5) #else #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS) #endif @@ -103,11 +122,11 @@ #if ENABLED(DELTA) #define Y_HOME_POS 0 #else - #define Y_HOME_POS ((Y_MAX_LENGTH) * (Y_HOME_DIR) * 0.5) + #define Y_HOME_POS ((Y_BED_SIZE) * (Y_HOME_DIR) * 0.5) #endif #else #if ENABLED(DELTA) - #define Y_HOME_POS (Y_MIN_POS + (Y_MAX_LENGTH) * 0.5) + #define Y_HOME_POS (Y_MIN_POS + (Y_BED_SIZE) * 0.5) #else #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS) #endif @@ -151,10 +170,10 @@ */ #if ENABLED(Z_SAFE_HOMING) #ifndef Z_SAFE_HOMING_X_POINT - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) + #define Z_SAFE_HOMING_X_POINT X_CENTER #endif #ifndef Z_SAFE_HOMING_Y_POINT - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) + #define Z_SAFE_HOMING_Y_POINT Y_CENTER #endif #define X_TILT_FULCRUM Z_SAFE_HOMING_X_POINT #define Y_TILT_FULCRUM Z_SAFE_HOMING_Y_POINT @@ -792,25 +811,40 @@ #define MANUAL_PROBE_HEIGHT Z_HOMING_HEIGHT #endif + /** + * Bed Probing rectangular bounds + * These can be further constrained in code for Delta and SCARA + */ #if ENABLED(DELTA) - // These will be further constrained in code, but UBL_PROBE_PT values - // cannot be compile-time verified within the radius. - #define MIN_PROBE_X (-DELTA_PRINTABLE_RADIUS) - #define MAX_PROBE_X ( DELTA_PRINTABLE_RADIUS) - #define MIN_PROBE_Y (-DELTA_PRINTABLE_RADIUS) - #define MAX_PROBE_Y ( DELTA_PRINTABLE_RADIUS) + #ifndef DELTA_PROBEABLE_RADIUS + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS + #endif + // Probing points may be verified at compile time within the radius + // using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(DELTA_PRINTABLE_RADIUS),"bad probe point!") + // so that may be added to SanityCheck.h in the future. + #define MIN_PROBE_X (X_CENTER - (DELTA_PROBEABLE_RADIUS)) + #define MIN_PROBE_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS)) + #define MAX_PROBE_X (X_CENTER + DELTA_PROBEABLE_RADIUS) + #define MAX_PROBE_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS) #elif IS_SCARA #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) - #define MIN_PROBE_X (-SCARA_PRINTABLE_RADIUS) - #define MAX_PROBE_X ( SCARA_PRINTABLE_RADIUS) - #define MIN_PROBE_Y (-SCARA_PRINTABLE_RADIUS) - #define MAX_PROBE_Y ( SCARA_PRINTABLE_RADIUS) + #define MIN_PROBE_X (X_CENTER - (SCARA_PRINTABLE_RADIUS)) + #define MIN_PROBE_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS)) + #define MAX_PROBE_X (X_CENTER + SCARA_PRINTABLE_RADIUS) + #define MAX_PROBE_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS) #else - // Boundaries for probing based on set limits - #define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) - #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MIN_PROBE_X (max(X_PROBE_OFFSET_FROM_EXTRUDER, 0) - (X_BED_SIZE) / 2) + #define MIN_PROBE_Y (max(Y_PROBE_OFFSET_FROM_EXTRUDER, 0) - (Y_BED_SIZE) / 2) + #define MAX_PROBE_X (min(X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER, X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MAX_PROBE_Y (min(Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER, Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MIN_PROBE_X (max(X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER, 0)) + #define MIN_PROBE_Y (max(Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER, 0)) + #define MAX_PROBE_X (min(X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER, X_BED_SIZE)) + #define MAX_PROBE_Y (min(Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER, Y_BED_SIZE)) + #endif #endif // Stepper pulse duration, in cycles @@ -835,7 +869,7 @@ #endif /** - * DELTA_SEGMENT_MIN_LENGTH and DELTA_PROBEABLE_RADIUS for UBL_DELTA + * DELTA_SEGMENT_MIN_LENGTH for UBL_DELTA */ #if UBL_DELTA #ifndef DELTA_SEGMENT_MIN_LENGTH @@ -847,9 +881,6 @@ #define DELTA_SEGMENT_MIN_LENGTH 1.00 // mm (similar to G2/G3 arc segmentation) #endif #endif - #ifndef DELTA_PROBEABLE_RADIUS - #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS - #endif #endif // Shorthand diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b62f5827f..35a6aaabb 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -755,12 +755,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 200 +#define Y_BED_SIZE 200 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 200 -#define Y_MAX_POS 200 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -968,8 +972,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5af9537d1..21daeae79 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -456,8 +456,8 @@ float filament_size[EXTRUDERS], volumetric_multiplier[EXTRUDERS]; #if HAS_SOFTWARE_ENDSTOPS bool soft_endstops_enabled = true; #endif -float soft_endstop_min[XYZ] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }, - soft_endstop_max[XYZ] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; +float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, + soft_endstop_max[XYZ] = { X_MAX_BED, Y_MAX_BED, Z_MAX_POS }; #if FAN_COUNT > 0 int16_t fanSpeeds[FAN_COUNT] = { 0 }; @@ -6905,15 +6905,16 @@ inline void gcode_M42() { for (uint8_t n = 0; n < n_samples; n++) { if (n_legs) { - int dir = (random(0, 10) > 5.0) ? -1 : 1; // clockwise or counter clockwise - float angle = random(0.0, 360.0), - radius = random( - #if ENABLED(DELTA) - DELTA_PROBEABLE_RADIUS / 8, DELTA_PROBEABLE_RADIUS / 3 - #else - 5, X_MAX_LENGTH / 8 - #endif - ); + const int dir = (random(0, 10) > 5.0) ? -1 : 1; // clockwise or counter clockwise + float angle = random(0.0, 360.0); + const float radius = random( + #if ENABLED(DELTA) + 0.1250000000 * (DELTA_PROBEABLE_RADIUS), + 0.3333333333 * (DELTA_PROBEABLE_RADIUS) + #else + 5.0, 0.125 * min(X_BED_SIZE, Y_BED_SIZE) + #endif + ); if (verbose_level > 3) { SERIAL_ECHOPAIR("Starting radius: ", radius); diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index dcd6ba1d5..448be0f04 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -50,7 +50,9 @@ /** * Warnings for old configurations */ -#if WATCH_TEMP_PERIOD > 500 +#if !defined(X_BED_SIZE) || !defined(Y_BED_SIZE) + #error "X_BED_SIZE and BED_Y_SIZE are now required! Please update your configuration." +#elif WATCH_TEMP_PERIOD > 500 #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds." #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD)) #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS." diff --git a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h index e32b57c58..3ed5c5474 100644 --- a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h +++ b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h @@ -770,12 +770,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 298 +#define Y_BED_SIZE 275 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 298 -#define Y_MAX_POS 275 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 250 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -983,8 +987,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/AliExpress/CL-260/Configuration.h b/Marlin/example_configurations/AliExpress/CL-260/Configuration.h index 769de81ee..a1e1630d3 100644 --- a/Marlin/example_configurations/AliExpress/CL-260/Configuration.h +++ b/Marlin/example_configurations/AliExpress/CL-260/Configuration.h @@ -752,12 +752,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 220 +#define Y_BED_SIZE 220 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 220 -#define Y_MAX_POS 220 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 260 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -965,8 +969,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/Anet/A6/Configuration.h b/Marlin/example_configurations/Anet/A6/Configuration.h index 550fd9953..766bde1a7 100644 --- a/Marlin/example_configurations/Anet/A6/Configuration.h +++ b/Marlin/example_configurations/Anet/A6/Configuration.h @@ -839,47 +839,52 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +//#define X_BED_SIZE 200 +//#define Y_BED_SIZE 200 + +// Travel limits (mm) after homing, corresponding to endstop positions. //#define X_MIN_POS 0 //#define Y_MIN_POS 0 +//#define X_MAX_POS X_BED_SIZE +//#define Y_MAX_POS Y_BED_SIZE //#define Z_MIN_POS 0 -//#define X_MAX_POS 200 -//#define Y_MAX_POS 200 //#define Z_MAX_POS 200 // ANET A6 Firmware V2.0 defaults: -//#define X_MIN_POS 0 -//#define Y_MIN_POS 0 -//#define Z_MIN_POS 0 -//#define X_MAX_POS 220 -//#define Y_MAX_POS 220 -//#define Z_MAX_POS 250 +//#define X_BED_SIZE 220 +//#define Y_BED_SIZE 220 +//#define X_MIN_POS 0 +//#define Y_MIN_POS 0 +//#define Z_MIN_POS 0 +//#define Z_MAX_POS 250 // ANET A6, X0/Y0 0 front left bed edge : -#define X_MIN_POS -3 -#define Y_MIN_POS -5 -#define Z_MIN_POS 0 -#define X_MAX_POS 222 -#define Y_MAX_POS 222 -#define Z_MAX_POS 230 +#define X_BED_SIZE 222 +#define Y_BED_SIZE 222 +#define X_MIN_POS -3 +#define Y_MIN_POS -5 +#define Z_MIN_POS 0 +#define Z_MAX_POS 230 // ANET A6 with new X-Axis / modded Y-Axis: -//#define X_MIN_POS 0 -//#define Y_MIN_POS 0 -//#define Z_MIN_POS 0 -//#define X_MAX_POS 235 -//#define Y_MAX_POS 230 -//#define Z_MAX_POS 230 +//#define X_BED_SIZE 235 +//#define Y_BED_SIZE 230 +//#define X_MIN_POS 0 +//#define Y_MIN_POS 0 +//#define Z_MIN_POS 0 +//#define Z_MAX_POS 230 // ANET A6 with new X-Axis / modded Y-Axis, X0/Y0 0 front left bed edge : -//#define X_MIN_POS -8 -//#define Y_MIN_POS -6 -//#define Z_MIN_POS 0 -//#define X_MAX_POS 227 -//#define Y_MAX_POS 224 -//#define Z_MAX_POS 230 - +//#define X_BED_SIZE 227 +//#define Y_BED_SIZE 224 +//#define X_MIN_POS -8 +//#define Y_MIN_POS -6 +//#define Z_MIN_POS 0 +//#define Z_MAX_POS 230 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE // If enabled, axes won't move below MIN_POS in response to movement commands. #define MIN_SOFTWARE_ENDSTOPS @@ -1115,8 +1120,8 @@ #define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). //Anet A6 with new X-Axis //#define Z_SAFE_HOMING_X_POINT 113 // X point for Z homing when homing all axis (G28). diff --git a/Marlin/example_configurations/Anet/A8/Configuration.h b/Marlin/example_configurations/Anet/A8/Configuration.h index d5aadbf2a..d02cdb921 100644 --- a/Marlin/example_configurations/Anet/A8/Configuration.h +++ b/Marlin/example_configurations/Anet/A8/Configuration.h @@ -761,12 +761,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 220 +#define Y_BED_SIZE 220 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS -33 #define Y_MIN_POS -10 #define Z_MIN_POS 0 -#define X_MAX_POS 220 -#define Y_MAX_POS 220 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 240 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -974,8 +978,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/BQ/Hephestos/Configuration.h b/Marlin/example_configurations/BQ/Hephestos/Configuration.h index e55858200..4d2da2cbb 100644 --- a/Marlin/example_configurations/BQ/Hephestos/Configuration.h +++ b/Marlin/example_configurations/BQ/Hephestos/Configuration.h @@ -741,12 +741,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 215 +#define Y_BED_SIZE 210 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 215 -#define Y_MAX_POS 210 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 180 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -954,8 +958,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h b/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h index 39af4832d..f4bff19f7 100644 --- a/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h @@ -752,12 +752,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 210 +#define Y_BED_SIZE 297 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 210 -#define Y_MAX_POS 297 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 210 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -965,8 +969,8 @@ #define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/BQ/WITBOX/Configuration.h b/Marlin/example_configurations/BQ/WITBOX/Configuration.h index 6984a9be1..870f6057d 100644 --- a/Marlin/example_configurations/BQ/WITBOX/Configuration.h +++ b/Marlin/example_configurations/BQ/WITBOX/Configuration.h @@ -741,12 +741,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 297 +#define Y_BED_SIZE 210 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 297 -#define Y_MAX_POS 210 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -954,8 +958,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 91c8d6bf7..7e8672468 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -749,12 +749,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 435 +#define Y_BED_SIZE 270 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 435 -#define Y_MAX_POS 270 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 400 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -962,8 +966,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/Creality/CR-10/Configuration.h b/Marlin/example_configurations/Creality/CR-10/Configuration.h index 535eec326..4fec96044 100644 --- a/Marlin/example_configurations/Creality/CR-10/Configuration.h +++ b/Marlin/example_configurations/Creality/CR-10/Configuration.h @@ -765,12 +765,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 300 +#define Y_BED_SIZE 300 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 300 -#define Y_MAX_POS 300 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 400 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -977,8 +981,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index fd80205a7..d9aee3ff6 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -733,12 +733,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 255 +#define Y_BED_SIZE 205 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 255 -#define Y_MAX_POS 205 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 235 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -946,8 +950,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index f1e5be4c3..8ac1bdcb8 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -733,12 +733,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 255 +#define Y_BED_SIZE 205 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 255 -#define Y_MAX_POS 205 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 235 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -946,8 +950,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/Folger Tech/i3-2020/Configuration.h b/Marlin/example_configurations/Folger Tech/i3-2020/Configuration.h index 151f76271..b24c0c713 100644 --- a/Marlin/example_configurations/Folger Tech/i3-2020/Configuration.h +++ b/Marlin/example_configurations/Folger Tech/i3-2020/Configuration.h @@ -754,13 +754,18 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 207 +#define Y_BED_SIZE 182 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 6 #define Y_MIN_POS 3 #define Z_MIN_POS 0 -#define X_MAX_POS 207 -#define Y_MAX_POS 182 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 175 + // If enabled, axes won't move below MIN_POS in response to movement commands. //#define MIN_SOFTWARE_ENDSTOPS // If enabled, axes won't move above MAX_POS in response to movement commands. @@ -968,8 +973,8 @@ #define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/Infitary/i3-M508/Configuration.h b/Marlin/example_configurations/Infitary/i3-M508/Configuration.h index f29594e42..1a303b7bd 100644 --- a/Marlin/example_configurations/Infitary/i3-M508/Configuration.h +++ b/Marlin/example_configurations/Infitary/i3-M508/Configuration.h @@ -759,12 +759,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 205 +#define Y_BED_SIZE 205 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 205 -#define Y_MAX_POS 205 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 185 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -972,8 +976,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/Malyan/M150/Configuration.h b/Marlin/example_configurations/Malyan/M150/Configuration.h index ac3dcbaf9..a9857fd9e 100644 --- a/Marlin/example_configurations/Malyan/M150/Configuration.h +++ b/Marlin/example_configurations/Malyan/M150/Configuration.h @@ -774,12 +774,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 200 +#define Y_BED_SIZE 200 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 200 -#define Y_MAX_POS 200 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 180 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -991,8 +995,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index f5f6eba19..761e9340f 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -751,12 +751,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 200 +#define Y_BED_SIZE 200 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 200 -#define Y_MAX_POS 200 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -964,8 +968,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 6c3cb72d1..5abc8e5e2 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -749,12 +749,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 254 // RigidBot regular is 254mm, RigitBot Big is 406mm +#define Y_BED_SIZE 248 // RigidBot regular is 248mm, RigitBot Big is 304mm + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 254 // RigidBot regular is 254mm, RigitBot Big is 406mm -#define Y_MAX_POS 248 // RigidBot regular is 248mm, RigitBot Big is 304mm +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 254 // RigidBot regular and Big are 254mm // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -962,8 +966,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 71ab77c01..6d53d8737 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -763,12 +763,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 200 +#define Y_BED_SIZE 200 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS MANUAL_Z_HOME_POS -#define X_MAX_POS 200 -#define Y_MAX_POS 200 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 225 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -976,8 +980,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/TinyBoy2/Configuration.h b/Marlin/example_configurations/TinyBoy2/Configuration.h index f41e8a87b..bc80b61a5 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration.h @@ -802,13 +802,17 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +// Tinyboy2: 100mm are marketed, actual length between endstop and end of rail is 98mm +#define X_BED_SIZE 98 +#define Y_BED_SIZE 98 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -// Tinyboy2: 100mm are marketed, actual length between endstop and end of rail is 98mm -#define X_MAX_POS 98 -#define Y_MAX_POS 98 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #if ENABLED(TB2_L10) #define Z_MAX_POS 98 #else @@ -1020,8 +1024,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/Velleman/K8200/Configuration.h b/Marlin/example_configurations/Velleman/K8200/Configuration.h index 0683fcbed..e314373e8 100644 --- a/Marlin/example_configurations/Velleman/K8200/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8200/Configuration.h @@ -780,12 +780,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 200 +#define Y_BED_SIZE 200 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 200 -#define Y_MAX_POS 200 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -993,8 +997,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/Velleman/K8400/Configuration.h b/Marlin/example_configurations/Velleman/K8400/Configuration.h index fa595b9a7..f93895aa9 100644 --- a/Marlin/example_configurations/Velleman/K8400/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8400/Configuration.h @@ -751,12 +751,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 200 +#define Y_BED_SIZE 200 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 20 #define Z_MIN_POS 0 -#define X_MAX_POS 200 -#define Y_MAX_POS 200 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 190 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -964,8 +968,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h index b7ecf8ad3..bcbe50581 100644 --- a/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h @@ -751,12 +751,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 200 +#define Y_BED_SIZE 200 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 20 #define Z_MIN_POS 0 -#define X_MAX_POS 200 -#define Y_MAX_POS 200 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 190 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -964,8 +968,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index cef34701f..835cc3199 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -751,12 +751,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 200 +#define Y_BED_SIZE 200 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 200 -#define Y_MAX_POS 200 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -964,8 +968,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h index c76ed5bf4..40a857ef0 100644 --- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h @@ -875,7 +875,11 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) +#define Y_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS -(DELTA_PRINTABLE_RADIUS) #define Y_MIN_POS -(DELTA_PRINTABLE_RADIUS) #define Z_MIN_POS 0 diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h index dd685ced0..87b410c25 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h @@ -875,7 +875,11 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) +#define Y_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS -(DELTA_PRINTABLE_RADIUS) #define Y_MIN_POS -(DELTA_PRINTABLE_RADIUS) #define Z_MIN_POS 0 diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 7919ff832..8633e20ac 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -862,7 +862,11 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) +#define Y_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS -(DELTA_PRINTABLE_RADIUS) #define Y_MIN_POS -(DELTA_PRINTABLE_RADIUS) #define Z_MIN_POS 0 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 0e6504820..2205fc014 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -860,7 +860,11 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) +#define Y_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS -(DELTA_PRINTABLE_RADIUS) #define Y_MIN_POS -(DELTA_PRINTABLE_RADIUS) #define Z_MIN_POS 0 diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 5ed569fd2..ad9d87e02 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -865,7 +865,11 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) +#define Y_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS -(DELTA_PRINTABLE_RADIUS) #define Y_MIN_POS -(DELTA_PRINTABLE_RADIUS) #define Z_MIN_POS 0 diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index bca02a2d8..aad12e7a1 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -928,7 +928,11 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) +#define Y_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS -(DELTA_PRINTABLE_RADIUS) #define Y_MIN_POS -(DELTA_PRINTABLE_RADIUS) #define Z_MIN_POS 0 diff --git a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h index ec55d2aaa..bd9c125e3 100644 --- a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h +++ b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h @@ -766,13 +766,17 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 420 // These numbers are not accurate for an unaltered gMax 1.5+ printer. My print bed +#define Y_BED_SIZE 420 // is inset a noticable amount from the edge of the bed. Combined with the inset, + // the nozzle can reach all cordinates of the mesh. + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 420 // These numbers are not accurate for an unaltered gMax 1.5+ printer. My print bed -#define Y_MAX_POS 420 // is inset a noticable amount from the edge of the bed. Combined with the inset, - // the nozzle can reach all cordinates of the mesh. +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 500 // If enabled, axes won't move below MIN_POS in response to movement commands. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 37b080d3b..ffb5d9e0c 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -754,12 +754,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 110 +#define Y_BED_SIZE 150 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 110 -#define Y_MAX_POS 150 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 86 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -967,8 +971,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 54c274207..112afb8cd 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -746,12 +746,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 205 +#define Y_BED_SIZE 205 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 205 -#define Y_MAX_POS 205 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 120 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -959,8 +963,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/example_configurations/wt150/Configuration.h b/Marlin/example_configurations/wt150/Configuration.h index 8cdde10c2..fbfe75a47 100644 --- a/Marlin/example_configurations/wt150/Configuration.h +++ b/Marlin/example_configurations/wt150/Configuration.h @@ -757,12 +757,16 @@ // @section machine -// Travel limits after homing (units are in mm) +// The size of the print bed +#define X_BED_SIZE 150 +#define Y_BED_SIZE 150 + +// Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 150 -#define Y_MAX_POS 150 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 143.0 // If enabled, axes won't move below MIN_POS in response to movement commands. @@ -970,8 +974,8 @@ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axis (G28). #endif // Homing speeds (mm/m) diff --git a/Marlin/ubl_G29.cpp b/Marlin/ubl_G29.cpp index 24ea39445..bc645fb2c 100644 --- a/Marlin/ubl_G29.cpp +++ b/Marlin/ubl_G29.cpp @@ -467,8 +467,8 @@ g29_x_pos = X_HOME_POS; g29_y_pos = Y_HOME_POS; #else // cartesian - g29_x_pos = X_PROBE_OFFSET_FROM_EXTRUDER > 0 ? X_MAX_POS : X_MIN_POS; - g29_y_pos = Y_PROBE_OFFSET_FROM_EXTRUDER < 0 ? Y_MAX_POS : Y_MIN_POS; + g29_x_pos = X_PROBE_OFFSET_FROM_EXTRUDER > 0 ? X_BED_SIZE : 0; + g29_y_pos = Y_PROBE_OFFSET_FROM_EXTRUDER < 0 ? Y_BED_SIZE : 0; #endif } @@ -1132,12 +1132,12 @@ SERIAL_PROTOCOLLNPGM("Both X & Y locations must be specified.\n"); err_flag = true; } - if (!WITHIN(RAW_X_POSITION(g29_x_pos), X_MIN_POS, X_MAX_POS)) { + if (!WITHIN(RAW_X_POSITION(g29_x_pos), X_MIN_BED, X_MAX_BED)) { SERIAL_PROTOCOLLNPGM("Invalid X location specified.\n"); err_flag = true; } - if (!WITHIN(RAW_Y_POSITION(g29_y_pos), Y_MIN_POS, Y_MAX_POS)) { + if (!WITHIN(RAW_Y_POSITION(g29_y_pos), Y_MIN_BED, Y_MAX_BED)) { SERIAL_PROTOCOLLNPGM("Invalid Y location specified.\n"); err_flag = true; }