Browse Source

Merge pull request #3806 from thinkyhead/rc_coreyz_support

Support for COREYZ. Fixes for COREXY, COREXZ
Scott Lahteine 8 years ago
parent
commit
fe3122774a

+ 8
- 2
Marlin/Conditionals.h View File

315
    * CoreXY and CoreXZ
315
    * CoreXY and CoreXZ
316
    */
316
    */
317
   #if ENABLED(COREXY)
317
   #if ENABLED(COREXY)
318
+    #define CORE_AXIS_1 A_AXIS // XY from A + B
318
     #define CORE_AXIS_2 B_AXIS
319
     #define CORE_AXIS_2 B_AXIS
319
-    #define CORE_AXIS_3 Z_AXIS
320
+    #define NORMAL_AXIS Z_AXIS
320
   #elif ENABLED(COREXZ)
321
   #elif ENABLED(COREXZ)
322
+    #define CORE_AXIS_1 A_AXIS // XZ from A + C
321
     #define CORE_AXIS_2 C_AXIS
323
     #define CORE_AXIS_2 C_AXIS
322
-    #define CORE_AXIS_3 Y_AXIS
324
+    #define NORMAL_AXIS Y_AXIS
325
+  #elif ENABLED(COREYZ)
326
+    #define CORE_AXIS_1 B_AXIS // YZ from B + C
327
+    #define CORE_AXIS_2 C_AXIS
328
+    #define NORMAL_AXIS X_AXIS
323
   #endif
329
   #endif
324
 
330
 
325
   /**
331
   /**

+ 2
- 3
Marlin/Configuration.h View File

345
 
345
 
346
 // @section machine
346
 // @section machine
347
 
347
 
348
-// Uncomment this option to enable CoreXY kinematics
348
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
349
 //#define COREXY
349
 //#define COREXY
350
-
351
-// Uncomment this option to enable CoreXZ kinematics
352
 //#define COREXZ
350
 //#define COREXZ
351
+//#define COREYZ
353
 
352
 
354
 // Enable this option for Toshiba steppers
353
 // Enable this option for Toshiba steppers
355
 //#define CONFIG_STEPPERS_TOSHIBA
354
 //#define CONFIG_STEPPERS_TOSHIBA

+ 10
- 0
Marlin/SanityCheck.h View File

390
 #endif
390
 #endif
391
 
391
 
392
 /**
392
 /**
393
+ * Don't set more than one kinematic type
394
+ */
395
+#if (ENABLED(DELTA) && (ENABLED(SCARA) || ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ))) \
396
+ || (ENABLED(SCARA) && (ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ))) \
397
+ || (ENABLED(COREXY) && (ENABLED(COREXZ) || ENABLED(COREYZ))) \
398
+ || (ENABLED(COREXZ) && ENABLED(COREYZ))
399
+  #error "Please enable only one of DELTA, SCARA, COREXY, COREXZ, or COREYZ."
400
+#endif
401
+
402
+/**
393
  * Allen Key Z probe requires Auto Bed Leveling grid and Delta
403
  * Allen Key Z probe requires Auto Bed Leveling grid and Delta
394
  */
404
  */
395
 #if ENABLED(Z_PROBE_ALLEN_KEY) && !(ENABLED(AUTO_BED_LEVELING_GRID) && ENABLED(DELTA))
405
 #if ENABLED(Z_PROBE_ALLEN_KEY) && !(ENABLED(AUTO_BED_LEVELING_GRID) && ENABLED(DELTA))

+ 11
- 11
Marlin/endstops.cpp View File

239
 
239
 
240
   #if ENABLED(COREXY) || ENABLED(COREXZ)
240
   #if ENABLED(COREXY) || ENABLED(COREXZ)
241
     // Head direction in -X axis for CoreXY and CoreXZ bots.
241
     // Head direction in -X axis for CoreXY and CoreXZ bots.
242
-    // If Delta1 == -Delta2, the movement is only in Y or Z axis
243
-    if ((stepper.current_block->steps[A_AXIS] != stepper.current_block->steps[CORE_AXIS_2]) || (stepper.motor_direction(A_AXIS) == stepper.motor_direction(CORE_AXIS_2))) {
242
+    // If DeltaA == -DeltaB, the movement is only in Y or Z axis
243
+    if ((stepper.current_block->steps[CORE_AXIS_1] != stepper.current_block->steps[CORE_AXIS_2]) || (stepper.motor_direction(CORE_AXIS_1) == stepper.motor_direction(CORE_AXIS_2))) {
244
       if (stepper.motor_direction(X_HEAD))
244
       if (stepper.motor_direction(X_HEAD))
245
   #else
245
   #else
246
     if (stepper.motor_direction(X_AXIS))   // stepping along -X axis (regular Cartesian bot)
246
     if (stepper.motor_direction(X_AXIS))   // stepping along -X axis (regular Cartesian bot)
271
     }
271
     }
272
   #endif
272
   #endif
273
 
273
 
274
-  #if ENABLED(COREXY)
275
-    // Head direction in -Y axis for CoreXY bots.
276
-    // If DeltaX == DeltaY, the movement is only in X axis
277
-    if ((stepper.current_block->steps[A_AXIS] != stepper.current_block->steps[B_AXIS]) || (stepper.motor_direction(A_AXIS) != stepper.motor_direction(B_AXIS))) {
274
+  #if ENABLED(COREXY) || ENABLED(COREYZ)
275
+    // Head direction in -Y axis for CoreXY / CoreYZ bots.
276
+    // If DeltaA == DeltaB, the movement is only in X or Y axis
277
+    if ((stepper.current_block->steps[CORE_AXIS_1] != stepper.current_block->steps[CORE_AXIS_2]) || (stepper.motor_direction(CORE_AXIS_1) != stepper.motor_direction(CORE_AXIS_2))) {
278
       if (stepper.motor_direction(Y_HEAD))
278
       if (stepper.motor_direction(Y_HEAD))
279
   #else
279
   #else
280
       if (stepper.motor_direction(Y_AXIS))   // -direction
280
       if (stepper.motor_direction(Y_AXIS))   // -direction
289
           UPDATE_ENDSTOP(Y, MAX);
289
           UPDATE_ENDSTOP(Y, MAX);
290
         #endif
290
         #endif
291
       }
291
       }
292
-  #if ENABLED(COREXY)
292
+  #if ENABLED(COREXY) || ENABLED(COREYZ)
293
     }
293
     }
294
   #endif
294
   #endif
295
 
295
 
296
-  #if ENABLED(COREXZ)
297
-    // Head direction in -Z axis for CoreXZ bots.
298
-    // If DeltaX == DeltaZ, the movement is only in X axis
299
-    if ((stepper.current_block->steps[A_AXIS] != stepper.current_block->steps[C_AXIS]) || (stepper.motor_direction(A_AXIS) != stepper.motor_direction(C_AXIS))) {
296
+  #if ENABLED(COREXZ) || ENABLED(COREYZ)
297
+    // Head direction in -Z axis for CoreXZ or CoreYZ bots.
298
+    // If DeltaA == DeltaB, the movement is only in X or Y axis
299
+    if ((stepper.current_block->steps[CORE_AXIS_1] != stepper.current_block->steps[CORE_AXIS_2]) || (stepper.motor_direction(CORE_AXIS_1) != stepper.motor_direction(CORE_AXIS_2))) {
300
       if (stepper.motor_direction(Z_HEAD))
300
       if (stepper.motor_direction(Z_HEAD))
301
   #else
301
   #else
302
       if (stepper.motor_direction(Z_AXIS))
302
       if (stepper.motor_direction(Z_AXIS))

+ 2
- 3
Marlin/example_configurations/Felix/Configuration.h View File

327
 
327
 
328
 // @section machine
328
 // @section machine
329
 
329
 
330
-// Uncomment this option to enable CoreXY kinematics
330
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
331
 //#define COREXY
331
 //#define COREXY
332
-
333
-// Uncomment this option to enable CoreXZ kinematics
334
 //#define COREXZ
332
 //#define COREXZ
333
+//#define COREYZ
335
 
334
 
336
 // Enable this option for Toshiba steppers
335
 // Enable this option for Toshiba steppers
337
 //#define CONFIG_STEPPERS_TOSHIBA
336
 //#define CONFIG_STEPPERS_TOSHIBA

+ 2
- 3
Marlin/example_configurations/Felix/DUAL/Configuration.h View File

325
 
325
 
326
 // @section machine
326
 // @section machine
327
 
327
 
328
-// Uncomment this option to enable CoreXY kinematics
328
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
329
 //#define COREXY
329
 //#define COREXY
330
-
331
-// Uncomment this option to enable CoreXZ kinematics
332
 //#define COREXZ
330
 //#define COREXZ
331
+//#define COREYZ
333
 
332
 
334
 // Enable this option for Toshiba steppers
333
 // Enable this option for Toshiba steppers
335
 //#define CONFIG_STEPPERS_TOSHIBA
334
 //#define CONFIG_STEPPERS_TOSHIBA

+ 2
- 3
Marlin/example_configurations/Hephestos/Configuration.h View File

337
 
337
 
338
 // @section machine
338
 // @section machine
339
 
339
 
340
-// Uncomment this option to enable CoreXY kinematics
340
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
341
 //#define COREXY
341
 //#define COREXY
342
-
343
-// Uncomment this option to enable CoreXZ kinematics
344
 //#define COREXZ
342
 //#define COREXZ
343
+//#define COREYZ
345
 
344
 
346
 // Enable this option for Toshiba steppers
345
 // Enable this option for Toshiba steppers
347
 //#define CONFIG_STEPPERS_TOSHIBA
346
 //#define CONFIG_STEPPERS_TOSHIBA

+ 2
- 3
Marlin/example_configurations/Hephestos_2/Configuration.h View File

339
 
339
 
340
 // @section machine
340
 // @section machine
341
 
341
 
342
-// Uncomment this option to enable CoreXY kinematics
342
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
343
 //#define COREXY
343
 //#define COREXY
344
-
345
-// Uncomment this option to enable CoreXZ kinematics
346
 //#define COREXZ
344
 //#define COREXZ
345
+//#define COREYZ
347
 
346
 
348
 // Enable this option for Toshiba steppers
347
 // Enable this option for Toshiba steppers
349
 //#define CONFIG_STEPPERS_TOSHIBA
348
 //#define CONFIG_STEPPERS_TOSHIBA

+ 2
- 3
Marlin/example_configurations/K8200/Configuration.h View File

362
 
362
 
363
 // @section machine
363
 // @section machine
364
 
364
 
365
-// Uncomment this option to enable CoreXY kinematics
365
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
366
 //#define COREXY
366
 //#define COREXY
367
-
368
-// Uncomment this option to enable CoreXZ kinematics
369
 //#define COREXZ
367
 //#define COREXZ
368
+//#define COREYZ
370
 
369
 
371
 // Enable this option for Toshiba steppers
370
 // Enable this option for Toshiba steppers
372
 //#define CONFIG_STEPPERS_TOSHIBA
371
 //#define CONFIG_STEPPERS_TOSHIBA

+ 2
- 3
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

345
 
345
 
346
 // @section machine
346
 // @section machine
347
 
347
 
348
-// Uncomment this option to enable CoreXY kinematics
348
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
349
 //#define COREXY
349
 //#define COREXY
350
-
351
-// Uncomment this option to enable CoreXZ kinematics
352
 //#define COREXZ
350
 //#define COREXZ
351
+//#define COREYZ
353
 
352
 
354
 // Enable this option for Toshiba steppers
353
 // Enable this option for Toshiba steppers
355
 //#define CONFIG_STEPPERS_TOSHIBA
354
 //#define CONFIG_STEPPERS_TOSHIBA

+ 2
- 3
Marlin/example_configurations/RigidBot/Configuration.h View File

339
 
339
 
340
 // @section machine
340
 // @section machine
341
 
341
 
342
-// Uncomment this option to enable CoreXY kinematics
342
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
343
 //#define COREXY
343
 //#define COREXY
344
-
345
-// Uncomment this option to enable CoreXZ kinematics
346
 //#define COREXZ
344
 //#define COREXZ
345
+//#define COREYZ
347
 
346
 
348
 // Enable this option for Toshiba steppers
347
 // Enable this option for Toshiba steppers
349
 //#define CONFIG_STEPPERS_TOSHIBA
348
 //#define CONFIG_STEPPERS_TOSHIBA

+ 2
- 3
Marlin/example_configurations/SCARA/Configuration.h View File

353
 
353
 
354
 // @section machine
354
 // @section machine
355
 
355
 
356
-// Uncomment this option to enable CoreXY kinematics
356
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
357
 //#define COREXY
357
 //#define COREXY
358
-
359
-// Uncomment this option to enable CoreXZ kinematics
360
 //#define COREXZ
358
 //#define COREXZ
359
+//#define COREYZ
361
 
360
 
362
 // Enable this option for Toshiba steppers
361
 // Enable this option for Toshiba steppers
363
 //#define CONFIG_STEPPERS_TOSHIBA
362
 //#define CONFIG_STEPPERS_TOSHIBA

+ 2
- 3
Marlin/example_configurations/TAZ4/Configuration.h View File

366
 
366
 
367
 // @section machine
367
 // @section machine
368
 
368
 
369
-// Uncomment this option to enable CoreXY kinematics
369
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
370
 //#define COREXY
370
 //#define COREXY
371
-
372
-// Uncomment this option to enable CoreXZ kinematics
373
 //#define COREXZ
371
 //#define COREXZ
372
+//#define COREYZ
374
 
373
 
375
 // Enable this option for Toshiba steppers
374
 // Enable this option for Toshiba steppers
376
 //#define CONFIG_STEPPERS_TOSHIBA
375
 //#define CONFIG_STEPPERS_TOSHIBA

+ 2
- 3
Marlin/example_configurations/WITBOX/Configuration.h View File

337
 
337
 
338
 // @section machine
338
 // @section machine
339
 
339
 
340
-// Uncomment this option to enable CoreXY kinematics
340
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
341
 //#define COREXY
341
 //#define COREXY
342
-
343
-// Uncomment this option to enable CoreXZ kinematics
344
 //#define COREXZ
342
 //#define COREXZ
343
+//#define COREYZ
345
 
344
 
346
 // Enable this option for Toshiba steppers
345
 // Enable this option for Toshiba steppers
347
 //#define CONFIG_STEPPERS_TOSHIBA
346
 //#define CONFIG_STEPPERS_TOSHIBA

+ 2
- 3
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

345
 
345
 
346
 // @section machine
346
 // @section machine
347
 
347
 
348
-// Uncomment this option to enable CoreXY kinematics
348
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
349
 //#define COREXY
349
 //#define COREXY
350
-
351
-// Uncomment this option to enable CoreXZ kinematics
352
 //#define COREXZ
350
 //#define COREXZ
351
+//#define COREYZ
353
 
352
 
354
 // Enable this option for Toshiba steppers
353
 // Enable this option for Toshiba steppers
355
 //#define CONFIG_STEPPERS_TOSHIBA
354
 //#define CONFIG_STEPPERS_TOSHIBA

+ 2
- 3
Marlin/example_configurations/delta/biv2.5/Configuration.h View File

345
 
345
 
346
 // @section machine
346
 // @section machine
347
 
347
 
348
-// Uncomment this option to enable CoreXY kinematics
348
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
349
 //#define COREXY
349
 //#define COREXY
350
-
351
-// Uncomment this option to enable CoreXZ kinematics
352
 //#define COREXZ
350
 //#define COREXZ
351
+//#define COREYZ
353
 
352
 
354
 //===========================================================================
353
 //===========================================================================
355
 //============================== Delta Settings =============================
354
 //============================== Delta Settings =============================

+ 2
- 3
Marlin/example_configurations/delta/generic/Configuration.h View File

345
 
345
 
346
 // @section machine
346
 // @section machine
347
 
347
 
348
-// Uncomment this option to enable CoreXY kinematics
348
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
349
 //#define COREXY
349
 //#define COREXY
350
-
351
-// Uncomment this option to enable CoreXZ kinematics
352
 //#define COREXZ
350
 //#define COREXZ
351
+//#define COREYZ
353
 
352
 
354
 //===========================================================================
353
 //===========================================================================
355
 //============================== Delta Settings =============================
354
 //============================== Delta Settings =============================

+ 2
- 3
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

345
 
345
 
346
 // @section machine
346
 // @section machine
347
 
347
 
348
-// Uncomment this option to enable CoreXY kinematics
348
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
349
 //#define COREXY
349
 //#define COREXY
350
-
351
-// Uncomment this option to enable CoreXZ kinematics
352
 //#define COREXZ
350
 //#define COREXZ
351
+//#define COREYZ
353
 
352
 
354
 //===========================================================================
353
 //===========================================================================
355
 //============================== Delta Settings =============================
354
 //============================== Delta Settings =============================

+ 2
- 3
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

334
 
334
 
335
 // @section machine
335
 // @section machine
336
 
336
 
337
-// Uncomment this option to enable CoreXY kinematics
337
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
338
 //#define COREXY
338
 //#define COREXY
339
-
340
-// Uncomment this option to enable CoreXZ kinematics
341
 //#define COREXZ
339
 //#define COREXZ
340
+//#define COREYZ
342
 
341
 
343
 //===========================================================================
342
 //===========================================================================
344
 //============================== Delta Settings =============================
343
 //============================== Delta Settings =============================

+ 2
- 3
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

343
 
343
 
344
 // @section machine
344
 // @section machine
345
 
345
 
346
-// Uncomment this option to enable CoreXY kinematics
346
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
347
 //#define COREXY
347
 //#define COREXY
348
-
349
-// Uncomment this option to enable CoreXZ kinematics
350
 //#define COREXZ
348
 //#define COREXZ
349
+//#define COREYZ
351
 
350
 
352
 //===========================================================================
351
 //===========================================================================
353
 //============================== Delta Settings =============================
352
 //============================== Delta Settings =============================

+ 2
- 3
Marlin/example_configurations/makibox/Configuration.h View File

348
 
348
 
349
 // @section machine
349
 // @section machine
350
 
350
 
351
-// Uncomment this option to enable CoreXY kinematics
351
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
352
 //#define COREXY
352
 //#define COREXY
353
-
354
-// Uncomment this option to enable CoreXZ kinematics
355
 //#define COREXZ
353
 //#define COREXZ
354
+//#define COREYZ
356
 
355
 
357
 // Enable this option for Toshiba steppers
356
 // Enable this option for Toshiba steppers
358
 //#define CONFIG_STEPPERS_TOSHIBA
357
 //#define CONFIG_STEPPERS_TOSHIBA

+ 2
- 3
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

335
 
335
 
336
 // @section machine
336
 // @section machine
337
 
337
 
338
-// Uncomment this option to enable CoreXY kinematics
338
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
339
 //#define COREXY
339
 //#define COREXY
340
-
341
-// Uncomment this option to enable CoreXZ kinematics
342
 //#define COREXZ
340
 //#define COREXZ
341
+//#define COREYZ
343
 
342
 
344
 // Enable this option for Toshiba steppers
343
 // Enable this option for Toshiba steppers
345
 #define CONFIG_STEPPERS_TOSHIBA
344
 #define CONFIG_STEPPERS_TOSHIBA

+ 34
- 14
Marlin/planner.cpp View File

543
     block->steps[A_AXIS] = labs(dx + dz);
543
     block->steps[A_AXIS] = labs(dx + dz);
544
     block->steps[Y_AXIS] = labs(dy);
544
     block->steps[Y_AXIS] = labs(dy);
545
     block->steps[C_AXIS] = labs(dx - dz);
545
     block->steps[C_AXIS] = labs(dx - dz);
546
+  #elif ENABLED(COREYZ)
547
+    // coreyz planning
548
+    block->steps[X_AXIS] = labs(dx);
549
+    block->steps[B_AXIS] = labs(dy + dz);
550
+    block->steps[C_AXIS] = labs(dy - dz);
546
   #else
551
   #else
547
     // default non-h-bot planning
552
     // default non-h-bot planning
548
     block->steps[X_AXIS] = labs(dx);
553
     block->steps[X_AXIS] = labs(dx);
581
     if (dy < 0) SBI(db, Y_AXIS);
586
     if (dy < 0) SBI(db, Y_AXIS);
582
     if (dz < 0) SBI(db, Z_HEAD); // ...and Z
587
     if (dz < 0) SBI(db, Z_HEAD); // ...and Z
583
     if (dx + dz < 0) SBI(db, A_AXIS); // Motor A direction
588
     if (dx + dz < 0) SBI(db, A_AXIS); // Motor A direction
584
-    if (dx - dz < 0) SBI(db, C_AXIS); // Motor B direction
589
+    if (dx - dz < 0) SBI(db, C_AXIS); // Motor C direction
590
+  #elif ENABLED(COREYZ)
591
+    if (dx < 0) SBI(db, X_AXIS);
592
+    if (dy < 0) SBI(db, Y_HEAD); // Save the real Extruder (head) direction in Y Axis
593
+    if (dz < 0) SBI(db, Z_HEAD); // ...and Z
594
+    if (dy + dz < 0) SBI(db, B_AXIS); // Motor B direction
595
+    if (dy - dz < 0) SBI(db, C_AXIS); // Motor C direction
585
   #else
596
   #else
586
     if (dx < 0) SBI(db, X_AXIS);
597
     if (dx < 0) SBI(db, X_AXIS);
587
     if (dy < 0) SBI(db, Y_AXIS);
598
     if (dy < 0) SBI(db, Y_AXIS);
698
    * So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head.
709
    * So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head.
699
    * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
710
    * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
700
    */
711
    */
701
-  #if ENABLED(COREXY)
712
+  #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
702
     float delta_mm[6];
713
     float delta_mm[6];
703
-    delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
704
-    delta_mm[Y_HEAD] = dy / axis_steps_per_unit[B_AXIS];
705
-    delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
706
-    delta_mm[A_AXIS] = (dx + dy) / axis_steps_per_unit[A_AXIS];
707
-    delta_mm[B_AXIS] = (dx - dy) / axis_steps_per_unit[B_AXIS];
708
-  #elif ENABLED(COREXZ)
709
-    float delta_mm[6];
710
-    delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
711
-    delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
712
-    delta_mm[Z_HEAD] = dz / axis_steps_per_unit[C_AXIS];
713
-    delta_mm[A_AXIS] = (dx + dz) / axis_steps_per_unit[A_AXIS];
714
-    delta_mm[C_AXIS] = (dx - dz) / axis_steps_per_unit[C_AXIS];
714
+    #if ENABLED(COREXY)
715
+      delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
716
+      delta_mm[Y_HEAD] = dy / axis_steps_per_unit[B_AXIS];
717
+      delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
718
+      delta_mm[A_AXIS] = (dx + dy) / axis_steps_per_unit[A_AXIS];
719
+      delta_mm[B_AXIS] = (dx - dy) / axis_steps_per_unit[B_AXIS];
720
+    #elif ENABLED(COREXZ)
721
+      delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
722
+      delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
723
+      delta_mm[Z_HEAD] = dz / axis_steps_per_unit[C_AXIS];
724
+      delta_mm[A_AXIS] = (dx + dz) / axis_steps_per_unit[A_AXIS];
725
+      delta_mm[C_AXIS] = (dx - dz) / axis_steps_per_unit[C_AXIS];
726
+    #elif ENABLED(COREYZ)
727
+      delta_mm[X_AXIS] = dx / axis_steps_per_unit[A_AXIS];
728
+      delta_mm[Y_HEAD] = dy / axis_steps_per_unit[Y_AXIS];
729
+      delta_mm[Z_HEAD] = dz / axis_steps_per_unit[C_AXIS];
730
+      delta_mm[B_AXIS] = (dy + dz) / axis_steps_per_unit[B_AXIS];
731
+      delta_mm[C_AXIS] = (dy - dz) / axis_steps_per_unit[C_AXIS];
732
+    #endif
715
   #else
733
   #else
716
     float delta_mm[4];
734
     float delta_mm[4];
717
     delta_mm[X_AXIS] = dx / axis_steps_per_unit[X_AXIS];
735
     delta_mm[X_AXIS] = dx / axis_steps_per_unit[X_AXIS];
729
         square(delta_mm[X_HEAD]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_AXIS])
747
         square(delta_mm[X_HEAD]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_AXIS])
730
       #elif ENABLED(COREXZ)
748
       #elif ENABLED(COREXZ)
731
         square(delta_mm[X_HEAD]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_HEAD])
749
         square(delta_mm[X_HEAD]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_HEAD])
750
+      #elif ENABLED(COREYZ)
751
+        square(delta_mm[X_AXIS]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_HEAD])
732
       #else
752
       #else
733
         square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS])
753
         square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS])
734
       #endif
754
       #endif

+ 1
- 1
Marlin/planner.h View File

204
        * Used by G92, G28, G29, and other procedures.
204
        * Used by G92, G28, G29, and other procedures.
205
        *
205
        *
206
        * Multiplies by axis_steps_per_unit[] and does necessary conversion
206
        * Multiplies by axis_steps_per_unit[] and does necessary conversion
207
-       * for COREXY / COREXZ to set the corresponding stepper positions.
207
+       * for COREXY / COREXZ / COREYZ to set the corresponding stepper positions.
208
        *
208
        *
209
        * Clears previous speed values.
209
        * Clears previous speed values.
210
        */
210
        */

+ 20
- 13
Marlin/stepper.cpp View File

204
 /**
204
 /**
205
  * Set the stepper direction of each axis
205
  * Set the stepper direction of each axis
206
  *
206
  *
207
- *   X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY
208
- *   X_AXIS=A_AXIS and Z_AXIS=C_AXIS for COREXZ
207
+ *   COREXY: X_AXIS=A_AXIS and Y_AXIS=B_AXIS
208
+ *   COREXZ: X_AXIS=A_AXIS and Z_AXIS=C_AXIS
209
+ *   COREYZ: Y_AXIS=B_AXIS and Z_AXIS=C_AXIS
209
  */
210
  */
210
 void Stepper::set_directions() {
211
 void Stepper::set_directions() {
211
 
212
 
649
     count_position[A_AXIS] = x + z;
650
     count_position[A_AXIS] = x + z;
650
     count_position[Y_AXIS] = y;
651
     count_position[Y_AXIS] = y;
651
     count_position[C_AXIS] = x - z;
652
     count_position[C_AXIS] = x - z;
653
+  #elif ENABLED(COREYZ)
654
+    // coreyz planning
655
+    count_position[X_AXIS] = x;
656
+    count_position[B_AXIS] = y + z;
657
+    count_position[C_AXIS] = y - z;
652
   #else
658
   #else
653
     // default non-h-bot planning
659
     // default non-h-bot planning
654
     count_position[X_AXIS] = x;
660
     count_position[X_AXIS] = x;
682
  */
688
  */
683
 float Stepper::get_axis_position_mm(AxisEnum axis) {
689
 float Stepper::get_axis_position_mm(AxisEnum axis) {
684
   float axis_steps;
690
   float axis_steps;
685
-  #if ENABLED(COREXY) | ENABLED(COREXZ)
686
-    if (axis == X_AXIS || axis == CORE_AXIS_2) {
691
+  #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
692
+    // Requesting one of the "core" axes?
693
+    if (axis == CORE_AXIS_1 || axis == CORE_AXIS_2) {
687
       CRITICAL_SECTION_START;
694
       CRITICAL_SECTION_START;
688
-      long pos1 = count_position[A_AXIS],
695
+      long pos1 = count_position[CORE_AXIS_1],
689
            pos2 = count_position[CORE_AXIS_2];
696
            pos2 = count_position[CORE_AXIS_2];
690
       CRITICAL_SECTION_END;
697
       CRITICAL_SECTION_END;
691
       // ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1
698
       // ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1
692
       // ((a1+a2)-(a1-a2))/2 -> (a1+a2-a1+a2)/2 -> (a2+a2)/2 -> a2
699
       // ((a1+a2)-(a1-a2))/2 -> (a1+a2-a1+a2)/2 -> (a2+a2)/2 -> a2
693
-      axis_steps = (pos1 + ((axis == X_AXIS) ? pos2 : -pos2)) / 2.0f;
700
+      axis_steps = (pos1 + ((axis == CORE_AXIS_1) ? pos2 : -pos2)) / 2.0f;
694
     }
701
     }
695
     else
702
     else
696
       axis_steps = position(axis);
703
       axis_steps = position(axis);
715
 
722
 
716
 void Stepper::endstop_triggered(AxisEnum axis) {
723
 void Stepper::endstop_triggered(AxisEnum axis) {
717
 
724
 
718
-  #if ENABLED(COREXY) || ENABLED(COREXZ)
725
+  #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
719
 
726
 
720
     float axis_pos = count_position[axis];
727
     float axis_pos = count_position[axis];
721
-    if (axis == A_AXIS)
728
+    if (axis == CORE_AXIS_1)
722
       axis_pos = (axis_pos + count_position[CORE_AXIS_2]) / 2;
729
       axis_pos = (axis_pos + count_position[CORE_AXIS_2]) / 2;
723
     else if (axis == CORE_AXIS_2)
730
     else if (axis == CORE_AXIS_2)
724
-      axis_pos = (count_position[A_AXIS] - axis_pos) / 2;
731
+      axis_pos = (count_position[CORE_AXIS_1] - axis_pos) / 2;
725
     endstops_trigsteps[axis] = axis_pos;
732
     endstops_trigsteps[axis] = axis_pos;
726
 
733
 
727
-  #else // !COREXY && !COREXZ
734
+  #else // !COREXY && !COREXZ && !COREYZ
728
 
735
 
729
     endstops_trigsteps[axis] = count_position[axis];
736
     endstops_trigsteps[axis] = count_position[axis];
730
 
737
 
731
-  #endif // !COREXY && !COREXZ
738
+  #endif // !COREXY && !COREXZ && !COREYZ
732
 
739
 
733
   kill_current_block();
740
   kill_current_block();
734
 }
741
 }
747
   #endif
754
   #endif
748
   SERIAL_PROTOCOL(xpos);
755
   SERIAL_PROTOCOL(xpos);
749
 
756
 
750
-  #if ENABLED(COREXY) || ENABLED(COREXZ)
757
+  #if ENABLED(COREXY) || ENABLED(COREYZ)
751
     SERIAL_PROTOCOLPGM(" B:");
758
     SERIAL_PROTOCOLPGM(" B:");
752
   #else
759
   #else
753
     SERIAL_PROTOCOLPGM(" Y:");
760
     SERIAL_PROTOCOLPGM(" Y:");
754
   #endif
761
   #endif
755
   SERIAL_PROTOCOL(ypos);
762
   SERIAL_PROTOCOL(ypos);
756
 
763
 
757
-  #if ENABLED(COREXZ) || ENABLED(COREXZ)
764
+  #if ENABLED(COREXZ) || ENABLED(COREYZ)
758
     SERIAL_PROTOCOLPGM(" C:");
765
     SERIAL_PROTOCOLPGM(" C:");
759
   #else
766
   #else
760
     SERIAL_PROTOCOLPGM(" Z:");
767
     SERIAL_PROTOCOLPGM(" Z:");

+ 11
- 10
Marlin/temperature.h View File

306
     #if ENABLED(BABYSTEPPING)
306
     #if ENABLED(BABYSTEPPING)
307
 
307
 
308
       FORCE_INLINE void babystep_axis(AxisEnum axis, int distance) {
308
       FORCE_INLINE void babystep_axis(AxisEnum axis, int distance) {
309
-        #if ENABLED(COREXY) || ENABLED(COREXZ)
309
+        #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
310
           #if ENABLED(BABYSTEP_XY)
310
           #if ENABLED(BABYSTEP_XY)
311
             switch (axis) {
311
             switch (axis) {
312
-              case X_AXIS: // X on CoreXY and CoreXZ
313
-                babystepsTodo[A_AXIS] += distance * 2;
312
+              case CORE_AXIS_1: // X on CoreXY and CoreXZ, Y on CoreYZ
313
+                babystepsTodo[CORE_AXIS_1] += distance * 2;
314
                 babystepsTodo[CORE_AXIS_2] += distance * 2;
314
                 babystepsTodo[CORE_AXIS_2] += distance * 2;
315
                 break;
315
                 break;
316
-              case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ
317
-                babystepsTodo[A_AXIS] += distance * 2;
316
+              case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ and CoreYZ
317
+                babystepsTodo[CORE_AXIS_1] += distance * 2;
318
                 babystepsTodo[CORE_AXIS_2] -= distance * 2;
318
                 babystepsTodo[CORE_AXIS_2] -= distance * 2;
319
                 break;
319
                 break;
320
-              case CORE_AXIS_3: // Z on CoreXY, Y on CoreXZ
321
-                babystepsTodo[CORE_AXIS_3] += distance;
320
+              case NORMAL_AXIS: // Z on CoreXY, Y on CoreXZ, X on CoreYZ
321
+                babystepsTodo[NORMAL_AXIS] += distance;
322
                 break;
322
                 break;
323
             }
323
             }
324
-          #elif ENABLED(COREXZ)
325
-            babystepsTodo[A_AXIS] += distance * 2;
326
-            babystepsTodo[C_AXIS] -= distance * 2;
324
+          #elif ENABLED(COREXZ) || ENABLED(COREYZ)
325
+            // Only Z stepping needs to be handled here
326
+            babystepsTodo[CORE_AXIS_1] += distance * 2;
327
+            babystepsTodo[CORE_AXIS_2] -= distance * 2;
327
           #else
328
           #else
328
             babystepsTodo[Z_AXIS] += distance;
329
             babystepsTodo[Z_AXIS] += distance;
329
           #endif
330
           #endif

Loading…
Cancel
Save