소스 검색

🎨 Various multi-axis patches (#22823)

Scott Lahteine 3 년 전
부모
커밋
dc5bef62ba
No account linked to committer's email address

+ 12
- 12
Marlin/Configuration.h 파일 보기

@@ -794,18 +794,18 @@
794 794
 #define ENDSTOPPULLUPS
795 795
 #if DISABLED(ENDSTOPPULLUPS)
796 796
   // Disable ENDSTOPPULLUPS to set pullups individually
797
-  //#define ENDSTOPPULLUP_XMAX
798
-  //#define ENDSTOPPULLUP_YMAX
799
-  //#define ENDSTOPPULLUP_ZMAX
800
-  //#define ENDSTOPPULLUP_IMAX
801
-  //#define ENDSTOPPULLUP_JMAX
802
-  //#define ENDSTOPPULLUP_KMAX
803 797
   //#define ENDSTOPPULLUP_XMIN
804 798
   //#define ENDSTOPPULLUP_YMIN
805 799
   //#define ENDSTOPPULLUP_ZMIN
806 800
   //#define ENDSTOPPULLUP_IMIN
807 801
   //#define ENDSTOPPULLUP_JMIN
808 802
   //#define ENDSTOPPULLUP_KMIN
803
+  //#define ENDSTOPPULLUP_XMAX
804
+  //#define ENDSTOPPULLUP_YMAX
805
+  //#define ENDSTOPPULLUP_ZMAX
806
+  //#define ENDSTOPPULLUP_IMAX
807
+  //#define ENDSTOPPULLUP_JMAX
808
+  //#define ENDSTOPPULLUP_KMAX
809 809
   //#define ENDSTOPPULLUP_ZMIN_PROBE
810 810
 #endif
811 811
 
@@ -813,18 +813,18 @@
813 813
 //#define ENDSTOPPULLDOWNS
814 814
 #if DISABLED(ENDSTOPPULLDOWNS)
815 815
   // Disable ENDSTOPPULLDOWNS to set pulldowns individually
816
-  //#define ENDSTOPPULLDOWN_XMAX
817
-  //#define ENDSTOPPULLDOWN_YMAX
818
-  //#define ENDSTOPPULLDOWN_ZMAX
819
-  //#define ENDSTOPPULLDOWN_IMAX
820
-  //#define ENDSTOPPULLDOWN_JMAX
821
-  //#define ENDSTOPPULLDOWN_KMAX
822 816
   //#define ENDSTOPPULLDOWN_XMIN
823 817
   //#define ENDSTOPPULLDOWN_YMIN
824 818
   //#define ENDSTOPPULLDOWN_ZMIN
825 819
   //#define ENDSTOPPULLDOWN_IMIN
826 820
   //#define ENDSTOPPULLDOWN_JMIN
827 821
   //#define ENDSTOPPULLDOWN_KMIN
822
+  //#define ENDSTOPPULLDOWN_XMAX
823
+  //#define ENDSTOPPULLDOWN_YMAX
824
+  //#define ENDSTOPPULLDOWN_ZMAX
825
+  //#define ENDSTOPPULLDOWN_IMAX
826
+  //#define ENDSTOPPULLDOWN_JMAX
827
+  //#define ENDSTOPPULLDOWN_KMAX
828 828
   //#define ENDSTOPPULLDOWN_ZMIN_PROBE
829 829
 #endif
830 830
 

+ 8
- 4
Marlin/src/HAL/SAMD51/endstop_interrupts.h 파일 보기

@@ -162,12 +162,14 @@ void setup_endstop_interrupts() {
162 162
       #error "Z_MIN_PROBE_PIN has no EXTINT line available."
163 163
     #endif
164 164
     _ATTACH(Z_MIN_PROBE_PIN);
165
-  #elif HAS_I_MAX
165
+  #endif
166
+  #if HAS_I_MAX
166 167
     #if !AVAILABLE_EILINE(I_MAX_PIN)
167 168
       #error "I_MAX_PIN has no EXTINT line available."
168 169
     #endif
169 170
     attachInterrupt(I_MAX_PIN, endstop_ISR, CHANGE);
170
-  #elif HAS_I_MIN
171
+  #endif
172
+  #if HAS_I_MIN
171 173
     #if !AVAILABLE_EILINE(I_MIN_PIN)
172 174
       #error "I_MIN_PIN has no EXTINT line available."
173 175
     #endif
@@ -178,7 +180,8 @@ void setup_endstop_interrupts() {
178 180
       #error "J_MAX_PIN has no EXTINT line available."
179 181
     #endif
180 182
     attachInterrupt(J_MAX_PIN, endstop_ISR, CHANGE);
181
-  #elif HAS_J_MIN
183
+  #endif
184
+  #if HAS_J_MIN
182 185
     #if !AVAILABLE_EILINE(J_MIN_PIN)
183 186
       #error "J_MIN_PIN has no EXTINT line available."
184 187
     #endif
@@ -189,7 +192,8 @@ void setup_endstop_interrupts() {
189 192
       #error "K_MAX_PIN has no EXTINT line available."
190 193
     #endif
191 194
     attachInterrupt(K_MAX_PIN, endstop_ISR, CHANGE);
192
-  #elif HAS_K_MIN
195
+  #endif
196
+  #if HAS_K_MIN
193 197
     #if !AVAILABLE_EILINE(K_MIN_PIN)
194 198
       #error "K_MIN_PIN has no EXTINT line available."
195 199
     #endif

+ 37
- 26
Marlin/src/core/macros.h 파일 보기

@@ -33,32 +33,32 @@
33 33
 
34 34
 #define _AXIS(A) (A##_AXIS)
35 35
 
36
-#define _XMIN_   100
37
-#define _YMIN_   200
38
-#define _ZMIN_   300
39
-#define _IMIN_   500
40
-#define _JMIN_   600
41
-#define _KMIN_   700
42
-#define _XMAX_   101
43
-#define _YMAX_   201
44
-#define _ZMAX_   301
45
-#define _IMAX_   501
46
-#define _JMAX_   601
47
-#define _KMAX_   701
48
-#define _XDIAG_  102
49
-#define _YDIAG_  202
50
-#define _ZDIAG_  302
51
-#define _IDIAG_  502
52
-#define _JDIAG_  602
53
-#define _KDIAG_  702
54
-#define _E0DIAG_ 400
55
-#define _E1DIAG_ 401
56
-#define _E2DIAG_ 402
57
-#define _E3DIAG_ 403
58
-#define _E4DIAG_ 404
59
-#define _E5DIAG_ 405
60
-#define _E6DIAG_ 406
61
-#define _E7DIAG_ 407
36
+#define _XMIN_   0x11
37
+#define _YMIN_   0x12
38
+#define _ZMIN_   0x13
39
+#define _IMIN_   0x14
40
+#define _JMIN_   0x15
41
+#define _KMIN_   0x16
42
+#define _XMAX_   0x21
43
+#define _YMAX_   0x22
44
+#define _ZMAX_   0x23
45
+#define _IMAX_   0x24
46
+#define _JMAX_   0x25
47
+#define _KMAX_   0x26
48
+#define _XDIAG_  0x31
49
+#define _YDIAG_  0x32
50
+#define _ZDIAG_  0x33
51
+#define _IDIAG_  0x34
52
+#define _JDIAG_  0x35
53
+#define _KDIAG_  0x36
54
+#define _E0DIAG_ 0xE0
55
+#define _E1DIAG_ 0xE1
56
+#define _E2DIAG_ 0xE2
57
+#define _E3DIAG_ 0xE3
58
+#define _E4DIAG_ 0xE4
59
+#define _E5DIAG_ 0xE5
60
+#define _E6DIAG_ 0xE6
61
+#define _E7DIAG_ 0xE7
62 62
 
63 63
 #define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__
64 64
 #define  FORCE_INLINE  __attribute__((always_inline)) inline
@@ -251,6 +251,8 @@
251 251
     memcpy(&a[0],&b[0],_MIN(sizeof(a),sizeof(b))); \
252 252
   }while(0)
253 253
 
254
+#define CODE_11( A,B,C,D,E,F,G,H,I,J,K,...) A; B; C; D; E; F; G; H; I; J; K
255
+#define CODE_10( A,B,C,D,E,F,G,H,I,J,...) A; B; C; D; E; F; G; H; I; J
254 256
 #define CODE_9( A,B,C,D,E,F,G,H,I,...) A; B; C; D; E; F; G; H; I
255 257
 #define CODE_8( A,B,C,D,E,F,G,H,...) A; B; C; D; E; F; G; H
256 258
 #define CODE_7( A,B,C,D,E,F,G,...) A; B; C; D; E; F; G
@@ -286,6 +288,10 @@
286 288
 #define GANG_N_1(N,K) _GANG_N(N,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K)
287 289
 
288 290
 // Macros for initializing arrays
291
+#define LIST_20(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T
292
+#define LIST_19(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S
293
+#define LIST_18(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R
294
+#define LIST_17(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q
289 295
 #define LIST_16(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P
290 296
 #define LIST_15(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O
291 297
 #define LIST_14(A,B,C,D,E,F,G,H,I,J,K,L,M,N,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N
@@ -502,6 +508,11 @@
502 508
 #define INC_13 14
503 509
 #define INC_14 15
504 510
 #define INC_15 16
511
+#define INC_16 17
512
+#define INC_17 18
513
+#define INC_18 19
514
+#define INC_19 20
515
+#define INC_20 21
505 516
 #define INCREMENT_(n) INC_##n
506 517
 #define INCREMENT(n) INCREMENT_(n)
507 518
 

+ 3
- 3
Marlin/src/feature/backlash.cpp 파일 보기

@@ -60,9 +60,9 @@ Backlash backlash;
60 60
  * spread over multiple segments, smoothing out artifacts even more.
61 61
  */
62 62
 
63
-void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const uint8_t dm, block_t * const block) {
64
-  static uint8_t last_direction_bits;
65
-  uint8_t changed_dir = last_direction_bits ^ dm;
63
+void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const axis_bits_t dm, block_t * const block) {
64
+  static axis_bits_t last_direction_bits;
65
+  axis_bits_t changed_dir = last_direction_bits ^ dm;
66 66
   // Ignore direction change unless steps are taken in that direction
67 67
   #if DISABLED(CORE_BACKLASH) || ENABLED(MARKFORGED_XY)
68 68
     if (!da) CBI(changed_dir, X_AXIS);

+ 1
- 1
Marlin/src/feature/backlash.h 파일 보기

@@ -71,7 +71,7 @@ public:
71 71
     return has_measurement(X_AXIS) || has_measurement(Y_AXIS) || has_measurement(Z_AXIS);
72 72
   }
73 73
 
74
-  void add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const uint8_t dm, block_t * const block);
74
+  void add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const axis_bits_t dm, block_t * const block);
75 75
 };
76 76
 
77 77
 extern Backlash backlash;

+ 3
- 3
Marlin/src/gcode/config/M217.cpp 파일 보기

@@ -141,9 +141,9 @@ void GcodeSuite::M217_report(const bool forReplay/*=true*/) {
141 141
                       SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime),
142 142
                       SP_P_STR, LINEAR_UNIT(toolchange_settings.prime_speed));
143 143
     SERIAL_ECHOPGM(" R", LINEAR_UNIT(toolchange_settings.retract_speed),
144
-                    " U", LINEAR_UNIT(toolchange_settings.unretract_speed),
145
-                    " F", toolchange_settings.fan_speed,
146
-                    " G", toolchange_settings.fan_time);
144
+                   " U", LINEAR_UNIT(toolchange_settings.unretract_speed),
145
+                   " F", toolchange_settings.fan_speed,
146
+                   " G", toolchange_settings.fan_time);
147 147
 
148 148
     #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
149 149
       SERIAL_ECHOPGM(" A", migration.automode);

+ 11
- 15
Marlin/src/gcode/feature/trinamic/M906.cpp 파일 보기

@@ -206,7 +206,8 @@ void GcodeSuite::M906_report(const bool forReplay/*=true*/) {
206 206
     SERIAL_ECHOPGM("  M906");
207 207
   };
208 208
 
209
-  #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
209
+  #if  AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) \
210
+    || AXIS_IS_TMC(I) || AXIS_IS_TMC(J) || AXIS_IS_TMC(K)
210 211
     say_M906(forReplay);
211 212
     #if AXIS_IS_TMC(X)
212 213
       SERIAL_ECHOPGM_P(SP_X_STR, stepperX.getMilliamps());
@@ -217,6 +218,15 @@ void GcodeSuite::M906_report(const bool forReplay/*=true*/) {
217 218
     #if AXIS_IS_TMC(Z)
218 219
       SERIAL_ECHOPGM_P(SP_Z_STR, stepperZ.getMilliamps());
219 220
     #endif
221
+    #if AXIS_IS_TMC(I)
222
+      SERIAL_ECHOPGM_P(SP_I_STR, stepperI.getMilliamps());
223
+    #endif
224
+    #if AXIS_IS_TMC(J)
225
+      SERIAL_ECHOPGM_P(SP_J_STR, stepperJ.getMilliamps());
226
+    #endif
227
+    #if AXIS_IS_TMC(K)
228
+      SERIAL_ECHOPGM_P(SP_K_STR, stepperK.getMilliamps());
229
+    #endif
220 230
     SERIAL_EOL();
221 231
   #endif
222 232
 
@@ -239,25 +249,11 @@ void GcodeSuite::M906_report(const bool forReplay/*=true*/) {
239 249
     say_M906(forReplay);
240 250
     SERIAL_ECHOLNPGM(" I2 Z", stepperZ3.getMilliamps());
241 251
   #endif
242
-
243 252
   #if AXIS_IS_TMC(Z4)
244 253
     say_M906(forReplay);
245 254
     SERIAL_ECHOLNPGM(" I3 Z", stepperZ4.getMilliamps());
246 255
   #endif
247 256
 
248
-  #if AXIS_IS_TMC(I)
249
-    say_M906(forReplay);
250
-    SERIAL_ECHOLNPGM_P(SP_I_STR, stepperI.getMilliamps());
251
-  #endif
252
-  #if AXIS_IS_TMC(J)
253
-    say_M906(forReplay);
254
-    SERIAL_ECHOLNPGM_P(SP_J_STR, stepperJ.getMilliamps());
255
-  #endif
256
-  #if AXIS_IS_TMC(K)
257
-    say_M906(forReplay);
258
-    SERIAL_ECHOLNPGM_P(SP_K_STR, stepperK.getMilliamps());
259
-  #endif
260
-
261 257
   #if AXIS_IS_TMC(E0)
262 258
     say_M906(forReplay);
263 259
     SERIAL_ECHOLNPGM(" T0 E", stepperE0.getMilliamps());

+ 1
- 1
Marlin/src/gcode/gcode.cpp 파일 보기

@@ -74,7 +74,7 @@ millis_t GcodeSuite::previous_move_ms = 0,
74 74
 
75 75
 // Relative motion mode for each logical axis
76 76
 static constexpr xyze_bool_t ar_init = AXIS_RELATIVE_MODES;
77
-uint8_t GcodeSuite::axis_relative = 0 LOGICAL_AXIS_GANG(
77
+axis_bits_t GcodeSuite::axis_relative = 0 LOGICAL_AXIS_GANG(
78 78
   | (ar_init.e << REL_E),
79 79
   | (ar_init.x << REL_X),
80 80
   | (ar_init.y << REL_Y),

+ 1
- 1
Marlin/src/gcode/gcode.h 파일 보기

@@ -327,7 +327,7 @@ extern const char G28_STR[];
327 327
 class GcodeSuite {
328 328
 public:
329 329
 
330
-  static uint8_t axis_relative;
330
+  static axis_bits_t axis_relative;
331 331
 
332 332
   static inline bool axis_is_relative(const AxisEnum a) {
333 333
     #if HAS_EXTRUDERS

+ 1
- 2
Marlin/src/gcode/queue.cpp 파일 보기

@@ -260,8 +260,7 @@ void GCodeQueue::RingBuffer::ok_to_send() {
260 260
       while (NUMERIC_SIGNED(*p))
261 261
         SERIAL_CHAR(*p++);
262 262
     }
263
-    SERIAL_ECHOPGM_P(SP_P_STR, planner.moves_free(),
264
-                      SP_B_STR, BUFSIZE - length);
263
+    SERIAL_ECHOPGM_P(SP_P_STR, planner.moves_free(), SP_B_STR, BUFSIZE - length);
265 264
   #endif
266 265
   SERIAL_EOL();
267 266
 }

+ 10
- 16
Marlin/src/inc/Conditionals_post.h 파일 보기

@@ -1927,20 +1927,14 @@
1927 1927
   #ifndef Z4_INTERPOLATE
1928 1928
     #define Z4_INTERPOLATE INTERPOLATE
1929 1929
   #endif
1930
-  #if LINEAR_AXES >= 4
1931
-    #ifndef I_INTERPOLATE
1932
-      #define I_INTERPOLATE INTERPOLATE
1933
-    #endif
1930
+  #if LINEAR_AXES >= 4 && !defined(I_INTERPOLATE)
1931
+    #define I_INTERPOLATE INTERPOLATE
1934 1932
   #endif
1935
-  #if LINEAR_AXES >= 5
1936
-    #ifndef J_INTERPOLATE
1937
-      #define J_INTERPOLATE INTERPOLATE
1938
-    #endif
1933
+  #if LINEAR_AXES >= 5 && !defined(J_INTERPOLATE)
1934
+    #define J_INTERPOLATE INTERPOLATE
1939 1935
   #endif
1940
-  #if LINEAR_AXES >= 6
1941
-    #ifndef K_INTERPOLATE
1942
-      #define K_INTERPOLATE INTERPOLATE
1943
-    #endif
1936
+  #if LINEAR_AXES >= 6 && !defined(K_INTERPOLATE)
1937
+    #define K_INTERPOLATE INTERPOLATE
1944 1938
   #endif
1945 1939
   #ifndef E0_INTERPOLATE
1946 1940
     #define E0_INTERPOLATE INTERPOLATE
@@ -1967,13 +1961,13 @@
1967 1961
     #define E7_INTERPOLATE INTERPOLATE
1968 1962
   #endif
1969 1963
   #ifndef X_SLAVE_ADDRESS
1970
-    #define X_SLAVE_ADDRESS  0
1964
+    #define X_SLAVE_ADDRESS 0
1971 1965
   #endif
1972 1966
   #ifndef Y_SLAVE_ADDRESS
1973
-    #define Y_SLAVE_ADDRESS  0
1967
+    #define Y_SLAVE_ADDRESS 0
1974 1968
   #endif
1975 1969
   #ifndef Z_SLAVE_ADDRESS
1976
-    #define Z_SLAVE_ADDRESS  0
1970
+    #define Z_SLAVE_ADDRESS 0
1977 1971
   #endif
1978 1972
   #ifndef I_SLAVE_ADDRESS
1979 1973
     #define I_SLAVE_ADDRESS 0
@@ -2665,7 +2659,7 @@
2665 2659
 #if HAS_EXTRUDERS && PIN_EXISTS(MOTOR_CURRENT_PWM_E)
2666 2660
   #define HAS_MOTOR_CURRENT_PWM_E 1
2667 2661
 #endif
2668
-#if HAS_MOTOR_CURRENT_PWM_E || ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z)
2662
+#if HAS_MOTOR_CURRENT_PWM_E || ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z, MOTOR_CURRENT_PWM_I, MOTOR_CURRENT_PWM_J, MOTOR_CURRENT_PWM_K)
2669 2663
   #define HAS_MOTOR_CURRENT_PWM 1
2670 2664
 #endif
2671 2665
 

+ 9
- 3
Marlin/src/inc/SanityCheck.h 파일 보기

@@ -1404,8 +1404,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1404 1404
   #endif
1405 1405
 #endif
1406 1406
 #if LINEAR_AXES >= 5
1407
-  #if AXIS5_NAME == AXIS4_NAME || AXIS5_NAME == AXIS6_NAME
1408
-    #error "AXIS5_NAME must be different from AXIS4_NAME and AXIS6_NAME"
1407
+  #if AXIS5_NAME == AXIS4_NAME
1408
+    #error "AXIS5_NAME must be unique."
1409 1409
   #elif AXIS5_NAME != 'A' && AXIS5_NAME != 'B' && AXIS5_NAME != 'C' && AXIS5_NAME != 'U' && AXIS5_NAME != 'V' && AXIS5_NAME != 'W'
1410 1410
     #error "AXIS5_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1411 1411
   #elif !defined(J_MIN_POS) || !defined(J_MAX_POS)
@@ -1418,7 +1418,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1418 1418
 #endif
1419 1419
 #if LINEAR_AXES >= 6
1420 1420
   #if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME
1421
-    #error "AXIS6_NAME must be different from AXIS5_NAME and AXIS4_NAME."
1421
+    #error "AXIS6_NAME must be unique."
1422 1422
   #elif AXIS6_NAME != 'A' && AXIS6_NAME != 'B' && AXIS6_NAME != 'C' && AXIS6_NAME != 'U' && AXIS6_NAME != 'V' && AXIS6_NAME != 'W'
1423 1423
     #error "AXIS6_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1424 1424
   #elif !defined(K_MIN_POS) || !defined(K_MAX_POS)
@@ -3040,10 +3040,16 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
3040 3040
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN."
3041 3041
     #elif Z_SENSORLESS && Z_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_ZMAX)
3042 3042
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX."
3043
+    #elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_IMIN)
3044
+      #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMIN (or ENDSTOPPULLUPS) when homing to I_MIN."
3043 3045
     #elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_IMAX)
3044 3046
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMAX (or ENDSTOPPULLUPS) when homing to I_MAX."
3047
+    #elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_JMIN)
3048
+      #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMIN (or ENDSTOPPULLUPS) when homing to J_MIN."
3045 3049
     #elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_JMAX)
3046 3050
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMAX (or ENDSTOPPULLUPS) when homing to J_MAX."
3051
+    #elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_KMIN)
3052
+      #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMIN (or ENDSTOPPULLUPS) when homing to K_MIN."
3047 3053
     #elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_KMAX)
3048 3054
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMAX (or ENDSTOPPULLUPS) when homing to K_MAX."
3049 3055
     #endif

+ 12
- 0
Marlin/src/lcd/extui/ui_api.cpp 파일 보기

@@ -423,6 +423,12 @@ namespace ExtUI {
423 423
         #if AXIS_IS_TMC(Z2)
424 424
           case Z2: return stepperZ2.getMilliamps();
425 425
         #endif
426
+        #if AXIS_IS_TMC(Z3)
427
+          case Z3: return stepperZ3.getMilliamps();
428
+        #endif
429
+        #if AXIS_IS_TMC(Z4)
430
+          case Z4: return stepperZ4.getMilliamps();
431
+        #endif
426 432
         default: return NAN;
427 433
       };
428 434
     }
@@ -486,6 +492,12 @@ namespace ExtUI {
486 492
         #if AXIS_IS_TMC(Z2)
487 493
           case Z2: stepperZ2.rms_current(constrain(mA, 400, 1500)); break;
488 494
         #endif
495
+        #if AXIS_IS_TMC(Z3)
496
+          case Z3: stepperZ3.rms_current(constrain(mA, 400, 1500)); break;
497
+        #endif
498
+        #if AXIS_IS_TMC(Z4)
499
+          case Z4: stepperZ4.rms_current(constrain(mA, 400, 1500)); break;
500
+        #endif
489 501
         default: break;
490 502
       };
491 503
     }

+ 4
- 4
Marlin/src/module/planner.cpp 파일 보기

@@ -1310,7 +1310,7 @@ void Planner::recalculate() {
1310 1310
  */
1311 1311
 void Planner::check_axes_activity() {
1312 1312
 
1313
-  #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z , DISABLE_I , DISABLE_J , DISABLE_K, DISABLE_E)
1313
+  #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_I, DISABLE_J, DISABLE_K, DISABLE_E)
1314 1314
     xyze_bool_t axis_active = { false };
1315 1315
   #endif
1316 1316
 
@@ -1913,7 +1913,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1913 1913
   #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE
1914 1914
 
1915 1915
   // Compute direction bit-mask for this block
1916
-  uint8_t dm = 0;
1916
+  axis_bits_t dm = 0;
1917 1917
   #if CORE_IS_XY
1918 1918
     if (da < 0) SBI(dm, X_HEAD);                // Save the toolhead's true direction in X
1919 1919
     if (db < 0) SBI(dm, Y_HEAD);                // ...and Y
@@ -2345,11 +2345,11 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2345 2345
 
2346 2346
   #ifdef XY_FREQUENCY_LIMIT
2347 2347
 
2348
-    static uint8_t old_direction_bits; // = 0
2348
+    static axis_bits_t old_direction_bits; // = 0
2349 2349
 
2350 2350
     if (xy_freq_limit_hz) {
2351 2351
       // Check and limit the xy direction change frequency
2352
-      const uint8_t direction_change = block->direction_bits ^ old_direction_bits;
2352
+      const axis_bits_t direction_change = block->direction_bits ^ old_direction_bits;
2353 2353
       old_direction_bits = block->direction_bits;
2354 2354
       segment_time_us = LROUND(float(segment_time_us) / speed_factor);
2355 2355
 

+ 1
- 1
Marlin/src/module/planner.h 파일 보기

@@ -202,7 +202,7 @@ typedef struct block_t {
202 202
     uint32_t acceleration_rate;             // The acceleration rate used for acceleration calculation
203 203
   #endif
204 204
 
205
-  uint8_t direction_bits;                   // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
205
+  axis_bits_t direction_bits;               // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
206 206
 
207 207
   // Advance extrusion
208 208
   #if ENABLED(LIN_ADVANCE)

+ 13
- 17
Marlin/src/module/stepper.cpp 파일 보기

@@ -149,8 +149,8 @@ Stepper stepper; // Singleton
149 149
 
150 150
 block_t* Stepper::current_block; // (= nullptr) A pointer to the block currently being traced
151 151
 
152
-uint8_t Stepper::last_direction_bits, // = 0
153
-        Stepper::axis_did_move; // = 0
152
+axis_bits_t Stepper::last_direction_bits, // = 0
153
+            Stepper::axis_did_move; // = 0
154 154
 
155 155
 bool Stepper::abort_current_block;
156 156
 
@@ -503,17 +503,14 @@ void Stepper::set_directions() {
503 503
   #if HAS_Z_DIR
504 504
     SET_STEP_DIR(Z); // C
505 505
   #endif
506
-
507 506
   #if HAS_I_DIR
508
-    SET_STEP_DIR(I); // I
507
+    SET_STEP_DIR(I);
509 508
   #endif
510
-
511 509
   #if HAS_J_DIR
512
-    SET_STEP_DIR(J); // J
510
+    SET_STEP_DIR(J);
513 511
   #endif
514
-
515 512
   #if HAS_K_DIR
516
-    SET_STEP_DIR(K); // K
513
+    SET_STEP_DIR(K);
517 514
   #endif
518 515
 
519 516
   #if DISABLED(LIN_ADVANCE)
@@ -1635,7 +1632,7 @@ void Stepper::pulse_phase_isr() {
1635 1632
             case 0: {
1636 1633
               const uint8_t low = page_step_state.page[page_step_state.segment_idx],
1637 1634
                            high = page_step_state.page[page_step_state.segment_idx + 1];
1638
-              uint8_t dm = last_direction_bits;
1635
+              axis_bits_t dm = last_direction_bits;
1639 1636
 
1640 1637
               PAGE_SEGMENT_UPDATE(X, low >> 4);
1641 1638
               PAGE_SEGMENT_UPDATE(Y, low & 0xF);
@@ -2156,7 +2153,7 @@ uint32_t Stepper::block_phase_isr() {
2156 2153
         #define Z_MOVE_TEST !!current_block->steps.c
2157 2154
       #endif
2158 2155
 
2159
-      uint8_t axis_bits = 0;
2156
+      axis_bits_t axis_bits = 0;
2160 2157
       LINEAR_AXIS_CODE(
2161 2158
         if (X_MOVE_TEST)            SBI(axis_bits, A_AXIS),
2162 2159
         if (Y_MOVE_TEST)            SBI(axis_bits, B_AXIS),
@@ -3003,16 +3000,15 @@ void Stepper::report_positions() {
3003 3000
 
3004 3001
           const bool z_direction = direction ^ BABYSTEP_INVERT_Z;
3005 3002
 
3006
-          ENABLE_AXIS_X();
3007
-          ENABLE_AXIS_Y();
3008
-          ENABLE_AXIS_Z();
3009
-          ENABLE_AXIS_I();
3010
-          ENABLE_AXIS_J();
3011
-          ENABLE_AXIS_K();
3003
+          ENABLE_AXIS_X(); ENABLE_AXIS_Y(); ENABLE_AXIS_Z();
3004
+          ENABLE_AXIS_I(); ENABLE_AXIS_J(); ENABLE_AXIS_K();
3012 3005
 
3013 3006
           DIR_WAIT_BEFORE();
3014 3007
 
3015
-          const xyz_byte_t old_dir = LINEAR_AXIS_ARRAY(X_DIR_READ(), Y_DIR_READ(), Z_DIR_READ(), I_DIR_READ(), J_DIR_READ(), K_DIR_READ());
3008
+          const xyz_byte_t old_dir = LINEAR_AXIS_ARRAY(
3009
+            X_DIR_READ(), Y_DIR_READ(), Z_DIR_READ(),
3010
+            I_DIR_READ(), J_DIR_READ(), K_DIR_READ()
3011
+          );
3016 3012
 
3017 3013
           X_DIR_WRITE(INVERT_X_DIR ^ z_direction);
3018 3014
           #ifdef Y_DIR_WRITE

+ 3
- 3
Marlin/src/module/stepper.h 파일 보기

@@ -276,8 +276,8 @@ class Stepper {
276 276
 
277 277
     static block_t* current_block;          // A pointer to the block currently being traced
278 278
 
279
-    static uint8_t last_direction_bits,     // The next stepping-bits to be output
280
-                   axis_did_move;           // Last Movement in the given direction is not null, as computed when the last movement was fetched from planner
279
+    static axis_bits_t last_direction_bits, // The next stepping-bits to be output
280
+                       axis_did_move;       // Last Movement in the given direction is not null, as computed when the last movement was fetched from planner
281 281
 
282 282
     static bool abort_current_block;        // Signals to the stepper that current block should be aborted
283 283
 
@@ -523,7 +523,7 @@ class Stepper {
523 523
     static void set_directions();
524 524
 
525 525
     // Set direction bits and update all stepper DIR states
526
-    static void set_directions(const uint8_t bits) {
526
+    static void set_directions(const axis_bits_t bits) {
527 527
       last_direction_bits = bits;
528 528
       set_directions();
529 529
     }

+ 3
- 3
Marlin/src/module/stepper/indirection.h 파일 보기

@@ -896,21 +896,21 @@ void reset_stepper_drivers();    // Called by settings.load / settings.reset
896 896
 #endif
897 897
 
898 898
 #if LINEAR_AXES >= 4
899
-  #define  ENABLE_AXIS_I() if (SHOULD_ENABLE(i))  {  ENABLE_STEPPER_I();  AFTER_CHANGE(i, true); }
899
+  #define  ENABLE_AXIS_I() if (SHOULD_ENABLE(i))  {  ENABLE_STEPPER_I(); AFTER_CHANGE(i, true); }
900 900
   #define DISABLE_AXIS_I() if (SHOULD_DISABLE(i)) { DISABLE_STEPPER_I(); AFTER_CHANGE(i, false); set_axis_untrusted(I_AXIS); }
901 901
 #else
902 902
   #define  ENABLE_AXIS_I() NOOP
903 903
   #define DISABLE_AXIS_I() NOOP
904 904
 #endif
905 905
 #if LINEAR_AXES >= 5
906
-  #define  ENABLE_AXIS_J() if (SHOULD_ENABLE(j))  {  ENABLE_STEPPER_J();  AFTER_CHANGE(j, true); }
906
+  #define  ENABLE_AXIS_J() if (SHOULD_ENABLE(j))  {  ENABLE_STEPPER_J(); AFTER_CHANGE(j, true); }
907 907
   #define DISABLE_AXIS_J() if (SHOULD_DISABLE(j)) { DISABLE_STEPPER_J(); AFTER_CHANGE(j, false); set_axis_untrusted(J_AXIS); }
908 908
 #else
909 909
   #define  ENABLE_AXIS_J() NOOP
910 910
   #define DISABLE_AXIS_J() NOOP
911 911
 #endif
912 912
 #if LINEAR_AXES >= 6
913
-  #define  ENABLE_AXIS_K() if (SHOULD_ENABLE(k))  {  ENABLE_STEPPER_K();  AFTER_CHANGE(k, true); }
913
+  #define  ENABLE_AXIS_K() if (SHOULD_ENABLE(k))  {  ENABLE_STEPPER_K(); AFTER_CHANGE(k, true); }
914 914
   #define DISABLE_AXIS_K() if (SHOULD_DISABLE(k)) { DISABLE_STEPPER_K(); AFTER_CHANGE(k, false); set_axis_untrusted(K_AXIS); }
915 915
 #else
916 916
   #define  ENABLE_AXIS_K() NOOP

+ 11
- 6
Marlin/src/module/stepper/trinamic.cpp 파일 보기

@@ -164,6 +164,15 @@ enum StealthIndex : uint8_t {
164 164
 #ifndef TMC_Z4_BAUD_RATE
165 165
   #define TMC_Z4_BAUD_RATE TMC_BAUD_RATE
166 166
 #endif
167
+#ifndef TMC_I_BAUD_RATE
168
+  #define TMC_I_BAUD_RATE TMC_BAUD_RATE
169
+#endif
170
+#ifndef TMC_J_BAUD_RATE
171
+  #define TMC_J_BAUD_RATE TMC_BAUD_RATE
172
+#endif
173
+#ifndef TMC_K_BAUD_RATE
174
+  #define TMC_K_BAUD_RATE TMC_BAUD_RATE
175
+#endif
167 176
 #ifndef TMC_E0_BAUD_RATE
168 177
   #define TMC_E0_BAUD_RATE TMC_BAUD_RATE
169 178
 #endif
@@ -834,12 +843,8 @@ void restore_trinamic_drivers() {
834 843
 void reset_trinamic_drivers() {
835 844
   static constexpr bool stealthchop_by_axis[] = LOGICAL_AXIS_ARRAY(
836 845
     ENABLED(STEALTHCHOP_E),
837
-    ENABLED(STEALTHCHOP_XY),
838
-    ENABLED(STEALTHCHOP_XY),
839
-    ENABLED(STEALTHCHOP_Z),
840
-    ENABLED(STEALTHCHOP_I),
841
-    ENABLED(STEALTHCHOP_J),
842
-    ENABLED(STEALTHCHOP_K)
846
+    ENABLED(STEALTHCHOP_XY), ENABLED(STEALTHCHOP_XY), ENABLED(STEALTHCHOP_Z),
847
+    ENABLED(STEALTHCHOP_I), ENABLED(STEALTHCHOP_J), ENABLED(STEALTHCHOP_K)
843 848
   );
844 849
 
845 850
   #if AXIS_IS_TMC(X)

+ 30
- 6
Marlin/src/pins/pins_postprocess.h 파일 보기

@@ -464,11 +464,19 @@
464 464
   #ifdef I_STOP_PIN
465 465
     #if I_HOME_TO_MIN
466 466
       #define I_MIN_PIN I_STOP_PIN
467
-      #define I_MAX_PIN -1
467
+      #ifndef I_MAX_PIN
468
+        #define I_MAX_PIN -1
469
+      #endif
468 470
     #else
469
-      #define I_MIN_PIN -1
470 471
       #define I_MAX_PIN I_STOP_PIN
472
+      #ifndef I_MIN_PIN
473
+        #define I_MIN_PIN -1
474
+      #endif
471 475
     #endif
476
+  #elif I_HOME_TO_MIN
477
+    #define I_STOP_PIN I_MIN_PIN
478
+  #else
479
+    #define I_STOP_PIN I_MAX_PIN
472 480
   #endif
473 481
 #else
474 482
   #undef I_MIN_PIN
@@ -479,11 +487,19 @@
479 487
   #ifdef J_STOP_PIN
480 488
     #if J_HOME_TO_MIN
481 489
       #define J_MIN_PIN J_STOP_PIN
482
-      #define J_MAX_PIN -1
490
+      #ifndef J_MAX_PIN
491
+        #define J_MAX_PIN -1
492
+      #endif
483 493
     #else
484
-      #define J_MIN_PIN -1
485 494
       #define J_MAX_PIN J_STOP_PIN
495
+      #ifndef J_MIN_PIN
496
+        #define J_MIN_PIN -1
497
+      #endif
486 498
     #endif
499
+  #elif J_HOME_TO_MIN
500
+    #define J_STOP_PIN J_MIN_PIN
501
+  #else
502
+    #define J_STOP_PIN J_MAX_PIN
487 503
   #endif
488 504
 #else
489 505
   #undef J_MIN_PIN
@@ -494,11 +510,19 @@
494 510
   #ifdef K_STOP_PIN
495 511
     #if K_HOME_TO_MIN
496 512
       #define K_MIN_PIN K_STOP_PIN
497
-      #define K_MAX_PIN -1
513
+      #ifndef K_MAX_PIN
514
+        #define K_MAX_PIN -1
515
+      #endif
498 516
     #else
499
-      #define K_MIN_PIN -1
500 517
       #define K_MAX_PIN K_STOP_PIN
518
+      #ifndef K_MIN_PIN
519
+        #define K_MIN_PIN -1
520
+      #endif
501 521
     #endif
522
+  #elif K_HOME_TO_MIN
523
+    #define K_STOP_PIN K_MIN_PIN
524
+  #else
525
+    #define K_STOP_PIN K_MAX_PIN
502 526
   #endif
503 527
 #else
504 528
   #undef K_MIN_PIN

Loading…
취소
저장