Clean up quick_home_xy()

Since we do the actual homing now in the 'normal' routines `quick_home_xy()`
can be simplified to a relative simple diagonal move.
This commit is contained in:
AnHardt 2016-07-08 13:40:38 +02:00
parent 98d0167a57
commit 653eff3b31

View file

@ -2779,8 +2779,6 @@ inline void gcode_G4() {
int x_axis_home_dir = home_dir(X_AXIS); int x_axis_home_dir = home_dir(X_AXIS);
#endif #endif
SYNC_PLAN_POSITION_KINEMATIC();
float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS), float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS),
mlratio = mlx > mly ? mly / mlx : mlx / mly; mlratio = mlx > mly ? mly / mlx : mlx / mly;
@ -2789,30 +2787,9 @@ inline void gcode_G4() {
feedrate = min(homing_feedrate[X_AXIS], homing_feedrate[Y_AXIS]) * sqrt(mlratio * mlratio + 1); feedrate = min(homing_feedrate[X_AXIS], homing_feedrate[Y_AXIS]) * sqrt(mlratio * mlratio + 1);
line_to_destination(); line_to_destination();
stepper.synchronize(); stepper.synchronize();
set_axis_is_at_home(X_AXIS);
set_axis_is_at_home(Y_AXIS);
SYNC_PLAN_POSITION_KINEMATIC();
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 1", current_position);
#endif
destination[X_AXIS] = current_position[X_AXIS];
destination[Y_AXIS] = current_position[Y_AXIS];
line_to_destination();
stepper.synchronize();
endstops.hit_on_purpose(); // clear endstop hit flags endstops.hit_on_purpose(); // clear endstop hit flags
current_position[X_AXIS] = destination[X_AXIS]; destination[X_AXIS] = destination[Y_AXIS] = 0;
current_position[Y_AXIS] = destination[Y_AXIS];
#if DISABLED(SCARA)
current_position[Z_AXIS] = destination[Z_AXIS];
#endif
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 2", current_position);
#endif
} }
#endif // QUICK_HOME #endif // QUICK_HOME
@ -2917,8 +2894,8 @@ inline void gcode_G28() {
#elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0 #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0
// Raise Z before homing X or Y, if specified
if (home_all_axis || homeX || homeY) { if (home_all_axis || homeX || homeY) {
// Raise Z before homing any other axes and z is not already high enough (never lower z)
float z_dest = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING; float z_dest = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING;
if (z_dest > current_position[Z_AXIS]) { if (z_dest > current_position[Z_AXIS]) {