PFW-1386 st_get_position_mm() is more accurate when using endstops (not homed printer)

If the endstops kick in, then st_get_position_mm shows the actual travel distance. current_position[Z-AXIS] does not get updated correctly thus we cannot use it when unhomed.

current_position[Z-AXIS] is later set to Z_MAX_POS,
we cannot use that either to calculate the travel distance
This commit is contained in:
Guðni Már Gilbert 2022-08-30 20:53:19 +00:00 committed by D.R.racer
parent f409426bdc
commit 2616df66af
1 changed files with 1 additions and 1 deletions

View File

@ -2128,7 +2128,7 @@ float raise_z(float delta)
st_synchronize();
// Get the final travel distance
travel_z = current_position[Z_AXIS] - travel_z;
travel_z = st_get_position_mm(Z_AXIS) - travel_z;
#ifdef TMC2130
if (endstop_z_hit_on_purpose())
{