Browse Source

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
Guðni Már Gilbert 2 years ago
parent
commit
2616df66af
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Firmware/Marlin_main.cpp

+ 1 - 1
Firmware/Marlin_main.cpp

@@ -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())
         {