Quellcode durchsuchen

♻️ Patches for Zero Extruders (with TMC)

Scott Lahteine vor 3 Jahren
Ursprung
Commit
82ea06e6a4

+ 2
- 2
Marlin/src/core/types.h Datei anzeigen

@@ -360,7 +360,7 @@ struct XYZval {
360 360
   FI void set(const XYval<T> pxy, const T pz)          { x = pxy.x; y = pxy.y; z = pz; }
361 361
   FI void set(const T (&arr)[XY])                      { x = arr[0]; y = arr[1]; }
362 362
   FI void set(const T (&arr)[LINEAR_AXES])             { LINEAR_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2]); }
363
-  #if LINEAR_AXES >= XYZ
363
+  #if HAS_Z_AXIS
364 364
     FI void set(LINEAR_AXIS_LIST(const T px, const T py, const T pz))
365 365
                                                        { LINEAR_AXIS_CODE(x = px, y = py, z = pz); }
366 366
   #endif
@@ -475,7 +475,7 @@ struct XYZEval {
475 475
   FI void set(const T px, const T py)                         { x = px;    y = py;    }
476 476
   FI void set(const XYval<T> pxy)                             { x = pxy.x; y = pxy.y; }
477 477
   FI void set(const XYZval<T> pxyz)                           { set(LINEAR_AXIS_LIST(pxyz.x, pxyz.y, pxyz.z)); }
478
-  #if LINEAR_AXES >= XYZ
478
+  #if HAS_Z_AXIS
479 479
     FI void set(LINEAR_AXIS_LIST(const T px, const T py, const T pz)) {
480 480
       LINEAR_AXIS_CODE(x = px, y = py, z = pz);
481 481
     }

+ 48
- 40
Marlin/src/feature/tmc_util.cpp Datei anzeigen

@@ -770,16 +770,18 @@
770 770
       #endif
771 771
     }
772 772
 
773
-    if (print_y) {
774
-      #if AXIS_IS_TMC(Y)
775
-        tmc_status(stepperY, i);
776
-      #endif
777
-      #if AXIS_IS_TMC(Y2)
778
-        tmc_status(stepperY2, i);
779
-      #endif
780
-    }
773
+    #if LINEAR_AXES >= XY
774
+      if (print_y) {
775
+        #if AXIS_IS_TMC(Y)
776
+          tmc_status(stepperY, i);
777
+        #endif
778
+        #if AXIS_IS_TMC(Y2)
779
+          tmc_status(stepperY2, i);
780
+        #endif
781
+      }
782
+    #endif
781 783
 
782
-    if (print_z) {
784
+    if (TERN0(HAS_Z_AXIS, print_z)) {
783 785
       #if AXIS_IS_TMC(Z)
784 786
         tmc_status(stepperZ, i);
785 787
       #endif
@@ -794,7 +796,7 @@
794 796
       #endif
795 797
     }
796 798
 
797
-    if (print_e) {
799
+    if (TERN0(HAS_EXTRUDERS, print_e)) {
798 800
       #if AXIS_IS_TMC(E0)
799 801
         tmc_status(stepperE0, i);
800 802
       #endif
@@ -837,16 +839,18 @@
837 839
       #endif
838 840
     }
839 841
 
840
-    if (print_y) {
841
-      #if AXIS_IS_TMC(Y)
842
-        tmc_parse_drv_status(stepperY, i);
843
-      #endif
844
-      #if AXIS_IS_TMC(Y2)
845
-        tmc_parse_drv_status(stepperY2, i);
846
-      #endif
847
-    }
842
+    #if LINEAR_AXES >= XY
843
+      if (print_y) {
844
+        #if AXIS_IS_TMC(Y)
845
+          tmc_parse_drv_status(stepperY, i);
846
+        #endif
847
+        #if AXIS_IS_TMC(Y2)
848
+          tmc_parse_drv_status(stepperY2, i);
849
+        #endif
850
+      }
851
+    #endif
848 852
 
849
-    if (print_z) {
853
+    if (TERN0(HAS_Z_AXIS, print_z)) {
850 854
       #if AXIS_IS_TMC(Z)
851 855
         tmc_parse_drv_status(stepperZ, i);
852 856
       #endif
@@ -861,7 +865,7 @@
861 865
       #endif
862 866
     }
863 867
 
864
-    if (print_e) {
868
+    if (TERN0(HAS_EXTRUDERS, print_e)) {
865 869
       #if AXIS_IS_TMC(E0)
866 870
         tmc_parse_drv_status(stepperE0, i);
867 871
       #endif
@@ -1037,16 +1041,18 @@
1037 1041
       #endif
1038 1042
     }
1039 1043
 
1040
-    if (print_y) {
1041
-      #if AXIS_IS_TMC(Y)
1042
-        tmc_get_registers(stepperY, i);
1043
-      #endif
1044
-      #if AXIS_IS_TMC(Y2)
1045
-        tmc_get_registers(stepperY2, i);
1046
-      #endif
1047
-    }
1044
+    #if LINEAR_AXES >= XY
1045
+      if (print_y) {
1046
+        #if AXIS_IS_TMC(Y)
1047
+          tmc_get_registers(stepperY, i);
1048
+        #endif
1049
+        #if AXIS_IS_TMC(Y2)
1050
+          tmc_get_registers(stepperY2, i);
1051
+        #endif
1052
+      }
1053
+    #endif
1048 1054
 
1049
-    if (print_z) {
1055
+    if (TERN0(HAS_Z_AXIS, print_z)) {
1050 1056
       #if AXIS_IS_TMC(Z)
1051 1057
         tmc_get_registers(stepperZ, i);
1052 1058
       #endif
@@ -1061,7 +1067,7 @@
1061 1067
       #endif
1062 1068
     }
1063 1069
 
1064
-    if (print_e) {
1070
+    if (TERN0(HAS_EXTRUDERS, print_e)) {
1065 1071
       #if AXIS_IS_TMC(E0)
1066 1072
         tmc_get_registers(stepperE0, i);
1067 1073
       #endif
@@ -1242,16 +1248,18 @@ void test_tmc_connection(
1242 1248
     #endif
1243 1249
   }
1244 1250
 
1245
-  if (test_y) {
1246
-    #if AXIS_IS_TMC(Y)
1247
-      axis_connection += test_connection(stepperY);
1248
-    #endif
1249
-    #if AXIS_IS_TMC(Y2)
1250
-      axis_connection += test_connection(stepperY2);
1251
-    #endif
1252
-  }
1251
+  #if LINEAR_AXES >= XY
1252
+    if (test_y) {
1253
+      #if AXIS_IS_TMC(Y)
1254
+        axis_connection += test_connection(stepperY);
1255
+      #endif
1256
+      #if AXIS_IS_TMC(Y2)
1257
+        axis_connection += test_connection(stepperY2);
1258
+      #endif
1259
+    }
1260
+  #endif
1253 1261
 
1254
-  if (test_z) {
1262
+  if (TERN0(HAS_Z_AXIS, test_z)) {
1255 1263
     #if AXIS_IS_TMC(Z)
1256 1264
       axis_connection += test_connection(stepperZ);
1257 1265
     #endif
@@ -1266,7 +1274,7 @@ void test_tmc_connection(
1266 1274
     #endif
1267 1275
   }
1268 1276
 
1269
-  if (test_e) {
1277
+  if (TERN0(HAS_EXTRUDERS, test_e)) {
1270 1278
     #if AXIS_IS_TMC(E0)
1271 1279
       axis_connection += test_connection(stepperE0);
1272 1280
     #endif

+ 55
- 46
Marlin/src/gcode/feature/L6470/M906.cpp Datei anzeigen

@@ -252,58 +252,67 @@ void GcodeSuite::M906() {
252 252
           if (index == 1) L6470_SET_KVAL_HOLD(X2);
253 253
         #endif
254 254
         break;
255
-      case Y_AXIS:
256
-        #if AXIS_IS_L64XX(Y)
257
-          if (index == 0) L6470_SET_KVAL_HOLD(Y);
258
-        #endif
259
-        #if AXIS_IS_L64XX(Y2)
260
-          if (index == 1) L6470_SET_KVAL_HOLD(Y2);
261
-        #endif
262
-        break;
263
-      case Z_AXIS:
264
-        #if AXIS_IS_L64XX(Z)
265
-          if (index == 0) L6470_SET_KVAL_HOLD(Z);
266
-        #endif
267
-        #if AXIS_IS_L64XX(Z2)
268
-          if (index == 1) L6470_SET_KVAL_HOLD(Z2);
269
-        #endif
270
-        #if AXIS_IS_L64XX(Z3)
271
-          if (index == 2) L6470_SET_KVAL_HOLD(Z3);
272
-        #endif
273
-        #if AXIS_DRIVER_TYPE_Z4(L6470)
274
-          if (index == 3) L6470_SET_KVAL_HOLD(Z4);
275
-        #endif
276
-        break;
277
-      case E_AXIS: {
278
-        const int8_t target_extruder = get_target_extruder_from_command();
279
-        if (target_extruder < 0) return;
280
-        switch (target_extruder) {
281
-          #if AXIS_IS_L64XX(E0)
282
-            case 0: L6470_SET_KVAL_HOLD(E0); break;
283
-          #endif
284
-          #if AXIS_IS_L64XX(E1)
285
-            case 1: L6470_SET_KVAL_HOLD(E1); break;
286
-          #endif
287
-          #if AXIS_IS_L64XX(E2)
288
-            case 2: L6470_SET_KVAL_HOLD(E2); break;
255
+
256
+      #if LINEAR_AXES >= XY
257
+        case Y_AXIS:
258
+          #if AXIS_IS_L64XX(Y)
259
+            if (index == 0) L6470_SET_KVAL_HOLD(Y);
289 260
           #endif
290
-          #if AXIS_IS_L64XX(E3)
291
-            case 3: L6470_SET_KVAL_HOLD(E3); break;
261
+          #if AXIS_IS_L64XX(Y2)
262
+            if (index == 1) L6470_SET_KVAL_HOLD(Y2);
292 263
           #endif
293
-          #if AXIS_IS_L64XX(E4)
294
-            case 4: L6470_SET_KVAL_HOLD(E4); break;
264
+          break;
265
+      #endif
266
+
267
+      #if HAS_Z_AXIS
268
+        case Z_AXIS:
269
+          #if AXIS_IS_L64XX(Z)
270
+            if (index == 0) L6470_SET_KVAL_HOLD(Z);
295 271
           #endif
296
-          #if AXIS_IS_L64XX(E5)
297
-            case 5: L6470_SET_KVAL_HOLD(E5); break;
272
+          #if AXIS_IS_L64XX(Z2)
273
+            if (index == 1) L6470_SET_KVAL_HOLD(Z2);
298 274
           #endif
299
-          #if AXIS_IS_L64XX(E6)
300
-            case 6: L6470_SET_KVAL_HOLD(E6); break;
275
+          #if AXIS_IS_L64XX(Z3)
276
+            if (index == 2) L6470_SET_KVAL_HOLD(Z3);
301 277
           #endif
302
-          #if AXIS_IS_L64XX(E7)
303
-            case 7: L6470_SET_KVAL_HOLD(E7); break;
278
+          #if AXIS_DRIVER_TYPE_Z4(L6470)
279
+            if (index == 3) L6470_SET_KVAL_HOLD(Z4);
304 280
           #endif
305
-        }
306
-      } break;
281
+          break;
282
+      #endif
283
+
284
+      #if HAS_EXTRUDERS
285
+        case E_AXIS: {
286
+          const int8_t target_extruder = get_target_extruder_from_command();
287
+          if (target_extruder < 0) return;
288
+          switch (target_extruder) {
289
+            #if AXIS_IS_L64XX(E0)
290
+              case 0: L6470_SET_KVAL_HOLD(E0); break;
291
+            #endif
292
+            #if AXIS_IS_L64XX(E1)
293
+              case 1: L6470_SET_KVAL_HOLD(E1); break;
294
+            #endif
295
+            #if AXIS_IS_L64XX(E2)
296
+              case 2: L6470_SET_KVAL_HOLD(E2); break;
297
+            #endif
298
+            #if AXIS_IS_L64XX(E3)
299
+              case 3: L6470_SET_KVAL_HOLD(E3); break;
300
+            #endif
301
+            #if AXIS_IS_L64XX(E4)
302
+              case 4: L6470_SET_KVAL_HOLD(E4); break;
303
+            #endif
304
+            #if AXIS_IS_L64XX(E5)
305
+              case 5: L6470_SET_KVAL_HOLD(E5); break;
306
+            #endif
307
+            #if AXIS_IS_L64XX(E6)
308
+              case 6: L6470_SET_KVAL_HOLD(E6); break;
309
+            #endif
310
+            #if AXIS_IS_L64XX(E7)
311
+              case 7: L6470_SET_KVAL_HOLD(E7); break;
312
+            #endif
313
+          }
314
+        } break;
315
+      #endif
307 316
     }
308 317
   }
309 318
 

+ 54
- 45
Marlin/src/gcode/feature/trinamic/M569.cpp Datei anzeigen

@@ -60,57 +60,66 @@ static void set_stealth_status(const bool enable, const int8_t target_extruder)
60 60
           if (index == 1) TMC_SET_STEALTH(X2);
61 61
         #endif
62 62
         break;
63
-      case Y_AXIS:
64
-        #if AXIS_HAS_STEALTHCHOP(Y)
65
-          if (index == 0) TMC_SET_STEALTH(Y);
66
-        #endif
67
-        #if AXIS_HAS_STEALTHCHOP(Y2)
68
-          if (index == 1) TMC_SET_STEALTH(Y2);
69
-        #endif
70
-        break;
71
-      case Z_AXIS:
72
-        #if AXIS_HAS_STEALTHCHOP(Z)
73
-          if (index == 0) TMC_SET_STEALTH(Z);
74
-        #endif
75
-        #if AXIS_HAS_STEALTHCHOP(Z2)
76
-          if (index == 1) TMC_SET_STEALTH(Z2);
77
-        #endif
78
-        #if AXIS_HAS_STEALTHCHOP(Z3)
79
-          if (index == 2) TMC_SET_STEALTH(Z3);
80
-        #endif
81
-        #if AXIS_HAS_STEALTHCHOP(Z4)
82
-          if (index == 3) TMC_SET_STEALTH(Z4);
83
-        #endif
84
-        break;
85
-      case E_AXIS: {
86
-        if (target_extruder < 0) return;
87
-        switch (target_extruder) {
88
-          #if AXIS_HAS_STEALTHCHOP(E0)
89
-            case 0: TMC_SET_STEALTH(E0); break;
90
-          #endif
91
-          #if AXIS_HAS_STEALTHCHOP(E1)
92
-            case 1: TMC_SET_STEALTH(E1); break;
93
-          #endif
94
-          #if AXIS_HAS_STEALTHCHOP(E2)
95
-            case 2: TMC_SET_STEALTH(E2); break;
63
+
64
+      #if LINEAR_AXES >= XY
65
+        case Y_AXIS:
66
+          #if AXIS_HAS_STEALTHCHOP(Y)
67
+            if (index == 0) TMC_SET_STEALTH(Y);
96 68
           #endif
97
-          #if AXIS_HAS_STEALTHCHOP(E3)
98
-            case 3: TMC_SET_STEALTH(E3); break;
69
+          #if AXIS_HAS_STEALTHCHOP(Y2)
70
+            if (index == 1) TMC_SET_STEALTH(Y2);
99 71
           #endif
100
-          #if AXIS_HAS_STEALTHCHOP(E4)
101
-            case 4: TMC_SET_STEALTH(E4); break;
72
+          break;
73
+      #endif
74
+
75
+      #if HAS_Z_AXIS
76
+        case Z_AXIS:
77
+          #if AXIS_HAS_STEALTHCHOP(Z)
78
+            if (index == 0) TMC_SET_STEALTH(Z);
102 79
           #endif
103
-          #if AXIS_HAS_STEALTHCHOP(E5)
104
-            case 5: TMC_SET_STEALTH(E5); break;
80
+          #if AXIS_HAS_STEALTHCHOP(Z2)
81
+            if (index == 1) TMC_SET_STEALTH(Z2);
105 82
           #endif
106
-          #if AXIS_HAS_STEALTHCHOP(E6)
107
-            case 6: TMC_SET_STEALTH(E6); break;
83
+          #if AXIS_HAS_STEALTHCHOP(Z3)
84
+            if (index == 2) TMC_SET_STEALTH(Z3);
108 85
           #endif
109
-          #if AXIS_HAS_STEALTHCHOP(E7)
110
-            case 7: TMC_SET_STEALTH(E7); break;
86
+          #if AXIS_HAS_STEALTHCHOP(Z4)
87
+            if (index == 3) TMC_SET_STEALTH(Z4);
111 88
           #endif
112
-        }
113
-      } break;
89
+          break;
90
+      #endif
91
+
92
+      #if HAS_EXTRUDERS
93
+        case E_AXIS: {
94
+          if (target_extruder < 0) return;
95
+          switch (target_extruder) {
96
+            #if AXIS_HAS_STEALTHCHOP(E0)
97
+              case 0: TMC_SET_STEALTH(E0); break;
98
+            #endif
99
+            #if AXIS_HAS_STEALTHCHOP(E1)
100
+              case 1: TMC_SET_STEALTH(E1); break;
101
+            #endif
102
+            #if AXIS_HAS_STEALTHCHOP(E2)
103
+              case 2: TMC_SET_STEALTH(E2); break;
104
+            #endif
105
+            #if AXIS_HAS_STEALTHCHOP(E3)
106
+              case 3: TMC_SET_STEALTH(E3); break;
107
+            #endif
108
+            #if AXIS_HAS_STEALTHCHOP(E4)
109
+              case 4: TMC_SET_STEALTH(E4); break;
110
+            #endif
111
+            #if AXIS_HAS_STEALTHCHOP(E5)
112
+              case 5: TMC_SET_STEALTH(E5); break;
113
+            #endif
114
+            #if AXIS_HAS_STEALTHCHOP(E6)
115
+              case 6: TMC_SET_STEALTH(E6); break;
116
+            #endif
117
+            #if AXIS_HAS_STEALTHCHOP(E7)
118
+              case 7: TMC_SET_STEALTH(E7); break;
119
+            #endif
120
+          }
121
+        } break;
122
+      #endif
114 123
     }
115 124
   }
116 125
 }

+ 55
- 46
Marlin/src/gcode/feature/trinamic/M906.cpp Datei anzeigen

@@ -63,58 +63,67 @@ void GcodeSuite::M906() {
63 63
           if (index == 1) TMC_SET_CURRENT(X2);
64 64
         #endif
65 65
         break;
66
-      case Y_AXIS:
67
-        #if AXIS_IS_TMC(Y)
68
-          if (index == 0) TMC_SET_CURRENT(Y);
69
-        #endif
70
-        #if AXIS_IS_TMC(Y2)
71
-          if (index == 1) TMC_SET_CURRENT(Y2);
72
-        #endif
73
-        break;
74
-      case Z_AXIS:
75
-        #if AXIS_IS_TMC(Z)
76
-          if (index == 0) TMC_SET_CURRENT(Z);
77
-        #endif
78
-        #if AXIS_IS_TMC(Z2)
79
-          if (index == 1) TMC_SET_CURRENT(Z2);
80
-        #endif
81
-        #if AXIS_IS_TMC(Z3)
82
-          if (index == 2) TMC_SET_CURRENT(Z3);
83
-        #endif
84
-        #if AXIS_IS_TMC(Z4)
85
-          if (index == 3) TMC_SET_CURRENT(Z4);
86
-        #endif
87
-        break;
88
-      case E_AXIS: {
89
-        const int8_t target_extruder = get_target_extruder_from_command();
90
-        if (target_extruder < 0) return;
91
-        switch (target_extruder) {
92
-          #if AXIS_IS_TMC(E0)
93
-            case 0: TMC_SET_CURRENT(E0); break;
94
-          #endif
95
-          #if AXIS_IS_TMC(E1)
96
-            case 1: TMC_SET_CURRENT(E1); break;
97
-          #endif
98
-          #if AXIS_IS_TMC(E2)
99
-            case 2: TMC_SET_CURRENT(E2); break;
66
+
67
+      #if LINEAR_AXES >= XY
68
+        case Y_AXIS:
69
+          #if AXIS_IS_TMC(Y)
70
+            if (index == 0) TMC_SET_CURRENT(Y);
100 71
           #endif
101
-          #if AXIS_IS_TMC(E3)
102
-            case 3: TMC_SET_CURRENT(E3); break;
72
+          #if AXIS_IS_TMC(Y2)
73
+            if (index == 1) TMC_SET_CURRENT(Y2);
103 74
           #endif
104
-          #if AXIS_IS_TMC(E4)
105
-            case 4: TMC_SET_CURRENT(E4); break;
75
+          break;
76
+      #endif
77
+
78
+      #if HAS_Z_AXIS
79
+        case Z_AXIS:
80
+          #if AXIS_IS_TMC(Z)
81
+            if (index == 0) TMC_SET_CURRENT(Z);
106 82
           #endif
107
-          #if AXIS_IS_TMC(E5)
108
-            case 5: TMC_SET_CURRENT(E5); break;
83
+          #if AXIS_IS_TMC(Z2)
84
+            if (index == 1) TMC_SET_CURRENT(Z2);
109 85
           #endif
110
-          #if AXIS_IS_TMC(E6)
111
-            case 6: TMC_SET_CURRENT(E6); break;
86
+          #if AXIS_IS_TMC(Z3)
87
+            if (index == 2) TMC_SET_CURRENT(Z3);
112 88
           #endif
113
-          #if AXIS_IS_TMC(E7)
114
-            case 7: TMC_SET_CURRENT(E7); break;
89
+          #if AXIS_IS_TMC(Z4)
90
+            if (index == 3) TMC_SET_CURRENT(Z4);
115 91
           #endif
116
-        }
117
-      } break;
92
+          break;
93
+      #endif
94
+
95
+      #if HAS_EXTRUDERS
96
+        case E_AXIS: {
97
+          const int8_t target_extruder = get_target_extruder_from_command();
98
+          if (target_extruder < 0) return;
99
+          switch (target_extruder) {
100
+            #if AXIS_IS_TMC(E0)
101
+              case 0: TMC_SET_CURRENT(E0); break;
102
+            #endif
103
+            #if AXIS_IS_TMC(E1)
104
+              case 1: TMC_SET_CURRENT(E1); break;
105
+            #endif
106
+            #if AXIS_IS_TMC(E2)
107
+              case 2: TMC_SET_CURRENT(E2); break;
108
+            #endif
109
+            #if AXIS_IS_TMC(E3)
110
+              case 3: TMC_SET_CURRENT(E3); break;
111
+            #endif
112
+            #if AXIS_IS_TMC(E4)
113
+              case 4: TMC_SET_CURRENT(E4); break;
114
+            #endif
115
+            #if AXIS_IS_TMC(E5)
116
+              case 5: TMC_SET_CURRENT(E5); break;
117
+            #endif
118
+            #if AXIS_IS_TMC(E6)
119
+              case 6: TMC_SET_CURRENT(E6); break;
120
+            #endif
121
+            #if AXIS_IS_TMC(E7)
122
+              case 7: TMC_SET_CURRENT(E7); break;
123
+            #endif
124
+          }
125
+        } break;
126
+      #endif
118 127
     }
119 128
   }
120 129
 

+ 4
- 0
Marlin/src/inc/Conditionals_LCD.h Datei anzeigen

@@ -624,6 +624,10 @@
624 624
   #define LOGICAL_AXES LINEAR_AXES
625 625
 #endif
626 626
 
627
+#if LINEAR_AXES >= XYZ
628
+  #define HAS_Z_AXIS 1
629
+#endif
630
+
627 631
 /**
628 632
  * DISTINCT_E_FACTORS is set to give extruders (some) individual settings.
629 633
  *

+ 4
- 0
Marlin/src/inc/SanityCheck.h Datei anzeigen

@@ -2956,6 +2956,10 @@ static_assert(   _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
2956 2956
     #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_EXTRA_HEIGHT to be set."
2957 2957
   #elif !defined(GANTRY_CALIBRATION_FEEDRATE)
2958 2958
     #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_FEEDRATE to be set."
2959
+  #elif ENABLED(Z_MULTI_ENDSTOPS)
2960
+    #error "Sorry! MECHANICAL_GANTRY_CALIBRATION cannot be used with Z_MULTI_ENDSTOPS."
2961
+  #elif ENABLED(Z_STEPPER_AUTO_ALIGN)
2962
+    #error "Sorry! MECHANICAL_GANTRY_CALIBRATION cannot be used with Z_STEPPER_AUTO_ALIGN."
2959 2963
   #endif
2960 2964
   #if defined(GANTRY_CALIBRATION_SAFE_POSITION) && !defined(GANTRY_CALIBRATION_XY_PARK_FEEDRATE)
2961 2965
     #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."

+ 4
- 4
Marlin/src/module/planner_bezier.cpp Datei anzeigen

@@ -181,11 +181,11 @@ void cubic_b_spline(
181 181
     t = new_t;
182 182
 
183 183
     // Compute and send new position
184
-    xyze_pos_t new_bez = {
184
+    xyze_pos_t new_bez = LOGICAL_AXIS_ARRAY(
185
+      interp(position.e, target.e, t),  // FIXME. These two are wrong, since the parameter t is not linear in the distance.
185 186
       new_pos0, new_pos1,
186
-      interp(position.z, target.z, t),   // FIXME. These two are wrong, since the parameter t is
187
-      interp(position.e, target.e, t)    // not linear in the distance.
188
-    };
187
+      interp(position.z, target.z, t)
188
+    );
189 189
     apply_motion_limits(new_bez);
190 190
     bez_target = new_bez;
191 191
 

+ 3
- 3
Marlin/src/module/stepper.cpp Datei anzeigen

@@ -259,7 +259,7 @@ xyze_int8_t Stepper::count_direction{0};
259 259
 
260 260
 #define DUAL_ENDSTOP_APPLY_STEP(A,V)                                                                                        \
261 261
   if (separate_multi_axis) {                                                                                                \
262
-    if (A##_HOME_TO_MIN) {                                                                                                  \
262
+    if (ENABLED(A##_HOME_TO_MIN)) {                                                                                         \
263 263
       if (TERN0(HAS_##A##_MIN, !(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##_motor)) A##_STEP_WRITE(V);     \
264 264
       if (TERN0(HAS_##A##2_MIN, !(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##2_motor)) A##2_STEP_WRITE(V); \
265 265
     }                                                                                                                       \
@@ -285,7 +285,7 @@ xyze_int8_t Stepper::count_direction{0};
285 285
 
286 286
 #define TRIPLE_ENDSTOP_APPLY_STEP(A,V)                                                                                      \
287 287
   if (separate_multi_axis) {                                                                                                \
288
-    if (A##_HOME_TO_MIN) {                                                                                                  \
288
+    if (ENABLED(A##_HOME_TO_MIN)) {                                                                                         \
289 289
       if (!(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##_motor) A##_STEP_WRITE(V);    \
290 290
       if (!(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \
291 291
       if (!(TEST(endstops.state(), A##3_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##3_motor) A##3_STEP_WRITE(V); \
@@ -316,7 +316,7 @@ xyze_int8_t Stepper::count_direction{0};
316 316
 
317 317
 #define QUAD_ENDSTOP_APPLY_STEP(A,V)                                                                                        \
318 318
   if (separate_multi_axis) {                                                                                                \
319
-    if (A##_HOME_TO_MIN) {                                                                                                  \
319
+    if (ENABLED(A##_HOME_TO_MIN)) {                                                                                         \
320 320
       if (!(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##_motor) A##_STEP_WRITE(V);    \
321 321
       if (!(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \
322 322
       if (!(TEST(endstops.state(), A##3_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##3_motor) A##3_STEP_WRITE(V); \

+ 95
- 87
Marlin/src/pins/pins_postprocess.h Datei anzeigen

@@ -438,88 +438,7 @@
438 438
   #define Z_STOP_PIN Z_MAX_PIN
439 439
 #endif
440 440
 
441
-//
442
-// Disable unused endstop / probe pins
443
-//
444
-#define _STOP_IN_USE(N) (X2_USE_ENDSTOP == N || Y2_USE_ENDSTOP == N || Z2_USE_ENDSTOP == N || Z3_USE_ENDSTOP == N || Z4_USE_ENDSTOP == N)
445
-#if _STOP_IN_USE(_XMAX_)
446
-  #define USE_XMAX_PLUG
447
-#endif
448
-#if _STOP_IN_USE(_YMAX_)
449
-  #define USE_YMAX_PLUG
450
-#endif
451
-#if _STOP_IN_USE(_ZMAX_)
452
-  #define USE_ZMAX_PLUG
453
-#endif
454
-#if _STOP_IN_USE(_XMIN_)
455
-  #define USE_XMIN_PLUG
456
-#endif
457
-#if _STOP_IN_USE(_YMIN_)
458
-  #define USE_YMIN_PLUG
459
-#endif
460
-#if _STOP_IN_USE(_ZMIN_)
461
-  #define USE_ZMIN_PLUG
462
-#endif
463
-#undef _STOP_IN_USE
464
-#if !HAS_CUSTOM_PROBE_PIN
465
-  #undef Z_MIN_PROBE_PIN
466
-  #define Z_MIN_PROBE_PIN    -1
467
-#endif
468
-#if DISABLED(USE_XMAX_PLUG)
469
-  #undef X_MAX_PIN
470
-  #define X_MAX_PIN          -1
471
-#endif
472
-#if DISABLED(USE_YMAX_PLUG)
473
-  #undef Y_MAX_PIN
474
-  #define Y_MAX_PIN          -1
475
-#endif
476
-#if DISABLED(USE_ZMAX_PLUG)
477
-  #undef Z_MAX_PIN
478
-  #define Z_MAX_PIN          -1
479
-#endif
480
-#if DISABLED(USE_XMIN_PLUG)
481
-  #undef X_MIN_PIN
482
-  #define X_MIN_PIN          -1
483
-#endif
484
-#if DISABLED(USE_YMIN_PLUG)
485
-  #undef Y_MIN_PIN
486
-  #define Y_MIN_PIN          -1
487
-#endif
488
-#if DISABLED(USE_ZMIN_PLUG)
489
-  #undef Z_MIN_PIN
490
-  #define Z_MIN_PIN          -1
491
-#endif
492
-#if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MAX
493
-  #undef X2_MIN_PIN
494
-#endif
495
-#if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MIN
496
-  #undef X2_MAX_PIN
497
-#endif
498
-#if DISABLED(Y_DUAL_ENDSTOPS) || Y_HOME_TO_MAX
499
-  #undef Y2_MIN_PIN
500
-#endif
501
-#if DISABLED(Y_DUAL_ENDSTOPS) || Y_HOME_TO_MIN
502
-  #undef Y2_MAX_PIN
503
-#endif
504
-#if DISABLED(Z_MULTI_ENDSTOPS) || Z_HOME_TO_MAX
505
-  #undef Z2_MIN_PIN
506
-#endif
507
-#if DISABLED(Z_MULTI_ENDSTOPS) || Z_HOME_TO_MIN
508
-  #undef Z2_MAX_PIN
509
-#endif
510
-#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 3 || Z_HOME_TO_MAX
511
-  #undef Z3_MIN_PIN
512
-#endif
513
-#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 3 || Z_HOME_TO_MIN
514
-  #undef Z3_MAX_PIN
515
-#endif
516
-#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 4 || Z_HOME_TO_MAX
517
-  #undef Z4_MIN_PIN
518
-#endif
519
-#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 4 || Z_HOME_TO_MIN
520
-  #undef Z4_MAX_PIN
521
-#endif
522
-
441
+// Filament Sensor first pin alias
523 442
 #if HAS_FILAMENT_SENSOR
524 443
   #define FIL_RUNOUT1_PIN FIL_RUNOUT_PIN
525 444
 #else
@@ -593,7 +512,7 @@
593 512
   //
594 513
   // Auto-assign pins for stallGuard sensorless homing
595 514
   //
596
-  #if defined(X2_STALL_SENSITIVITY) && ENABLED(X_DUAL_ENDSTOPS) && _PEXI(X2_E_INDEX, DIAG)
515
+  #if !defined(X2_USE_ENDSTOP) && defined(X2_STALL_SENSITIVITY) && ENABLED(X_DUAL_ENDSTOPS) && _PEXI(X2_E_INDEX, DIAG)
597 516
     #define X2_DIAG_PIN _EPIN(X2_E_INDEX, DIAG)
598 517
     #if   DIAG_REMAPPED(X2, X_MIN)      // If already remapped in the pins file...
599 518
       #define X2_USE_ENDSTOP _XMIN_
@@ -662,7 +581,8 @@
662 581
       #define Y2_SERIAL_RX_PIN _EPIN(Y2_E_INDEX, SERIAL_RX)
663 582
     #endif
664 583
   #endif
665
-  #if defined(Y2_STALL_SENSITIVITY) && ENABLED(Y_DUAL_ENDSTOPS) && _PEXI(Y2_E_INDEX, DIAG)
584
+  // Auto-assign pins for stallGuard sensorless homing
585
+  #if !defined(Y2_USE_ENDSTOP) && defined(Y2_STALL_SENSITIVITY) && ENABLED(Y_DUAL_ENDSTOPS) && _PEXI(Y2_E_INDEX, DIAG)
666 586
     #define Y2_DIAG_PIN _EPIN(Y2_E_INDEX, DIAG)
667 587
     #if   DIAG_REMAPPED(Y2, X_MIN)
668 588
       #define Y2_USE_ENDSTOP _XMIN_
@@ -730,7 +650,8 @@
730 650
       #define Z2_SERIAL_RX_PIN _EPIN(Z2_E_INDEX, SERIAL_RX)
731 651
     #endif
732 652
   #endif
733
-  #if defined(Z2_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 2 && _PEXI(Z2_E_INDEX, DIAG)
653
+  // Auto-assign pins for stallGuard sensorless homing
654
+  #if !defined(Z2_USE_ENDSTOP) && defined(Z2_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 2 && _PEXI(Z2_E_INDEX, DIAG)
734 655
     #define Z2_DIAG_PIN _EPIN(Z2_E_INDEX, DIAG)
735 656
     #if   DIAG_REMAPPED(Z2, X_MIN)
736 657
       #define Z2_USE_ENDSTOP _XMIN_
@@ -799,7 +720,8 @@
799 720
       #define Z3_SERIAL_RX_PIN _EPIN(Z3_E_INDEX, SERIAL_RX)
800 721
     #endif
801 722
   #endif
802
-  #if defined(Z3_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 && _PEXI(Z3_E_INDEX, DIAG)
723
+  // Auto-assign pins for stallGuard sensorless homing
724
+  #if !defined(Z3_USE_ENDSTOP) && defined(Z3_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 && _PEXI(Z3_E_INDEX, DIAG)
803 725
     #define Z3_DIAG_PIN _EPIN(Z3_E_INDEX, DIAG)
804 726
     #if   DIAG_REMAPPED(Z3, X_MIN)
805 727
       #define Z3_USE_ENDSTOP _XMIN_
@@ -866,7 +788,8 @@
866 788
       #define Z4_SERIAL_RX_PIN _EPIN(Z4_E_INDEX, SERIAL_RX)
867 789
     #endif
868 790
   #endif
869
-  #if defined(Z4_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && _PEXI(Z4_E_INDEX, DIAG)
791
+  // Auto-assign pins for stallGuard sensorless homing
792
+  #if !defined(Z4_USE_ENDSTOP) && defined(Z4_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && _PEXI(Z4_E_INDEX, DIAG)
870 793
     #define Z4_DIAG_PIN _EPIN(Z4_E_INDEX, DIAG)
871 794
     #if   DIAG_REMAPPED(Z4, X_MIN)
872 795
       #define Z4_USE_ENDSTOP _XMIN_
@@ -901,6 +824,91 @@
901 824
   #define Z4_MS3_PIN -1
902 825
 #endif
903 826
 
827
+//
828
+// Disable unused endstop / probe pins
829
+//
830
+#define _STOP_IN_USE(N) (X2_USE_ENDSTOP == N || Y2_USE_ENDSTOP == N || Z2_USE_ENDSTOP == N || Z3_USE_ENDSTOP == N || Z4_USE_ENDSTOP == N)
831
+#if _STOP_IN_USE(_XMAX_)
832
+  #define USE_XMAX_PLUG
833
+#endif
834
+#if _STOP_IN_USE(_YMAX_)
835
+  #define USE_YMAX_PLUG
836
+#endif
837
+#if _STOP_IN_USE(_ZMAX_)
838
+  #define USE_ZMAX_PLUG
839
+#endif
840
+#if _STOP_IN_USE(_XMIN_)
841
+  #define USE_XMIN_PLUG
842
+#endif
843
+#if _STOP_IN_USE(_YMIN_)
844
+  #define USE_YMIN_PLUG
845
+#endif
846
+#if _STOP_IN_USE(_ZMIN_)
847
+  #define USE_ZMIN_PLUG
848
+#endif
849
+#undef _STOP_IN_USE
850
+#if !HAS_CUSTOM_PROBE_PIN
851
+  #undef Z_MIN_PROBE_PIN
852
+  #define Z_MIN_PROBE_PIN    -1
853
+#endif
854
+#if DISABLED(USE_XMAX_PLUG)
855
+  #undef X_MAX_PIN
856
+  #define X_MAX_PIN          -1
857
+#endif
858
+#if DISABLED(USE_YMAX_PLUG)
859
+  #undef Y_MAX_PIN
860
+  #define Y_MAX_PIN          -1
861
+#endif
862
+#if DISABLED(USE_ZMAX_PLUG)
863
+  #undef Z_MAX_PIN
864
+  #define Z_MAX_PIN          -1
865
+#endif
866
+#if DISABLED(USE_XMIN_PLUG)
867
+  #undef X_MIN_PIN
868
+  #define X_MIN_PIN          -1
869
+#endif
870
+#if DISABLED(USE_YMIN_PLUG)
871
+  #undef Y_MIN_PIN
872
+  #define Y_MIN_PIN          -1
873
+#endif
874
+#if DISABLED(USE_ZMIN_PLUG)
875
+  #undef Z_MIN_PIN
876
+  #define Z_MIN_PIN          -1
877
+#endif
878
+#if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MAX
879
+  #undef X2_MIN_PIN
880
+#endif
881
+#if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MIN
882
+  #undef X2_MAX_PIN
883
+#endif
884
+#if DISABLED(Y_DUAL_ENDSTOPS) || Y_HOME_TO_MAX
885
+  #undef Y2_MIN_PIN
886
+#endif
887
+#if DISABLED(Y_DUAL_ENDSTOPS) || Y_HOME_TO_MIN
888
+  #undef Y2_MAX_PIN
889
+#endif
890
+#if DISABLED(Z_MULTI_ENDSTOPS) || Z_HOME_TO_MAX
891
+  #undef Z2_MIN_PIN
892
+#endif
893
+#if DISABLED(Z_MULTI_ENDSTOPS) || Z_HOME_TO_MIN
894
+  #undef Z2_MAX_PIN
895
+#endif
896
+#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 3 || Z_HOME_TO_MAX
897
+  #undef Z3_MIN_PIN
898
+#endif
899
+#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 3 || Z_HOME_TO_MIN
900
+  #undef Z3_MAX_PIN
901
+#endif
902
+#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 4 || Z_HOME_TO_MAX
903
+  #undef Z4_MIN_PIN
904
+#endif
905
+#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 4 || Z_HOME_TO_MIN
906
+  #undef Z4_MAX_PIN
907
+#endif
908
+
909
+//
910
+// Default DOGLCD SPI delays
911
+//
904 912
 #if HAS_MARLINUI_U8GLIB
905 913
   #if !defined(ST7920_DELAY_1) && defined(BOARD_ST7920_DELAY_1)
906 914
     #define ST7920_DELAY_1 BOARD_ST7920_DELAY_1

Laden…
Abbrechen
Speichern