Browse Source

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

Remove obsolete workarounds in G33 for the now fixed zprobe_zoffset bug
Luc Van Daele 6 years ago
parent
commit
c6e09c2689

+ 13
- 54
Marlin/src/gcode/calibrate/G33.cpp View File

@@ -140,12 +140,6 @@ static void print_calibration_settings(const bool end_stops, const bool tower_an
140 140
   if ((!end_stops && tower_angles) || (end_stops && !tower_angles)) { // XOR
141 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 143
   SERIAL_EOL();
150 144
 }
151 145
 
@@ -194,30 +188,19 @@ static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool
194 188
 /**
195 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 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 194
   #else
201 195
     UNUSED(stow);
202
-    UNUSED(set_up);
203 196
     return lcd_probe_pt(nx, ny);
204 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 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 204
   const bool _0p_calibration      = probe_points == 0,
222 205
              _1p_calibration      = probe_points == 1 || probe_points == -1,
223 206
              _4p_calibration      = probe_points == 2,
@@ -240,7 +223,7 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi
240 223
   if (!_0p_calibration) {
241 224
 
242 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 227
       if (isnan(z_pt[CEN])) return false;
245 228
     }
246 229
 
@@ -250,7 +233,7 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi
250 233
       I_LOOP_CAL_PT(rad, start, steps) {
251 234
         const float a = RADIANS(210 + (360 / NPP) *  (rad - 1)),
252 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 237
         if (isnan(z_pt[CEN])) return false;
255 238
      }
256 239
       z_pt[CEN] /= float(_7p_2_intermediates ? 7 : probe_points);
@@ -274,7 +257,7 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi
274 257
           const float a = RADIANS(210 + (360 / NPP) *  (rad - 1)),
275 258
                       r = delta_calibration_radius * (1 - 0.1 * (zig_zag ? offset - circle : circle)),
276 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 261
           if (isnan(z_temp)) return false;
279 262
           // split probe point to neighbouring calibration points
280 263
           z_pt[uint8_t(LROUND(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90)));
@@ -403,10 +386,7 @@ static float auto_tune_a() {
403 386
  *
404 387
  * Parameters:
405 388
  *
406
- *   S   Setup mode; disables probe protection
407
- *
408 389
  *   Pn  Number of probe points:
409
- *      P-1      Checks the z_offset with a center probe and paper test.
410 390
  *      P0       Normalizes calibration.
411 391
  *      P1       Calibrates height only with center probe.
412 392
  *      P2       Probe center and towers. Calibrate height, endstops and delta radius.
@@ -429,22 +409,15 @@ static float auto_tune_a() {
429 409
  */
430 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 415
     return;
443 416
   }
444 417
 
445 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 421
   if (calibration_precision < 0) {
449 422
     SERIAL_ECHOLNPGM("?(C)alibration precision is implausible (>=0).");
450 423
     return;
@@ -452,26 +425,18 @@ void GcodeSuite::G33() {
452 425
 
453 426
   const int8_t force_iterations = parser.intval('F', 0);
454 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 429
     return;
457 430
   }
458 431
 
459 432
   const int8_t verbose_level = parser.byteval('V', 1);
460 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 435
     return;
463 436
   }
464 437
 
465 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 440
   const bool _0p_calibration      = probe_points == 0,
476 441
              _1p_calibration      = probe_points == 1 || probe_points == -1,
477 442
              _4p_calibration      = probe_points == 2,
@@ -520,7 +485,6 @@ void GcodeSuite::G33() {
520 485
   PGM_P checkingac = PSTR("Checking... AC");
521 486
   serialprintPGM(checkingac);
522 487
   if (verbose_level == 0) SERIAL_ECHOPGM(" (DRY-RUN)");
523
-  if (set_up) SERIAL_ECHOPGM("  (SET-UP)");
524 488
   SERIAL_EOL();
525 489
   ui.set_status_P(checkingac);
526 490
 
@@ -539,7 +503,7 @@ void GcodeSuite::G33() {
539 503
 
540 504
     // Probe the points
541 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 507
       SERIAL_ECHOLNPGM("Correct delta settings with M665 and M666");
544 508
       return AC_CLEANUP();
545 509
     }
@@ -587,11 +551,6 @@ void GcodeSuite::G33() {
587 551
       delta_calibration_radius = cr_old;
588 552
 
589 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 554
         case 0:
596 555
           test_precision = 0.00; // forced end
597 556
           break;

+ 0
- 2
Marlin/src/lcd/menu/menu_delta_calibrate.cpp View File

@@ -111,8 +111,6 @@ void menu_delta_calibrate() {
111 111
 
112 112
   #if ENABLED(DELTA_AUTO_CALIBRATION)
113 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 114
     #if ENABLED(EEPROM_SETTINGS)
117 115
       MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings);
118 116
       MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings);

+ 2
- 2
Marlin/src/module/motion.cpp View File

@@ -539,7 +539,7 @@ void clean_up_after_endstop_or_probe_move() { bracket_probe_move(false); }
539 539
       soft_endstop_min[axis] = base_min_pos(axis);
540 540
       soft_endstop_max[axis] = (axis == Z_AXIS ? delta_height
541 541
       #if HAS_BED_PROBE
542
-        - zprobe_zoffset + Z_PROBE_OFFSET_FROM_EXTRUDER
542
+        - zprobe_zoffset
543 543
       #endif
544 544
       : base_max_pos(axis));
545 545
 
@@ -1277,7 +1277,7 @@ void set_axis_is_at_home(const AxisEnum axis) {
1277 1277
   #elif ENABLED(DELTA)
1278 1278
     current_position[axis] = (axis == Z_AXIS ? delta_height
1279 1279
     #if HAS_BED_PROBE
1280
-      - zprobe_zoffset + Z_PROBE_OFFSET_FROM_EXTRUDER
1280
+      - zprobe_zoffset
1281 1281
     #endif
1282 1282
     : base_home_pos(axis));
1283 1283
   #else

Loading…
Cancel
Save