|
@@ -459,8 +459,18 @@ bool Probe::set_deployed(const bool deploy) {
|
459
|
459
|
const char Probe::msg_wait_for_bed_heating[25] PROGMEM = "Wait for bed heating...\n";
|
460
|
460
|
#endif
|
461
|
461
|
|
462
|
|
-bool Probe::move_to_z(const float z, const feedRate_t fr_mm_s) {
|
463
|
|
- if (DEBUGGING(LEVELING)) DEBUG_POS(">>> Probe::move_to_z", current_position);
|
|
462
|
+/**
|
|
463
|
+ * @brief Move down until the probe triggers or the low limit is reached
|
|
464
|
+ *
|
|
465
|
+ * @details Used by run_z_probe to get each bed Z height measurement.
|
|
466
|
+ * Sets current_position.z to the height where the probe triggered
|
|
467
|
+ * (according to the Z stepper count). The float Z is propagated
|
|
468
|
+ * back to the planner.position to preempt any rounding error.
|
|
469
|
+ *
|
|
470
|
+ * @return TRUE if the probe failed to trigger.
|
|
471
|
+ */
|
|
472
|
+bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) {
|
|
473
|
+ if (DEBUGGING(LEVELING)) DEBUG_POS(">>> Probe::probe_down_to_z", current_position);
|
464
|
474
|
|
465
|
475
|
#if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER)
|
466
|
476
|
// Wait for bed to heat back up between probing points
|
|
@@ -536,7 +546,7 @@ bool Probe::move_to_z(const float z, const feedRate_t fr_mm_s) {
|
536
|
546
|
// Tell the planner where we actually are
|
537
|
547
|
sync_plan_position();
|
538
|
548
|
|
539
|
|
- if (DEBUGGING(LEVELING)) DEBUG_POS("<<< Probe::move_to_z", current_position);
|
|
549
|
+ if (DEBUGGING(LEVELING)) DEBUG_POS("<<< Probe::probe_down_to_z", current_position);
|
540
|
550
|
|
541
|
551
|
return !probe_triggered;
|
542
|
552
|
}
|
|
@@ -561,7 +571,7 @@ float Probe::run_z_probe() {
|
561
|
571
|
#if TOTAL_PROBING == 2
|
562
|
572
|
|
563
|
573
|
// Do a first probe at the fast speed
|
564
|
|
- if (move_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST))) {
|
|
574
|
+ if (probe_down_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST))) {
|
565
|
575
|
if (DEBUGGING(LEVELING)) {
|
566
|
576
|
DEBUG_ECHOLNPGM("FAST Probe fail!");
|
567
|
577
|
DEBUG_POS("<<< run_z_probe", current_position);
|
|
@@ -583,7 +593,7 @@ float Probe::run_z_probe() {
|
583
|
593
|
const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0 + (offset.z < 0 ? -offset.z : 0);
|
584
|
594
|
if (current_position.z > z) {
|
585
|
595
|
// Probe down fast. If the probe never triggered, raise for probe clearance
|
586
|
|
- if (!move_to_z(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST)))
|
|
596
|
+ if (!probe_down_to_z(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST)))
|
587
|
597
|
do_blocking_move_to_z(current_position.z + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
|
588
|
598
|
}
|
589
|
599
|
#endif
|
|
@@ -604,7 +614,7 @@ float Probe::run_z_probe() {
|
604
|
614
|
#endif
|
605
|
615
|
{
|
606
|
616
|
// Probe downward slowly to find the bed
|
607
|
|
- if (move_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW))) {
|
|
617
|
+ if (probe_down_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW))) {
|
608
|
618
|
if (DEBUGGING(LEVELING)) {
|
609
|
619
|
DEBUG_ECHOLNPGM("SLOW Probe fail!");
|
610
|
620
|
DEBUG_POS("<<< run_z_probe", current_position);
|