Add final Z raise after Delta probe

This commit is contained in:
Scott Lahteine 2015-08-11 16:10:59 -07:00 committed by Richard Wackerbarth
parent 8c768a76a2
commit fabf3ae4a0

View File

@ -1388,6 +1388,7 @@ static void setup_for_endstop_move() {
inline void do_blocking_move_to_xy(float x, float y) { do_blocking_move_to(x, y, current_position[Z_AXIS]); }
inline void do_blocking_move_to_x(float x) { do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS]); }
inline void do_blocking_move_to_z(float z) { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z); }
inline void raise_z_after_probing() { do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); }
static void clean_up_after_endstop_move() {
#if ENABLED(ENDSTOPS_ONLY_FOR_HOMING)
@ -1518,11 +1519,11 @@ static void setup_for_endstop_move() {
if (marlin_debug_flags & DEBUG_LEVELING) {
SERIAL_ECHOPAIR("Raise Z (after) by ", (float)Z_RAISE_AFTER_PROBING);
SERIAL_EOL;
SERIAL_ECHOPAIR("> SERVO_ENDSTOPS > do_blocking_move_to_z ", current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING);
SERIAL_ECHOPAIR("> SERVO_ENDSTOPS > raise_z_after_probing()");
SERIAL_EOL;
}
#endif
do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); // this also updates current_position
raise_z_after_probing(); // this also updates current_position
st_synchronize();
}
#endif
@ -1794,7 +1795,7 @@ static void setup_for_endstop_move() {
float oldXpos = current_position[X_AXIS]; // save x position
if (dock) {
#if Z_RAISE_AFTER_PROBING > 0
do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); // raise Z
raise_z_after_probing(); // raise Z
#endif
do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1); // Dock sled a bit closer to ensure proper capturing
digitalWrite(SLED_PIN, LOW); // turn off magnet
@ -3126,7 +3127,14 @@ inline void gcode_G28() {
#endif // !AUTO_BED_LEVELING_GRID
#if DISABLED(DELTA)
#if ENABLED(DELTA)
// Allen Key Probe for Delta
#if ENABLED(Z_PROBE_ALLEN_KEY)
stow_z_probe();
#elif Z_RAISE_AFTER_PROBING > 0
raise_z_after_probing();
#endif
#else // !DELTA
if (verbose_level > 0)
plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");
@ -3187,14 +3195,14 @@ inline void gcode_G28() {
}
#endif
}
#endif // !DELTA
// Sled assembly for Cartesian bots
#if ENABLED(Z_PROBE_SLED)
dock_sled(true); // dock the Z probe
#elif ENABLED(Z_PROBE_ALLEN_KEY) //|| SERVO_LEVELING
stow_z_probe();
dock_sled(true); // dock the sled
#endif
#endif // !DELTA
#ifdef Z_PROBE_END_SCRIPT
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (marlin_debug_flags & DEBUG_LEVELING) {