|
@@ -920,19 +920,28 @@ static void homeaxis(int axis) {
|
920
|
920
|
axis_home_dir = x_home_dir(active_extruder);
|
921
|
921
|
#endif
|
922
|
922
|
|
|
923
|
+ current_position[axis] = 0;
|
|
924
|
+ plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
925
|
+
|
923
|
926
|
// Engage Servo endstop if enabled
|
924
|
927
|
#ifdef SERVO_ENDSTOPS
|
925
|
|
-#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
|
926
|
|
- if (axis==Z_AXIS) engage_z_probe();
|
927
|
|
- else
|
928
|
|
-#endif
|
|
928
|
+ #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
|
|
929
|
+ if (axis==Z_AXIS) {
|
|
930
|
+ #if defined (Z_RAISE_BEFORE_HOMING) && (Z_RAISE_BEFORE_HOMING > 0)
|
|
931
|
+ destination[axis] = Z_RAISE_BEFORE_HOMING * axis_home_dir * (-1); // Set destination away from bed
|
|
932
|
+ feedrate = max_feedrate[axis];
|
|
933
|
+ plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
|
934
|
+ st_synchronize();
|
|
935
|
+ #endif
|
|
936
|
+ engage_z_probe();
|
|
937
|
+ }
|
|
938
|
+ else
|
|
939
|
+ #endif
|
929
|
940
|
if (servo_endstops[axis] > -1) {
|
930
|
941
|
servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
|
931
|
942
|
}
|
932
|
943
|
#endif
|
933
|
944
|
|
934
|
|
- current_position[axis] = 0;
|
935
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
936
|
945
|
destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
|
937
|
946
|
feedrate = homing_feedrate[axis];
|
938
|
947
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
@@ -1198,6 +1207,9 @@ void process_commands()
|
1198
|
1207
|
current_position[Z_AXIS]=code_value()+add_homeing[2];
|
1199
|
1208
|
}
|
1200
|
1209
|
}
|
|
1210
|
+ #ifdef ENABLE_AUTO_BED_LEVELING
|
|
1211
|
+ current_position[Z_AXIS] -= Z_PROBE_OFFSET_FROM_EXTRUDER; //Add Z_Probe offset (the distance is negative)
|
|
1212
|
+ #endif
|
1201
|
1213
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
1202
|
1214
|
#endif // else DELTA
|
1203
|
1215
|
|