Apply physical limits to mesh bounds

This commit is contained in:
Scott Lahteine
2017-10-19 01:39:39 -05:00
parent 4e2baeb3e1
commit 580b6e9089
78 changed files with 615 additions and 2157 deletions

View File

@ -810,9 +810,12 @@
#endif
/**
* Delta endstops, radius/rod trimmers, angle trimmers
* Delta radius/rod trimmers/angle trimmers
*/
#if ENABLED(DELTA)
#ifndef DELTA_PROBEABLE_RADIUS
#define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS
#endif
#ifndef DELTA_CALIBRATION_RADIUS
#define DELTA_CALIBRATION_RADIUS DELTA_PRINTABLE_RADIUS - 10
#endif
@ -833,7 +836,6 @@
/**
* Set granular options based on the specific type of leveling
*/
#define UBL_DELTA (ENABLED(AUTO_BED_LEVELING_UBL) && (ENABLED(DELTA) || ENABLED(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN)))
#define ABL_PLANAR (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT))
#define ABL_GRID (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR))
@ -849,6 +851,70 @@
#define PROBE_BED_HEIGHT abs(BACK_PROBE_BED_POSITION - (FRONT_PROBE_BED_POSITION))
#endif
/**
* Bed Probing rectangular bounds
* These can be further constrained in code for Delta and SCARA
*/
#if ENABLED(DELTA)
// 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 (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 Cartesian probing based on bed limits
#define MIN_PROBE_X (max(X_MIN_BED, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
#define MIN_PROBE_Y (max(Y_MIN_BED, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
#define MAX_PROBE_X (min(X_MAX_BED, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
#define MAX_PROBE_Y (min(Y_MAX_BED, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
#endif
/**
* Default mesh area is an area with an inset margin on the print area.
*/
#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL)
#if IS_KINEMATIC
// 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 _MESH_MIN_X (MIN_PROBE_X + MESH_INSET)
#define _MESH_MIN_Y (MIN_PROBE_Y + MESH_INSET)
#define _MESH_MAX_X (MAX_PROBE_X - (MESH_INSET))
#define _MESH_MAX_Y (MAX_PROBE_Y - (MESH_INSET))
#else
// Boundaries for Cartesian probing based on set limits
#define _MESH_MIN_X (max(X_MIN_BED + MESH_INSET, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
#define _MESH_MIN_Y (max(Y_MIN_BED + MESH_INSET, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
#define _MESH_MAX_X (min(X_MAX_BED - (MESH_INSET), X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
#define _MESH_MAX_Y (min(Y_MAX_BED - (MESH_INSET), Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
#endif
/**
* These may be overridden in Configuration if a smaller area is wanted
*/
#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL)
#ifndef MESH_MIN_X
#define MESH_MIN_X _MESH_MIN_X
#endif
#ifndef MESH_MIN_Y
#define MESH_MIN_Y _MESH_MIN_Y
#endif
#ifndef MESH_MAX_X
#define MESH_MAX_X _MESH_MAX_X
#endif
#ifndef MESH_MAX_Y
#define MESH_MAX_Y _MESH_MAX_Y
#endif
#endif
#endif // MESH_BED_LEVELING || AUTO_BED_LEVELING_UBL
/**
* Buzzer/Speaker
*/
@ -899,35 +965,6 @@
#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)
#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 (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 Cartesian probing based on bed limits
#define MIN_PROBE_X (max(X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER, X_MIN_BED))
#define MIN_PROBE_Y (max(Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER, Y_MIN_BED))
#define MAX_PROBE_X (min(X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER, X_MAX_BED))
#define MAX_PROBE_Y (min(Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER, Y_MAX_BED))
#endif
// Stepper pulse duration, in cycles
#define STEP_PULSE_CYCLES ((MINIMUM_STEPPER_PULSE) * CYCLES_PER_MICROSECOND)
#ifdef CPU_32_BIT

View File

@ -215,6 +215,10 @@
#error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE."
#elif defined(NEOPIXEL_RGBW_LED)
#error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration."
#elif defined(UBL_MESH_INSET)
#error "UBL_MESH_INSET is now just MESH_INSET. Please update your configuration."
#elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y)
#error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]. Please update your configuration."
#endif
/**