Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Marlin/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,10 @@
#define XY_PROBE_SPEED 4000
#endif
#endif
#if Z_PROBE_TRAVEL_HEIGHT > Z_PROBE_DEPLOY_HEIGHT
#define _Z_PROBE_DEPLOY_HEIGHT Z_PROBE_TRAVEL_HEIGHT
#if Z_CLEARANCE_BETWEEN_PROBES > Z_CLEARANCE_DEPLOY_PROBE
#define _Z_CLEARANCE_DEPLOY_PROBE Z_CLEARANCE_BETWEEN_PROBES
#else
#define _Z_PROBE_DEPLOY_HEIGHT Z_PROBE_DEPLOY_HEIGHT
#define _Z_CLEARANCE_DEPLOY_PROBE Z_CLEARANCE_DEPLOY_PROBE
#endif
#else
#undef X_PROBE_OFFSET_FROM_EXTRUDER
Expand Down Expand Up @@ -681,17 +681,17 @@
#endif

/**
* Z_HOMING_HEIGHT / Z_PROBE_TRAVEL_HEIGHT
* Z_HOMING_HEIGHT / Z_CLEARANCE_BETWEEN_PROBES
*/
#ifndef Z_HOMING_HEIGHT
#ifndef Z_PROBE_TRAVEL_HEIGHT
#ifndef Z_CLEARANCE_BETWEEN_PROBES
#define Z_HOMING_HEIGHT 0
#else
#define Z_HOMING_HEIGHT Z_PROBE_TRAVEL_HEIGHT
#define Z_HOMING_HEIGHT Z_CLEARANCE_BETWEEN_PROBES
#endif
#endif
#ifndef Z_PROBE_TRAVEL_HEIGHT
#define Z_PROBE_TRAVEL_HEIGHT Z_HOMING_HEIGHT
#ifndef Z_CLEARANCE_BETWEEN_PROBES
#define Z_CLEARANCE_BETWEEN_PROBES Z_HOMING_HEIGHT
#endif

#if IS_KINEMATIC
Expand Down
22 changes: 16 additions & 6 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,22 @@
// Enable Z Probe Repeatability test to see how accurate your probe is
//#define Z_MIN_PROBE_REPEATABILITY_TEST

//
// Minimum heights for the probe to deploy/stow and travel.
// These values specify the distance from the NOZZLE to the BED.
//
#define Z_PROBE_DEPLOY_HEIGHT 15 // Z position for the probe to deploy/stow
#define Z_PROBE_TRAVEL_HEIGHT 5 // Z position for travel between points
/**
* Z probes require clearance when deploying, stowing, and moving between
* probe points to avoid hitting the bed and other hardware.
* Servo-mounted probes require extra space for the arm to rotate.
* Inductive probes need space to keep from triggering early.
*
* Use these settings to specify the distance (mm) to raise the probe (or
* lower the bed). The values set here apply over and above any (negative)
* probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD.
* Only integer values >= 1 are valid here.
*
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
* But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle.
*/
#define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points

//
// For M851 give a range for adjusting the Z probe offset
Expand Down
32 changes: 15 additions & 17 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,10 @@ static void clean_up_after_endstop_or_probe_move() {
SERIAL_ECHOLNPGM(")");
}
#endif

float z_dest = LOGICAL_Z_POSITION(z_raise);
if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset;

if (z_dest > current_position[Z_AXIS])
do_blocking_move_to_z(z_dest);
}
Expand Down Expand Up @@ -1879,7 +1882,7 @@ static void clean_up_after_endstop_or_probe_move() {
if (endstops.z_probe_enabled == deploy) return false;

// Make room for probe
do_probe_raise(_Z_PROBE_DEPLOY_HEIGHT);
do_probe_raise(_Z_CLEARANCE_DEPLOY_PROBE);

// Check BLTOUCH probe status for an error
#if ENABLED(BLTOUCH)
Expand Down Expand Up @@ -1988,7 +1991,7 @@ static void clean_up_after_endstop_or_probe_move() {

// If the nozzle is above the travel height then
// move down quickly before doing the slow probe
float z = LOGICAL_Z_POSITION(Z_PROBE_TRAVEL_HEIGHT);
float z = LOGICAL_Z_POSITION(Z_CLEARANCE_BETWEEN_PROBES);
if (z < current_position[Z_AXIS])
do_blocking_move_to_z(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST));

Expand Down Expand Up @@ -2027,7 +2030,7 @@ static void clean_up_after_endstop_or_probe_move() {
float old_feedrate_mm_s = feedrate_mm_s;

// Ensure a minimum height before moving the probe
do_probe_raise(Z_PROBE_TRAVEL_HEIGHT);
do_probe_raise(Z_CLEARANCE_BETWEEN_PROBES);

// Move to the XY where we shall probe
#if ENABLED(DEBUG_LEVELING_FEATURE)
Expand All @@ -2047,15 +2050,10 @@ static void clean_up_after_endstop_or_probe_move() {

float measured_z = run_z_probe();

if (stow) {
if (!stow)
do_probe_raise(Z_CLEARANCE_BETWEEN_PROBES);
else
if (STOW_PROBE()) return NAN;
}
else {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> do_probe_raise");
#endif
do_probe_raise(Z_PROBE_TRAVEL_HEIGHT);
}

if (verbose_level > 2) {
SERIAL_PROTOCOLPGM("Bed X: ");
Expand Down Expand Up @@ -3099,8 +3097,8 @@ inline void gcode_G28() {
feedrate_mm_s = homing_feedrate_mm_s[X_AXIS];

current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
#if Z_PROBE_TRAVEL_HEIGHT > Z_HOMING_HEIGHT
+ Z_PROBE_TRAVEL_HEIGHT
#if Z_CLEARANCE_BETWEEN_PROBES > Z_HOMING_HEIGHT
+ Z_CLEARANCE_BETWEEN_PROBES
#elif Z_HOMING_HEIGHT > 0
+ Z_HOMING_HEIGHT
#endif
Expand All @@ -3111,7 +3109,7 @@ inline void gcode_G28() {
current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
line_to_current_position();

#if Z_PROBE_TRAVEL_HEIGHT > 0 || Z_HOMING_HEIGHT > 0
#if Z_CLEARANCE_BETWEEN_PROBES > 0 || Z_HOMING_HEIGHT > 0
current_position[Z_AXIS] = LOGICAL_Z_POSITION(MESH_HOME_SEARCH_Z);
line_to_current_position();
#endif
Expand Down Expand Up @@ -3206,8 +3204,8 @@ inline void gcode_G28() {
else {
// One last "return to the bed" (as originally coded) at completion
current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
#if Z_PROBE_TRAVEL_HEIGHT > Z_HOMING_HEIGHT
+ Z_PROBE_TRAVEL_HEIGHT
#if Z_CLEARANCE_BETWEEN_PROBES > Z_HOMING_HEIGHT
+ Z_CLEARANCE_BETWEEN_PROBES
#elif Z_HOMING_HEIGHT > 0
+ Z_HOMING_HEIGHT
#endif
Expand Down Expand Up @@ -3560,7 +3558,7 @@ inline void gcode_G28() {

#endif // AUTO_BED_LEVELING_3POINT

// Raise to _Z_PROBE_DEPLOY_HEIGHT. Stow the probe.
// Raise to _Z_CLEARANCE_DEPLOY_PROBE. Stow the probe.
if (STOW_PROBE()) return;

// Restore state after probing
Expand Down
22 changes: 12 additions & 10 deletions Marlin/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@
#elif defined(MIN_Z_HEIGHT_FOR_HOMING)
#error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT. Please update your configuration."
#elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
#error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_PROBE_DEPLOY_HEIGHT instead."
#error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE instead."
#elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS)
#error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT Please update your configuration."
#error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration."
#elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
#error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration."
#elif !defined(MIN_STEPS_PER_SEGMENT)
#error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h.
#elif defined(PREVENT_DANGEROUS_EXTRUDE)
Expand Down Expand Up @@ -425,14 +427,14 @@
/**
* Make sure Z raise values are set
*/
#if !defined(Z_PROBE_DEPLOY_HEIGHT)
#error "You must set Z_PROBE_DEPLOY_HEIGHT in your configuration."
#elif !defined(Z_PROBE_TRAVEL_HEIGHT)
#error "You must set Z_PROBE_TRAVEL_HEIGHT in your configuration."
#elif Z_PROBE_DEPLOY_HEIGHT < 0
#error "Probes need Z_PROBE_DEPLOY_HEIGHT >= 0."
#elif Z_PROBE_TRAVEL_HEIGHT < 0
#error "Probes need Z_PROBE_TRAVEL_HEIGHT >= 0."
#if !defined(Z_CLEARANCE_DEPLOY_PROBE)
#error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
#elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
#error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
#elif Z_CLEARANCE_DEPLOY_PROBE < 0
#error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0."
#elif Z_CLEARANCE_BETWEEN_PROBES < 0
#error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
#endif

#else
Expand Down
22 changes: 16 additions & 6 deletions Marlin/example_configurations/Cartesio/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,12 +602,22 @@
// Enable Z Probe Repeatability test to see how accurate your probe is
//#define Z_MIN_PROBE_REPEATABILITY_TEST

//
// Minimum heights for the probe to deploy/stow and travel.
// These values specify the distance from the NOZZLE to the BED.
//
#define Z_PROBE_DEPLOY_HEIGHT 15 // Z position for the probe to deploy/stow
#define Z_PROBE_TRAVEL_HEIGHT 5 // Z position for travel between points
/**
* Z probes require clearance when deploying, stowing, and moving between
* probe points to avoid hitting the bed and other hardware.
* Servo-mounted probes require extra space for the arm to rotate.
* Inductive probes need space to keep from triggering early.
*
* Use these settings to specify the distance (mm) to raise the probe (or
* lower the bed). The values set here apply over and above any (negative)
* probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD.
* Only integer values >= 1 are valid here.
*
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
* But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle.
*/
#define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points

//
// For M851 give a range for adjusting the Z probe offset
Expand Down
22 changes: 16 additions & 6 deletions Marlin/example_configurations/Felix/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,12 +585,22 @@
// Enable Z Probe Repeatability test to see how accurate your probe is
//#define Z_MIN_PROBE_REPEATABILITY_TEST

//
// Minimum heights for the probe to deploy/stow and travel.
// These values specify the distance from the NOZZLE to the BED.
//
#define Z_PROBE_DEPLOY_HEIGHT 15 // Z position for the probe to deploy/stow
#define Z_PROBE_TRAVEL_HEIGHT 5 // Z position for travel between points
/**
* Z probes require clearance when deploying, stowing, and moving between
* probe points to avoid hitting the bed and other hardware.
* Servo-mounted probes require extra space for the arm to rotate.
* Inductive probes need space to keep from triggering early.
*
* Use these settings to specify the distance (mm) to raise the probe (or
* lower the bed). The values set here apply over and above any (negative)
* probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD.
* Only integer values >= 1 are valid here.
*
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
* But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle.
*/
#define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points

//
// For M851 give a range for adjusting the Z probe offset
Expand Down
22 changes: 16 additions & 6 deletions Marlin/example_configurations/Felix/DUAL/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -583,12 +583,22 @@
// Enable Z Probe Repeatability test to see how accurate your probe is
//#define Z_MIN_PROBE_REPEATABILITY_TEST

//
// Minimum heights for the probe to deploy/stow and travel.
// These values specify the distance from the NOZZLE to the BED.
//
#define Z_PROBE_DEPLOY_HEIGHT 15 // Z position for the probe to deploy/stow
#define Z_PROBE_TRAVEL_HEIGHT 5 // Z position for travel between points
/**
* Z probes require clearance when deploying, stowing, and moving between
* probe points to avoid hitting the bed and other hardware.
* Servo-mounted probes require extra space for the arm to rotate.
* Inductive probes need space to keep from triggering early.
*
* Use these settings to specify the distance (mm) to raise the probe (or
* lower the bed). The values set here apply over and above any (negative)
* probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD.
* Only integer values >= 1 are valid here.
*
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
* But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle.
*/
#define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points

//
// For M851 give a range for adjusting the Z probe offset
Expand Down
22 changes: 16 additions & 6 deletions Marlin/example_configurations/Hephestos/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -594,12 +594,22 @@
// Enable Z Probe Repeatability test to see how accurate your probe is
//#define Z_MIN_PROBE_REPEATABILITY_TEST

//
// Minimum heights for the probe to deploy/stow and travel.
// These values specify the distance from the NOZZLE to the BED.
//
#define Z_PROBE_DEPLOY_HEIGHT 15 // Z position for the probe to deploy/stow
#define Z_PROBE_TRAVEL_HEIGHT 5 // Z position for travel between points
/**
* Z probes require clearance when deploying, stowing, and moving between
* probe points to avoid hitting the bed and other hardware.
* Servo-mounted probes require extra space for the arm to rotate.
* Inductive probes need space to keep from triggering early.
*
* Use these settings to specify the distance (mm) to raise the probe (or
* lower the bed). The values set here apply over and above any (negative)
* probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD.
* Only integer values >= 1 are valid here.
*
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
* But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle.
*/
#define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points

//
// For M851 give a range for adjusting the Z probe offset
Expand Down
22 changes: 16 additions & 6 deletions Marlin/example_configurations/Hephestos_2/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -596,12 +596,22 @@
// Enable Z Probe Repeatability test to see how accurate your probe is
//#define Z_MIN_PROBE_REPEATABILITY_TEST

//
// Minimum heights for the probe to deploy/stow and travel.
// These values specify the distance from the NOZZLE to the BED.
//
#define Z_PROBE_DEPLOY_HEIGHT 5 // Z position for the probe to deploy/stow
#define Z_PROBE_TRAVEL_HEIGHT 2 // Z position for travel between points
/**
* Z probes require clearance when deploying, stowing, and moving between
* probe points to avoid hitting the bed and other hardware.
* Servo-mounted probes require extra space for the arm to rotate.
* Inductive probes need space to keep from triggering early.
*
* Use these settings to specify the distance (mm) to raise the probe (or
* lower the bed). The values set here apply over and above any (negative)
* probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD.
* Only integer values >= 1 are valid here.
*
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
* But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle.
*/
#define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 2 // Z Clearance between probe points

//
// For M851 give a range for adjusting the Z probe offset
Expand Down
22 changes: 16 additions & 6 deletions Marlin/example_configurations/K8200/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,22 @@
// Enable Z Probe Repeatability test to see how accurate your probe is
//#define Z_MIN_PROBE_REPEATABILITY_TEST

//
// Minimum heights for the probe to deploy/stow and travel.
// These values specify the distance from the NOZZLE to the BED.
//
#define Z_PROBE_DEPLOY_HEIGHT 15 // Z position for the probe to deploy/stow
#define Z_PROBE_TRAVEL_HEIGHT 5 // Z position for travel between points
/**
* Z probes require clearance when deploying, stowing, and moving between
* probe points to avoid hitting the bed and other hardware.
* Servo-mounted probes require extra space for the arm to rotate.
* Inductive probes need space to keep from triggering early.
*
* Use these settings to specify the distance (mm) to raise the probe (or
* lower the bed). The values set here apply over and above any (negative)
* probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD.
* Only integer values >= 1 are valid here.
*
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
* But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle.
*/
#define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points

//
// For M851 give a range for adjusting the Z probe offset
Expand Down
Loading