|
@@ -539,17 +539,34 @@ 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
|
|
-static float run_z_probe() {
|
|
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
|
+) {
|
543
|
548
|
|
544
|
549
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
545
|
550
|
if (DEBUGGING(LEVELING)) DEBUG_POS(">>> run_z_probe", current_position);
|
546
|
551
|
#endif
|
547
|
552
|
|
|
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
|
|
564
|
+
|
548
|
565
|
// Double-probing does a fast probe followed by a slow probe
|
549
|
566
|
#if MULTIPLE_PROBING == 2
|
550
|
567
|
|
551
|
568
|
// Do a first probe at the fast speed
|
552
|
|
- if (do_probe_move(-10, Z_PROBE_SPEED_FAST)) return NAN;
|
|
569
|
+ if (do_probe_move(z_probe_low_point, Z_PROBE_SPEED_FAST)) return NAN;
|
553
|
570
|
|
554
|
571
|
float first_probe_z = current_position[Z_AXIS];
|
555
|
572
|
|
|
@@ -580,7 +597,7 @@ static float run_z_probe() {
|
580
|
597
|
#endif
|
581
|
598
|
|
582
|
599
|
// Move down slowly to find bed, not too far
|
583
|
|
- if (do_probe_move(-10, Z_PROBE_SPEED_SLOW)) return NAN;
|
|
600
|
+ if (do_probe_move(z_probe_low_point, Z_PROBE_SPEED_SLOW)) return NAN;
|
584
|
601
|
|
585
|
602
|
#if MULTIPLE_PROBING > 2
|
586
|
603
|
probes_total += current_position[Z_AXIS];
|
|
@@ -628,14 +645,14 @@ static float run_z_probe() {
|
628
|
645
|
* - Raise to the BETWEEN height
|
629
|
646
|
* - Return the probed Z position
|
630
|
647
|
*/
|
631
|
|
-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*/) {
|
|
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*/) {
|
632
|
649
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
633
|
650
|
if (DEBUGGING(LEVELING)) {
|
634
|
651
|
SERIAL_ECHOPAIR(">>> probe_pt(", LOGICAL_X_POSITION(rx));
|
635
|
652
|
SERIAL_ECHOPAIR(", ", LOGICAL_Y_POSITION(ry));
|
636
|
653
|
SERIAL_ECHOPAIR(", ", raise_after == PROBE_PT_RAISE ? "raise" : raise_after == PROBE_PT_STOW ? "stow" : "none");
|
637
|
654
|
SERIAL_ECHOPAIR(", ", int(verbose_level));
|
638
|
|
- SERIAL_ECHOPAIR(", ", probe_relative ? "probe" : "nozzle");
|
|
655
|
+ SERIAL_ECHOPAIR(", ", is_calibration ? "nozzle" : "probe");
|
639
|
656
|
SERIAL_ECHOLNPGM("_relative)");
|
640
|
657
|
DEBUG_POS("", current_position);
|
641
|
658
|
}
|
|
@@ -643,7 +660,7 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/
|
643
|
660
|
|
644
|
661
|
// TODO: Adapt for SCARA, where the offset rotates
|
645
|
662
|
float nx = rx, ny = ry;
|
646
|
|
- if (probe_relative) {
|
|
663
|
+ if (!is_calibration) {
|
647
|
664
|
if (!position_is_reachable_by_probe(rx, ry)) return NAN; // The given position is in terms of the probe
|
648
|
665
|
nx -= (X_PROBE_OFFSET_FROM_EXTRUDER); // Get the nozzle position
|
649
|
666
|
ny -= (Y_PROBE_OFFSET_FROM_EXTRUDER);
|
|
@@ -667,7 +684,11 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/
|
667
|
684
|
|
668
|
685
|
float measured_z = NAN;
|
669
|
686
|
if (!DEPLOY_PROBE()) {
|
670
|
|
- measured_z = run_z_probe() + zprobe_zoffset;
|
|
687
|
+ measured_z = run_z_probe(
|
|
688
|
+ #if HAS_CALIBRATION_PROBE
|
|
689
|
+ is_calibration
|
|
690
|
+ #endif
|
|
691
|
+ ) + zprobe_zoffset;
|
671
|
692
|
|
672
|
693
|
if (raise_after == PROBE_PT_RAISE)
|
673
|
694
|
do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
|