Fix up untilted_stepper_position and set_current_from_steppers_for_axis

This commit is contained in:
Scott Lahteine 2016-09-12 02:52:52 -05:00
parent d65f5d816f
commit 82be65065c

View file

@ -2073,10 +2073,12 @@ static void clean_up_after_endstop_or_probe_move() {
* using the home XY and Z0 position as the fulcrum. * using the home XY and Z0 position as the fulcrum.
*/ */
vector_3 untilted_stepper_position() { vector_3 untilted_stepper_position() {
get_cartesian_from_steppers();
vector_3 pos = vector_3( vector_3 pos = vector_3(
RAW_X_POSITION(stepper.get_axis_position_mm(X_AXIS)) - X_TILT_FULCRUM, cartes[X_AXIS] - X_TILT_FULCRUM,
RAW_Y_POSITION(stepper.get_axis_position_mm(Y_AXIS)) - Y_TILT_FULCRUM, cartes[Y_AXIS] - Y_TILT_FULCRUM,
RAW_Z_POSITION(stepper.get_axis_position_mm(Z_AXIS)) cartes[Z_AXIS]
); );
matrix_3x3 inverse = matrix_3x3::transpose(planner.bed_level_matrix); matrix_3x3 inverse = matrix_3x3::transpose(planner.bed_level_matrix);
@ -7838,12 +7840,12 @@ void ok_to_send() {
#endif // DELTA #endif // DELTA
void set_current_from_steppers_for_axis(AxisEnum axis) { void set_current_from_steppers_for_axis(AxisEnum axis) {
#if ENABLED(DELTA) #if ENABLED(AUTO_BED_LEVELING_LINEAR)
get_cartesian_from_steppers();
current_position[axis] = LOGICAL_POSITION(cartes[axis], axis);
#elif ENABLED(AUTO_BED_LEVELING_FEATURE)
vector_3 pos = untilted_stepper_position(); vector_3 pos = untilted_stepper_position();
current_position[axis] = axis == X_AXIS ? pos.x : axis == Y_AXIS ? pos.y : pos.z; current_position[axis] = axis == X_AXIS ? pos.x : axis == Y_AXIS ? pos.y : pos.z;
#elif IS_KINEMATIC
get_cartesian_from_steppers();
current_position[axis] = LOGICAL_POSITION(cartes[axis], axis);
#else #else
current_position[axis] = stepper.get_axis_position_mm(axis); // CORE handled transparently current_position[axis] = stepper.get_axis_position_mm(axis); // CORE handled transparently
#endif #endif