Browse Source

🧑‍💻 Misc. updates for extra axes (#23521)

Scott Lahteine 3 years ago
parent
commit
40481947fc
No account linked to committer's email address

+ 3
- 3
Marlin/Configuration_adv.h View File

3224
     #define Z4_SLEW_RATE                 1
3224
     #define Z4_SLEW_RATE                 1
3225
   #endif
3225
   #endif
3226
 
3226
 
3227
-  #if AXIS_DRIVER_TYPE_I(L6470)
3227
+  #if AXIS_IS_L64XX(I)
3228
     #define I_MICROSTEPS      128
3228
     #define I_MICROSTEPS      128
3229
     #define I_OVERCURRENT    2000
3229
     #define I_OVERCURRENT    2000
3230
     #define I_STALLCURRENT   1500
3230
     #define I_STALLCURRENT   1500
3233
     #define I_SLEW_RATE         1
3233
     #define I_SLEW_RATE         1
3234
   #endif
3234
   #endif
3235
 
3235
 
3236
-  #if AXIS_DRIVER_TYPE_J(L6470)
3236
+  #if AXIS_IS_L64XX(J)
3237
     #define J_MICROSTEPS      128
3237
     #define J_MICROSTEPS      128
3238
     #define J_OVERCURRENT    2000
3238
     #define J_OVERCURRENT    2000
3239
     #define J_STALLCURRENT   1500
3239
     #define J_STALLCURRENT   1500
3242
     #define J_SLEW_RATE         1
3242
     #define J_SLEW_RATE         1
3243
   #endif
3243
   #endif
3244
 
3244
 
3245
-  #if AXIS_DRIVER_TYPE_K(L6470)
3245
+  #if AXIS_IS_L64XX(K)
3246
     #define K_MICROSTEPS      128
3246
     #define K_MICROSTEPS      128
3247
     #define K_OVERCURRENT    2000
3247
     #define K_OVERCURRENT    2000
3248
     #define K_STALLCURRENT   1500
3248
     #define K_STALLCURRENT   1500

+ 1
- 0
Marlin/src/HAL/AVR/endstop_interrupts.h View File

301
       pciSetup(Z_MIN_PROBE_PIN);
301
       pciSetup(Z_MIN_PROBE_PIN);
302
     #endif
302
     #endif
303
   #endif
303
   #endif
304
+
304
   // If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI.
305
   // If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI.
305
 }
306
 }

+ 5
- 23
Marlin/src/core/language.h View File

384
     #define STR_I_MIN "w_min"
384
     #define STR_I_MIN "w_min"
385
     #define STR_I_MAX "w_max"
385
     #define STR_I_MAX "w_max"
386
   #else
386
   #else
387
-    #define STR_I "A"
388
-    #define STR_I_MIN "a_min"
389
-    #define STR_I_MAX "a_max"
387
+    #error "AXIS4_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
390
   #endif
388
   #endif
391
 #else
389
 #else
392
   #define STR_I   ""
390
   #define STR_I   ""
393
 #endif
391
 #endif
394
 
392
 
395
 #if HAS_J_AXIS
393
 #if HAS_J_AXIS
396
-  #if AXIS5_NAME == 'A'
397
-    #define STR_J "A"
398
-    #define STR_J_MIN "a_min"
399
-    #define STR_J_MAX "a_max"
400
-  #elif AXIS5_NAME == 'B'
394
+  #if AXIS5_NAME == 'B'
401
     #define STR_J "B"
395
     #define STR_J "B"
402
     #define STR_J_MIN "b_min"
396
     #define STR_J_MIN "b_min"
403
     #define STR_J_MAX "b_max"
397
     #define STR_J_MAX "b_max"
418
     #define STR_J_MIN "w_min"
412
     #define STR_J_MIN "w_min"
419
     #define STR_J_MAX "w_max"
413
     #define STR_J_MAX "w_max"
420
   #else
414
   #else
421
-    #define STR_J "B"
422
-    #define STR_J_MIN "b_min"
423
-    #define STR_J_MAX "b_max"
415
+    #error "AXIS5_NAME can only be one of 'B', 'C', 'U', 'V', or 'W'."
424
   #endif
416
   #endif
425
 #else
417
 #else
426
   #define STR_J   ""
418
   #define STR_J   ""
427
 #endif
419
 #endif
428
 
420
 
429
 #if HAS_K_AXIS
421
 #if HAS_K_AXIS
430
-  #if AXIS6_NAME == 'A'
431
-    #define STR_K "A"
432
-    #define STR_K_MIN "a_min"
433
-    #define STR_K_MAX "a_max"
434
-  #elif AXIS6_NAME == 'B'
435
-    #define STR_K "B"
436
-    #define STR_K_MIN "b_min"
437
-    #define STR_K_MAX "b_max"
438
-  #elif AXIS6_NAME == 'C'
422
+  #if AXIS6_NAME == 'C'
439
     #define STR_K "C"
423
     #define STR_K "C"
440
     #define STR_K_MIN "c_min"
424
     #define STR_K_MIN "c_min"
441
     #define STR_K_MAX "c_max"
425
     #define STR_K_MAX "c_max"
452
     #define STR_K_MIN "w_min"
436
     #define STR_K_MIN "w_min"
453
     #define STR_K_MAX "w_max"
437
     #define STR_K_MAX "w_max"
454
   #else
438
   #else
455
-    #define STR_K "C"
456
-    #define STR_K_MIN "c_min"
457
-    #define STR_K_MAX "c_max"
439
+    #error "AXIS6_NAME can only be one of 'C', 'U', 'V', or 'W'."
458
   #endif
440
   #endif
459
 #else
441
 #else
460
   #define STR_K   ""
442
   #define STR_K   ""

+ 5
- 5
Marlin/src/feature/direct_stepping.cpp View File

52
   volatile bool SerialPageManager<Cfg>::fatal_error;
52
   volatile bool SerialPageManager<Cfg>::fatal_error;
53
 
53
 
54
   template<typename Cfg>
54
   template<typename Cfg>
55
-  volatile PageState SerialPageManager<Cfg>::page_states[Cfg::NUM_PAGES];
55
+  volatile PageState SerialPageManager<Cfg>::page_states[Cfg::PAGE_COUNT];
56
 
56
 
57
   template<typename Cfg>
57
   template<typename Cfg>
58
   volatile bool SerialPageManager<Cfg>::page_states_dirty;
58
   volatile bool SerialPageManager<Cfg>::page_states_dirty;
59
 
59
 
60
   template<typename Cfg>
60
   template<typename Cfg>
61
-  uint8_t SerialPageManager<Cfg>::pages[Cfg::NUM_PAGES][Cfg::PAGE_SIZE];
61
+  uint8_t SerialPageManager<Cfg>::pages[Cfg::PAGE_COUNT][Cfg::PAGE_SIZE];
62
 
62
 
63
   template<typename Cfg>
63
   template<typename Cfg>
64
   uint8_t SerialPageManager<Cfg>::checksum;
64
   uint8_t SerialPageManager<Cfg>::checksum;
74
 
74
 
75
   template <typename Cfg>
75
   template <typename Cfg>
76
   void SerialPageManager<Cfg>::init() {
76
   void SerialPageManager<Cfg>::init() {
77
-    for (int i = 0 ; i < Cfg::NUM_PAGES ; i++)
77
+    for (int i = 0 ; i < Cfg::PAGE_COUNT ; i++)
78
       page_states[i] = PageState::FREE;
78
       page_states[i] = PageState::FREE;
79
 
79
 
80
     fatal_error = false;
80
     fatal_error = false;
183
 
183
 
184
     SERIAL_CHAR(Cfg::CONTROL_CHAR);
184
     SERIAL_CHAR(Cfg::CONTROL_CHAR);
185
     constexpr int state_bits = 2;
185
     constexpr int state_bits = 2;
186
-    constexpr int n_bytes = Cfg::NUM_PAGES >> state_bits;
186
+    constexpr int n_bytes = Cfg::PAGE_COUNT >> state_bits;
187
     volatile uint8_t bits_b[n_bytes] = { 0 };
187
     volatile uint8_t bits_b[n_bytes] = { 0 };
188
 
188
 
189
-    for (page_idx_t i = 0 ; i < Cfg::NUM_PAGES ; i++) {
189
+    for (page_idx_t i = 0 ; i < Cfg::PAGE_COUNT ; i++) {
190
       bits_b[i >> state_bits] |= page_states[i] << ((i * state_bits) & 0x7);
190
       bits_b[i >> state_bits] |= page_states[i] << ((i * state_bits) & 0x7);
191
     }
191
     }
192
 
192
 

+ 6
- 6
Marlin/src/feature/direct_stepping.h View File

68
     static State state;
68
     static State state;
69
     static volatile bool fatal_error;
69
     static volatile bool fatal_error;
70
 
70
 
71
-    static volatile PageState page_states[Cfg::NUM_PAGES];
71
+    static volatile PageState page_states[Cfg::PAGE_COUNT];
72
     static volatile bool page_states_dirty;
72
     static volatile bool page_states_dirty;
73
 
73
 
74
-    static uint8_t pages[Cfg::NUM_PAGES][Cfg::PAGE_SIZE];
74
+    static uint8_t pages[Cfg::PAGE_COUNT][Cfg::PAGE_SIZE];
75
     static uint8_t checksum;
75
     static uint8_t checksum;
76
     static write_byte_idx_t write_byte_idx;
76
     static write_byte_idx_t write_byte_idx;
77
     static page_idx_t write_page_idx;
77
     static page_idx_t write_page_idx;
87
   struct config_t {
87
   struct config_t {
88
     static constexpr char CONTROL_CHAR  = '!';
88
     static constexpr char CONTROL_CHAR  = '!';
89
 
89
 
90
-    static constexpr int NUM_PAGES      = num_pages;
91
-    static constexpr int NUM_AXES       = num_axes;
90
+    static constexpr int PAGE_COUNT     = num_pages;
91
+    static constexpr int AXIS_COUNT     = num_axes;
92
     static constexpr int BITS_SEGMENT   = bits_segment;
92
     static constexpr int BITS_SEGMENT   = bits_segment;
93
     static constexpr int DIRECTIONAL    = dir ? 1 : 0;
93
     static constexpr int DIRECTIONAL    = dir ? 1 : 0;
94
     static constexpr int SEGMENTS       = segments;
94
     static constexpr int SEGMENTS       = segments;
96
     static constexpr int NUM_SEGMENTS   = _BV(BITS_SEGMENT);
96
     static constexpr int NUM_SEGMENTS   = _BV(BITS_SEGMENT);
97
     static constexpr int SEGMENT_STEPS  = _BV(BITS_SEGMENT - DIRECTIONAL) - 1;
97
     static constexpr int SEGMENT_STEPS  = _BV(BITS_SEGMENT - DIRECTIONAL) - 1;
98
     static constexpr int TOTAL_STEPS    = SEGMENT_STEPS * SEGMENTS;
98
     static constexpr int TOTAL_STEPS    = SEGMENT_STEPS * SEGMENTS;
99
-    static constexpr int PAGE_SIZE      = (NUM_AXES * BITS_SEGMENT * SEGMENTS) / 8;
99
+    static constexpr int PAGE_SIZE      = (AXIS_COUNT * BITS_SEGMENT * SEGMENTS) / 8;
100
 
100
 
101
     typedef typename TypeSelector<(PAGE_SIZE>256), uint16_t, uint8_t>::type write_byte_idx_t;
101
     typedef typename TypeSelector<(PAGE_SIZE>256), uint16_t, uint8_t>::type write_byte_idx_t;
102
-    typedef typename TypeSelector<(NUM_PAGES>256), uint16_t, uint8_t>::type page_idx_t;
102
+    typedef typename TypeSelector<(PAGE_COUNT>256), uint16_t, uint8_t>::type page_idx_t;
103
   };
103
   };
104
 
104
 
105
   template <uint8_t num_pages>
105
   template <uint8_t num_pages>

+ 0
- 2
Marlin/src/feature/tmc_util.cpp View File

421
         if (monitor_tmc_driver(stepperI, need_update_error_counters, need_debug_reporting))
421
         if (monitor_tmc_driver(stepperI, need_update_error_counters, need_debug_reporting))
422
           step_current_down(stepperI);
422
           step_current_down(stepperI);
423
       #endif
423
       #endif
424
-
425
       #if AXIS_IS_TMC(J)
424
       #if AXIS_IS_TMC(J)
426
         if (monitor_tmc_driver(stepperJ, need_update_error_counters, need_debug_reporting))
425
         if (monitor_tmc_driver(stepperJ, need_update_error_counters, need_debug_reporting))
427
           step_current_down(stepperJ);
426
           step_current_down(stepperJ);
428
       #endif
427
       #endif
429
-
430
       #if AXIS_IS_TMC(K)
428
       #if AXIS_IS_TMC(K)
431
         if (monitor_tmc_driver(stepperK, need_update_error_counters, need_debug_reporting))
429
         if (monitor_tmc_driver(stepperK, need_update_error_counters, need_debug_reporting))
432
           step_current_down(stepperK);
430
           step_current_down(stepperK);

+ 22
- 7
Marlin/src/gcode/calibrate/G28.cpp View File

262
   reset_stepper_timeout();
262
   reset_stepper_timeout();
263
 
263
 
264
   #define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT)
264
   #define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT)
265
-  #if HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2) || HAS_CURRENT_HOME(I) || HAS_CURRENT_HOME(J) || HAS_CURRENT_HOME(K) || (ENABLED(DELTA) && HAS_CURRENT_HOME(Z))
265
+  #if HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2) || (ENABLED(DELTA) && HAS_CURRENT_HOME(Z)) || HAS_CURRENT_HOME(I) || HAS_CURRENT_HOME(J) || HAS_CURRENT_HOME(K)
266
     #define HAS_HOMING_CURRENT 1
266
     #define HAS_HOMING_CURRENT 1
267
   #endif
267
   #endif
268
 
268
 
273
     #if HAS_CURRENT_HOME(X)
273
     #if HAS_CURRENT_HOME(X)
274
       const int16_t tmc_save_current_X = stepperX.getMilliamps();
274
       const int16_t tmc_save_current_X = stepperX.getMilliamps();
275
       stepperX.rms_current(X_CURRENT_HOME);
275
       stepperX.rms_current(X_CURRENT_HOME);
276
-      if (DEBUGGING(LEVELING)) debug_current(F("X"), tmc_save_current_X, X_CURRENT_HOME);
276
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_X), tmc_save_current_X, X_CURRENT_HOME);
277
     #endif
277
     #endif
278
     #if HAS_CURRENT_HOME(X2)
278
     #if HAS_CURRENT_HOME(X2)
279
       const int16_t tmc_save_current_X2 = stepperX2.getMilliamps();
279
       const int16_t tmc_save_current_X2 = stepperX2.getMilliamps();
280
       stepperX2.rms_current(X2_CURRENT_HOME);
280
       stepperX2.rms_current(X2_CURRENT_HOME);
281
-      if (DEBUGGING(LEVELING)) debug_current(F("X2"), tmc_save_current_X2, X2_CURRENT_HOME);
281
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_X2), tmc_save_current_X2, X2_CURRENT_HOME);
282
     #endif
282
     #endif
283
     #if HAS_CURRENT_HOME(Y)
283
     #if HAS_CURRENT_HOME(Y)
284
       const int16_t tmc_save_current_Y = stepperY.getMilliamps();
284
       const int16_t tmc_save_current_Y = stepperY.getMilliamps();
285
       stepperY.rms_current(Y_CURRENT_HOME);
285
       stepperY.rms_current(Y_CURRENT_HOME);
286
-      if (DEBUGGING(LEVELING)) debug_current(F("Y"), tmc_save_current_Y, Y_CURRENT_HOME);
286
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_Y), tmc_save_current_Y, Y_CURRENT_HOME);
287
     #endif
287
     #endif
288
     #if HAS_CURRENT_HOME(Y2)
288
     #if HAS_CURRENT_HOME(Y2)
289
       const int16_t tmc_save_current_Y2 = stepperY2.getMilliamps();
289
       const int16_t tmc_save_current_Y2 = stepperY2.getMilliamps();
290
       stepperY2.rms_current(Y2_CURRENT_HOME);
290
       stepperY2.rms_current(Y2_CURRENT_HOME);
291
-      if (DEBUGGING(LEVELING)) debug_current(F("Y2"), tmc_save_current_Y2, Y2_CURRENT_HOME);
291
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_Y2), tmc_save_current_Y2, Y2_CURRENT_HOME);
292
     #endif
292
     #endif
293
     #if HAS_CURRENT_HOME(I)
293
     #if HAS_CURRENT_HOME(I)
294
       const int16_t tmc_save_current_I = stepperI.getMilliamps();
294
       const int16_t tmc_save_current_I = stepperI.getMilliamps();
308
     #if HAS_CURRENT_HOME(Z) && ENABLED(DELTA)
308
     #if HAS_CURRENT_HOME(Z) && ENABLED(DELTA)
309
       const int16_t tmc_save_current_Z = stepperZ.getMilliamps();
309
       const int16_t tmc_save_current_Z = stepperZ.getMilliamps();
310
       stepperZ.rms_current(Z_CURRENT_HOME);
310
       stepperZ.rms_current(Z_CURRENT_HOME);
311
-      if (DEBUGGING(LEVELING)) debug_current(F("Z"), tmc_save_current_Z, Z_CURRENT_HOME);
311
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_Z), tmc_save_current_Z, Z_CURRENT_HOME);
312
+    #endif
313
+    #if HAS_CURRENT_HOME(I)
314
+      const int16_t tmc_save_current_I = stepperI.getMilliamps();
315
+      stepperI.rms_current(I_CURRENT_HOME);
316
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_I), tmc_save_current_I, I_CURRENT_HOME);
317
+    #endif
318
+    #if HAS_CURRENT_HOME(J)
319
+      const int16_t tmc_save_current_J = stepperJ.getMilliamps();
320
+      stepperJ.rms_current(J_CURRENT_HOME);
321
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_J), tmc_save_current_J, J_CURRENT_HOME);
322
+    #endif
323
+    #if HAS_CURRENT_HOME(K)
324
+      const int16_t tmc_save_current_K = stepperK.getMilliamps();
325
+      stepperK.rms_current(K_CURRENT_HOME);
326
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_K), tmc_save_current_K, K_CURRENT_HOME);
312
     #endif
327
     #endif
313
   #endif
328
   #endif
314
 
329
 
361
                  homeX = needX || parser.seen_test('X'),
376
                  homeX = needX || parser.seen_test('X'),
362
                  homeY = needY || parser.seen_test('Y'),
377
                  homeY = needY || parser.seen_test('Y'),
363
                  homeZZ = homeZ,
378
                  homeZZ = homeZ,
364
-                 homeI = needI || parser.seen_test(AXIS4_NAME), homeJ = needJ || parser.seen_test(AXIS5_NAME), homeK = needK || parser.seen_test(AXIS6_NAME),
379
+                 homeI = needI || parser.seen_test(AXIS4_NAME), homeJ = needJ || parser.seen_test(AXIS5_NAME), homeK = needK || parser.seen_test(AXIS6_NAME)
365
                ),
380
                ),
366
                home_all = LINEAR_AXIS_GANG(   // Home-all if all or none are flagged
381
                home_all = LINEAR_AXIS_GANG(   // Home-all if all or none are flagged
367
                     homeX == homeX, && homeY == homeX, && homeZ == homeX,
382
                     homeX == homeX, && homeY == homeX, && homeZ == homeX,

+ 8
- 10
Marlin/src/gcode/calibrate/G425.cpp View File

241
 
241
 
242
   park_above_object(m, uncertainty);
242
   park_above_object(m, uncertainty);
243
 
243
 
244
+  #define _ACASE(N,A,B) case A: dir = -1; case B: axis = N##_AXIS; break
245
+  #define _PCASE(N) _ACASE(N, N##MINIMUM, N##MAXIMUM)
246
+
244
   switch (side) {
247
   switch (side) {
245
     #if AXIS_CAN_CALIBRATE(X)
248
     #if AXIS_CAN_CALIBRATE(X)
246
-      case RIGHT: dir = -1;
247
-      case LEFT:  axis = X_AXIS; break;
249
+      _ACASE(X, RIGHT, LEFT);
248
     #endif
250
     #endif
249
     #if HAS_Y_AXIS && AXIS_CAN_CALIBRATE(Y)
251
     #if HAS_Y_AXIS && AXIS_CAN_CALIBRATE(Y)
250
-      case BACK:  dir = -1;
251
-      case FRONT: axis = Y_AXIS; break;
252
+      _ACASE(Y, BACK, FRONT);
252
     #endif
253
     #endif
253
     #if HAS_Z_AXIS && AXIS_CAN_CALIBRATE(Z)
254
     #if HAS_Z_AXIS && AXIS_CAN_CALIBRATE(Z)
254
       case TOP: {
255
       case TOP: {
259
       }
260
       }
260
     #endif
261
     #endif
261
     #if HAS_I_AXIS && AXIS_CAN_CALIBRATE(I)
262
     #if HAS_I_AXIS && AXIS_CAN_CALIBRATE(I)
262
-      case IMINIMUM: dir = -1;
263
-      case IMAXIMUM: axis = I_AXIS; break;
263
+      _PCASE(I);
264
     #endif
264
     #endif
265
     #if HAS_J_AXIS && AXIS_CAN_CALIBRATE(J)
265
     #if HAS_J_AXIS && AXIS_CAN_CALIBRATE(J)
266
-      case JMINIMUM: dir = -1;
267
-      case JMAXIMUM: axis = J_AXIS; break;
266
+      _PCASE(J);
268
     #endif
267
     #endif
269
     #if HAS_K_AXIS && AXIS_CAN_CALIBRATE(K)
268
     #if HAS_K_AXIS && AXIS_CAN_CALIBRATE(K)
270
-      case KMINIMUM: dir = -1;
271
-      case KMAXIMUM: axis = K_AXIS; break;
269
+      _PCASE(K);
272
     #endif
270
     #endif
273
     default: return;
271
     default: return;
274
   }
272
   }

+ 1
- 1
Marlin/src/gcode/calibrate/M425.cpp View File

55
         case Z_AXIS: return AXIS_CAN_CALIBRATE(Z),
55
         case Z_AXIS: return AXIS_CAN_CALIBRATE(Z),
56
         case I_AXIS: return AXIS_CAN_CALIBRATE(I),
56
         case I_AXIS: return AXIS_CAN_CALIBRATE(I),
57
         case J_AXIS: return AXIS_CAN_CALIBRATE(J),
57
         case J_AXIS: return AXIS_CAN_CALIBRATE(J),
58
-        case K_AXIS: return AXIS_CAN_CALIBRATE(K),
58
+        case K_AXIS: return AXIS_CAN_CALIBRATE(K)
59
       );
59
       );
60
     }
60
     }
61
   };
61
   };

+ 7
- 2
Marlin/src/gcode/config/M200-M205.cpp View File

288
   report_heading_etc(forReplay, F(
288
   report_heading_etc(forReplay, F(
289
     "Advanced (B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
289
     "Advanced (B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
290
     TERN_(HAS_JUNCTION_DEVIATION, " J<junc_dev>")
290
     TERN_(HAS_JUNCTION_DEVIATION, " J<junc_dev>")
291
-    TERN_(HAS_CLASSIC_JERK, " X<max_x_jerk> Y<max_y_jerk> Z<max_z_jerk>")
292
-    TERN_(HAS_CLASSIC_E_JERK, " E<max_e_jerk>")
291
+    #if HAS_CLASSIC_JERK
292
+      LINEAR_AXIS_GANG(
293
+        " X<max_jerk>", " Y<max_jerk>", " Z<max_jerk>",
294
+        " " STR_I "<max_jerk>", " " STR_J "<max_jerk>", " " STR_K "<max_jerk>"
295
+      )
296
+    #endif
297
+    TERN_(HAS_CLASSIC_E_JERK, " E<max_jerk>")
293
     ")"
298
     ")"
294
   ));
299
   ));
295
   SERIAL_ECHOLNPGM_P(
300
   SERIAL_ECHOLNPGM_P(

+ 35
- 4
Marlin/src/gcode/config/M217.cpp View File

50
  *  W[linear]   0/1 Enable park & Z Raise
50
  *  W[linear]   0/1 Enable park & Z Raise
51
  *  X[linear]   Park X (Requires TOOLCHANGE_PARK)
51
  *  X[linear]   Park X (Requires TOOLCHANGE_PARK)
52
  *  Y[linear]   Park Y (Requires TOOLCHANGE_PARK)
52
  *  Y[linear]   Park Y (Requires TOOLCHANGE_PARK)
53
+ *  I[linear]   Park I (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 4)
54
+ *  J[linear]   Park J (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 5)
55
+ *  K[linear]   Park K (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 6)
53
  *  Z[linear]   Z Raise
56
  *  Z[linear]   Z Raise
54
  *  F[linear]   Fan Speed 0-255
57
  *  F[linear]   Fan Speed 0-255
55
  *  G[linear/s] Fan time
58
  *  G[linear/s] Fan time
88
   #if ENABLED(TOOLCHANGE_PARK)
91
   #if ENABLED(TOOLCHANGE_PARK)
89
     if (parser.seenval('W')) { toolchange_settings.enable_park = parser.value_linear_units(); }
92
     if (parser.seenval('W')) { toolchange_settings.enable_park = parser.value_linear_units(); }
90
     if (parser.seenval('X')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.x = constrain(v, X_MIN_POS, X_MAX_POS); }
93
     if (parser.seenval('X')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.x = constrain(v, X_MIN_POS, X_MAX_POS); }
91
-    if (parser.seenval('Y')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.y = constrain(v, Y_MIN_POS, Y_MAX_POS); }
94
+    #if HAS_Y_AXIS
95
+      if (parser.seenval('Y')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.y = constrain(v, Y_MIN_POS, Y_MAX_POS); }
96
+    #endif
97
+    #if HAS_I_AXIS
98
+      if (parser.seenval('I')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.i = constrain(v, I_MIN_POS, I_MAX_POS); }
99
+    #endif
100
+    #if HAS_J_AXIS
101
+      if (parser.seenval('J')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.j = constrain(v, J_MIN_POS, J_MAX_POS); }
102
+    #endif
103
+    #if HAS_K_AXIS
104
+      if (parser.seenval('K')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.k = constrain(v, K_MIN_POS, K_MAX_POS); }
105
+    #endif
92
   #endif
106
   #endif
93
 
107
 
94
-  if (parser.seenval('Z')) { toolchange_settings.z_raise = parser.value_linear_units(); }
108
+  #if HAS_Z_AXIS
109
+    if (parser.seenval('Z')) { toolchange_settings.z_raise = parser.value_linear_units(); }
110
+  #endif
95
 
111
 
96
   #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
112
   #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
97
     migration.target = 0;       // 0 = disabled
113
     migration.target = 0;       // 0 = disabled
151
     #endif
167
     #endif
152
 
168
 
153
     #if ENABLED(TOOLCHANGE_PARK)
169
     #if ENABLED(TOOLCHANGE_PARK)
170
+    {
154
       SERIAL_ECHOPGM(" W", LINEAR_UNIT(toolchange_settings.enable_park));
171
       SERIAL_ECHOPGM(" W", LINEAR_UNIT(toolchange_settings.enable_park));
155
-      SERIAL_ECHOPGM_P(SP_X_STR, LINEAR_UNIT(toolchange_settings.change_point.x));
156
-      SERIAL_ECHOPGM_P(SP_Y_STR, LINEAR_UNIT(toolchange_settings.change_point.y));
172
+      SERIAL_ECHOPGM_P(
173
+            SP_X_STR, LINEAR_UNIT(toolchange_settings.change_point.x)
174
+        #if HAS_Y_AXIS
175
+          , SP_Y_STR, LINEAR_UNIT(toolchange_settings.change_point.y)
176
+        #endif
177
+        #if HAS_I_AXIS
178
+          , SP_I_STR, LINEAR_UNIT(toolchange_settings.change_point.i)
179
+        #endif
180
+        #if HAS_J_AXIS
181
+          , SP_J_STR, LINEAR_UNIT(toolchange_settings.change_point.j)
182
+        #endif
183
+        #if HAS_K_AXIS
184
+          , SP_K_STR, LINEAR_UNIT(toolchange_settings.change_point.k)
185
+        #endif
186
+      );
187
+    }
157
     #endif
188
     #endif
158
 
189
 
159
     #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED)
190
     #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED)

+ 1
- 1
Marlin/src/gcode/config/M92.cpp View File

24
 #include "../../module/planner.h"
24
 #include "../../module/planner.h"
25
 
25
 
26
 /**
26
 /**
27
- * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, and E.
27
+ * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, [I, [J, [K]]] and E.
28
  *      (Follows the same syntax as G92)
28
  *      (Follows the same syntax as G92)
29
  *
29
  *
30
  *      With multiple extruders use T to specify which one.
30
  *      With multiple extruders use T to specify which one.

+ 4
- 2
Marlin/src/gcode/feature/digipot/M907-M910.cpp View File

39
 #endif
39
 #endif
40
 
40
 
41
 /**
41
 /**
42
- * M907: Set digital trimpot motor current using axis codes X, Y, Z, E, B, S
42
+ * M907: Set digital trimpot motor current using axis codes X [Y] [Z] [E]
43
+ *   B<current> - Special case for 4th (E) axis
44
+ *   S<current> - Special case to set first 3 axes
43
  */
45
  */
44
 void GcodeSuite::M907() {
46
 void GcodeSuite::M907() {
45
   #if HAS_MOTOR_CURRENT_SPI
47
   #if HAS_MOTOR_CURRENT_SPI
75
       if (parser.seenval('E')) stepper.set_digipot_current(2, parser.value_int());
77
       if (parser.seenval('E')) stepper.set_digipot_current(2, parser.value_int());
76
     #endif
78
     #endif
77
 
79
 
78
-  #endif
80
+  #endif // HAS_MOTOR_CURRENT_PWM
79
 
81
 
80
   #if HAS_MOTOR_CURRENT_I2C
82
   #if HAS_MOTOR_CURRENT_I2C
81
     // this one uses actual amps in floating point
83
     // this one uses actual amps in floating point

+ 12
- 3
Marlin/src/gcode/feature/pause/M125.cpp View File

49
  *    L<linear> = Override retract Length
49
  *    L<linear> = Override retract Length
50
  *    X<pos>    = Override park position X
50
  *    X<pos>    = Override park position X
51
  *    Y<pos>    = Override park position Y
51
  *    Y<pos>    = Override park position Y
52
+ *    A<pos>    = Override park position A (requires AXIS*_NAME 'A')
53
+ *    B<pos>    = Override park position B (requires AXIS*_NAME 'B')
54
+ *    C<pos>    = Override park position C (requires AXIS*_NAME 'C')
52
  *    Z<linear> = Override Z raise
55
  *    Z<linear> = Override Z raise
53
  *
56
  *
54
  *  With an LCD menu:
57
  *  With an LCD menu:
60
 
63
 
61
   xyz_pos_t park_point = NOZZLE_PARK_POINT;
64
   xyz_pos_t park_point = NOZZLE_PARK_POINT;
62
 
65
 
63
-  // Move XY axes to filament change position or given position
64
-  if (parser.seenval('X')) park_point.x = RAW_X_POSITION(parser.linearval('X'));
65
-  if (parser.seenval('Y')) park_point.y = RAW_X_POSITION(parser.linearval('Y'));
66
+  // Move to filament change position or given position
67
+  LINEAR_AXIS_CODE(
68
+    if (parser.seenval('X')) park_point.x = RAW_X_POSITION(parser.linearval('X')),
69
+    if (parser.seenval('Y')) park_point.y = RAW_Y_POSITION(parser.linearval('Y')),
70
+    NOOP,
71
+    if (parser.seenval(AXIS4_NAME)) park_point.i = RAW_I_POSITION(parser.linearval(AXIS4_NAME)),
72
+    if (parser.seenval(AXIS5_NAME)) park_point.j = RAW_J_POSITION(parser.linearval(AXIS5_NAME)),
73
+    if (parser.seenval(AXIS6_NAME)) park_point.k = RAW_K_POSITION(parser.linearval(AXIS6_NAME))
74
+  );
66
 
75
 
67
   // Lift Z axis
76
   // Lift Z axis
68
   if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
77
   if (parser.seenval('Z')) park_point.z = parser.linearval('Z');

+ 11
- 7
Marlin/src/gcode/feature/pause/M600.cpp View File

101
   if (standardM600)
101
   if (standardM600)
102
     ui.pause_show_message(PAUSE_MESSAGE_CHANGING, PAUSE_MODE_PAUSE_PRINT, target_extruder);
102
     ui.pause_show_message(PAUSE_MESSAGE_CHANGING, PAUSE_MODE_PAUSE_PRINT, target_extruder);
103
 
103
 
104
-  #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE)
105
-    // If needed, home before parking for filament change
106
-    home_if_needed(true);
107
-  #endif
104
+  // If needed, home before parking for filament change
105
+  TERN_(HOME_BEFORE_FILAMENT_CHANGE, home_if_needed(true));
108
 
106
 
109
   #if HAS_MULTI_EXTRUDER
107
   #if HAS_MULTI_EXTRUDER
110
     // Change toolhead if specified
108
     // Change toolhead if specified
118
 
116
 
119
   xyz_pos_t park_point NOZZLE_PARK_POINT;
117
   xyz_pos_t park_point NOZZLE_PARK_POINT;
120
 
118
 
121
-  // Lift Z axis
119
+  // Lift Z axis first
122
   if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
120
   if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
123
 
121
 
124
   // Move XY axes to filament change position or given position
122
   // Move XY axes to filament change position or given position
125
-  if (parser.seenval('X')) park_point.x = parser.linearval('X');
126
-  if (parser.seenval('Y')) park_point.y = parser.linearval('Y');
123
+  LINEAR_AXIS_CODE(
124
+    if (parser.seenval('X')) park_point.x = parser.linearval('X'),
125
+    if (parser.seenval('Y')) park_point.y = parser.linearval('Y'),
126
+    NOOP,
127
+    if (parser.seenval(AXIS4_NAME)) park_point.i = parser.linearval(AXIS4_NAME);
128
+    if (parser.seenval(AXIS5_NAME)) park_point.j = parser.linearval(AXIS5_NAME);
129
+    if (parser.seenval(AXIS6_NAME)) park_point.k = parser.linearval(AXIS6_NAME);
130
+  );
127
 
131
 
128
   #if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA)
132
   #if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA)
129
     park_point += hotend_offset[active_extruder];
133
     park_point += hotend_offset[active_extruder];

+ 3
- 0
Marlin/src/gcode/feature/trinamic/M906.cpp View File

41
  *   X[current]  - Set mA current for X driver(s)
41
  *   X[current]  - Set mA current for X driver(s)
42
  *   Y[current]  - Set mA current for Y driver(s)
42
  *   Y[current]  - Set mA current for Y driver(s)
43
  *   Z[current]  - Set mA current for Z driver(s)
43
  *   Z[current]  - Set mA current for Z driver(s)
44
+ *   A[current]  - Set mA current for A driver(s) (Requires AXIS*_NAME 'A')
45
+ *   B[current]  - Set mA current for B driver(s) (Requires AXIS*_NAME 'B')
46
+ *   C[current]  - Set mA current for C driver(s) (Requires AXIS*_NAME 'C')
44
  *   E[current]  - Set mA current for E driver(s)
47
  *   E[current]  - Set mA current for E driver(s)
45
  *
48
  *
46
  *   I[index]    - Axis sub-index (Omit or 0 for X, Y, Z; 1 for X2, Y2, Z2; 2 for Z3; 3 for Z4.)
49
  *   I[index]    - Axis sub-index (Omit or 0 for X, Y, Z; 1 for X2, Y2, Z2; 2 for Z3; 3 for Z4.)

+ 4
- 4
Marlin/src/gcode/geometry/G92.cpp View File

29
 #endif
29
 #endif
30
 
30
 
31
 /**
31
 /**
32
- * G92: Set the Current Position to the given X Y Z E values.
32
+ * G92: Set the Current Position to the given X [Y [Z [A [B [C [E]]]]]] values.
33
  *
33
  *
34
  * Behind the scenes the G92 command may modify the Current Position
34
  * Behind the scenes the G92 command may modify the Current Position
35
  * or the Position Shift depending on settings and sub-commands.
35
  * or the Position Shift depending on settings and sub-commands.
37
  * Since E has no Workspace Offset, it is always set directly.
37
  * Since E has no Workspace Offset, it is always set directly.
38
  *
38
  *
39
  * Without Workspace Offsets (e.g., with NO_WORKSPACE_OFFSETS):
39
  * Without Workspace Offsets (e.g., with NO_WORKSPACE_OFFSETS):
40
- *   G92   : Set NATIVE Current Position to the given X Y Z E.
40
+ *   G92   : Set NATIVE Current Position to the given X [Y [Z [A [B [C [E]]]]]].
41
  *
41
  *
42
  * Using Workspace Offsets (default Marlin behavior):
42
  * Using Workspace Offsets (default Marlin behavior):
43
- *   G92   : Modify Workspace Offsets so the reported position shows the given X Y Z E.
43
+ *   G92   : Modify Workspace Offsets so the reported position shows the given X [Y [Z [A [B [C [E]]]]]].
44
  *   G92.1 : Zero XYZ Workspace Offsets (so the reported position = the native position).
44
  *   G92.1 : Zero XYZ Workspace Offsets (so the reported position = the native position).
45
  *
45
  *
46
  * With POWER_LOSS_RECOVERY:
46
  * With POWER_LOSS_RECOVERY:
47
- *   G92.9 : Set NATIVE Current Position to the given X Y Z E.
47
+ *   G92.9 : Set NATIVE Current Position to the given X [Y [Z [A [B [C [E]]]]]].
48
  */
48
  */
49
 void GcodeSuite::G92() {
49
 void GcodeSuite::G92() {
50
 
50
 

+ 1
- 0
Marlin/src/inc/Conditionals_post.h View File

2214
 #define TMC_UART_IS(A,N) (defined(A##_HARDWARE_SERIAL) && (CAT(HW_,A##_HARDWARE_SERIAL) == HW_Serial##N || CAT(HW_,A##_HARDWARE_SERIAL) == HW_MSerial##N))
2214
 #define TMC_UART_IS(A,N) (defined(A##_HARDWARE_SERIAL) && (CAT(HW_,A##_HARDWARE_SERIAL) == HW_Serial##N || CAT(HW_,A##_HARDWARE_SERIAL) == HW_MSerial##N))
2215
 #define ANY_SERIAL_IS(N) (  CONF_SERIAL_IS(N) \
2215
 #define ANY_SERIAL_IS(N) (  CONF_SERIAL_IS(N) \
2216
                          || TMC_UART_IS(X,  N) || TMC_UART_IS(Y , N) || TMC_UART_IS(Z , N) \
2216
                          || TMC_UART_IS(X,  N) || TMC_UART_IS(Y , N) || TMC_UART_IS(Z , N) \
2217
+                         || TMC_UART_IS(I,  N) || TMC_UART_IS(J , N) || TMC_UART_IS(K , N) \
2217
                          || TMC_UART_IS(X2, N) || TMC_UART_IS(Y2, N) || TMC_UART_IS(Z2, N) || TMC_UART_IS(Z3, N) || TMC_UART_IS(Z4, N) \
2218
                          || TMC_UART_IS(X2, N) || TMC_UART_IS(Y2, N) || TMC_UART_IS(Z2, N) || TMC_UART_IS(Z3, N) || TMC_UART_IS(Z4, N) \
2218
                          || TMC_UART_IS(E0, N) || TMC_UART_IS(E1, N) || TMC_UART_IS(E2, N) || TMC_UART_IS(E3, N) || TMC_UART_IS(E4, N) )
2219
                          || TMC_UART_IS(E0, N) || TMC_UART_IS(E1, N) || TMC_UART_IS(E2, N) || TMC_UART_IS(E3, N) || TMC_UART_IS(E4, N) )
2219
 
2220
 

+ 14
- 21
Marlin/src/inc/SanityCheck.h View File

791
   #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
791
   #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
792
 #elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX)
792
 #elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX)
793
   #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
793
   #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
794
+#elif BOTH(ENDSTOPPULLUP_IMAX, ENDSTOPPULLDOWN_IMAX)
795
+  #error "Enable only one of ENDSTOPPULLUP_I_MAX or ENDSTOPPULLDOWN_I_MAX."
796
+#elif BOTH(ENDSTOPPULLUP_JMAX, ENDSTOPPULLDOWN_JMAX)
797
+  #error "Enable only one of ENDSTOPPULLUP_J_MAX or ENDSTOPPULLDOWN_J_MAX."
798
+#elif BOTH(ENDSTOPPULLUP_KMAX, ENDSTOPPULLDOWN_KMAX)
799
+  #error "Enable only one of ENDSTOPPULLUP_K_MAX or ENDSTOPPULLDOWN_K_MAX."
794
 #elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
800
 #elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
795
   #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
801
   #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
796
 #elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
802
 #elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
1417
  * Allow only extra axis codes that do not conflict with G-code parameter names
1423
  * Allow only extra axis codes that do not conflict with G-code parameter names
1418
  */
1424
  */
1419
 #if HAS_I_AXIS
1425
 #if HAS_I_AXIS
1420
-  #if AXIS4_NAME != 'A' && AXIS4_NAME != 'B' && AXIS4_NAME != 'C' && AXIS4_NAME != 'U' && AXIS4_NAME != 'V' && AXIS4_NAME != 'W'
1421
-    #error "AXIS4_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1422
-  #elif !defined(I_MIN_POS) || !defined(I_MAX_POS)
1426
+  #if !defined(I_MIN_POS) || !defined(I_MAX_POS)
1423
     #error "I_MIN_POS and I_MAX_POS are required with LINEAR_AXES >= 4."
1427
     #error "I_MIN_POS and I_MAX_POS are required with LINEAR_AXES >= 4."
1424
   #elif !defined(I_HOME_DIR)
1428
   #elif !defined(I_HOME_DIR)
1425
     #error "I_HOME_DIR is required with LINEAR_AXES >= 4."
1429
     #error "I_HOME_DIR is required with LINEAR_AXES >= 4."
1430
 #if HAS_J_AXIS
1434
 #if HAS_J_AXIS
1431
   #if AXIS5_NAME == AXIS4_NAME
1435
   #if AXIS5_NAME == AXIS4_NAME
1432
     #error "AXIS5_NAME must be unique."
1436
     #error "AXIS5_NAME must be unique."
1433
-  #elif AXIS5_NAME != 'A' && AXIS5_NAME != 'B' && AXIS5_NAME != 'C' && AXIS5_NAME != 'U' && AXIS5_NAME != 'V' && AXIS5_NAME != 'W'
1434
-    #error "AXIS5_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1435
   #elif !defined(J_MIN_POS) || !defined(J_MAX_POS)
1437
   #elif !defined(J_MIN_POS) || !defined(J_MAX_POS)
1436
     #error "J_MIN_POS and J_MAX_POS are required with LINEAR_AXES >= 5."
1438
     #error "J_MIN_POS and J_MAX_POS are required with LINEAR_AXES >= 5."
1437
   #elif !defined(J_HOME_DIR)
1439
   #elif !defined(J_HOME_DIR)
1443
 #if HAS_K_AXIS
1445
 #if HAS_K_AXIS
1444
   #if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME
1446
   #if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME
1445
     #error "AXIS6_NAME must be unique."
1447
     #error "AXIS6_NAME must be unique."
1446
-  #elif AXIS6_NAME != 'A' && AXIS6_NAME != 'B' && AXIS6_NAME != 'C' && AXIS6_NAME != 'U' && AXIS6_NAME != 'V' && AXIS6_NAME != 'W'
1447
-    #error "AXIS6_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1448
   #elif !defined(K_MIN_POS) || !defined(K_MAX_POS)
1448
   #elif !defined(K_MIN_POS) || !defined(K_MAX_POS)
1449
     #error "K_MIN_POS and K_MAX_POS are required with LINEAR_AXES >= 6."
1449
     #error "K_MIN_POS and K_MAX_POS are required with LINEAR_AXES >= 6."
1450
   #elif !defined(K_HOME_DIR)
1450
   #elif !defined(K_HOME_DIR)
3317
  * L64XX requirement
3317
  * L64XX requirement
3318
  */
3318
  */
3319
 #if HAS_L64XX && HAS_I_AXIS
3319
 #if HAS_L64XX && HAS_I_AXIS
3320
-  #error "L64XX requires LINEAR_AXES 3. Homing with L64XX is not yet implemented for LINEAR_AXES > 3."
3320
+  #error "L64XX requires LINEAR_AXES <= 3. Homing with L64XX is not yet implemented for LINEAR_AXES > 3."
3321
 #endif
3321
 #endif
3322
 
3322
 
3323
 /**
3323
 /**
3793
 #if _BAD_DRIVER(Z)
3793
 #if _BAD_DRIVER(Z)
3794
   #error "Z_DRIVER_TYPE is not recognized."
3794
   #error "Z_DRIVER_TYPE is not recognized."
3795
 #endif
3795
 #endif
3796
-#if HAS_I_AXIS
3797
-  #if _BAD_DRIVER(I)
3798
-    #error "I_DRIVER_TYPE is not recognized."
3799
-  #endif
3796
+#if _BAD_DRIVER(I)
3797
+  #error "I_DRIVER_TYPE is not recognized."
3800
 #endif
3798
 #endif
3801
-#if HAS_J_AXIS
3802
-  #if _BAD_DRIVER(J)
3803
-    #error "J_DRIVER_TYPE is not recognized."
3804
-  #endif
3799
+#if _BAD_DRIVER(J)
3800
+  #error "J_DRIVER_TYPE is not recognized."
3805
 #endif
3801
 #endif
3806
-#if HAS_K_AXIS
3807
-  #if _BAD_DRIVER(K)
3808
-    #error "K_DRIVER_TYPE is not recognized."
3809
-  #endif
3802
+#if _BAD_DRIVER(K)
3803
+  #error "K_DRIVER_TYPE is not recognized."
3810
 #endif
3804
 #endif
3811
-
3812
 #if _BAD_DRIVER(X2)
3805
 #if _BAD_DRIVER(X2)
3813
   #error "X2_DRIVER_TYPE is not recognized."
3806
   #error "X2_DRIVER_TYPE is not recognized."
3814
 #endif
3807
 #endif

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

558
   #if HAS_J_MAX
558
   #if HAS_J_MAX
559
     ES_REPORT(J_MAX);
559
     ES_REPORT(J_MAX);
560
   #endif
560
   #endif
561
-    #if HAS_K_MIN
561
+  #if HAS_K_MIN
562
     ES_REPORT(K_MIN);
562
     ES_REPORT(K_MIN);
563
   #endif
563
   #endif
564
   #if HAS_K_MAX
564
   #if HAS_K_MAX

+ 56
- 32
Marlin/src/module/motion.cpp View File

467
 }
467
 }
468
 
468
 
469
 /**
469
 /**
470
- * Plan a move to (X, Y, Z, [I, [J, [K]]]) and set the current_position
471
- * Plan a move to (X, Y, Z) with separation of Z from other components.
470
+ * Plan a move to (X, Y, Z, [I, [J, [K...]]]) and set the current_position
471
+ * Plan a move to (X, Y, Z, [I, [J, [K...]]]) with separation of Z from other components.
472
  *
472
  *
473
  * - If Z is moving up, the Z move is done before XY, etc.
473
  * - If Z is moving up, the Z move is done before XY, etc.
474
  * - If Z is moving down, the Z move is done after XY, etc.
474
  * - If Z is moving down, the Z move is done after XY, etc.
484
   #if HAS_Z_AXIS
484
   #if HAS_Z_AXIS
485
     const feedRate_t z_feedrate = fr_mm_s ?: homing_feedrate(Z_AXIS);
485
     const feedRate_t z_feedrate = fr_mm_s ?: homing_feedrate(Z_AXIS);
486
   #endif
486
   #endif
487
+  #if HAS_I_AXIS
488
+    const feedRate_t i_feedrate = fr_mm_s ?: homing_feedrate(I_AXIS);
489
+  #endif
490
+  #if HAS_J_AXIS
491
+    const feedRate_t j_feedrate = fr_mm_s ?: homing_feedrate(J_AXIS);
492
+  #endif
493
+  #if HAS_K_AXIS
494
+    const feedRate_t k_feedrate = fr_mm_s ?: homing_feedrate(K_AXIS);
495
+  #endif
487
 
496
 
488
   #if IS_KINEMATIC
497
   #if IS_KINEMATIC
489
     if (!position_is_reachable(x, y)) return;
498
     if (!position_is_reachable(x, y)) return;
498
 
507
 
499
     // when in the danger zone
508
     // when in the danger zone
500
     if (current_position.z > delta_clip_start_height) {
509
     if (current_position.z > delta_clip_start_height) {
501
-      if (z > delta_clip_start_height) {                     // staying in the danger zone
502
-        destination.set(x, y, z);                          // move directly (uninterpolated)
510
+      if (z > delta_clip_start_height) {                      // staying in the danger zone
511
+        destination.set(x, y, z);                             // move directly (uninterpolated)
503
         prepare_internal_fast_move_to_destination();          // set current_position from destination
512
         prepare_internal_fast_move_to_destination();          // set current_position from destination
504
         if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position);
513
         if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position);
505
         return;
514
         return;
509
       if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position);
518
       if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position);
510
     }
519
     }
511
 
520
 
512
-    if (z > current_position.z) {                            // raising?
521
+    if (z > current_position.z) {                             // raising?
513
       destination.z = z;
522
       destination.z = z;
514
       prepare_internal_fast_move_to_destination(z_feedrate);  // set current_position from destination
523
       prepare_internal_fast_move_to_destination(z_feedrate);  // set current_position from destination
515
       if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position);
524
       if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position);
519
     prepare_internal_move_to_destination();                   // set current_position from destination
528
     prepare_internal_move_to_destination();                   // set current_position from destination
520
     if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position);
529
     if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position);
521
 
530
 
522
-    if (z < current_position.z) {                            // lowering?
531
+    if (z < current_position.z) {                             // lowering?
523
       destination.z = z;
532
       destination.z = z;
524
       prepare_internal_fast_move_to_destination(z_feedrate);  // set current_position from destination
533
       prepare_internal_fast_move_to_destination(z_feedrate);  // set current_position from destination
525
       if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position);
534
       if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position);
528
   #elif IS_SCARA
537
   #elif IS_SCARA
529
 
538
 
530
     // If Z needs to raise, do it before moving XY
539
     // If Z needs to raise, do it before moving XY
531
-    if (destination.z < z) {
532
-      destination.z = z;
533
-      prepare_internal_fast_move_to_destination(z_feedrate);
534
-    }
540
+    if (destination.z < z) { destination.z = z; prepare_internal_fast_move_to_destination(z_feedrate); }
535
 
541
 
536
-    destination.set(x, y);
537
-    prepare_internal_fast_move_to_destination(xy_feedrate);
542
+    destination.set(x, y); prepare_internal_fast_move_to_destination(xy_feedrate);
538
 
543
 
539
     // If Z needs to lower, do it after moving XY
544
     // If Z needs to lower, do it after moving XY
540
-    if (destination.z > z) {
541
-      destination.z = z;
542
-      prepare_internal_fast_move_to_destination(z_feedrate);
543
-    }
545
+    if (destination.z > z) { destination.z = z; prepare_internal_fast_move_to_destination(z_feedrate); }
544
 
546
 
545
   #else
547
   #else
546
 
548
 
547
-    #if HAS_Z_AXIS
548
-      // If Z needs to raise, do it before moving XY
549
-      if (current_position.z < z) {
550
-        current_position.z = z;
551
-        line_to_current_position(z_feedrate);
552
-      }
549
+    #if HAS_Z_AXIS  // If Z needs to raise, do it before moving XY
550
+      if (current_position.z < z) { current_position.z = z; line_to_current_position(z_feedrate); }
553
     #endif
551
     #endif
554
 
552
 
555
-    current_position.set(x, y);
556
-    line_to_current_position(xy_feedrate);
553
+    current_position.set(x, y); line_to_current_position(xy_feedrate);
557
 
554
 
558
-    #if HAS_Z_AXIS
559
-      // If Z needs to lower, do it after moving XY
560
-      if (current_position.z > z) {
561
-        current_position.z = z;
562
-        line_to_current_position(z_feedrate);
563
-      }
555
+    #if HAS_I_AXIS
556
+      current_position.i = i; line_to_current_position(i_feedrate);
557
+    #endif
558
+    #if HAS_J_AXIS
559
+      current_position.j = j; line_to_current_position(j_feedrate);
560
+    #endif
561
+    #if HAS_K_AXIS
562
+      current_position.k = k; line_to_current_position(k_feedrate);
563
+    #endif
564
+    #if HAS_Z_AXIS  // If Z needs to lower, do it after moving XY...
565
+      if (current_position.z > z) { current_position.z = z; line_to_current_position(z_feedrate); }
564
     #endif
566
     #endif
565
 
567
 
566
   #endif
568
   #endif
1402
             #endif
1404
             #endif
1403
             break;
1405
             break;
1404
         #endif
1406
         #endif
1407
+        #if I_SENSORLESS
1408
+          case I_AXIS: stealth_states.i = tmc_enable_stallguard(stepperI); break;
1409
+        #endif
1410
+        #if J_SENSORLESS
1411
+          case J_AXIS: stealth_states.j = tmc_enable_stallguard(stepperJ); break;
1412
+        #endif
1413
+        #if K_SENSORLESS
1414
+          case K_AXIS: stealth_states.k = tmc_enable_stallguard(stepperK); break;
1415
+        #endif
1405
       }
1416
       }
1406
 
1417
 
1407
       #if ENABLED(SPI_ENDSTOPS)
1418
       #if ENABLED(SPI_ENDSTOPS)
1479
             #endif
1490
             #endif
1480
             break;
1491
             break;
1481
         #endif
1492
         #endif
1493
+        #if I_SENSORLESS
1494
+          case I_AXIS: tmc_disable_stallguard(stepperI, enable_stealth.i); break;
1495
+        #endif
1496
+        #if J_SENSORLESS
1497
+          case J_AXIS: tmc_disable_stallguard(stepperJ, enable_stealth.j); break;
1498
+        #endif
1499
+        #if K_SENSORLESS
1500
+          case K_AXIS: tmc_disable_stallguard(stepperK, enable_stealth.k); break;
1501
+        #endif
1482
       }
1502
       }
1483
 
1503
 
1484
       #if ENABLED(SPI_ENDSTOPS)
1504
       #if ENABLED(SPI_ENDSTOPS)
1815
         switch (axis) {
1835
         switch (axis) {
1816
           default:
1836
           default:
1817
           case X_AXIS: es = X_ENDSTOP; break;
1837
           case X_AXIS: es = X_ENDSTOP; break;
1818
-          case Y_AXIS: es = Y_ENDSTOP; break;
1819
-          case Z_AXIS: es = Z_ENDSTOP; break;
1838
+          #if HAS_Y_AXIS
1839
+            case Y_AXIS: es = Y_ENDSTOP; break;
1840
+          #endif
1841
+          #if HAS_Z_AXIS
1842
+            case Z_AXIS: es = Z_ENDSTOP; break;
1843
+          #endif
1820
           #if HAS_I_AXIS
1844
           #if HAS_I_AXIS
1821
             case I_AXIS: es = I_ENDSTOP; break;
1845
             case I_AXIS: es = I_ENDSTOP; break;
1822
           #endif
1846
           #endif

+ 9
- 21
Marlin/src/module/planner.cpp View File

2041
       steps_dist_mm.b      = (db + dc) * mm_per_step[B_AXIS];
2041
       steps_dist_mm.b      = (db + dc) * mm_per_step[B_AXIS];
2042
       steps_dist_mm.c      = CORESIGN(db - dc) * mm_per_step[C_AXIS];
2042
       steps_dist_mm.c      = CORESIGN(db - dc) * mm_per_step[C_AXIS];
2043
     #endif
2043
     #endif
2044
-    #if HAS_I_AXIS
2045
-      steps_dist_mm.i = di * mm_per_step[I_AXIS];
2046
-    #endif
2047
-    #if HAS_J_AXIS
2048
-      steps_dist_mm.j = dj * mm_per_step[J_AXIS];
2049
-    #endif
2050
-    #if HAS_K_AXIS
2051
-      steps_dist_mm.k = dk * mm_per_step[K_AXIS];
2052
-    #endif
2044
+    TERN_(HAS_I_AXIS, steps_dist_mm.i = di * mm_per_step[I_AXIS]);
2045
+    TERN_(HAS_J_AXIS, steps_dist_mm.j = dj * mm_per_step[J_AXIS]);
2046
+    TERN_(HAS_K_AXIS, steps_dist_mm.k = dk * mm_per_step[K_AXIS]);
2053
   #elif ENABLED(MARKFORGED_XY)
2047
   #elif ENABLED(MARKFORGED_XY)
2054
     steps_dist_mm.a      = (da - db) * mm_per_step[A_AXIS];
2048
     steps_dist_mm.a      = (da - db) * mm_per_step[A_AXIS];
2055
     steps_dist_mm.b      = db * mm_per_step[B_AXIS];
2049
     steps_dist_mm.b      = db * mm_per_step[B_AXIS];
2197
     );
2191
     );
2198
   #endif
2192
   #endif
2199
   #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
2193
   #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
2200
-    #if HAS_I_AXIS
2201
-      if (block->steps.i) stepper.enable_axis(I_AXIS);
2202
-    #endif
2203
-    #if HAS_J_AXIS
2204
-      if (block->steps.j) stepper.enable_axis(J_AXIS);
2205
-    #endif
2206
-    #if HAS_K_AXIS
2207
-      if (block->steps.k) stepper.enable_axis(K_AXIS);
2208
-    #endif
2194
+    TERN_(HAS_I_AXIS, if (block->steps.i) stepper.enable_axis(I_AXIS));
2195
+    TERN_(HAS_J_AXIS, if (block->steps.j) stepper.enable_axis(J_AXIS));
2196
+    TERN_(HAS_K_AXIS, if (block->steps.k) stepper.enable_axis(K_AXIS));
2209
   #endif
2197
   #endif
2210
 
2198
 
2211
   // Enable extruder(s)
2199
   // Enable extruder(s)
2260
 
2248
 
2261
   // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
2249
   // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
2262
   #if EITHER(SLOWDOWN, HAS_WIRED_LCD) || defined(XY_FREQUENCY_LIMIT)
2250
   #if EITHER(SLOWDOWN, HAS_WIRED_LCD) || defined(XY_FREQUENCY_LIMIT)
2263
-    // Segment time im micro seconds
2251
+    // Segment time in microseconds
2264
     int32_t segment_time_us = LROUND(1000000.0f / inverse_secs);
2252
     int32_t segment_time_us = LROUND(1000000.0f / inverse_secs);
2265
   #endif
2253
   #endif
2266
 
2254
 
2419
     accel = CEIL((esteps ? settings.acceleration : settings.travel_acceleration) * steps_per_mm);
2407
     accel = CEIL((esteps ? settings.acceleration : settings.travel_acceleration) * steps_per_mm);
2420
 
2408
 
2421
     #if ENABLED(LIN_ADVANCE)
2409
     #if ENABLED(LIN_ADVANCE)
2422
-
2410
+      // Linear advance is currently not ready for HAS_I_AXIS
2423
       #define MAX_E_JERK(N) TERN(HAS_LINEAR_E_JERK, max_e_jerk[E_INDEX_N(N)], max_jerk.e)
2411
       #define MAX_E_JERK(N) TERN(HAS_LINEAR_E_JERK, max_e_jerk[E_INDEX_N(N)], max_jerk.e)
2424
 
2412
 
2425
       /**
2413
       /**
2939
       SERIAL_ECHOPGM_P(SP_Y_LBL, abce.b);
2927
       SERIAL_ECHOPGM_P(SP_Y_LBL, abce.b);
2940
     #endif
2928
     #endif
2941
     SERIAL_ECHOPGM(" (", position.y, "->", target.y);
2929
     SERIAL_ECHOPGM(" (", position.y, "->", target.y);
2942
-    #if LINEAR_AXES >= ABC
2930
+    #if HAS_Z_AXIS
2943
       #if ENABLED(DELTA)
2931
       #if ENABLED(DELTA)
2944
         SERIAL_ECHOPGM(") C:", abce.c);
2932
         SERIAL_ECHOPGM(") C:", abce.c);
2945
       #else
2933
       #else

+ 4
- 1
Marlin/src/module/probe.cpp View File

787
   #endif
787
   #endif
788
 
788
 
789
   // On delta keep Z below clip height or do_blocking_move_to will abort
789
   // On delta keep Z below clip height or do_blocking_move_to will abort
790
-  xyz_pos_t npos = { rx, ry, TERN(DELTA, _MIN(delta_clip_start_height, current_position.z), current_position.z) };
790
+  xyz_pos_t npos = LINEAR_AXIS_ARRAY(
791
+    rx, ry, TERN(DELTA, _MIN(delta_clip_start_height, current_position.z), current_position.z),
792
+    current_position.i, current_position.j, current_position.k
793
+  );
791
   if (!can_reach(npos, probe_relative)) {
794
   if (!can_reach(npos, probe_relative)) {
792
     if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Position Not Reachable");
795
     if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Position Not Reachable");
793
     return NAN;
796
     return NAN;

+ 43
- 41
Marlin/src/module/stepper.cpp View File

522
     }
522
     }
523
   }
523
   }
524
 
524
 
525
-  bool Stepper::disable_extruder(E_TERN_(const uint8_t eindex)) {
525
+  bool Stepper::disable_extruder(E_TERN_(const uint8_t eindex/*=0*/)) {
526
     IF_DISABLED(HAS_MULTI_EXTRUDER, constexpr uint8_t eindex = 0);
526
     IF_DISABLED(HAS_MULTI_EXTRUDER, constexpr uint8_t eindex = 0);
527
     mark_axis_disabled(E_AXIS E_OPTARG(eindex));
527
     mark_axis_disabled(E_AXIS E_OPTARG(eindex));
528
     const bool can_disable = can_axis_disable(E_AXIS E_OPTARG(eindex));
528
     const bool can_disable = can_axis_disable(E_AXIS E_OPTARG(eindex));
1688
     const bool is_page = IS_PAGE(current_block);
1688
     const bool is_page = IS_PAGE(current_block);
1689
 
1689
 
1690
     #if ENABLED(DIRECT_STEPPING)
1690
     #if ENABLED(DIRECT_STEPPING)
1691
-      // TODO (DerAndere): Add support for HAS_I_AXIS
1691
+      // Direct stepping is currently not ready for HAS_I_AXIS
1692
       if (is_page) {
1692
       if (is_page) {
1693
 
1693
 
1694
         #if STEPPER_PAGE_FORMAT == SP_4x4D_128
1694
         #if STEPPER_PAGE_FORMAT == SP_4x4D_128
1929
     // If current block is finished, reset pointer and finalize state
1929
     // If current block is finished, reset pointer and finalize state
1930
     if (step_events_completed >= step_event_count) {
1930
     if (step_events_completed >= step_event_count) {
1931
       #if ENABLED(DIRECT_STEPPING)
1931
       #if ENABLED(DIRECT_STEPPING)
1932
-        // TODO (DerAndere): Add support for HAS_I_AXIS
1932
+        // Direct stepping is currently not ready for HAS_I_AXIS
1933
         #if STEPPER_PAGE_FORMAT == SP_4x4D_128
1933
         #if STEPPER_PAGE_FORMAT == SP_4x4D_128
1934
           #define PAGE_SEGMENT_UPDATE_POS(AXIS) \
1934
           #define PAGE_SEGMENT_UPDATE_POS(AXIS) \
1935
             count_position[_AXIS(AXIS)] += page_step_state.bd[_AXIS(AXIS)] - 128 * 7;
1935
             count_position[_AXIS(AXIS)] += page_step_state.bd[_AXIS(AXIS)] - 128 * 7;
3352
 
3352
 
3353
   void Stepper::microstep_init() {
3353
   void Stepper::microstep_init() {
3354
     #if HAS_X_MS_PINS
3354
     #if HAS_X_MS_PINS
3355
-      SET_OUTPUT(X_MS1_PIN);
3356
-      SET_OUTPUT(X_MS2_PIN);
3355
+      SET_OUTPUT(X_MS1_PIN); SET_OUTPUT(X_MS2_PIN);
3357
       #if PIN_EXISTS(X_MS3)
3356
       #if PIN_EXISTS(X_MS3)
3358
         SET_OUTPUT(X_MS3_PIN);
3357
         SET_OUTPUT(X_MS3_PIN);
3359
       #endif
3358
       #endif
3360
     #endif
3359
     #endif
3361
     #if HAS_X2_MS_PINS
3360
     #if HAS_X2_MS_PINS
3362
-      SET_OUTPUT(X2_MS1_PIN);
3363
-      SET_OUTPUT(X2_MS2_PIN);
3361
+      SET_OUTPUT(X2_MS1_PIN); SET_OUTPUT(X2_MS2_PIN);
3364
       #if PIN_EXISTS(X2_MS3)
3362
       #if PIN_EXISTS(X2_MS3)
3365
         SET_OUTPUT(X2_MS3_PIN);
3363
         SET_OUTPUT(X2_MS3_PIN);
3366
       #endif
3364
       #endif
3367
     #endif
3365
     #endif
3368
     #if HAS_Y_MS_PINS
3366
     #if HAS_Y_MS_PINS
3369
-      SET_OUTPUT(Y_MS1_PIN);
3370
-      SET_OUTPUT(Y_MS2_PIN);
3367
+      SET_OUTPUT(Y_MS1_PIN); SET_OUTPUT(Y_MS2_PIN);
3371
       #if PIN_EXISTS(Y_MS3)
3368
       #if PIN_EXISTS(Y_MS3)
3372
         SET_OUTPUT(Y_MS3_PIN);
3369
         SET_OUTPUT(Y_MS3_PIN);
3373
       #endif
3370
       #endif
3374
     #endif
3371
     #endif
3375
     #if HAS_Y2_MS_PINS
3372
     #if HAS_Y2_MS_PINS
3376
-      SET_OUTPUT(Y2_MS1_PIN);
3377
-      SET_OUTPUT(Y2_MS2_PIN);
3373
+      SET_OUTPUT(Y2_MS1_PIN); SET_OUTPUT(Y2_MS2_PIN);
3378
       #if PIN_EXISTS(Y2_MS3)
3374
       #if PIN_EXISTS(Y2_MS3)
3379
         SET_OUTPUT(Y2_MS3_PIN);
3375
         SET_OUTPUT(Y2_MS3_PIN);
3380
       #endif
3376
       #endif
3381
     #endif
3377
     #endif
3382
     #if HAS_Z_MS_PINS
3378
     #if HAS_Z_MS_PINS
3383
-      SET_OUTPUT(Z_MS1_PIN);
3384
-      SET_OUTPUT(Z_MS2_PIN);
3379
+      SET_OUTPUT(Z_MS1_PIN); SET_OUTPUT(Z_MS2_PIN);
3385
       #if PIN_EXISTS(Z_MS3)
3380
       #if PIN_EXISTS(Z_MS3)
3386
         SET_OUTPUT(Z_MS3_PIN);
3381
         SET_OUTPUT(Z_MS3_PIN);
3387
       #endif
3382
       #endif
3388
     #endif
3383
     #endif
3389
     #if HAS_Z2_MS_PINS
3384
     #if HAS_Z2_MS_PINS
3390
-      SET_OUTPUT(Z2_MS1_PIN);
3391
-      SET_OUTPUT(Z2_MS2_PIN);
3385
+      SET_OUTPUT(Z2_MS1_PIN); SET_OUTPUT(Z2_MS2_PIN);
3392
       #if PIN_EXISTS(Z2_MS3)
3386
       #if PIN_EXISTS(Z2_MS3)
3393
         SET_OUTPUT(Z2_MS3_PIN);
3387
         SET_OUTPUT(Z2_MS3_PIN);
3394
       #endif
3388
       #endif
3395
     #endif
3389
     #endif
3396
     #if HAS_Z3_MS_PINS
3390
     #if HAS_Z3_MS_PINS
3397
-      SET_OUTPUT(Z3_MS1_PIN);
3398
-      SET_OUTPUT(Z3_MS2_PIN);
3391
+      SET_OUTPUT(Z3_MS1_PIN); SET_OUTPUT(Z3_MS2_PIN);
3399
       #if PIN_EXISTS(Z3_MS3)
3392
       #if PIN_EXISTS(Z3_MS3)
3400
         SET_OUTPUT(Z3_MS3_PIN);
3393
         SET_OUTPUT(Z3_MS3_PIN);
3401
       #endif
3394
       #endif
3402
     #endif
3395
     #endif
3403
     #if HAS_Z4_MS_PINS
3396
     #if HAS_Z4_MS_PINS
3404
-      SET_OUTPUT(Z4_MS1_PIN);
3405
-      SET_OUTPUT(Z4_MS2_PIN);
3397
+      SET_OUTPUT(Z4_MS1_PIN); SET_OUTPUT(Z4_MS2_PIN);
3406
       #if PIN_EXISTS(Z4_MS3)
3398
       #if PIN_EXISTS(Z4_MS3)
3407
         SET_OUTPUT(Z4_MS3_PIN);
3399
         SET_OUTPUT(Z4_MS3_PIN);
3408
       #endif
3400
       #endif
3409
     #endif
3401
     #endif
3402
+    #if HAS_I_MS_PINS
3403
+      SET_OUTPUT(I_MS1_PIN); SET_OUTPUT(I_MS2_PIN);
3404
+      #if PIN_EXISTS(I_MS3)
3405
+        SET_OUTPUT(I_MS3_PIN);
3406
+      #endif
3407
+    #endif
3408
+    #if HAS_J_MS_PINS
3409
+      SET_OUTPUT(J_MS1_PIN); SET_OUTPUT(J_MS2_PIN);
3410
+      #if PIN_EXISTS(J_MS3)
3411
+        SET_OUTPUT(J_MS3_PIN);
3412
+      #endif
3413
+    #endif
3414
+    #if HAS_K_MS_PINS
3415
+      SET_OUTPUT(K_MS1_PIN); SET_OUTPUT(K_MS2_PIN);
3416
+      #if PIN_EXISTS(K_MS3)
3417
+        SET_OUTPUT(K_MS3_PIN);
3418
+      #endif
3419
+    #endif
3410
     #if HAS_E0_MS_PINS
3420
     #if HAS_E0_MS_PINS
3411
-      SET_OUTPUT(E0_MS1_PIN);
3412
-      SET_OUTPUT(E0_MS2_PIN);
3421
+      SET_OUTPUT(E0_MS1_PIN); SET_OUTPUT(E0_MS2_PIN);
3413
       #if PIN_EXISTS(E0_MS3)
3422
       #if PIN_EXISTS(E0_MS3)
3414
         SET_OUTPUT(E0_MS3_PIN);
3423
         SET_OUTPUT(E0_MS3_PIN);
3415
       #endif
3424
       #endif
3416
     #endif
3425
     #endif
3417
     #if HAS_E1_MS_PINS
3426
     #if HAS_E1_MS_PINS
3418
-      SET_OUTPUT(E1_MS1_PIN);
3419
-      SET_OUTPUT(E1_MS2_PIN);
3427
+      SET_OUTPUT(E1_MS1_PIN); SET_OUTPUT(E1_MS2_PIN);
3420
       #if PIN_EXISTS(E1_MS3)
3428
       #if PIN_EXISTS(E1_MS3)
3421
         SET_OUTPUT(E1_MS3_PIN);
3429
         SET_OUTPUT(E1_MS3_PIN);
3422
       #endif
3430
       #endif
3423
     #endif
3431
     #endif
3424
     #if HAS_E2_MS_PINS
3432
     #if HAS_E2_MS_PINS
3425
-      SET_OUTPUT(E2_MS1_PIN);
3426
-      SET_OUTPUT(E2_MS2_PIN);
3433
+      SET_OUTPUT(E2_MS1_PIN); SET_OUTPUT(E2_MS2_PIN);
3427
       #if PIN_EXISTS(E2_MS3)
3434
       #if PIN_EXISTS(E2_MS3)
3428
         SET_OUTPUT(E2_MS3_PIN);
3435
         SET_OUTPUT(E2_MS3_PIN);
3429
       #endif
3436
       #endif
3430
     #endif
3437
     #endif
3431
     #if HAS_E3_MS_PINS
3438
     #if HAS_E3_MS_PINS
3432
-      SET_OUTPUT(E3_MS1_PIN);
3433
-      SET_OUTPUT(E3_MS2_PIN);
3439
+      SET_OUTPUT(E3_MS1_PIN); SET_OUTPUT(E3_MS2_PIN);
3434
       #if PIN_EXISTS(E3_MS3)
3440
       #if PIN_EXISTS(E3_MS3)
3435
         SET_OUTPUT(E3_MS3_PIN);
3441
         SET_OUTPUT(E3_MS3_PIN);
3436
       #endif
3442
       #endif
3437
     #endif
3443
     #endif
3438
     #if HAS_E4_MS_PINS
3444
     #if HAS_E4_MS_PINS
3439
-      SET_OUTPUT(E4_MS1_PIN);
3440
-      SET_OUTPUT(E4_MS2_PIN);
3445
+      SET_OUTPUT(E4_MS1_PIN); SET_OUTPUT(E4_MS2_PIN);
3441
       #if PIN_EXISTS(E4_MS3)
3446
       #if PIN_EXISTS(E4_MS3)
3442
         SET_OUTPUT(E4_MS3_PIN);
3447
         SET_OUTPUT(E4_MS3_PIN);
3443
       #endif
3448
       #endif
3444
     #endif
3449
     #endif
3445
     #if HAS_E5_MS_PINS
3450
     #if HAS_E5_MS_PINS
3446
-      SET_OUTPUT(E5_MS1_PIN);
3447
-      SET_OUTPUT(E5_MS2_PIN);
3451
+      SET_OUTPUT(E5_MS1_PIN); SET_OUTPUT(E5_MS2_PIN);
3448
       #if PIN_EXISTS(E5_MS3)
3452
       #if PIN_EXISTS(E5_MS3)
3449
         SET_OUTPUT(E5_MS3_PIN);
3453
         SET_OUTPUT(E5_MS3_PIN);
3450
       #endif
3454
       #endif
3451
     #endif
3455
     #endif
3452
     #if HAS_E6_MS_PINS
3456
     #if HAS_E6_MS_PINS
3453
-      SET_OUTPUT(E6_MS1_PIN);
3454
-      SET_OUTPUT(E6_MS2_PIN);
3457
+      SET_OUTPUT(E6_MS1_PIN); SET_OUTPUT(E6_MS2_PIN);
3455
       #if PIN_EXISTS(E6_MS3)
3458
       #if PIN_EXISTS(E6_MS3)
3456
         SET_OUTPUT(E6_MS3_PIN);
3459
         SET_OUTPUT(E6_MS3_PIN);
3457
       #endif
3460
       #endif
3458
     #endif
3461
     #endif
3459
     #if HAS_E7_MS_PINS
3462
     #if HAS_E7_MS_PINS
3460
-      SET_OUTPUT(E7_MS1_PIN);
3461
-      SET_OUTPUT(E7_MS2_PIN);
3463
+      SET_OUTPUT(E7_MS1_PIN); SET_OUTPUT(E7_MS2_PIN);
3462
       #if PIN_EXISTS(E7_MS3)
3464
       #if PIN_EXISTS(E7_MS3)
3463
         SET_OUTPUT(E7_MS3_PIN);
3465
         SET_OUTPUT(E7_MS3_PIN);
3464
       #endif
3466
       #endif
3531
       #if HAS_E7_MS_PINS
3533
       #if HAS_E7_MS_PINS
3532
         case 10: WRITE(E7_MS1_PIN, ms1); break;
3534
         case 10: WRITE(E7_MS1_PIN, ms1); break;
3533
       #endif
3535
       #endif
3534
-      #if HAS_I_MICROSTEPS
3536
+      #if HAS_I_MS_PINS
3535
         case 11: WRITE(I_MS1_PIN, ms1); break
3537
         case 11: WRITE(I_MS1_PIN, ms1); break
3536
       #endif
3538
       #endif
3537
-      #if HAS_J_MICROSTEPS
3539
+      #if HAS_J_MS_PINS
3538
         case 12: WRITE(J_MS1_PIN, ms1); break
3540
         case 12: WRITE(J_MS1_PIN, ms1); break
3539
       #endif
3541
       #endif
3540
-      #if HAS_K_MICROSTEPS
3542
+      #if HAS_K_MS_PINS
3541
         case 13: WRITE(K_MS1_PIN, ms1); break
3543
         case 13: WRITE(K_MS1_PIN, ms1); break
3542
       #endif
3544
       #endif
3543
     }
3545
     }
3602
       #if HAS_E7_MS_PINS
3604
       #if HAS_E7_MS_PINS
3603
         case 10: WRITE(E7_MS2_PIN, ms2); break;
3605
         case 10: WRITE(E7_MS2_PIN, ms2); break;
3604
       #endif
3606
       #endif
3605
-      #if HAS_I_M_PINS
3607
+      #if HAS_I_MS_PINS
3606
         case 11: WRITE(I_MS2_PIN, ms2); break
3608
         case 11: WRITE(I_MS2_PIN, ms2); break
3607
       #endif
3609
       #endif
3608
-      #if HAS_J_M_PINS
3610
+      #if HAS_J_MS_PINS
3609
         case 12: WRITE(J_MS2_PIN, ms2); break
3611
         case 12: WRITE(J_MS2_PIN, ms2); break
3610
       #endif
3612
       #endif
3611
-      #if HAS_K_M_PINS
3613
+      #if HAS_K_MS_PINS
3612
         case 13: WRITE(K_MS2_PIN, ms2); break
3614
         case 13: WRITE(K_MS2_PIN, ms2); break
3613
       #endif
3615
       #endif
3614
     }
3616
     }

+ 0
- 1
Marlin/src/module/stepper.h View File

320
         #ifndef MOTOR_CURRENT_PWM_FREQUENCY
320
         #ifndef MOTOR_CURRENT_PWM_FREQUENCY
321
           #define MOTOR_CURRENT_PWM_FREQUENCY 31400
321
           #define MOTOR_CURRENT_PWM_FREQUENCY 31400
322
         #endif
322
         #endif
323
-
324
         #define MOTOR_CURRENT_COUNT LINEAR_AXES
323
         #define MOTOR_CURRENT_COUNT LINEAR_AXES
325
       #elif HAS_MOTOR_CURRENT_SPI
324
       #elif HAS_MOTOR_CURRENT_SPI
326
         static constexpr uint32_t digipot_count[] = DIGIPOT_MOTOR_CURRENT;
325
         static constexpr uint32_t digipot_count[] = DIGIPOT_MOTOR_CURRENT;

+ 18
- 0
Marlin/src/pins/pinsDebug_list.h View File

1601
 #if PIN_EXISTS(Z4_SERIAL_RX)
1601
 #if PIN_EXISTS(Z4_SERIAL_RX)
1602
   REPORT_NAME_DIGITAL(__LINE__, Z4_SERIAL_RX_PIN)
1602
   REPORT_NAME_DIGITAL(__LINE__, Z4_SERIAL_RX_PIN)
1603
 #endif
1603
 #endif
1604
+#if PIN_EXISTS(I_SERIAL_TX)
1605
+  REPORT_NAME_DIGITAL(__LINE__, I_SERIAL_TX_PIN)
1606
+#endif
1607
+#if PIN_EXISTS(I_SERIAL_RX)
1608
+  REPORT_NAME_DIGITAL(__LINE__, I_SERIAL_RX_PIN)
1609
+#endif
1610
+#if PIN_EXISTS(J_SERIAL_TX)
1611
+  REPORT_NAME_DIGITAL(__LINE__, J_SERIAL_TX_PIN)
1612
+#endif
1613
+#if PIN_EXISTS(J_SERIAL_RX)
1614
+  REPORT_NAME_DIGITAL(__LINE__, J_SERIAL_RX_PIN)
1615
+#endif
1616
+#if PIN_EXISTS(K_SERIAL_TX)
1617
+  REPORT_NAME_DIGITAL(__LINE__, K_SERIAL_TX_PIN)
1618
+#endif
1619
+#if PIN_EXISTS(K_SERIAL_RX)
1620
+  REPORT_NAME_DIGITAL(__LINE__, K_SERIAL_RX_PIN)
1621
+#endif
1604
 #if PIN_EXISTS(E0_DIAG)
1622
 #if PIN_EXISTS(E0_DIAG)
1605
   REPORT_NAME_DIGITAL(__LINE__, E0_DIAG_PIN)
1623
   REPORT_NAME_DIGITAL(__LINE__, E0_DIAG_PIN)
1606
 #endif
1624
 #endif

+ 15
- 7
Marlin/src/pins/pins_postprocess.h View File

546
   #undef K_MAX_PIN
546
   #undef K_MAX_PIN
547
 #endif
547
 #endif
548
 
548
 
549
+// Filament Sensor first pin alias
549
 #if HAS_FILAMENT_SENSOR
550
 #if HAS_FILAMENT_SENSOR
550
   #define FIL_RUNOUT1_PIN FIL_RUNOUT_PIN  // Filament Sensor first pin alias
551
   #define FIL_RUNOUT1_PIN FIL_RUNOUT_PIN  // Filament Sensor first pin alias
551
 #else
552
 #else
598
   #define X2_E_INDEX E_STEPPERS
599
   #define X2_E_INDEX E_STEPPERS
599
 #endif
600
 #endif
600
 
601
 
601
-// The X2 axis, if any, should be the next open extruder port
602
 #if HAS_X2_STEPPER && !defined(X2_DIAG_PIN) && !defined(X2_STEP_PIN) && !PIN_EXISTS(X2_CS_PIN)
602
 #if HAS_X2_STEPPER && !defined(X2_DIAG_PIN) && !defined(X2_STEP_PIN) && !PIN_EXISTS(X2_CS_PIN)
603
   #define Y2_E_INDEX INCREMENT(X2_E_INDEX)
603
   #define Y2_E_INDEX INCREMENT(X2_E_INDEX)
604
 #else
604
 #else
605
   #define Y2_E_INDEX X2_E_INDEX
605
   #define Y2_E_INDEX X2_E_INDEX
606
 #endif
606
 #endif
607
+
608
+// The X2 axis, if any, should be the next open extruder port
607
 #if HAS_X2_STEPPER
609
 #if HAS_X2_STEPPER
608
   #ifndef X2_STEP_PIN
610
   #ifndef X2_STEP_PIN
609
     #define X2_STEP_PIN   _EPIN(X2_E_INDEX, STEP)
611
     #define X2_STEP_PIN   _EPIN(X2_E_INDEX, STEP)
686
   #define X2_MS3_PIN -1
688
   #define X2_MS3_PIN -1
687
 #endif
689
 #endif
688
 
690
 
689
-// The Y2 axis, if any, should be the next open extruder port
690
 #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !defined(Y2_DIAG_PIN) && !defined(Y2_STEP_PIN) && !PIN_EXISTS(Y2_CS_PIN)
691
 #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !defined(Y2_DIAG_PIN) && !defined(Y2_STEP_PIN) && !PIN_EXISTS(Y2_CS_PIN)
691
   #define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
692
   #define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
692
 #else
693
 #else
693
   #define Z2_E_INDEX Y2_E_INDEX
694
   #define Z2_E_INDEX Y2_E_INDEX
694
 #endif
695
 #endif
696
+
697
+// The Y2 axis, if any, should be the next open extruder port
695
 #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
698
 #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
696
   #ifndef Y2_STEP_PIN
699
   #ifndef Y2_STEP_PIN
697
     #define Y2_STEP_PIN   _EPIN(Y2_E_INDEX, STEP)
700
     #define Y2_STEP_PIN   _EPIN(Y2_E_INDEX, STEP)
771
   #define Y2_MS3_PIN -1
774
   #define Y2_MS3_PIN -1
772
 #endif
775
 #endif
773
 
776
 
774
-// The Z2 axis, if any, should be the next open extruder port
775
 #if NUM_Z_STEPPER_DRIVERS >= 2 && !defined(Z2_DIAG_PIN) && !defined(Z2_STEP_PIN) && !PIN_EXISTS(Z2_CS_PIN)
777
 #if NUM_Z_STEPPER_DRIVERS >= 2 && !defined(Z2_DIAG_PIN) && !defined(Z2_STEP_PIN) && !PIN_EXISTS(Z2_CS_PIN)
776
   #define Z3_E_INDEX INCREMENT(Z2_E_INDEX)
778
   #define Z3_E_INDEX INCREMENT(Z2_E_INDEX)
777
 #else
779
 #else
778
   #define Z3_E_INDEX Z2_E_INDEX
780
   #define Z3_E_INDEX Z2_E_INDEX
779
 #endif
781
 #endif
782
+
783
+// The Z2 axis, if any, should be the next open extruder port
780
 #if NUM_Z_STEPPER_DRIVERS >= 2
784
 #if NUM_Z_STEPPER_DRIVERS >= 2
781
   #ifndef Z2_STEP_PIN
785
   #ifndef Z2_STEP_PIN
782
     #define Z2_STEP_PIN   _EPIN(Z2_E_INDEX, STEP)
786
     #define Z2_STEP_PIN   _EPIN(Z2_E_INDEX, STEP)
856
   #define Z2_MS3_PIN -1
860
   #define Z2_MS3_PIN -1
857
 #endif
861
 #endif
858
 
862
 
859
-// The Z3 axis, if any, should be the next open extruder port
860
 #if NUM_Z_STEPPER_DRIVERS >= 3 && !defined(Z3_DIAG_PIN) && !defined(Z3_STEP_PIN) && !PIN_EXISTS(Z3_CS_PIN)
863
 #if NUM_Z_STEPPER_DRIVERS >= 3 && !defined(Z3_DIAG_PIN) && !defined(Z3_STEP_PIN) && !PIN_EXISTS(Z3_CS_PIN)
861
   #define Z4_E_INDEX INCREMENT(Z3_E_INDEX)
864
   #define Z4_E_INDEX INCREMENT(Z3_E_INDEX)
862
 #else
865
 #else
863
   #define Z4_E_INDEX Z3_E_INDEX
866
   #define Z4_E_INDEX Z3_E_INDEX
864
 #endif
867
 #endif
868
+
869
+// The Z3 axis, if any, should be the next open extruder port
865
 #if NUM_Z_STEPPER_DRIVERS >= 3
870
 #if NUM_Z_STEPPER_DRIVERS >= 3
866
   #ifndef Z3_STEP_PIN
871
   #ifndef Z3_STEP_PIN
867
     #define Z3_STEP_PIN   _EPIN(Z3_E_INDEX, STEP)
872
     #define Z3_STEP_PIN   _EPIN(Z3_E_INDEX, STEP)
941
   #define Z3_MS3_PIN -1
946
   #define Z3_MS3_PIN -1
942
 #endif
947
 #endif
943
 
948
 
944
-// The Z4 axis, if any, should be the next open extruder port
945
 #if NUM_Z_STEPPER_DRIVERS >= 4 && !defined(Z4_DIAG_PIN) && !defined(Z4_STEP_PIN) && !PIN_EXISTS(Z4_CS_PIN)
949
 #if NUM_Z_STEPPER_DRIVERS >= 4 && !defined(Z4_DIAG_PIN) && !defined(Z4_STEP_PIN) && !PIN_EXISTS(Z4_CS_PIN)
946
   #define I_E_INDEX INCREMENT(Z4_E_INDEX)
950
   #define I_E_INDEX INCREMENT(Z4_E_INDEX)
947
 #else
951
 #else
948
   #define I_E_INDEX Z4_E_INDEX
952
   #define I_E_INDEX Z4_E_INDEX
949
 #endif
953
 #endif
954
+
955
+// The Z4 axis, if any, should be the next open extruder port
950
 #if NUM_Z_STEPPER_DRIVERS >= 4
956
 #if NUM_Z_STEPPER_DRIVERS >= 4
951
   #ifndef Z4_STEP_PIN
957
   #ifndef Z4_STEP_PIN
952
     #define Z4_STEP_PIN   _EPIN(Z4_E_INDEX, STEP)
958
     #define Z4_STEP_PIN   _EPIN(Z4_E_INDEX, STEP)
1026
   #define Z4_MS3_PIN -1
1032
   #define Z4_MS3_PIN -1
1027
 #endif
1033
 #endif
1028
 
1034
 
1029
-// The I axis, if any, should be the next open extruder port
1030
 #if HAS_I_AXIS && !defined(I_DIAG_PIN) && !defined(I_STEP_PIN) && !PIN_EXISTS(I_CS_PIN)
1035
 #if HAS_I_AXIS && !defined(I_DIAG_PIN) && !defined(I_STEP_PIN) && !PIN_EXISTS(I_CS_PIN)
1031
   #define J_E_INDEX INCREMENT(I_E_INDEX)
1036
   #define J_E_INDEX INCREMENT(I_E_INDEX)
1032
 #else
1037
 #else
1033
   #define J_E_INDEX I_E_INDEX
1038
   #define J_E_INDEX I_E_INDEX
1034
 #endif
1039
 #endif
1040
+
1041
+// The I axis, if any, should be the next open extruder port
1035
 #if HAS_I_AXIS
1042
 #if HAS_I_AXIS
1036
   #ifndef I_STEP_PIN
1043
   #ifndef I_STEP_PIN
1037
     #define I_STEP_PIN   _EPIN(I_E_INDEX, STEP)
1044
     #define I_STEP_PIN   _EPIN(I_E_INDEX, STEP)
1111
   #define I_MS3_PIN -1
1118
   #define I_MS3_PIN -1
1112
 #endif
1119
 #endif
1113
 
1120
 
1114
-// The J axis, if any, should be the next open extruder port
1115
 #if HAS_J_AXIS && !defined(J_DIAG_PIN) && !defined(J_STEP_PIN) && !PIN_EXISTS(J_CS_PIN)
1121
 #if HAS_J_AXIS && !defined(J_DIAG_PIN) && !defined(J_STEP_PIN) && !PIN_EXISTS(J_CS_PIN)
1116
   #define K_E_INDEX INCREMENT(J_E_INDEX)
1122
   #define K_E_INDEX INCREMENT(J_E_INDEX)
1117
 #else
1123
 #else
1118
   #define K_E_INDEX J_E_INDEX
1124
   #define K_E_INDEX J_E_INDEX
1119
 #endif
1125
 #endif
1126
+
1127
+// The J axis, if any, should be the next open extruder port
1120
 #if HAS_J_AXIS
1128
 #if HAS_J_AXIS
1121
   #ifndef J_STEP_PIN
1129
   #ifndef J_STEP_PIN
1122
     #define J_STEP_PIN   _EPIN(J_E_INDEX, STEP)
1130
     #define J_STEP_PIN   _EPIN(J_E_INDEX, STEP)

Loading…
Cancel
Save