M851 XY 3 point followup (incomplete) (#15361)

This commit is contained in:
InsanityAutomation
2019-09-25 03:43:41 -04:00
committed by Scott Lahteine
parent 66d0221077
commit e9cf46a9a5
120 changed files with 67 additions and 1617 deletions

View File

@ -200,6 +200,10 @@
#undef SLOWDOWN
#endif
#ifndef MESH_INSET
#define MESH_INSET 0
#endif
/**
* Safe Homing Options
*/
@ -1490,15 +1494,6 @@ constexpr float nozzle_to_probe_offset[XYZ] = NOZZLE_TO_PROBE_OFFSET;
#define PROBE_Y_MIN (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MIN_PROBE_EDGE)
#define PROBE_X_MAX (X_CENTER + SCARA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE))
#define PROBE_Y_MAX (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE))
#else
// Boundaries for Cartesian probing based on bed limits
#define PROBE_X_MIN (_MAX(X_MIN_BED + MIN_PROBE_EDGE, X_MIN_POS + nozzle_to_probe_offset[X_AXIS]))
#define PROBE_Y_MIN (_MAX(Y_MIN_BED + MIN_PROBE_EDGE, Y_MIN_POS + nozzle_to_probe_offset[Y_AXIS]))
#define PROBE_X_MAX (_MIN(X_MAX_BED - (MIN_PROBE_EDGE), X_MAX_POS + nozzle_to_probe_offset[X_AXIS]))
#define PROBE_Y_MAX (_MIN(Y_MAX_BED - (MIN_PROBE_EDGE), Y_MAX_POS + nozzle_to_probe_offset[Y_AXIS]))
#endif
#if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH)
@ -1508,7 +1503,7 @@ constexpr float nozzle_to_probe_offset[XYZ] = NOZZLE_TO_PROBE_OFFSET;
/**
* Default mesh area is an area with an inset margin on the print area.
*/
#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_BILINEAR)
#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!")
@ -1548,54 +1543,6 @@ constexpr float nozzle_to_probe_offset[XYZ] = NOZZLE_TO_PROBE_OFFSET;
#endif // MESH_BED_LEVELING || AUTO_BED_LEVELING_UBL
#if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT)
#if IS_KINEMATIC
#define SIN0 0.0
#define SIN120 0.866025
#define SIN240 -0.866025
#define COS0 1.0
#define COS120 -0.5
#define COS240 -0.5
#ifndef PROBE_PT_1_X
#define PROBE_PT_1_X (X_CENTER + (_PROBE_RADIUS) * COS0)
#endif
#ifndef PROBE_PT_1_Y
#define PROBE_PT_1_Y (Y_CENTER + (_PROBE_RADIUS) * SIN0)
#endif
#ifndef PROBE_PT_2_X
#define PROBE_PT_2_X (X_CENTER + (_PROBE_RADIUS) * COS120)
#endif
#ifndef PROBE_PT_2_Y
#define PROBE_PT_2_Y (Y_CENTER + (_PROBE_RADIUS) * SIN120)
#endif
#ifndef PROBE_PT_3_X
#define PROBE_PT_3_X (X_CENTER + (_PROBE_RADIUS) * COS240)
#endif
#ifndef PROBE_PT_3_Y
#define PROBE_PT_3_Y (Y_CENTER + (_PROBE_RADIUS) * SIN240)
#endif
#else
#ifndef PROBE_PT_1_X
#define PROBE_PT_1_X PROBE_X_MIN
#endif
#ifndef PROBE_PT_1_Y
#define PROBE_PT_1_Y PROBE_Y_MIN
#endif
#ifndef PROBE_PT_2_X
#define PROBE_PT_2_X PROBE_X_MAX
#endif
#ifndef PROBE_PT_2_Y
#define PROBE_PT_2_Y PROBE_Y_MIN
#endif
#ifndef PROBE_PT_3_X
#define PROBE_PT_3_X X_CENTER
#endif
#ifndef PROBE_PT_3_Y
#define PROBE_PT_3_Y PROBE_Y_MAX
#endif
#endif
#endif
/**
* Buzzer/Speaker
*/

View File

@ -248,9 +248,11 @@
#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."
#elif defined(ABL_PROBE_PT_1_X) || defined(ABL_PROBE_PT_1_Y) || defined(ABL_PROBE_PT_2_X) || defined(ABL_PROBE_PT_2_Y) || defined(ABL_PROBE_PT_3_X) || defined(ABL_PROBE_PT_3_Y)
#error "ABL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration."
#error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h."
#elif defined(UBL_PROBE_PT_1_X) || defined(UBL_PROBE_PT_1_Y) || defined(UBL_PROBE_PT_2_X) || defined(UBL_PROBE_PT_2_Y) || defined(UBL_PROBE_PT_3_X) || defined(UBL_PROBE_PT_3_Y)
#error "UBL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration."
#error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h."
#elif defined(PROBE_PT_1_X) || defined(PROBE_PT_1_Y) || defined(PROBE_PT_2_X) || defined(PROBE_PT_2_Y) || defined(PROBE_PT_3_X) || defined(PROBE_PT_3_Y)
#error "PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h."
#elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY)
#error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY. Please update your configuration."
#elif defined(BABYSTEP_ZPROBE_GFX_REVERSE)
@ -1206,19 +1208,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
* Bed Leveling Requirements
*/
//
// !! TODO: REPLACE WITH TESTS IN THE 3-POINT LEVELING CODE !!
//
//#if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT)
// static_assert(WITHIN(PROBE_PT_1_X, PROBE_X_MIN, PROBE_X_MAX), "PROBE_PT_1_X is outside the probe region.");
// static_assert(WITHIN(PROBE_PT_2_X, PROBE_X_MIN, PROBE_X_MAX), "PROBE_PT_2_X is outside the probe region.");
// static_assert(WITHIN(PROBE_PT_3_X, PROBE_X_MIN, PROBE_X_MAX), "PROBE_PT_3_X is outside the probe region.");
// static_assert(WITHIN(PROBE_PT_1_Y, PROBE_Y_MIN, PROBE_Y_MAX), "PROBE_PT_1_Y is outside the probe region.");
// static_assert(WITHIN(PROBE_PT_2_Y, PROBE_Y_MIN, PROBE_Y_MAX), "PROBE_PT_2_Y is outside the probe region.");
// static_assert(WITHIN(PROBE_PT_3_Y, PROBE_Y_MIN, PROBE_Y_MAX), "PROBE_PT_3_Y is outside the probe region.");
//#endif
#if ENABLED(AUTO_BED_LEVELING_UBL)
/**
@ -1318,12 +1307,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
* Make sure Z_SAFE_HOMING point is reachable
*/
#if ENABLED(Z_SAFE_HOMING)
#if HAS_BED_PROBE
//
// !! TODO: REPLACE WITH TESTS IN THE Z_SAFE_HOMING CODE !!
//
//static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, PROBE_X_MIN, PROBE_X_MAX), "Z_SAFE_HOMING_X_POINT is outside the probe region.");
//static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, PROBE_Y_MIN, PROBE_Y_MAX), "Z_SAFE_HOMING_Y_POINT is outside the probe region.");
#if HAS_BED_PROBE && (ENABLED(DELTA) || IS_SCARA)
static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, PROBE_X_MIN, PROBE_X_MAX), "Z_SAFE_HOMING_X_POINT is outside the probe region.");
static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, PROBE_Y_MIN, PROBE_Y_MAX), "Z_SAFE_HOMING_Y_POINT is outside the probe region.");
#else
static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, X_MIN_POS, X_MAX_POS), "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle.");
static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");