Browse Source

Allow weird probe values in G33

Scott Lahteine 5 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
  */
190
  */
191
 static float calibration_probe(const xy_pos_t &xy, const bool stow) {
191
 static float calibration_probe(const xy_pos_t &xy, const bool stow) {
192
   #if HAS_BED_PROBE
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
   #else
194
   #else
195
     UNUSED(stow);
195
     UNUSED(stow);
196
     return lcd_probe_pt(xy);
196
     return lcd_probe_pt(xy);

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

559
  *
559
  *
560
  * @return The Z position of the bed at the current XY or NAN on error.
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
   if (DEBUGGING(LEVELING)) DEBUG_POS(">>> Probe::run_z_probe", current_position);
564
   if (DEBUGGING(LEVELING)) DEBUG_POS(">>> Probe::run_z_probe", current_position);
565
 
565
 
572
 
572
 
573
     // Do a first probe at the fast speed
573
     // Do a first probe at the fast speed
574
     if (probe_down_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST))         // No probe trigger?
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
       if (DEBUGGING(LEVELING)) {
577
       if (DEBUGGING(LEVELING)) {
578
         DEBUG_ECHOLNPGM("FAST Probe fail!");
578
         DEBUG_ECHOLNPGM("FAST Probe fail!");
617
     {
617
     {
618
       // Probe downward slowly to find the bed
618
       // Probe downward slowly to find the bed
619
       if (probe_down_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW))      // No probe trigger?
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
         if (DEBUGGING(LEVELING)) {
622
         if (DEBUGGING(LEVELING)) {
623
           DEBUG_ECHOLNPGM("SLOW Probe fail!");
623
           DEBUG_ECHOLNPGM("SLOW Probe fail!");
709
  *   - Raise to the BETWEEN height
709
  *   - Raise to the BETWEEN height
710
  * - Return the probed Z position
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
   if (DEBUGGING(LEVELING)) {
713
   if (DEBUGGING(LEVELING)) {
714
     DEBUG_ECHOLNPAIR(
714
     DEBUG_ECHOLNPAIR(
715
       ">>> Probe::probe_at_point(", LOGICAL_X_POSITION(rx), ", ", LOGICAL_Y_POSITION(ry),
715
       ">>> Probe::probe_at_point(", LOGICAL_X_POSITION(rx), ", ", LOGICAL_Y_POSITION(ry),
751
   do_blocking_move_to(npos);
751
   do_blocking_move_to(npos);
752
 
752
 
753
   float measured_z = NAN;
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
   if (!isnan(measured_z)) {
755
   if (!isnan(measured_z)) {
756
     const bool big_raise = raise_after == PROBE_PT_BIG_RAISE;
756
     const bool big_raise = raise_after == PROBE_PT_BIG_RAISE;
757
     if (big_raise || raise_after == PROBE_PT_RAISE)
757
     if (big_raise || raise_after == PROBE_PT_RAISE)

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

48
     #ifdef Z_AFTER_PROBING
48
     #ifdef Z_AFTER_PROBING
49
       static void move_z_after_probing();
49
       static void move_z_after_probing();
50
     #endif
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
       return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative);
53
       return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative);
54
     }
54
     }
55
     #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER)
55
     #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER)
164
 private:
164
 private:
165
   static bool probe_down_to_z(const float z, const feedRate_t fr_mm_s);
165
   static bool probe_down_to_z(const float z, const feedRate_t fr_mm_s);
166
   static void do_z_raise(const float z_raise);
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
 extern Probe probe;
170
 extern Probe probe;

Loading…
Cancel
Save