Apply home offsets to probing, Z Safe Homing (#19423)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b0f0dc683d
commit
6375829448
@ -361,32 +361,24 @@ G29_TYPE GcodeSuite::G29() {
|
||||
|
||||
if (parser.seen('H')) {
|
||||
const int16_t size = (int16_t)parser.value_linear_units();
|
||||
probe_position_lf.set(
|
||||
_MAX(X_CENTER - size / 2, x_min),
|
||||
_MAX(Y_CENTER - size / 2, y_min)
|
||||
);
|
||||
probe_position_rb.set(
|
||||
_MIN(probe_position_lf.x + size, x_max),
|
||||
_MIN(probe_position_lf.y + size, y_max)
|
||||
);
|
||||
probe_position_lf.set(_MAX((X_CENTER) - size / 2, x_min), _MAX((Y_CENTER) - size / 2, y_min));
|
||||
probe_position_rb.set(_MIN(probe_position_lf.x + size, x_max), _MIN(probe_position_lf.y + size, y_max));
|
||||
}
|
||||
else {
|
||||
probe_position_lf.set(
|
||||
parser.seenval('L') ? RAW_X_POSITION(parser.value_linear_units()) : x_min,
|
||||
parser.seenval('F') ? RAW_Y_POSITION(parser.value_linear_units()) : y_min
|
||||
);
|
||||
probe_position_rb.set(
|
||||
parser.seenval('R') ? RAW_X_POSITION(parser.value_linear_units()) : x_max,
|
||||
parser.seenval('B') ? RAW_Y_POSITION(parser.value_linear_units()) : y_max
|
||||
);
|
||||
probe_position_lf.set(parser.linearval('L', x_min), parser.linearval('F', y_min));
|
||||
probe_position_rb.set(parser.linearval('R', x_max), parser.linearval('B', y_max));
|
||||
}
|
||||
|
||||
if (!probe.good_bounds(probe_position_lf, probe_position_rb)) {
|
||||
if (DEBUGGING(LEVELING)) {
|
||||
DEBUG_ECHOLNPAIR("G29 L", probe_position_lf.x, " R", probe_position_rb.x,
|
||||
" F", probe_position_lf.y, " B", probe_position_rb.y);
|
||||
}
|
||||
SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds.");
|
||||
G29_RETURN(false);
|
||||
}
|
||||
|
||||
// probe at the points of a lattice grid
|
||||
// Probe at the points of a lattice grid
|
||||
gridSpacing.set((probe_position_rb.x - probe_position_lf.x) / (abl_grid_points.x - 1),
|
||||
(probe_position_rb.y - probe_position_lf.y) / (abl_grid_points.y - 1));
|
||||
|
||||
|
@ -126,7 +126,15 @@
|
||||
* Move the Z probe (or just the nozzle) to the safe homing point
|
||||
* (Z is already at the right height)
|
||||
*/
|
||||
destination.set(safe_homing_xy, current_position.z);
|
||||
constexpr xy_float_t safe_homing_xy = { Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT };
|
||||
#if HAS_HOME_OFFSET
|
||||
xy_float_t okay_homing_xy = safe_homing_xy;
|
||||
okay_homing_xy -= home_offset;
|
||||
#else
|
||||
constexpr xy_float_t okay_homing_xy = safe_homing_xy;
|
||||
#endif
|
||||
|
||||
destination.set(okay_homing_xy, current_position.z);
|
||||
|
||||
TERN_(HOMING_Z_WITH_PROBE, destination -= probe.offset_xy);
|
||||
|
||||
|
@ -28,6 +28,13 @@
|
||||
#include "../../module/motion.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
#include "../../libs/buzzer.h"
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
extern const char SP_Y_STR[], SP_Z_STR[];
|
||||
|
||||
void m206_report() {
|
||||
SERIAL_ECHOLNPAIR_P(PSTR("M206 X"), home_offset.x, SP_Y_STR, home_offset.y, SP_Z_STR, home_offset.z);
|
||||
}
|
||||
|
||||
/**
|
||||
* M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y
|
||||
@ -46,7 +53,10 @@ void GcodeSuite::M206() {
|
||||
if (parser.seen('P')) set_home_offset(B_AXIS, parser.value_float()); // Psi
|
||||
#endif
|
||||
|
||||
report_current_position();
|
||||
if (!parser.seen("XYZ"))
|
||||
m206_report();
|
||||
else
|
||||
report_current_position();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user