Browse Source

🚸 Machine-relative Z_STEPPER_ALIGN_XY (#24261)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
InsanityAutomation 2 years ago
parent
commit
bb3c5aa186
No account linked to committer's email address
2 changed files with 10 additions and 5 deletions
  1. 6
    3
      Marlin/Configuration_adv.h
  2. 4
    2
      Marlin/src/gcode/calibrate/G34_M422.cpp

+ 6
- 3
Marlin/Configuration_adv.h View File

937
  */
937
  */
938
 //#define Z_STEPPER_AUTO_ALIGN
938
 //#define Z_STEPPER_AUTO_ALIGN
939
 #if ENABLED(Z_STEPPER_AUTO_ALIGN)
939
 #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
+   */
943
   //#define Z_STEPPER_ALIGN_XY { {  10, 190 }, { 100,  10 }, { 190, 190 } }
946
   //#define Z_STEPPER_ALIGN_XY { {  10, 190 }, { 100,  10 }, { 190, 190 } }
944
 
947
 
945
   /**
948
   /**

+ 4
- 2
Marlin/src/gcode/calibrate/G34_M422.cpp View File

224
           // Safe clearance even on an incline
224
           // Safe clearance even on an incline
225
           if ((iteration == 0 || i > 0) && z_probe > current_position.z) do_blocking_move_to_z(z_probe);
225
           if ((iteration == 0 || i > 0) && z_probe > current_position.z) do_blocking_move_to_z(z_probe);
226
 
226
 
227
+          xy_pos_t &ppos = z_stepper_align.xy[iprobe];
228
+
227
           if (DEBUGGING(LEVELING))
229
           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);
229
 
231
 
230
           // Probe a Z height for each stepper.
232
           // Probe a Z height for each stepper.
231
           // Probing sanity check is disabled, as it would trigger even in normal cases because
233
           // Probing sanity check is disabled, as it would trigger even in normal cases because
232
           // current_position.z has been manually altered in the "dirty trick" above.
234
           // 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);
234
           if (isnan(z_probed_height)) {
236
           if (isnan(z_probed_height)) {
235
             SERIAL_ECHOLNPGM("Probing failed");
237
             SERIAL_ECHOLNPGM("Probing failed");
236
             LCD_MESSAGE(MSG_LCD_PROBING_FAILED);
238
             LCD_MESSAGE(MSG_LCD_PROBING_FAILED);

Loading…
Cancel
Save