瀏覽代碼

[2.0.x] G33 clean up (#12648)

Remove obsolete workarounds in G33 for the now fixed zprobe_zoffset bug
Luc Van Daele 6 年之前
父節點
當前提交
c6e09c2689
共有 3 個檔案被更改,包括 15 行新增58 行删除
  1. 13
    54
      Marlin/src/gcode/calibrate/G33.cpp
  2. 0
    2
      Marlin/src/lcd/menu/menu_delta_calibrate.cpp
  3. 2
    2
      Marlin/src/module/motion.cpp

+ 13
- 54
Marlin/src/gcode/calibrate/G33.cpp 查看文件

140
   if ((!end_stops && tower_angles) || (end_stops && !tower_angles)) { // XOR
140
   if ((!end_stops && tower_angles) || (end_stops && !tower_angles)) { // XOR
141
     SERIAL_ECHOPAIR("  Radius:", delta_radius);
141
     SERIAL_ECHOPAIR("  Radius:", delta_radius);
142
   }
142
   }
143
-  #if HAS_BED_PROBE
144
-    if (!end_stops && !tower_angles) {
145
-      SERIAL_ECHO_SP(30);
146
-      print_signed_float(PSTR("Offset"), zprobe_zoffset);
147
-    }
148
-  #endif
149
   SERIAL_EOL();
143
   SERIAL_EOL();
150
 }
144
 }
151
 
145
 
194
 /**
188
 /**
195
  *  - Probe a point
189
  *  - Probe a point
196
  */
190
  */
197
-static float calibration_probe(const float &nx, const float &ny, const bool stow, const bool set_up) {
191
+static float calibration_probe(const float &nx, const float &ny, const bool stow) {
198
   #if HAS_BED_PROBE
192
   #if HAS_BED_PROBE
199
-    return probe_pt(nx, ny, set_up ? PROBE_PT_BIG_RAISE : stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, false);
193
+    return probe_pt(nx, ny, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, false);
200
   #else
194
   #else
201
     UNUSED(stow);
195
     UNUSED(stow);
202
-    UNUSED(set_up);
203
     return lcd_probe_pt(nx, ny);
196
     return lcd_probe_pt(nx, ny);
204
   #endif
197
   #endif
205
 }
198
 }
206
 
199
 
207
-#if HAS_BED_PROBE && HAS_LCD_MENU
208
-  static float probe_z_shift(const float center) {
209
-    STOW_PROBE();
210
-    endstops.enable_z_probe(false);
211
-    float z_shift = lcd_probe_pt(0, 0) - center;
212
-    endstops.enable_z_probe(true);
213
-    return z_shift;
214
-  }
215
-#endif
216
-
217
 /**
200
 /**
218
  *  - Probe a grid
201
  *  - Probe a grid
219
  */
202
  */
220
-static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_points, const bool towers_set, const bool stow_after_each, const bool set_up) {
203
+static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_points, const bool towers_set, const bool stow_after_each) {
221
   const bool _0p_calibration      = probe_points == 0,
204
   const bool _0p_calibration      = probe_points == 0,
222
              _1p_calibration      = probe_points == 1 || probe_points == -1,
205
              _1p_calibration      = probe_points == 1 || probe_points == -1,
223
              _4p_calibration      = probe_points == 2,
206
              _4p_calibration      = probe_points == 2,
240
   if (!_0p_calibration) {
223
   if (!_0p_calibration) {
241
 
224
 
242
     if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center
225
     if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center
243
-      z_pt[CEN] += calibration_probe(0, 0, stow_after_each, set_up);
226
+      z_pt[CEN] += calibration_probe(0, 0, stow_after_each);
244
       if (isnan(z_pt[CEN])) return false;
227
       if (isnan(z_pt[CEN])) return false;
245
     }
228
     }
246
 
229
 
250
       I_LOOP_CAL_PT(rad, start, steps) {
233
       I_LOOP_CAL_PT(rad, start, steps) {
251
         const float a = RADIANS(210 + (360 / NPP) *  (rad - 1)),
234
         const float a = RADIANS(210 + (360 / NPP) *  (rad - 1)),
252
                     r = delta_calibration_radius * 0.1;
235
                     r = delta_calibration_radius * 0.1;
253
-        z_pt[CEN] += calibration_probe(cos(a) * r, sin(a) * r, stow_after_each, set_up);
236
+        z_pt[CEN] += calibration_probe(cos(a) * r, sin(a) * r, stow_after_each);
254
         if (isnan(z_pt[CEN])) return false;
237
         if (isnan(z_pt[CEN])) return false;
255
      }
238
      }
256
       z_pt[CEN] /= float(_7p_2_intermediates ? 7 : probe_points);
239
       z_pt[CEN] /= float(_7p_2_intermediates ? 7 : probe_points);
274
           const float a = RADIANS(210 + (360 / NPP) *  (rad - 1)),
257
           const float a = RADIANS(210 + (360 / NPP) *  (rad - 1)),
275
                       r = delta_calibration_radius * (1 - 0.1 * (zig_zag ? offset - circle : circle)),
258
                       r = delta_calibration_radius * (1 - 0.1 * (zig_zag ? offset - circle : circle)),
276
                       interpol = FMOD(rad, 1);
259
                       interpol = FMOD(rad, 1);
277
-          const float z_temp = calibration_probe(cos(a) * r, sin(a) * r, stow_after_each, set_up);
260
+          const float z_temp = calibration_probe(cos(a) * r, sin(a) * r, stow_after_each);
278
           if (isnan(z_temp)) return false;
261
           if (isnan(z_temp)) return false;
279
           // split probe point to neighbouring calibration points
262
           // split probe point to neighbouring calibration points
280
           z_pt[uint8_t(LROUND(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90)));
263
           z_pt[uint8_t(LROUND(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90)));
403
  *
386
  *
404
  * Parameters:
387
  * Parameters:
405
  *
388
  *
406
- *   S   Setup mode; disables probe protection
407
- *
408
  *   Pn  Number of probe points:
389
  *   Pn  Number of probe points:
409
- *      P-1      Checks the z_offset with a center probe and paper test.
410
  *      P0       Normalizes calibration.
390
  *      P0       Normalizes calibration.
411
  *      P1       Calibrates height only with center probe.
391
  *      P1       Calibrates height only with center probe.
412
  *      P2       Probe center and towers. Calibrate height, endstops and delta radius.
392
  *      P2       Probe center and towers. Calibrate height, endstops and delta radius.
429
  */
409
  */
430
 void GcodeSuite::G33() {
410
 void GcodeSuite::G33() {
431
 
411
 
432
-  const bool set_up =
433
-    #if HAS_BED_PROBE
434
-      parser.seen('S');
435
-    #else
436
-      false;
437
-    #endif
438
-
439
-  const int8_t probe_points = set_up ? 2 : parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS);
440
-  if (!WITHIN(probe_points, -1, 10)) {
441
-    SERIAL_ECHOLNPGM("?(P)oints is implausible (-1 - 10).");
412
+  const int8_t probe_points = parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS);
413
+  if (!WITHIN(probe_points, 0, 10)) {
414
+    SERIAL_ECHOLNPGM("?(P)oints is implausible (0-10).");
442
     return;
415
     return;
443
   }
416
   }
444
 
417
 
445
   const bool towers_set = !parser.seen('T');
418
   const bool towers_set = !parser.seen('T');
446
 
419
 
447
-  const float calibration_precision = set_up ? Z_CLEARANCE_BETWEEN_PROBES / 5.0 : parser.floatval('C', 0.0);
420
+  const float calibration_precision = parser.floatval('C', 0.0);
448
   if (calibration_precision < 0) {
421
   if (calibration_precision < 0) {
449
     SERIAL_ECHOLNPGM("?(C)alibration precision is implausible (>=0).");
422
     SERIAL_ECHOLNPGM("?(C)alibration precision is implausible (>=0).");
450
     return;
423
     return;
452
 
425
 
453
   const int8_t force_iterations = parser.intval('F', 0);
426
   const int8_t force_iterations = parser.intval('F', 0);
454
   if (!WITHIN(force_iterations, 0, 30)) {
427
   if (!WITHIN(force_iterations, 0, 30)) {
455
-    SERIAL_ECHOLNPGM("?(F)orce iteration is implausible (0 - 30).");
428
+    SERIAL_ECHOLNPGM("?(F)orce iteration is implausible (0-30).");
456
     return;
429
     return;
457
   }
430
   }
458
 
431
 
459
   const int8_t verbose_level = parser.byteval('V', 1);
432
   const int8_t verbose_level = parser.byteval('V', 1);
460
   if (!WITHIN(verbose_level, 0, 3)) {
433
   if (!WITHIN(verbose_level, 0, 3)) {
461
-    SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0 - 3).");
434
+    SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-3).");
462
     return;
435
     return;
463
   }
436
   }
464
 
437
 
465
   const bool stow_after_each = parser.seen('E');
438
   const bool stow_after_each = parser.seen('E');
466
 
439
 
467
-  if (set_up) {
468
-    delta_height = 999.99;
469
-    delta_radius = DELTA_PRINTABLE_RADIUS;
470
-    ZERO(delta_endstop_adj);
471
-    ZERO(delta_tower_angle_trim);
472
-    recalc_delta_settings();
473
-  }
474
-
475
   const bool _0p_calibration      = probe_points == 0,
440
   const bool _0p_calibration      = probe_points == 0,
476
              _1p_calibration      = probe_points == 1 || probe_points == -1,
441
              _1p_calibration      = probe_points == 1 || probe_points == -1,
477
              _4p_calibration      = probe_points == 2,
442
              _4p_calibration      = probe_points == 2,
520
   PGM_P checkingac = PSTR("Checking... AC");
485
   PGM_P checkingac = PSTR("Checking... AC");
521
   serialprintPGM(checkingac);
486
   serialprintPGM(checkingac);
522
   if (verbose_level == 0) SERIAL_ECHOPGM(" (DRY-RUN)");
487
   if (verbose_level == 0) SERIAL_ECHOPGM(" (DRY-RUN)");
523
-  if (set_up) SERIAL_ECHOPGM("  (SET-UP)");
524
   SERIAL_EOL();
488
   SERIAL_EOL();
525
   ui.set_status_P(checkingac);
489
   ui.set_status_P(checkingac);
526
 
490
 
539
 
503
 
540
     // Probe the points
504
     // Probe the points
541
     zero_std_dev_old = zero_std_dev;
505
     zero_std_dev_old = zero_std_dev;
542
-    if (!probe_calibration_points(z_at_pt, probe_points, towers_set, stow_after_each, set_up)) {
506
+    if (!probe_calibration_points(z_at_pt, probe_points, towers_set, stow_after_each)) {
543
       SERIAL_ECHOLNPGM("Correct delta settings with M665 and M666");
507
       SERIAL_ECHOLNPGM("Correct delta settings with M665 and M666");
544
       return AC_CLEANUP();
508
       return AC_CLEANUP();
545
     }
509
     }
587
       delta_calibration_radius = cr_old;
551
       delta_calibration_radius = cr_old;
588
 
552
 
589
       switch (probe_points) {
553
       switch (probe_points) {
590
-        case -1:
591
-          #if HAS_BED_PROBE && HAS_LCD_MENU
592
-            zprobe_zoffset += probe_z_shift(z_at_pt[CEN]);
593
-          #endif
594
-
595
         case 0:
554
         case 0:
596
           test_precision = 0.00; // forced end
555
           test_precision = 0.00; // forced end
597
           break;
556
           break;

+ 0
- 2
Marlin/src/lcd/menu/menu_delta_calibrate.cpp 查看文件

111
 
111
 
112
   #if ENABLED(DELTA_AUTO_CALIBRATION)
112
   #if ENABLED(DELTA_AUTO_CALIBRATION)
113
     MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33"));
113
     MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33"));
114
-    MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 S P1"));
115
-    MENU_ITEM(gcode, MSG_DELTA_Z_OFFSET_CALIBRATE, PSTR("G33 P-1"));
116
     #if ENABLED(EEPROM_SETTINGS)
114
     #if ENABLED(EEPROM_SETTINGS)
117
       MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings);
115
       MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings);
118
       MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings);
116
       MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings);

+ 2
- 2
Marlin/src/module/motion.cpp 查看文件

539
       soft_endstop_min[axis] = base_min_pos(axis);
539
       soft_endstop_min[axis] = base_min_pos(axis);
540
       soft_endstop_max[axis] = (axis == Z_AXIS ? delta_height
540
       soft_endstop_max[axis] = (axis == Z_AXIS ? delta_height
541
       #if HAS_BED_PROBE
541
       #if HAS_BED_PROBE
542
-        - zprobe_zoffset + Z_PROBE_OFFSET_FROM_EXTRUDER
542
+        - zprobe_zoffset
543
       #endif
543
       #endif
544
       : base_max_pos(axis));
544
       : base_max_pos(axis));
545
 
545
 
1277
   #elif ENABLED(DELTA)
1277
   #elif ENABLED(DELTA)
1278
     current_position[axis] = (axis == Z_AXIS ? delta_height
1278
     current_position[axis] = (axis == Z_AXIS ? delta_height
1279
     #if HAS_BED_PROBE
1279
     #if HAS_BED_PROBE
1280
-      - zprobe_zoffset + Z_PROBE_OFFSET_FROM_EXTRUDER
1280
+      - zprobe_zoffset
1281
     #endif
1281
     #endif
1282
     : base_home_pos(axis));
1282
     : base_home_pos(axis));
1283
   #else
1283
   #else

Loading…
取消
儲存