diff options
author | InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> | 2022-07-19 04:12:27 +0300 |
---|---|---|
committer | Scott Lahteine <thinkyhead@users.noreply.github.com> | 2022-07-29 14:09:35 +0300 |
commit | 406c2342fd5556a0c54a090f38b674cd82f9fa2a (patch) | |
tree | 355795633e9de97f80b8da86621897267b0eaa1e | |
parent | fa50d2c757f9b1fecc133d511c4fc1297842e184 (diff) |
🚸 Machine-relative Z_STEPPER_ALIGN_XY (#24261)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
-rw-r--r-- | Marlin/Configuration_adv.h | 9 | ||||
-rw-r--r-- | Marlin/src/gcode/calibrate/G34_M422.cpp | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 5f58541455..ca071a8460 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -923,9 +923,12 @@ */ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) - // Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]] - // If not defined, probe limits will be used. - // Override with 'M422 S<index> X<pos> Y<pos>' + /** + * Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]] + * These positions are machine-relative and do not shift with the M206 home offset! + * If not defined, probe limits will be used. + * Override with 'M422 S<index> X<pos> Y<pos>'. + */ //#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } } /** diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index d68207885d..8cf652cd84 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -224,13 +224,15 @@ void GcodeSuite::G34() { // Safe clearance even on an incline if ((iteration == 0 || i > 0) && z_probe > current_position.z) do_blocking_move_to_z(z_probe); + xy_pos_t &ppos = z_stepper_align.xy[iprobe]; + if (DEBUGGING(LEVELING)) - DEBUG_ECHOLNPGM_P(PSTR("Probing X"), z_stepper_align.xy[iprobe].x, SP_Y_STR, z_stepper_align.xy[iprobe].y); + DEBUG_ECHOLNPGM_P(PSTR("Probing X"), ppos.x, SP_Y_STR, ppos.y); // Probe a Z height for each stepper. // Probing sanity check is disabled, as it would trigger even in normal cases because // current_position.z has been manually altered in the "dirty trick" above. - const float z_probed_height = probe.probe_at_point(z_stepper_align.xy[iprobe], raise_after, 0, true, false); + const float z_probed_height = probe.probe_at_point(DIFF_TERN(HAS_HOME_OFFSET, ppos, xy_pos_t(home_offset)), raise_after, 0, true, false); if (isnan(z_probed_height)) { SERIAL_ECHOLNPGM("Probing failed"); LCD_MESSAGE(MSG_LCD_PROBING_FAILED); |