|
|
|
@ -539,28 +539,15 @@ static bool do_probe_move(const float z, const float fr_mm_m) {
|
|
|
|
|
*
|
|
|
|
|
* @return The raw Z position where the probe was triggered
|
|
|
|
|
*/
|
|
|
|
|
#define HAS_CALIBRATION_PROBE (ENABLED(DELTA_AUTO_CALIBRATION) && Z_PROBE_LOW_POINT < 0)
|
|
|
|
|
static float run_z_probe(
|
|
|
|
|
#if HAS_CALIBRATION_PROBE
|
|
|
|
|
const bool is_calibration
|
|
|
|
|
#endif
|
|
|
|
|
) {
|
|
|
|
|
static float run_z_probe() {
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS(">>> run_z_probe", current_position);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if Z_PROBE_LOW_POINT < 0
|
|
|
|
|
// Stop the probe before it goes too low to prevent damage.
|
|
|
|
|
// If Z isn't known or this is a "calibration probe" then probe to -10mm.
|
|
|
|
|
#if !HAS_CALIBRATION_PROBE
|
|
|
|
|
constexpr bool is_calibration = false;
|
|
|
|
|
#endif
|
|
|
|
|
const float z_probe_low_point = !is_calibration && axis_known_position[Z_AXIS] ? -zprobe_zoffset + Z_PROBE_LOW_POINT : -10.0;
|
|
|
|
|
#else
|
|
|
|
|
// Assertively move down in all cases
|
|
|
|
|
constexpr float z_probe_low_point = -10.0;
|
|
|
|
|
#endif
|
|
|
|
|
// If Z isn't known then probe to -10mm.
|
|
|
|
|
const float z_probe_low_point = axis_known_position[Z_AXIS] ? -zprobe_zoffset + Z_PROBE_LOW_POINT : -10.0;
|
|
|
|
|
|
|
|
|
|
// Double-probing does a fast probe followed by a slow probe
|
|
|
|
|
#if MULTIPLE_PROBING == 2
|
|
|
|
@ -645,14 +632,14 @@ static float run_z_probe(
|
|
|
|
|
* - Raise to the BETWEEN height
|
|
|
|
|
* - Return the probed Z position
|
|
|
|
|
*/
|
|
|
|
|
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*/) {
|
|
|
|
|
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*/) {
|
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
|
if (DEBUGGING(LEVELING)) {
|
|
|
|
|
SERIAL_ECHOPAIR(">>> probe_pt(", LOGICAL_X_POSITION(rx));
|
|
|
|
|
SERIAL_ECHOPAIR(", ", LOGICAL_Y_POSITION(ry));
|
|
|
|
|
SERIAL_ECHOPAIR(", ", raise_after == PROBE_PT_RAISE ? "raise" : raise_after == PROBE_PT_STOW ? "stow" : "none");
|
|
|
|
|
SERIAL_ECHOPAIR(", ", int(verbose_level));
|
|
|
|
|
SERIAL_ECHOPAIR(", ", is_calibration ? "nozzle" : "probe");
|
|
|
|
|
SERIAL_ECHOPAIR(", ", probe_relative ? "probe" : "nozzle");
|
|
|
|
|
SERIAL_ECHOLNPGM("_relative)");
|
|
|
|
|
DEBUG_POS("", current_position);
|
|
|
|
|
}
|
|
|
|
@ -660,7 +647,7 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/
|
|
|
|
|
|
|
|
|
|
// TODO: Adapt for SCARA, where the offset rotates
|
|
|
|
|
float nx = rx, ny = ry;
|
|
|
|
|
if (!is_calibration) {
|
|
|
|
|
if (probe_relative) {
|
|
|
|
|
if (!position_is_reachable_by_probe(rx, ry)) return NAN; // The given position is in terms of the probe
|
|
|
|
|
nx -= (X_PROBE_OFFSET_FROM_EXTRUDER); // Get the nozzle position
|
|
|
|
|
ny -= (Y_PROBE_OFFSET_FROM_EXTRUDER);
|
|
|
|
@ -684,11 +671,7 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/
|
|
|
|
|
|
|
|
|
|
float measured_z = NAN;
|
|
|
|
|
if (!DEPLOY_PROBE()) {
|
|
|
|
|
measured_z = run_z_probe(
|
|
|
|
|
#if HAS_CALIBRATION_PROBE
|
|
|
|
|
is_calibration
|
|
|
|
|
#endif
|
|
|
|
|
) + zprobe_zoffset;
|
|
|
|
|
measured_z = run_z_probe() + zprobe_zoffset;
|
|
|
|
|
|
|
|
|
|
if (raise_after == PROBE_PT_RAISE)
|
|
|
|
|
do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
|
|
|
|
|