Skip to content

Commit

Permalink
Use implications from MarlinFirmware#4370 in run_z_probe()
Browse files Browse the repository at this point in the history
  • Loading branch information
AnHardt committed Jul 23, 2016
1 parent 5167cb4 commit 3788711
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2104,12 +2104,6 @@ static void clean_up_after_endstop_or_probe_move() {
return false;
}

#if ENABLED(DELTA)
#define SET_Z_FROM_STEPPERS() set_current_from_steppers()
#else
#define SET_Z_FROM_STEPPERS() current_position[Z_AXIS] = LOGICAL_POSITION(stepper.get_axis_position_mm(Z_AXIS), Z_AXIS)
#endif

// Do a single Z probe and return with current_position[Z_AXIS]
// at the height where the probe triggered.
static float run_z_probe() {
Expand All @@ -2121,28 +2115,18 @@ static void clean_up_after_endstop_or_probe_move() {
planner.bed_level_matrix.set_to_identity();
#endif

#if ENABLED(DELTA)
float z_before = current_position[Z_AXIS], // Current Z
z_mm = stepper.get_axis_position_mm(Z_AXIS); // Some tower's current position
#endif

do_blocking_move_to_z(-(Z_MAX_LENGTH + 10), Z_PROBE_SPEED_FAST);
endstops.hit_on_purpose();
SET_Z_FROM_STEPPERS();
set_current_from_steppers();
SYNC_PLAN_POSITION_KINEMATIC();

// move up the retract distance
do_blocking_move_to_z(current_position[Z_AXIS] + home_bump_mm(Z_AXIS), Z_PROBE_SPEED_FAST);

#if ENABLED(DELTA)
z_before = current_position[Z_AXIS];
z_mm = stepper.get_axis_position_mm(Z_AXIS);
#endif

// move back down slowly to find bed
do_blocking_move_to_z(current_position[Z_AXIS] - home_bump_mm(Z_AXIS) * 2, Z_PROBE_SPEED_SLOW);
endstops.hit_on_purpose();
SET_Z_FROM_STEPPERS();
set_current_from_steppers();
SYNC_PLAN_POSITION_KINEMATIC();

#if ENABLED(DEBUG_LEVELING_FEATURE)
Expand Down

0 comments on commit 3788711

Please # to comment.