소스 검색

Fix get_cartesian_from_steppers

Scott Lahteine 8 년 전
부모
커밋
46cc2e3f6a
1개의 변경된 파일7개의 추가작업 그리고 14개의 파일을 삭제
  1. 7
    14
      Marlin/Marlin_main.cpp

+ 7
- 14
Marlin/Marlin_main.cpp 파일 보기

3445
       // Re-orient the current position without leveling
3445
       // Re-orient the current position without leveling
3446
       // based on where the steppers are positioned.
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
       // Inform the planner about the new coordinates
3451
       // Inform the planner about the new coordinates
3464
       SYNC_PLAN_POSITION_KINEMATIC();
3452
       SYNC_PLAN_POSITION_KINEMATIC();
7918
       stepper.get_axis_position_mm(B_AXIS),
7906
       stepper.get_axis_position_mm(B_AXIS),
7919
       stepper.get_axis_position_mm(C_AXIS)
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
   #elif IS_SCARA
7912
   #elif IS_SCARA
7922
     forward_kinematics_SCARA(
7913
     forward_kinematics_SCARA(
7923
       stepper.get_axis_position_degrees(A_AXIS),
7914
       stepper.get_axis_position_degrees(A_AXIS),
7924
       stepper.get_axis_position_degrees(B_AXIS)
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
     cartes[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS);
7919
     cartes[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS);
7927
   #else
7920
   #else
7928
     cartes[X_AXIS] = stepper.get_axis_position_mm(X_AXIS);
7921
     cartes[X_AXIS] = stepper.get_axis_position_mm(X_AXIS);

Loading…
취소
저장