✨ Probe XY Offset value limits (#26267)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
parent
0d42196d11
commit
cb044d989c
|
@ -1641,9 +1641,13 @@
|
||||||
|
|
||||||
#define Z_PROBE_LOW_POINT -2 // (mm) Farthest distance below the trigger-point to go before stopping
|
#define Z_PROBE_LOW_POINT -2 // (mm) Farthest distance below the trigger-point to go before stopping
|
||||||
|
|
||||||
// For M851 give a range for adjusting the Z probe offset
|
// For M851 provide ranges for adjusting the X, Y, and Z probe offsets
|
||||||
#define Z_PROBE_OFFSET_RANGE_MIN -20 // (mm)
|
//#define PROBE_OFFSET_XMIN -50 // (mm)
|
||||||
#define Z_PROBE_OFFSET_RANGE_MAX 20 // (mm)
|
//#define PROBE_OFFSET_XMAX 50 // (mm)
|
||||||
|
//#define PROBE_OFFSET_YMIN -50 // (mm)
|
||||||
|
//#define PROBE_OFFSET_YMAX 50 // (mm)
|
||||||
|
//#define PROBE_OFFSET_ZMIN -20 // (mm)
|
||||||
|
//#define PROBE_OFFSET_ZMAX 20 // (mm)
|
||||||
|
|
||||||
// Enable the M48 repeatability test to test probe accuracy
|
// Enable the M48 repeatability test to test probe accuracy
|
||||||
//#define Z_MIN_PROBE_REPEATABILITY_TEST
|
//#define Z_MIN_PROBE_REPEATABILITY_TEST
|
||||||
|
|
|
@ -44,10 +44,10 @@ void GcodeSuite::M851() {
|
||||||
if (parser.seenval('X')) {
|
if (parser.seenval('X')) {
|
||||||
const float x = parser.value_float();
|
const float x = parser.value_float();
|
||||||
#if HAS_PROBE_XY_OFFSET
|
#if HAS_PROBE_XY_OFFSET
|
||||||
if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE))
|
if (WITHIN(x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX))
|
||||||
offs.x = x;
|
offs.x = x;
|
||||||
else {
|
else {
|
||||||
SERIAL_ECHOLNPGM("?X out of range (-", X_BED_SIZE, " to ", X_BED_SIZE, ")");
|
SERIAL_ECHOLNPGM("?X out of range (", PROBE_OFFSET_XMIN, " to ", PROBE_OFFSET_XMAX, ")");
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -58,10 +58,10 @@ void GcodeSuite::M851() {
|
||||||
if (parser.seenval('Y')) {
|
if (parser.seenval('Y')) {
|
||||||
const float y = parser.value_float();
|
const float y = parser.value_float();
|
||||||
#if HAS_PROBE_XY_OFFSET
|
#if HAS_PROBE_XY_OFFSET
|
||||||
if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE))
|
if (WITHIN(y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX))
|
||||||
offs.y = y;
|
offs.y = y;
|
||||||
else {
|
else {
|
||||||
SERIAL_ECHOLNPGM("?Y out of range (-", Y_BED_SIZE, " to ", Y_BED_SIZE, ")");
|
SERIAL_ECHOLNPGM("?Y out of range (", PROBE_OFFSET_YMIN, " to ", PROBE_OFFSET_YMAX, ")");
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -71,10 +71,10 @@ void GcodeSuite::M851() {
|
||||||
|
|
||||||
if (parser.seenval('Z')) {
|
if (parser.seenval('Z')) {
|
||||||
const float z = parser.value_float();
|
const float z = parser.value_float();
|
||||||
if (WITHIN(z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
|
if (WITHIN(z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX))
|
||||||
offs.z = z;
|
offs.z = z;
|
||||||
else {
|
else {
|
||||||
SERIAL_ECHOLNPGM("?Z out of range (", Z_PROBE_OFFSET_RANGE_MIN, " to ", Z_PROBE_OFFSET_RANGE_MAX, ")");
|
SERIAL_ECHOLNPGM("?Z out of range (", PROBE_OFFSET_ZMIN, " to ", PROBE_OFFSET_ZMAX, ")");
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -665,6 +665,8 @@
|
||||||
#error "FOLDER_SORTING is now SDSORT_FOLDERS."
|
#error "FOLDER_SORTING is now SDSORT_FOLDERS."
|
||||||
#elif defined(BTT_MINI_12864_V1)
|
#elif defined(BTT_MINI_12864_V1)
|
||||||
#error "BTT_MINI_12864_V1 is now BTT_MINI_12864."
|
#error "BTT_MINI_12864_V1 is now BTT_MINI_12864."
|
||||||
|
#elif defined(Z_PROBE_OFFSET_RANGE_MIN) || defined(Z_PROBE_OFFSET_RANGE_MAX)
|
||||||
|
#error "Z_PROBE_OFFSET_RANGE_(MIN|MAX) is now PROBE_OFFSET_Z(MIN|MAX)."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// L64xx stepper drivers have been removed
|
// L64xx stepper drivers have been removed
|
||||||
|
|
|
@ -2943,14 +2943,26 @@
|
||||||
* Bed Probe dependencies
|
* Bed Probe dependencies
|
||||||
*/
|
*/
|
||||||
#if ANY(MESH_BED_LEVELING, HAS_BED_PROBE)
|
#if ANY(MESH_BED_LEVELING, HAS_BED_PROBE)
|
||||||
#ifndef Z_PROBE_OFFSET_RANGE_MIN
|
#ifndef PROBE_OFFSET_ZMIN
|
||||||
#define Z_PROBE_OFFSET_RANGE_MIN -20
|
#define PROBE_OFFSET_ZMIN -20
|
||||||
#endif
|
#endif
|
||||||
#ifndef Z_PROBE_OFFSET_RANGE_MAX
|
#ifndef PROBE_OFFSET_ZMAX
|
||||||
#define Z_PROBE_OFFSET_RANGE_MAX 20
|
#define PROBE_OFFSET_ZMAX 20
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if HAS_BED_PROBE
|
#if HAS_BED_PROBE
|
||||||
|
#ifndef PROBE_OFFSET_XMIN
|
||||||
|
#define PROBE_OFFSET_XMIN -50
|
||||||
|
#endif
|
||||||
|
#ifndef PROBE_OFFSET_XMAX
|
||||||
|
#define PROBE_OFFSET_XMAX 50
|
||||||
|
#endif
|
||||||
|
#ifndef PROBE_OFFSET_YMIN
|
||||||
|
#define PROBE_OFFSET_YMIN -50
|
||||||
|
#endif
|
||||||
|
#ifndef PROBE_OFFSET_YMAX
|
||||||
|
#define PROBE_OFFSET_YMAX 50
|
||||||
|
#endif
|
||||||
#if ALL(ENDSTOPPULLUPS, USE_Z_MIN_PROBE)
|
#if ALL(ENDSTOPPULLUPS, USE_Z_MIN_PROBE)
|
||||||
#define ENDSTOPPULLUP_ZMIN_PROBE
|
#define ENDSTOPPULLUP_ZMIN_PROBE
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1418,20 +1418,15 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for improper NOZZLE_TO_PROBE_OFFSET
|
* Check for improper PROBING_MARGIN
|
||||||
*/
|
*/
|
||||||
constexpr xyz_pos_t sanity_nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET;
|
#if NONE(NOZZLE_AS_PROBE, IS_KINEMATIC)
|
||||||
#if ENABLED(NOZZLE_AS_PROBE)
|
|
||||||
static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0,
|
|
||||||
"NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0.");
|
|
||||||
#elif !IS_KINEMATIC
|
|
||||||
static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0.");
|
static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0.");
|
||||||
static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0.");
|
static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0.");
|
||||||
static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0.");
|
static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0.");
|
||||||
static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0.");
|
static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0.");
|
||||||
static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0.");
|
static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0.");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _MARGIN(A) TERN(IS_KINEMATIC, PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2))
|
#define _MARGIN(A) TERN(IS_KINEMATIC, PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2))
|
||||||
static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large.");
|
static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large.");
|
||||||
static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large.");
|
static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large.");
|
||||||
|
@ -1440,6 +1435,34 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
|
||||||
static_assert(PROBING_MARGIN_RIGHT < _MARGIN(X), "PROBING_MARGIN_RIGHT is too large.");
|
static_assert(PROBING_MARGIN_RIGHT < _MARGIN(X), "PROBING_MARGIN_RIGHT is too large.");
|
||||||
#undef _MARGIN
|
#undef _MARGIN
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check for improper PROBE_OFFSET_[XYZ](MIN|MAX)
|
||||||
|
*/
|
||||||
|
#define PROBE_OFFSET_ASSERT(varname, x, min, max) static_assert(WITHIN(x, min, max), varname " must be within " STRINGIFY(min) " and " STRINGIFY(max))
|
||||||
|
#if HAS_PROBE_XY_OFFSET
|
||||||
|
PROBE_OFFSET_ASSERT("PROBE_OFFSET_XMIN", PROBE_OFFSET_XMIN, -(X_BED_SIZE), X_BED_SIZE);
|
||||||
|
PROBE_OFFSET_ASSERT("PROBE_OFFSET_XMAX", PROBE_OFFSET_XMAX, -(X_BED_SIZE), X_BED_SIZE);
|
||||||
|
PROBE_OFFSET_ASSERT("PROBE_OFFSET_YMIN", PROBE_OFFSET_YMIN, -(Y_BED_SIZE), Y_BED_SIZE);
|
||||||
|
PROBE_OFFSET_ASSERT("PROBE_OFFSET_YMAX", PROBE_OFFSET_YMAX, -(Y_BED_SIZE), Y_BED_SIZE);
|
||||||
|
#endif
|
||||||
|
PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMIN", PROBE_OFFSET_ZMIN, -20, 20);
|
||||||
|
PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMAX", PROBE_OFFSET_ZMAX, -20, 20);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check for improper NOZZLE_AS_PROBE or NOZZLE_TO_PROBE_OFFSET
|
||||||
|
*/
|
||||||
|
constexpr xyz_pos_t sanity_nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET;
|
||||||
|
#if ENABLED(NOZZLE_AS_PROBE)
|
||||||
|
static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0,
|
||||||
|
"NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0.");
|
||||||
|
#endif
|
||||||
|
#if HAS_PROBE_XY_OFFSET
|
||||||
|
PROBE_OFFSET_ASSERT("NOZZLE_TO_PROBE_OFFSET.x", sanity_nozzle_to_probe_offset.x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX);
|
||||||
|
PROBE_OFFSET_ASSERT("NOZZLE_TO_PROBE_OFFSET.y", sanity_nozzle_to_probe_offset.y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX);
|
||||||
|
#endif
|
||||||
|
PROBE_OFFSET_ASSERT("NOZZLE_TO_PROBE_OFFSET.z", sanity_nozzle_to_probe_offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX);
|
||||||
|
#undef PROBE_OFFSET_ASSERT
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make sure Z raise values are set
|
* Make sure Z raise values are set
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1384,7 +1384,7 @@ void hmiMoveDone(const AxisEnum axis) {
|
||||||
dwinUpdateLCD();
|
dwinUpdateLCD();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LIMIT(hmiValues.offset_value, (Z_PROBE_OFFSET_RANGE_MIN) * 100, (Z_PROBE_OFFSET_RANGE_MAX) * 100);
|
LIMIT(hmiValues.offset_value, (PROBE_OFFSET_ZMIN) * 100, (PROBE_OFFSET_ZMAX) * 100);
|
||||||
last_zoffset = dwin_zoffset;
|
last_zoffset = dwin_zoffset;
|
||||||
dwin_zoffset = hmiValues.offset_value / 100.0f;
|
dwin_zoffset = hmiValues.offset_value / 100.0f;
|
||||||
#if ANY(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP)
|
#if ANY(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP)
|
||||||
|
|
|
@ -2057,7 +2057,7 @@ void autoHome() { queue.inject_P(G28_STR); }
|
||||||
#if ANY(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP)
|
#if ANY(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP)
|
||||||
babystep.accum = round(planner.settings.axis_steps_per_mm[Z_AXIS] * BABY_Z_VAR);
|
babystep.accum = round(planner.settings.axis_steps_per_mm[Z_AXIS] * BABY_Z_VAR);
|
||||||
#endif
|
#endif
|
||||||
setPFloatOnClick(Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, 2, applyZOffset, liveZOffset);
|
setPFloatOnClick(PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX, 2, applyZOffset, liveZOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setMoveZto0() {
|
void setMoveZto0() {
|
||||||
|
|
|
@ -795,7 +795,7 @@ void RTS::handleData() {
|
||||||
tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100;
|
tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100;
|
||||||
else
|
else
|
||||||
tmp_zprobe_offset = float(recdat.data[0]) / 100;
|
tmp_zprobe_offset = float(recdat.data[0]) / 100;
|
||||||
if (WITHIN((tmp_zprobe_offset), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
|
if (WITHIN((tmp_zprobe_offset), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) {
|
||||||
int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, axis_t(Z));
|
int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, axis_t(Z));
|
||||||
if (tmpSteps == 0) tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1;
|
if (tmpSteps == 0) tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1;
|
||||||
smartAdjustAxis_steps(-tmpSteps, axis_t(Z), false);
|
smartAdjustAxis_steps(-tmpSteps, axis_t(Z), false);
|
||||||
|
@ -1116,7 +1116,7 @@ void RTS::handleData() {
|
||||||
#if HAS_BED_PROBE
|
#if HAS_BED_PROBE
|
||||||
|
|
||||||
case 2: { // Z-axis to Up
|
case 2: { // Z-axis to Up
|
||||||
if (WITHIN((getZOffset_mm() + 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
|
if (WITHIN((getZOffset_mm() + 0.1), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) {
|
||||||
smartAdjustAxis_steps(getAxisSteps_per_mm(Z) / 10, axis_t(Z), false);
|
smartAdjustAxis_steps(getAxisSteps_per_mm(Z) / 10, axis_t(Z), false);
|
||||||
//setZOffset_mm(getZOffset_mm() + 0.1);
|
//setZOffset_mm(getZOffset_mm() + 0.1);
|
||||||
sendData(getZOffset_mm() * 100, ProbeOffset_Z);
|
sendData(getZOffset_mm() * 100, ProbeOffset_Z);
|
||||||
|
@ -1125,7 +1125,7 @@ void RTS::handleData() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: { // Z-axis to Down
|
case 3: { // Z-axis to Down
|
||||||
if (WITHIN((getZOffset_mm() - 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
|
if (WITHIN((getZOffset_mm() - 0.1), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) {
|
||||||
smartAdjustAxis_steps(-getAxisSteps_per_mm(Z) / 10, axis_t(Z), false);
|
smartAdjustAxis_steps(-getAxisSteps_per_mm(Z) / 10, axis_t(Z), false);
|
||||||
//babystepAxis_steps(int16_t(-getAxisSteps_per_mm(Z)) / 10, axis_t(Z));
|
//babystepAxis_steps(int16_t(-getAxisSteps_per_mm(Z)) / 10, axis_t(Z));
|
||||||
//setZOffset_mm(getZOffset_mm() - 0.1);
|
//setZOffset_mm(getZOffset_mm() - 0.1);
|
||||||
|
|
|
@ -358,20 +358,20 @@ static void set_value_confirm() {
|
||||||
case x_offset: {
|
case x_offset: {
|
||||||
#if HAS_PROBE_XY_OFFSET
|
#if HAS_PROBE_XY_OFFSET
|
||||||
const float x = atof(key_value);
|
const float x = atof(key_value);
|
||||||
if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE))
|
if (WITHIN(x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX))
|
||||||
probe.offset.x = x;
|
probe.offset.x = x;
|
||||||
#endif
|
#endif
|
||||||
} break;
|
} break;
|
||||||
case y_offset: {
|
case y_offset: {
|
||||||
#if HAS_PROBE_XY_OFFSET
|
#if HAS_PROBE_XY_OFFSET
|
||||||
const float y = atof(key_value);
|
const float y = atof(key_value);
|
||||||
if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE))
|
if (WITHIN(y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX))
|
||||||
probe.offset.y = y;
|
probe.offset.y = y;
|
||||||
#endif
|
#endif
|
||||||
} break;
|
} break;
|
||||||
case z_offset: {
|
case z_offset: {
|
||||||
const float z = atof(key_value);
|
const float z = atof(key_value);
|
||||||
if (WITHIN(z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
|
if (WITHIN(z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX))
|
||||||
probe.offset.z = z;
|
probe.offset.z = z;
|
||||||
} break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -895,7 +895,7 @@ namespace ExtUI {
|
||||||
|
|
||||||
void setZOffset_mm(const_float_t value) {
|
void setZOffset_mm(const_float_t value) {
|
||||||
#if HAS_BED_PROBE
|
#if HAS_BED_PROBE
|
||||||
if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
|
if (WITHIN(value, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX))
|
||||||
probe.offset.z = value;
|
probe.offset.z = value;
|
||||||
#elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
|
#elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
|
||||||
babystep.add_mm(Z_AXIS, value - getZOffset_mm());
|
babystep.add_mm(Z_AXIS, value - getZOffset_mm());
|
||||||
|
|
|
@ -298,7 +298,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
|
||||||
, do_probe ? new_probe_offset : hotend_offset[active_extruder].z - diff
|
, do_probe ? new_probe_offset : hotend_offset[active_extruder].z - diff
|
||||||
, new_probe_offset
|
, new_probe_offset
|
||||||
);
|
);
|
||||||
if (WITHIN(new_offs, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
|
if (WITHIN(new_offs, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) {
|
||||||
|
|
||||||
babystep.add_steps(Z_AXIS, babystep_increment);
|
babystep.add_steps(Z_AXIS, babystep_increment);
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ typedef void (*selectFunc_t)();
|
||||||
#define SS_INVERT 0x04
|
#define SS_INVERT 0x04
|
||||||
#define SS_DEFAULT SS_CENTER
|
#define SS_DEFAULT SS_CENTER
|
||||||
|
|
||||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) && Z_PROBE_OFFSET_RANGE_MIN >= -9 && Z_PROBE_OFFSET_RANGE_MAX <= 9
|
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) && PROBE_OFFSET_ZMIN >= -9 && PROBE_OFFSET_ZMAX <= 9
|
||||||
#define BABYSTEP_TO_STR(N) ftostr43sign(N)
|
#define BABYSTEP_TO_STR(N) ftostr43sign(N)
|
||||||
#elif ENABLED(BABYSTEPPING)
|
#elif ENABLED(BABYSTEPPING)
|
||||||
#define BABYSTEP_TO_STR(N) ftostr53sign(N)
|
#define BABYSTEP_TO_STR(N) ftostr53sign(N)
|
||||||
|
|
|
@ -628,10 +628,10 @@ void menu_backlash();
|
||||||
START_MENU();
|
START_MENU();
|
||||||
BACK_ITEM(MSG_ADVANCED_SETTINGS);
|
BACK_ITEM(MSG_ADVANCED_SETTINGS);
|
||||||
#if HAS_PROBE_XY_OFFSET
|
#if HAS_PROBE_XY_OFFSET
|
||||||
EDIT_ITEM(float31sign, MSG_ZPROBE_XOFFSET, &probe.offset.x, -(X_BED_SIZE), X_BED_SIZE);
|
EDIT_ITEM(float31sign, MSG_ZPROBE_XOFFSET, &probe.offset.x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX);
|
||||||
EDIT_ITEM(float31sign, MSG_ZPROBE_YOFFSET, &probe.offset.y, -(Y_BED_SIZE), Y_BED_SIZE);
|
EDIT_ITEM(float31sign, MSG_ZPROBE_YOFFSET, &probe.offset.y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX);
|
||||||
#endif
|
#endif
|
||||||
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX);
|
||||||
|
|
||||||
#if ENABLED(PROBE_OFFSET_WIZARD)
|
#if ENABLED(PROBE_OFFSET_WIZARD)
|
||||||
SUBMENU(MSG_PROBE_WIZARD, goto_probe_offset_wizard);
|
SUBMENU(MSG_PROBE_WIZARD, goto_probe_offset_wizard);
|
||||||
|
|
|
@ -278,18 +278,18 @@ void menu_bed_leveling() {
|
||||||
// Mesh Bed Leveling Z-Offset
|
// Mesh Bed Leveling Z-Offset
|
||||||
//
|
//
|
||||||
#if ENABLED(MESH_BED_LEVELING)
|
#if ENABLED(MESH_BED_LEVELING)
|
||||||
#if WITHIN(Z_PROBE_OFFSET_RANGE_MIN, -9, 9)
|
#if WITHIN(PROBE_OFFSET_ZMIN, -9, 9)
|
||||||
#define LCD_Z_OFFSET_TYPE float43 // Values from -9.000 to +9.000
|
#define LCD_Z_OFFSET_TYPE float43 // Values from -9.000 to +9.000
|
||||||
#else
|
#else
|
||||||
#define LCD_Z_OFFSET_TYPE float42_52 // Values from -99.99 to 99.99
|
#define LCD_Z_OFFSET_TYPE float42_52 // Values from -99.99 to 99.99
|
||||||
#endif
|
#endif
|
||||||
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_MESH_Z_OFFSET, &bedlevel.z_offset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_MESH_Z_OFFSET, &bedlevel.z_offset, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||||
SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
|
SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
|
||||||
#elif HAS_BED_PROBE
|
#elif HAS_BED_PROBE
|
||||||
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(PROBE_OFFSET_WIZARD)
|
#if ENABLED(PROBE_OFFSET_WIZARD)
|
||||||
|
|
|
@ -562,7 +562,7 @@ void menu_configuration() {
|
||||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||||
SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
|
SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
|
||||||
#elif HAS_BED_PROBE
|
#elif HAS_BED_PROBE
|
||||||
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -163,7 +163,7 @@ DEFINE_MENU_EDIT_ITEM_TYPE(long5 ,uint32_t ,ftostr5rj , 0.01f
|
||||||
DEFINE_MENU_EDIT_ITEM_TYPE(long5_25 ,uint32_t ,ftostr5rj , 0.04f ); // 12345 right-justified (25 increment)
|
DEFINE_MENU_EDIT_ITEM_TYPE(long5_25 ,uint32_t ,ftostr5rj , 0.04f ); // 12345 right-justified (25 increment)
|
||||||
|
|
||||||
#if HAS_BED_PROBE
|
#if HAS_BED_PROBE
|
||||||
#if Z_PROBE_OFFSET_RANGE_MIN >= -9 && Z_PROBE_OFFSET_RANGE_MAX <= 9
|
#if WITHIN(PROBE_OFFSET_ZMIN, -9, 9)
|
||||||
#define LCD_Z_OFFSET_TYPE float43 // Values from -9.000 to +9.000
|
#define LCD_Z_OFFSET_TYPE float43 // Values from -9.000 to +9.000
|
||||||
#else
|
#else
|
||||||
#define LCD_Z_OFFSET_TYPE float42_52 // Values from -99.99 to 99.99
|
#define LCD_Z_OFFSET_TYPE float42_52 // Values from -99.99 to 99.99
|
||||||
|
|
|
@ -85,7 +85,7 @@ void moveAxis(const AxisEnum axis, const int8_t direction) {
|
||||||
, do_probe ? new_probe_offset : hotend_offset[active_extruder].z - bsDiff
|
, do_probe ? new_probe_offset : hotend_offset[active_extruder].z - bsDiff
|
||||||
, new_probe_offset
|
, new_probe_offset
|
||||||
);
|
);
|
||||||
if (WITHIN(new_offs, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
|
if (WITHIN(new_offs, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) {
|
||||||
babystep.add_steps(Z_AXIS, babystep_increment);
|
babystep.add_steps(Z_AXIS, babystep_increment);
|
||||||
if (do_probe)
|
if (do_probe)
|
||||||
probe.offset.z = new_offs;
|
probe.offset.z = new_offs;
|
||||||
|
@ -100,12 +100,12 @@ void moveAxis(const AxisEnum axis, const int8_t direction) {
|
||||||
#else
|
#else
|
||||||
// Only change probe.offset.z
|
// Only change probe.offset.z
|
||||||
probe.offset.z += diff;
|
probe.offset.z += diff;
|
||||||
if (direction < 0 && current_position.z < Z_PROBE_OFFSET_RANGE_MIN) {
|
if (direction < 0 && current_position.z < PROBE_OFFSET_ZMIN) {
|
||||||
current_position.z = Z_PROBE_OFFSET_RANGE_MIN;
|
current_position.z = PROBE_OFFSET_ZMIN;
|
||||||
drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS));
|
drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS));
|
||||||
}
|
}
|
||||||
else if (direction > 0 && current_position.z > Z_PROBE_OFFSET_RANGE_MAX) {
|
else if (direction > 0 && current_position.z > PROBE_OFFSET_ZMAX) {
|
||||||
current_position.z = Z_PROBE_OFFSET_RANGE_MAX;
|
current_position.z = PROBE_OFFSET_ZMAX;
|
||||||
drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS));
|
drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue