Pass the z for after probing to retract_z_probe

A `z_before` value is passed to probe_pt, but the `retract_z_probe`
function assumes that Z is 0, doesn’t add `current_position[Z_AXIS]` as
other cases do. This may be superfluous, so this is a test, and will be
reverted if it has no effect.
This commit is contained in:
Scott Lahteine 2015-03-30 00:45:02 -07:00
parent e96db1cd6c
commit 41d258697a

View file

@ -1138,7 +1138,7 @@ inline void sync_plan_position() {
feedrate = homing_feedrate[Z_AXIS] / homing_bump_divisor[Z_AXIS]; feedrate = homing_feedrate[Z_AXIS] / homing_bump_divisor[Z_AXIS];
else { else {
feedrate = homing_feedrate[Z_AXIS] / 10; feedrate = homing_feedrate[Z_AXIS] / 10;
SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1");
} }
zPosition -= home_retract_mm(Z_AXIS) * 2; zPosition -= home_retract_mm(Z_AXIS) * 2;
@ -1255,17 +1255,17 @@ inline void sync_plan_position() {
} }
static void retract_z_probe() { static void retract_z_probe(const float z_after=Z_RAISE_AFTER_PROBING) {
#ifdef SERVO_ENDSTOPS #ifdef SERVO_ENDSTOPS
// Retract Z Servo endstop if enabled // Retract Z Servo endstop if enabled
if (servo_endstops[Z_AXIS] >= 0) { if (servo_endstops[Z_AXIS] >= 0) {
#if Z_RAISE_AFTER_PROBING > 0 if (z_after > 0) {
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING); do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_after);
st_synchronize(); st_synchronize();
#endif }
#if SERVO_LEVELING #if SERVO_LEVELING
servos[servo_endstops[Z_AXIS]].attach(0); servos[servo_endstops[Z_AXIS]].attach(0);
@ -1345,7 +1345,7 @@ inline void sync_plan_position() {
float measured_z = current_position[Z_AXIS]; float measured_z = current_position[Z_AXIS];
#if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY)
if (retract_action & ProbeRetract) retract_z_probe(); if (retract_action & ProbeRetract) retract_z_probe(z_before);
#endif #endif
if (verbose_level > 2) { if (verbose_level > 2) {
@ -1481,7 +1481,7 @@ static void homeaxis(int axis) {
feedrate = homing_feedrate[axis] / homing_bump_divisor[axis]; feedrate = homing_feedrate[axis] / homing_bump_divisor[axis];
else { else {
feedrate = homing_feedrate[axis] / 10; feedrate = homing_feedrate[axis] / 10;
SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1");
} }
line_to_destination(); line_to_destination();
@ -2315,7 +2315,7 @@ inline void gcode_G28() {
// raise extruder // raise extruder
float measured_z, float measured_z,
z_before = probePointCounter == 0 ? Z_RAISE_BEFORE_PROBING : current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS; z_before = Z_RAISE_BETWEEN_PROBINGS + (probePointCounter ? current_position[Z_AXIS] : 0);
#ifdef DELTA #ifdef DELTA
// Avoid probing the corners (outside the round or hexagon print surface) on a delta printer. // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer.