Browse Source

Low Point for delta calibration (#10363)

Luc Van Daele 7 years ago
parent
commit
ac2e0afb62
3 changed files with 10 additions and 27 deletions
  1. 1
    1
      Marlin/src/gcode/calibrate/G33.cpp
  2. 8
    25
      Marlin/src/module/probe.cpp
  3. 1
    1
      Marlin/src/module/probe.h

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

@@ -137,7 +137,7 @@ static void G33_cleanup(
137 137
 
138 138
 inline float calibration_probe(const float nx, const float ny, const bool stow) {
139 139
   #if HAS_BED_PROBE
140
-    return probe_pt(nx, ny, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true);
140
+    return probe_pt(nx, ny, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, false);
141 141
   #else
142 142
     UNUSED(stow);
143 143
     return lcd_probe_pt(nx, ny);

+ 8
- 25
Marlin/src/module/probe.cpp View File

@@ -539,28 +539,15 @@ static bool do_probe_move(const float z, const float fr_mm_m) {
539 539
  *
540 540
  * @return The raw Z position where the probe was triggered
541 541
  */
542
-#define HAS_CALIBRATION_PROBE (ENABLED(DELTA_AUTO_CALIBRATION) && Z_PROBE_LOW_POINT < 0)
543
-static float run_z_probe(
544
-  #if HAS_CALIBRATION_PROBE
545
-    const bool is_calibration
546
-  #endif
547
-) {
542
+  static float run_z_probe() {
548 543
 
549 544
   #if ENABLED(DEBUG_LEVELING_FEATURE)
550 545
     if (DEBUGGING(LEVELING)) DEBUG_POS(">>> run_z_probe", current_position);
551 546
   #endif
552 547
 
553
-  #if Z_PROBE_LOW_POINT < 0
554
-    // Stop the probe before it goes too low to prevent damage.
555
-    // If Z isn't known or this is a "calibration probe" then probe to -10mm.
556
-    #if !HAS_CALIBRATION_PROBE
557
-      constexpr bool is_calibration = false;
558
-    #endif
559
-    const float z_probe_low_point = !is_calibration && axis_known_position[Z_AXIS] ? -zprobe_zoffset + Z_PROBE_LOW_POINT : -10.0;
560
-  #else
561
-    // Assertively move down in all cases
562
-    constexpr float z_probe_low_point = -10.0;
563
-  #endif
548
+  // Stop the probe before it goes too low to prevent damage.
549
+  // If Z isn't known then probe to -10mm.
550
+  const float z_probe_low_point = axis_known_position[Z_AXIS] ? -zprobe_zoffset + Z_PROBE_LOW_POINT : -10.0;
564 551
 
565 552
   // Double-probing does a fast probe followed by a slow probe
566 553
   #if MULTIPLE_PROBING == 2
@@ -645,14 +632,14 @@ static float run_z_probe(
645 632
  *   - Raise to the BETWEEN height
646 633
  * - Return the probed Z position
647 634
  */
648
-float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool is_calibration/*=false*/) {
635
+float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/) {
649 636
   #if ENABLED(DEBUG_LEVELING_FEATURE)
650 637
     if (DEBUGGING(LEVELING)) {
651 638
       SERIAL_ECHOPAIR(">>> probe_pt(", LOGICAL_X_POSITION(rx));
652 639
       SERIAL_ECHOPAIR(", ", LOGICAL_Y_POSITION(ry));
653 640
       SERIAL_ECHOPAIR(", ", raise_after == PROBE_PT_RAISE ? "raise" : raise_after == PROBE_PT_STOW ? "stow" : "none");
654 641
       SERIAL_ECHOPAIR(", ", int(verbose_level));
655
-      SERIAL_ECHOPAIR(", ", is_calibration ? "nozzle" : "probe");
642
+      SERIAL_ECHOPAIR(", ", probe_relative ? "probe" : "nozzle");
656 643
       SERIAL_ECHOLNPGM("_relative)");
657 644
       DEBUG_POS("", current_position);
658 645
     }
@@ -660,7 +647,7 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/
660 647
 
661 648
   // TODO: Adapt for SCARA, where the offset rotates
662 649
   float nx = rx, ny = ry;
663
-  if (!is_calibration) {
650
+  if (probe_relative) {
664 651
     if (!position_is_reachable_by_probe(rx, ry)) return NAN;  // The given position is in terms of the probe
665 652
     nx -= (X_PROBE_OFFSET_FROM_EXTRUDER);                     // Get the nozzle position
666 653
     ny -= (Y_PROBE_OFFSET_FROM_EXTRUDER);
@@ -684,11 +671,7 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/
684 671
 
685 672
   float measured_z = NAN;
686 673
   if (!DEPLOY_PROBE()) {
687
-    measured_z = run_z_probe(
688
-      #if HAS_CALIBRATION_PROBE
689
-        is_calibration
690
-      #endif
691
-    ) + zprobe_zoffset;
674
+    measured_z = run_z_probe() + zprobe_zoffset;
692 675
 
693 676
     if (raise_after == PROBE_PT_RAISE)
694 677
       do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST));

+ 1
- 1
Marlin/src/module/probe.h View File

@@ -40,7 +40,7 @@
40 40
     PROBE_PT_STOW,  // Do a complete stow after run_z_probe
41 41
     PROBE_PT_RAISE  // Raise to "between" clearance after run_z_probe
42 42
   };
43
-  float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool is_calibration=false);
43
+  float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true);
44 44
   #define DEPLOY_PROBE() set_probe_deployed(true)
45 45
   #define STOW_PROBE() set_probe_deployed(false)
46 46
 #else

Loading…
Cancel
Save