@@ -147,7 +147,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
147
147
WRITE (MAGLEV_TRIGGER_PIN, LOW);
148
148
}
149
149
150
- inline void maglev_idle () { do_blocking_move_to_z (10 ); }
150
+ inline void maglev_idle () { do_z_clearance (10 ); }
151
151
152
152
#elif ENABLED(TOUCH_MI_PROBE)
153
153
@@ -749,7 +749,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
749
749
if (DEBUGGING (LEVELING)) DEBUG_ECHOLNPGM (" 1st Probe Z:" , first_probe_z);
750
750
751
751
// Raise to give the probe clearance
752
- do_blocking_move_to_z (current_position.z + Z_CLEARANCE_MULTI_PROBE, z_probe_fast_mm_s );
752
+ do_z_clearance (current_position.z + Z_CLEARANCE_MULTI_PROBE);
753
753
754
754
#elif Z_PROBE_FEEDRATE_FAST != Z_PROBE_FEEDRATE_SLOW
755
755
@@ -759,7 +759,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
759
759
if (current_position.z > z) {
760
760
// Probe down fast. If the probe never triggered, raise for probe clearance
761
761
if (!probe_down_to_z (z, z_probe_fast_mm_s))
762
- do_blocking_move_to_z (current_position.z + Z_CLEARANCE_BETWEEN_PROBES, z_probe_fast_mm_s );
762
+ do_z_clearance (current_position.z + Z_CLEARANCE_BETWEEN_PROBES);
763
763
}
764
764
#endif
765
765
@@ -810,7 +810,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
810
810
#if EXTRA_PROBING > 0
811
811
< TOTAL_PROBING - 1
812
812
#endif
813
- ) do_blocking_move_to_z (z + Z_CLEARANCE_MULTI_PROBE, z_probe_fast_mm_s );
813
+ ) do_z_clearance (z + Z_CLEARANCE_MULTI_PROBE);
814
814
#endif
815
815
}
816
816
@@ -878,13 +878,16 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
878
878
}
879
879
880
880
#if ENABLED(BLTOUCH)
881
- if (bltouch. high_speed_mode && bltouch. triggered ())
882
- bltouch._reset ();
881
+ // Reset a BLTouch in HS mode if already triggered
882
+ if (bltouch. high_speed_mode && bltouch. triggered ()) bltouch._reset ();
883
883
#endif
884
884
885
+ // Use a safe Z height for the XY move
886
+ const float safe_z = _MAX (current_position.z , SUM_TERN (BLTOUCH, Z_CLEARANCE_BETWEEN_PROBES, bltouch.z_extra_clearance ()));
887
+
885
888
// On delta keep Z below clip height or do_blocking_move_to will abort
886
889
xyz_pos_t npos = NUM_AXIS_ARRAY (
887
- rx, ry, TERN (DELTA, _MIN (delta_clip_start_height, current_position. z ), current_position. z ),
890
+ rx, ry, TERN (DELTA, _MIN (delta_clip_start_height, safe_z ), safe_z ),
888
891
current_position.i , current_position.j , current_position.k ,
889
892
current_position.u , current_position.v , current_position.w
890
893
);
@@ -907,17 +910,22 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
907
910
TERN_ (HAS_PTC, ptc.apply_compensation (measured_z));
908
911
TERN_ (X_AXIS_TWIST_COMPENSATION, measured_z += xatc.compensation (npos + offset_xy));
909
912
}
913
+
914
+ // Deploy succeeded and a successful measurement was done.
915
+ // Raise and/or stow the probe depending on 'raise_after' and settings.
910
916
if (!isnan (measured_z)) {
911
- const bool big_raise = raise_after == PROBE_PT_BIG_RAISE;
912
- if (big_raise || raise_after == PROBE_PT_RAISE)
913
- do_blocking_move_to_z (current_position.z + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES), z_probe_fast_mm_s);
914
- else if (raise_after == PROBE_PT_STOW || raise_after == PROBE_PT_LAST_STOW)
917
+ const ProbePtRaise raise_type = (TERN0 (BLTOUCH, !bltouch.high_speed_mode ) && raise_after == PROBE_PT_RAISE) ? PROBE_PT_STOW : raise_after;
918
+ const bool big_raise = raise_type == PROBE_PT_BIG_RAISE;
919
+ if (big_raise || raise_type == PROBE_PT_RAISE)
920
+ do_z_clearance (current_position.z + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES));
921
+ else if (raise_type == PROBE_PT_STOW || raise_type == PROBE_PT_LAST_STOW)
915
922
if (stow ()) measured_z = NAN; // Error on stow?
916
923
917
924
if (verbose_level > 2 )
918
925
SERIAL_ECHOLNPGM (" Bed X: " , LOGICAL_X_POSITION (rx), " Y: " , LOGICAL_Y_POSITION (ry), " Z: " , measured_z);
919
926
}
920
927
928
+ // If any error occurred stow the probe and set an alert
921
929
if (isnan (measured_z)) {
922
930
stow ();
923
931
LCD_MESSAGE (MSG_LCD_PROBING_FAILED);
0 commit comments