Explorar o código

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 %!s(int64=2) %!d(string=hai) anos
pai
achega
2616df66af
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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())
         {