Fix MIN_PROBE_EDGE bug in default ABL G29 (#16367)

This commit is contained in:
Jason Smith
2020-01-03 17:46:26 -06:00
committed by Scott Lahteine
parent d7aee3b7b6
commit 3cade6245e
17 changed files with 175 additions and 110 deletions

View File

@@ -39,8 +39,9 @@
* E Engage the probe for each probe (default 1)
*/
void GcodeSuite::G30() {
const xy_pos_t pos = { parser.linearval('X', current_position.x + probe_offset.x),
parser.linearval('Y', current_position.y + probe_offset.y) };
const xy_pos_t pos = { parser.linearval('X', current_position.x + probe_offset_xy.x),
parser.linearval('Y', current_position.y + probe_offset_xy.y) };
if (!position_is_reachable_by_probe(pos)) return;

View File

@@ -37,32 +37,49 @@ void GcodeSuite::M851() {
// Show usage with no parameters
if (!parser.seen("XYZ")) {
SERIAL_ECHOLNPAIR_P(PSTR(MSG_PROBE_OFFSET " X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR, probe_offset.z);
SERIAL_ECHOLNPAIR_P(
#if HAS_PROBE_XY_OFFSET
PSTR(MSG_PROBE_OFFSET " X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR
#else
PSTR(MSG_PROBE_OFFSET " X0 Y0 Z")
#endif
, probe_offset.z
);
return;
}
// Start with current offsets and modify
xyz_pos_t offs = probe_offset;
// Assume no errors
bool ok = true;
if (parser.seenval('X')) {
const float x = parser.value_float();
if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE))
offs.x = x;
else {
SERIAL_ECHOLNPAIR("?X out of range (-", int(X_BED_SIZE), " to ", int(X_BED_SIZE), ")");
ok = false;
}
#if HAS_PROBE_XY_OFFSET
if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE))
offs.x = x;
else {
SERIAL_ECHOLNPAIR("?X out of range (-", int(X_BED_SIZE), " to ", int(X_BED_SIZE), ")");
ok = false;
}
#else
if (x) SERIAL_ECHOLNPAIR("?X must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
#endif
}
if (parser.seenval('Y')) {
const float y = parser.value_float();
if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE))
offs.y = y;
else {
SERIAL_ECHOLNPAIR("?Y out of range (-", int(Y_BED_SIZE), " to ", int(Y_BED_SIZE), ")");
ok = false;
}
#if HAS_PROBE_XY_OFFSET
if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE))
offs.y = y;
else {
SERIAL_ECHOLNPAIR("?Y out of range (-", int(Y_BED_SIZE), " to ", int(Y_BED_SIZE), ")");
ok = false;
}
#else
if (y) SERIAL_ECHOLNPAIR("?Y must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
#endif
}
if (parser.seenval('Z')) {