Skip to content

Commit b954cc4

Browse files
InsanityAutomationthinkyhead
authored andcommitted
🚸 Machine-relative Z_STEPPER_ALIGN_XY (MarlinFirmware#24261)
Co-authored-by: Scott Lahteine <[email protected]>
1 parent a6b133b commit b954cc4

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Marlin/Configuration_adv.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -937,9 +937,12 @@
937937
*/
938938
//#define Z_STEPPER_AUTO_ALIGN
939939
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
940-
// Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
941-
// If not defined, probe limits will be used.
942-
// Override with 'M422 S<index> X<pos> Y<pos>'
940+
/**
941+
* Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
942+
* These positions are machine-relative and do not shift with the M206 home offset!
943+
* If not defined, probe limits will be used.
944+
* Override with 'M422 S<index> X<pos> Y<pos>'.
945+
*/
943946
//#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }
944947

945948
/**

Marlin/src/gcode/calibrate/G34_M422.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,15 @@ void GcodeSuite::G34() {
224224
// Safe clearance even on an incline
225225
if ((iteration == 0 || i > 0) && z_probe > current_position.z) do_blocking_move_to_z(z_probe);
226226

227+
xy_pos_t &ppos = z_stepper_align.xy[iprobe];
228+
227229
if (DEBUGGING(LEVELING))
228-
DEBUG_ECHOLNPGM_P(PSTR("Probing X"), z_stepper_align.xy[iprobe].x, SP_Y_STR, z_stepper_align.xy[iprobe].y);
230+
DEBUG_ECHOLNPGM_P(PSTR("Probing X"), ppos.x, SP_Y_STR, ppos.y);
229231

230232
// Probe a Z height for each stepper.
231233
// Probing sanity check is disabled, as it would trigger even in normal cases because
232234
// current_position.z has been manually altered in the "dirty trick" above.
233-
const float z_probed_height = probe.probe_at_point(z_stepper_align.xy[iprobe], raise_after, 0, true, false);
235+
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);
234236
if (isnan(z_probed_height)) {
235237
SERIAL_ECHOLNPGM("Probing failed");
236238
LCD_MESSAGE(MSG_LCD_PROBING_FAILED);

0 commit comments

Comments
 (0)