Browse Source

Allow weird probe values in G33

Scott Lahteine 4 years ago
parent
commit
cf597e2bb1
3 changed files with 9 additions and 9 deletions
  1. 1
    1
      Marlin/src/gcode/calibrate/G33.cpp
  2. 5
    5
      Marlin/src/module/probe.cpp
  3. 3
    3
      Marlin/src/module/probe.h

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

@@ -190,7 +190,7 @@ static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool
190 190
  */
191 191
 static float calibration_probe(const xy_pos_t &xy, const bool stow) {
192 192
   #if HAS_BED_PROBE
193
-    return probe.probe_at_point(xy, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true);
193
+    return probe.probe_at_point(xy, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true, false);
194 194
   #else
195 195
     UNUSED(stow);
196 196
     return lcd_probe_pt(xy);

+ 5
- 5
Marlin/src/module/probe.cpp View File

@@ -559,7 +559,7 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) {
559 559
  *
560 560
  * @return The Z position of the bed at the current XY or NAN on error.
561 561
  */
562
-float Probe::run_z_probe() {
562
+float Probe::run_z_probe(const bool sanity_check/*=true*/) {
563 563
 
564 564
   if (DEBUGGING(LEVELING)) DEBUG_POS(">>> Probe::run_z_probe", current_position);
565 565
 
@@ -572,7 +572,7 @@ float Probe::run_z_probe() {
572 572
 
573 573
     // Do a first probe at the fast speed
574 574
     if (probe_down_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST))         // No probe trigger?
575
-      || current_position.z > -offset.z + _MAX(Z_CLEARANCE_BETWEEN_PROBES, 4) / 2  // Probe triggered too high?
575
+      || (sanity_check && current_position.z > -offset.z + _MAX(Z_CLEARANCE_BETWEEN_PROBES, 4) / 2)  // Probe triggered too high?
576 576
     ) {
577 577
       if (DEBUGGING(LEVELING)) {
578 578
         DEBUG_ECHOLNPGM("FAST Probe fail!");
@@ -617,7 +617,7 @@ float Probe::run_z_probe() {
617 617
     {
618 618
       // Probe downward slowly to find the bed
619 619
       if (probe_down_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW))      // No probe trigger?
620
-        || current_position.z > -offset.z + _MAX(Z_CLEARANCE_MULTI_PROBE, 4) / 2  // Probe triggered too high?
620
+        || (sanity_check && current_position.z > -offset.z + _MAX(Z_CLEARANCE_MULTI_PROBE, 4) / 2)  // Probe triggered too high?
621 621
       ) {
622 622
         if (DEBUGGING(LEVELING)) {
623 623
           DEBUG_ECHOLNPGM("SLOW Probe fail!");
@@ -709,7 +709,7 @@ float Probe::run_z_probe() {
709 709
  *   - Raise to the BETWEEN height
710 710
  * - Return the probed Z position
711 711
  */
712
-float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/) {
712
+float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/, const bool sanity_check/*=true*/) {
713 713
   if (DEBUGGING(LEVELING)) {
714 714
     DEBUG_ECHOLNPAIR(
715 715
       ">>> Probe::probe_at_point(", LOGICAL_X_POSITION(rx), ", ", LOGICAL_Y_POSITION(ry),
@@ -751,7 +751,7 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise
751 751
   do_blocking_move_to(npos);
752 752
 
753 753
   float measured_z = NAN;
754
-  if (!deploy()) measured_z = run_z_probe() + offset.z;
754
+  if (!deploy()) measured_z = run_z_probe(sanity_check) + offset.z;
755 755
   if (!isnan(measured_z)) {
756 756
     const bool big_raise = raise_after == PROBE_PT_BIG_RAISE;
757 757
     if (big_raise || raise_after == PROBE_PT_RAISE)

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

@@ -48,8 +48,8 @@ public:
48 48
     #ifdef Z_AFTER_PROBING
49 49
       static void move_z_after_probing();
50 50
     #endif
51
-    static float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true);
52
-    static inline float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true) {
51
+    static float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true);
52
+    static inline float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true) {
53 53
       return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative);
54 54
     }
55 55
     #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER)
@@ -164,7 +164,7 @@ public:
164 164
 private:
165 165
   static bool probe_down_to_z(const float z, const feedRate_t fr_mm_s);
166 166
   static void do_z_raise(const float z_raise);
167
-  static float run_z_probe();
167
+  static float run_z_probe(const bool sanity_check=true);
168 168
 };
169 169
 
170 170
 extern Probe probe;

Loading…
Cancel
Save