|
@@ -564,7 +564,7 @@ void stop();
|
564
|
564
|
void get_available_commands();
|
565
|
565
|
void process_next_command();
|
566
|
566
|
void prepare_move_to_destination();
|
567
|
|
-void set_current_from_steppers();
|
|
567
|
+void set_current_from_steppers_for_axis(AxisEnum axis);
|
568
|
568
|
|
569
|
569
|
#if ENABLED(ARC_SUPPORT)
|
570
|
570
|
void plan_arc(float target[NUM_AXIS], float* offset, uint8_t clockwise);
|
|
@@ -2116,7 +2116,7 @@ static void clean_up_after_endstop_or_probe_move() {
|
2116
|
2116
|
|
2117
|
2117
|
do_blocking_move_to_z(-(Z_MAX_LENGTH + 10), Z_PROBE_SPEED_FAST);
|
2118
|
2118
|
endstops.hit_on_purpose();
|
2119
|
|
- set_current_from_steppers();
|
|
2119
|
+ set_current_from_steppers_for_axis(Z_AXIS);
|
2120
|
2120
|
SYNC_PLAN_POSITION_KINEMATIC();
|
2121
|
2121
|
|
2122
|
2122
|
// move up the retract distance
|
|
@@ -2125,7 +2125,7 @@ static void clean_up_after_endstop_or_probe_move() {
|
2125
|
2125
|
// move back down slowly to find bed
|
2126
|
2126
|
do_blocking_move_to_z(current_position[Z_AXIS] - home_bump_mm(Z_AXIS) * 2, Z_PROBE_SPEED_SLOW);
|
2127
|
2127
|
endstops.hit_on_purpose();
|
2128
|
|
- set_current_from_steppers();
|
|
2128
|
+ set_current_from_steppers_for_axis(Z_AXIS);
|
2129
|
2129
|
SYNC_PLAN_POSITION_KINEMATIC();
|
2130
|
2130
|
|
2131
|
2131
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
@@ -6074,8 +6074,8 @@ void quickstop_stepper() {
|
6074
|
6074
|
stepper.quick_stop();
|
6075
|
6075
|
#if DISABLED(SCARA)
|
6076
|
6076
|
stepper.synchronize();
|
6077
|
|
- set_current_from_steppers();
|
6078
|
|
- sync_plan_position(); // ...re-apply to planner position
|
|
6077
|
+ LOOP_XYZ(i) set_current_from_steppers_for_axis((AxisEnum)i);
|
|
6078
|
+ SYNC_PLAN_POSITION_KINEMATIC();
|
6079
|
6079
|
#endif
|
6080
|
6080
|
}
|
6081
|
6081
|
|
|
@@ -7912,25 +7912,16 @@ void clamp_to_software_endstops(float target[3]) {
|
7912
|
7912
|
|
7913
|
7913
|
#endif // DELTA
|
7914
|
7914
|
|
7915
|
|
-void set_current_from_steppers() {
|
|
7915
|
+void set_current_from_steppers_for_axis(AxisEnum axis) {
|
7916
|
7916
|
#if ENABLED(DELTA)
|
7917
|
7917
|
set_cartesian_from_steppers();
|
7918
|
|
- current_position[X_AXIS] = cartesian_position[X_AXIS];
|
7919
|
|
- current_position[Y_AXIS] = cartesian_position[Y_AXIS];
|
7920
|
|
- current_position[Z_AXIS] = cartesian_position[Z_AXIS];
|
|
7918
|
+ current_position[axis] = LOGICAL_POSITION(cartesian_position[axis], axis);
|
7921
|
7919
|
#elif ENABLED(AUTO_BED_LEVELING_FEATURE)
|
7922
|
|
- vector_3 pos = planner.adjusted_position(); // values directly from steppers...
|
7923
|
|
- current_position[X_AXIS] = pos.x;
|
7924
|
|
- current_position[Y_AXIS] = pos.y;
|
7925
|
|
- current_position[Z_AXIS] = pos.z;
|
|
7920
|
+ vector_3 pos = planner.adjusted_position();
|
|
7921
|
+ current_position[axis] = LOGICAL_POSITION(axis == X_AXIS ? pos.x : axis == Y_AXIS ? pos.y : pos.z, axis);
|
7926
|
7922
|
#else
|
7927
|
|
- current_position[X_AXIS] = stepper.get_axis_position_mm(X_AXIS); // CORE handled transparently
|
7928
|
|
- current_position[Y_AXIS] = stepper.get_axis_position_mm(Y_AXIS);
|
7929
|
|
- current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS);
|
|
7923
|
+ current_position[axis] = LOGICAL_POSITION(stepper.get_axis_position_mm(axis), axis); // CORE handled transparently
|
7930
|
7924
|
#endif
|
7931
|
|
-
|
7932
|
|
- for (uint8_t i = X_AXIS; i <= Z_AXIS; i++)
|
7933
|
|
- current_position[i] += LOGICAL_POSITION(0, i);
|
7934
|
7925
|
}
|
7935
|
7926
|
|
7936
|
7927
|
#if ENABLED(MESH_BED_LEVELING)
|