Browse Source

Fix Core axis babystepping (#18342)

brian park 4 years ago
parent
commit
8e20691f42
No account linked to committer's email address
2 changed files with 2 additions and 50 deletions
  1. 1
    49
      Marlin/src/feature/babystep.cpp
  2. 1
    1
      Marlin/src/module/stepper.cpp

+ 1
- 49
Marlin/src/feature/babystep.cpp View File

@@ -54,60 +54,12 @@ void Babystep::add_mm(const AxisEnum axis, const float &mm) {
54 54
 }
55 55
 
56 56
 void Babystep::add_steps(const AxisEnum axis, const int16_t distance) {
57
-
58 57
   if (DISABLED(BABYSTEP_WITHOUT_HOMING) && !TEST(axis_known_position, axis)) return;
59 58
 
60 59
   accum += distance; // Count up babysteps for the UI
60
+  steps[BS_AXIS_IND(axis)] += distance;
61 61
   TERN_(BABYSTEP_DISPLAY_TOTAL, axis_total[BS_TOTAL_IND(axis)] += distance);
62
-
63
-  #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE)
64
-    #define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: ENABLE_AXIS_X(); break; case Y_AXIS: ENABLE_AXIS_Y(); break; case Z_AXIS: ENABLE_AXIS_Z(); break; default: break; } }while(0)
65
-  #else
66
-    #define BSA_ENABLE(AXIS) NOOP
67
-  #endif
68
-
69
-  #if IS_CORE
70
-    #if ENABLED(BABYSTEP_XY)
71
-      switch (axis) {
72
-        case CORE_AXIS_1: // X on CoreXY and CoreXZ, Y on CoreYZ
73
-          BSA_ENABLE(CORE_AXIS_1);
74
-          BSA_ENABLE(CORE_AXIS_2);
75
-          steps[CORE_AXIS_1] += distance * 2;
76
-          steps[CORE_AXIS_2] += distance * 2;
77
-          break;
78
-        case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ and CoreYZ
79
-          BSA_ENABLE(CORE_AXIS_1);
80
-          BSA_ENABLE(CORE_AXIS_2);
81
-          steps[CORE_AXIS_1] += CORESIGN(distance * 2);
82
-          steps[CORE_AXIS_2] -= CORESIGN(distance * 2);
83
-          break;
84
-        case NORMAL_AXIS: // Z on CoreXY, Y on CoreXZ, X on CoreYZ
85
-        default:
86
-          BSA_ENABLE(NORMAL_AXIS);
87
-          steps[NORMAL_AXIS] += distance;
88
-          break;
89
-      }
90
-    #elif CORE_IS_XZ || CORE_IS_YZ
91
-      // Only Z stepping needs to be handled here
92
-      BSA_ENABLE(CORE_AXIS_1);
93
-      BSA_ENABLE(CORE_AXIS_2);
94
-      steps[CORE_AXIS_1] += CORESIGN(distance * 2);
95
-      steps[CORE_AXIS_2] -= CORESIGN(distance * 2);
96
-    #else
97
-      BSA_ENABLE(Z_AXIS);
98
-      steps[Z_AXIS] += distance;
99
-    #endif
100
-  #else
101
-    #if ENABLED(BABYSTEP_XY)
102
-      BSA_ENABLE(axis);
103
-    #else
104
-      BSA_ENABLE(Z_AXIS);
105
-    #endif
106
-    steps[BS_AXIS_IND(axis)] += distance;
107
-  #endif
108
-
109 62
   TERN_(BABYSTEP_ALWAYS_AVAILABLE, gcode.reset_stepper_timeout());
110
-
111 63
   TERN_(INTEGRATED_BABYSTEPPING, if (has_steps()) stepper.initiateBabystepping());
112 64
 }
113 65
 

+ 1
- 1
Marlin/src/module/stepper.cpp View File

@@ -2850,7 +2850,7 @@ void Stepper::report_positions() {
2850 2850
 
2851 2851
         case Y_AXIS:
2852 2852
           #if CORE_IS_XY
2853
-            BABYSTEP_CORE(X, Y, 0, direction, (CORESIGN(1)<0));
2853
+            BABYSTEP_CORE(X, Y, 1, !direction, (CORESIGN(1)>0));
2854 2854
           #elif CORE_IS_YZ
2855 2855
             BABYSTEP_CORE(Y, Z, 0, direction, (CORESIGN(1)<0));
2856 2856
           #else

Loading…
Cancel
Save