From 41d258697ac7e272e6dc54cb93722e0b4462a8b4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Mar 2015 00:45:02 -0700 Subject: [PATCH] Pass the z for after probing to retract_z_probe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Marlin/Marlin_main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d92f2ae8c5..e58836cb94 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1138,7 +1138,7 @@ inline void sync_plan_position() { feedrate = homing_feedrate[Z_AXIS] / homing_bump_divisor[Z_AXIS]; else { 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; @@ -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 // Retract Z Servo endstop if enabled if (servo_endstops[Z_AXIS] >= 0) { - #if Z_RAISE_AFTER_PROBING > 0 - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING); + if (z_after > 0) { + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_after); st_synchronize(); - #endif + } #if SERVO_LEVELING servos[servo_endstops[Z_AXIS]].attach(0); @@ -1345,7 +1345,7 @@ inline void sync_plan_position() { float measured_z = current_position[Z_AXIS]; #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 if (verbose_level > 2) { @@ -1481,7 +1481,7 @@ static void homeaxis(int axis) { feedrate = homing_feedrate[axis] / homing_bump_divisor[axis]; else { 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(); @@ -2315,7 +2315,7 @@ inline void gcode_G28() { // raise extruder 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 // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer.