Bläddra i källkod

Fix get_cartesian_from_steppers

Scott Lahteine 8 år sedan
förälder
incheckning
46cc2e3f6a
1 ändrade filer med 7 tillägg och 14 borttagningar
  1. 7
    14
      Marlin/Marlin_main.cpp

+ 7
- 14
Marlin/Marlin_main.cpp Visa fil

@@ -3445,20 +3445,8 @@ inline void gcode_G28() {
3445 3445
       // Re-orient the current position without leveling
3446 3446
       // based on where the steppers are positioned.
3447 3447
       //
3448
-      #if IS_KINEMATIC
3449
-
3450
-        // For DELTA/SCARA we need to apply forward kinematics.
3451
-        // This returns raw positions and we remap to the space.
3452
-        get_cartesian_from_steppers();
3453
-        LOOP_XYZ(i) current_position[i] = LOGICAL_POSITION(cartes[i], i);
3454
-
3455
-      #else
3456
-
3457
-        // For cartesian/core the steppers are already mapped to
3458
-        // the coordinate space by design.
3459
-        LOOP_XYZ(i) current_position[i] = stepper.get_axis_position_mm((AxisEnum)i);
3460
-
3461
-      #endif // !DELTA
3448
+      get_cartesian_from_steppers();
3449
+      memcpy(current_position, cartes, sizeof(cartes));
3462 3450
 
3463 3451
       // Inform the planner about the new coordinates
3464 3452
       SYNC_PLAN_POSITION_KINEMATIC();
@@ -7918,11 +7906,16 @@ void get_cartesian_from_steppers() {
7918 7906
       stepper.get_axis_position_mm(B_AXIS),
7919 7907
       stepper.get_axis_position_mm(C_AXIS)
7920 7908
     );
7909
+    cartes[X_AXIS] += LOGICAL_X_POSITION(0);
7910
+    cartes[Y_AXIS] += LOGICAL_Y_POSITION(0);
7911
+    cartes[Z_AXIS] += LOGICAL_Z_POSITION(0);
7921 7912
   #elif IS_SCARA
7922 7913
     forward_kinematics_SCARA(
7923 7914
       stepper.get_axis_position_degrees(A_AXIS),
7924 7915
       stepper.get_axis_position_degrees(B_AXIS)
7925 7916
     );
7917
+    cartes[X_AXIS] += LOGICAL_X_POSITION(0);
7918
+    cartes[Y_AXIS] += LOGICAL_Y_POSITION(0);
7926 7919
     cartes[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS);
7927 7920
   #else
7928 7921
     cartes[X_AXIS] = stepper.get_axis_position_mm(X_AXIS);

Laddar…
Avbryt
Spara