Просмотр исходного кода

🚸 Machine-relative Z_STEPPER_ALIGN_XY (#24261)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
InsanityAutomation 2 лет назад
Родитель
Сommit
bb3c5aa186
Аккаунт пользователя с таким Email не найден
2 измененных файлов: 10 добавлений и 5 удалений
  1. 6
    3
      Marlin/Configuration_adv.h
  2. 4
    2
      Marlin/src/gcode/calibrate/G34_M422.cpp

+ 6
- 3
Marlin/Configuration_adv.h Просмотреть файл

@@ -937,9 +937,12 @@
937 937
  */
938 938
 //#define Z_STEPPER_AUTO_ALIGN
939 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 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 Просмотреть файл

@@ -224,13 +224,15 @@ void GcodeSuite::G34() {
224 224
           // Safe clearance even on an incline
225 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 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 232
           // Probe a Z height for each stepper.
231 233
           // Probing sanity check is disabled, as it would trigger even in normal cases because
232 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 236
           if (isnan(z_probed_height)) {
235 237
             SERIAL_ECHOLNPGM("Probing failed");
236 238
             LCD_MESSAGE(MSG_LCD_PROBING_FAILED);

Загрузка…
Отмена
Сохранить