Merge pull request #4821 from thinkyhead/rc_revert_to_raises

Z Raise/Clearance rather than Height
This commit is contained in:
Scott Lahteine
2016-09-22 15:30:07 -05:00
committed by GitHub
25 changed files with 387 additions and 167 deletions

View File

@@ -1657,7 +1657,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);
}
@@ -1911,7 +1914,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);
// When deploying make sure BLTOUCH is not already triggered
#if ENABLED(BLTOUCH)
@@ -2030,7 +2033,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));
@@ -2069,7 +2072,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)
@@ -2089,15 +2092,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: ");
@@ -3194,8 +3192,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
@@ -3206,7 +3204,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
@@ -3301,8 +3299,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
@@ -3645,7 +3643,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