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,11 +315,17 @@
315 315
    * CoreXY and CoreXZ
316 316
    */
317 317
   #if ENABLED(COREXY)
318
+    #define CORE_AXIS_1 A_AXIS // XY from A + B
318 319
     #define CORE_AXIS_2 B_AXIS
319
-    #define CORE_AXIS_3 Z_AXIS
320
+    #define NORMAL_AXIS Z_AXIS
320 321
   #elif ENABLED(COREXZ)
322
+    #define CORE_AXIS_1 A_AXIS // XZ from A + C
321 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 329
   #endif
324 330
 
325 331
   /**

+ 2
- 3
Marlin/Configuration.h View File

@@ -345,11 +345,10 @@
345 345
 
346 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 349
 //#define COREXY
350
-
351
-// Uncomment this option to enable CoreXZ kinematics
352 350
 //#define COREXZ
351
+//#define COREYZ
353 352
 
354 353
 // Enable this option for Toshiba steppers
355 354
 //#define CONFIG_STEPPERS_TOSHIBA

+ 10
- 0
Marlin/SanityCheck.h View File

@@ -390,6 +390,16 @@
390 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 403
  * Allen Key Z probe requires Auto Bed Leveling grid and Delta
394 404
  */
395 405
 #if ENABLED(Z_PROBE_ALLEN_KEY) && !(ENABLED(AUTO_BED_LEVELING_GRID) && ENABLED(DELTA))

+ 11
- 11
Marlin/endstops.cpp View File

@@ -239,8 +239,8 @@ void Endstops::update() {
239 239
 
240 240
   #if ENABLED(COREXY) || ENABLED(COREXZ)
241 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 244
       if (stepper.motor_direction(X_HEAD))
245 245
   #else
246 246
     if (stepper.motor_direction(X_AXIS))   // stepping along -X axis (regular Cartesian bot)
@@ -271,10 +271,10 @@ void Endstops::update() {
271 271
     }
272 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 278
       if (stepper.motor_direction(Y_HEAD))
279 279
   #else
280 280
       if (stepper.motor_direction(Y_AXIS))   // -direction
@@ -289,14 +289,14 @@ void Endstops::update() {
289 289
           UPDATE_ENDSTOP(Y, MAX);
290 290
         #endif
291 291
       }
292
-  #if ENABLED(COREXY)
292
+  #if ENABLED(COREXY) || ENABLED(COREYZ)
293 293
     }
294 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 300
       if (stepper.motor_direction(Z_HEAD))
301 301
   #else
302 302
       if (stepper.motor_direction(Z_AXIS))

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

@@ -327,11 +327,10 @@
327 327
 
328 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 331
 //#define COREXY
332
-
333
-// Uncomment this option to enable CoreXZ kinematics
334 332
 //#define COREXZ
333
+//#define COREYZ
335 334
 
336 335
 // Enable this option for Toshiba steppers
337 336
 //#define CONFIG_STEPPERS_TOSHIBA

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

@@ -325,11 +325,10 @@
325 325
 
326 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 329
 //#define COREXY
330
-
331
-// Uncomment this option to enable CoreXZ kinematics
332 330
 //#define COREXZ
331
+//#define COREYZ
333 332
 
334 333
 // Enable this option for Toshiba steppers
335 334
 //#define CONFIG_STEPPERS_TOSHIBA

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

@@ -337,11 +337,10 @@
337 337
 
338 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 341
 //#define COREXY
342
-
343
-// Uncomment this option to enable CoreXZ kinematics
344 342
 //#define COREXZ
343
+//#define COREYZ
345 344
 
346 345
 // Enable this option for Toshiba steppers
347 346
 //#define CONFIG_STEPPERS_TOSHIBA

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

@@ -339,11 +339,10 @@
339 339
 
340 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 343
 //#define COREXY
344
-
345
-// Uncomment this option to enable CoreXZ kinematics
346 344
 //#define COREXZ
345
+//#define COREYZ
347 346
 
348 347
 // Enable this option for Toshiba steppers
349 348
 //#define CONFIG_STEPPERS_TOSHIBA

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

@@ -362,11 +362,10 @@
362 362
 
363 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 366
 //#define COREXY
367
-
368
-// Uncomment this option to enable CoreXZ kinematics
369 367
 //#define COREXZ
368
+//#define COREYZ
370 369
 
371 370
 // Enable this option for Toshiba steppers
372 371
 //#define CONFIG_STEPPERS_TOSHIBA

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

@@ -345,11 +345,10 @@
345 345
 
346 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 349
 //#define COREXY
350
-
351
-// Uncomment this option to enable CoreXZ kinematics
352 350
 //#define COREXZ
351
+//#define COREYZ
353 352
 
354 353
 // Enable this option for Toshiba steppers
355 354
 //#define CONFIG_STEPPERS_TOSHIBA

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

@@ -339,11 +339,10 @@
339 339
 
340 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 343
 //#define COREXY
344
-
345
-// Uncomment this option to enable CoreXZ kinematics
346 344
 //#define COREXZ
345
+//#define COREYZ
347 346
 
348 347
 // Enable this option for Toshiba steppers
349 348
 //#define CONFIG_STEPPERS_TOSHIBA

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

@@ -353,11 +353,10 @@
353 353
 
354 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 357
 //#define COREXY
358
-
359
-// Uncomment this option to enable CoreXZ kinematics
360 358
 //#define COREXZ
359
+//#define COREYZ
361 360
 
362 361
 // Enable this option for Toshiba steppers
363 362
 //#define CONFIG_STEPPERS_TOSHIBA

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

@@ -366,11 +366,10 @@
366 366
 
367 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 370
 //#define COREXY
371
-
372
-// Uncomment this option to enable CoreXZ kinematics
373 371
 //#define COREXZ
372
+//#define COREYZ
374 373
 
375 374
 // Enable this option for Toshiba steppers
376 375
 //#define CONFIG_STEPPERS_TOSHIBA

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

@@ -337,11 +337,10 @@
337 337
 
338 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 341
 //#define COREXY
342
-
343
-// Uncomment this option to enable CoreXZ kinematics
344 342
 //#define COREXZ
343
+//#define COREYZ
345 344
 
346 345
 // Enable this option for Toshiba steppers
347 346
 //#define CONFIG_STEPPERS_TOSHIBA

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

@@ -345,11 +345,10 @@
345 345
 
346 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 349
 //#define COREXY
350
-
351
-// Uncomment this option to enable CoreXZ kinematics
352 350
 //#define COREXZ
351
+//#define COREYZ
353 352
 
354 353
 // Enable this option for Toshiba steppers
355 354
 //#define CONFIG_STEPPERS_TOSHIBA

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

@@ -345,11 +345,10 @@
345 345
 
346 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 349
 //#define COREXY
350
-
351
-// Uncomment this option to enable CoreXZ kinematics
352 350
 //#define COREXZ
351
+//#define COREYZ
353 352
 
354 353
 //===========================================================================
355 354
 //============================== Delta Settings =============================

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

@@ -345,11 +345,10 @@
345 345
 
346 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 349
 //#define COREXY
350
-
351
-// Uncomment this option to enable CoreXZ kinematics
352 350
 //#define COREXZ
351
+//#define COREYZ
353 352
 
354 353
 //===========================================================================
355 354
 //============================== Delta Settings =============================

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

@@ -345,11 +345,10 @@
345 345
 
346 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 349
 //#define COREXY
350
-
351
-// Uncomment this option to enable CoreXZ kinematics
352 350
 //#define COREXZ
351
+//#define COREYZ
353 352
 
354 353
 //===========================================================================
355 354
 //============================== Delta Settings =============================

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

@@ -334,11 +334,10 @@
334 334
 
335 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 338
 //#define COREXY
339
-
340
-// Uncomment this option to enable CoreXZ kinematics
341 339
 //#define COREXZ
340
+//#define COREYZ
342 341
 
343 342
 //===========================================================================
344 343
 //============================== Delta Settings =============================

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

@@ -343,11 +343,10 @@
343 343
 
344 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 347
 //#define COREXY
348
-
349
-// Uncomment this option to enable CoreXZ kinematics
350 348
 //#define COREXZ
349
+//#define COREYZ
351 350
 
352 351
 //===========================================================================
353 352
 //============================== Delta Settings =============================

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

@@ -348,11 +348,10 @@
348 348
 
349 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 352
 //#define COREXY
353
-
354
-// Uncomment this option to enable CoreXZ kinematics
355 353
 //#define COREXZ
354
+//#define COREYZ
356 355
 
357 356
 // Enable this option for Toshiba steppers
358 357
 //#define CONFIG_STEPPERS_TOSHIBA

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

@@ -335,11 +335,10 @@
335 335
 
336 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 339
 //#define COREXY
340
-
341
-// Uncomment this option to enable CoreXZ kinematics
342 340
 //#define COREXZ
341
+//#define COREYZ
343 342
 
344 343
 // Enable this option for Toshiba steppers
345 344
 #define CONFIG_STEPPERS_TOSHIBA

+ 34
- 14
Marlin/planner.cpp View File

@@ -543,6 +543,11 @@ void Planner::check_axes_activity() {
543 543
     block->steps[A_AXIS] = labs(dx + dz);
544 544
     block->steps[Y_AXIS] = labs(dy);
545 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 551
   #else
547 552
     // default non-h-bot planning
548 553
     block->steps[X_AXIS] = labs(dx);
@@ -581,7 +586,13 @@ void Planner::check_axes_activity() {
581 586
     if (dy < 0) SBI(db, Y_AXIS);
582 587
     if (dz < 0) SBI(db, Z_HEAD); // ...and Z
583 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 596
   #else
586 597
     if (dx < 0) SBI(db, X_AXIS);
587 598
     if (dy < 0) SBI(db, Y_AXIS);
@@ -698,20 +709,27 @@ void Planner::check_axes_activity() {
698 709
    * So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head.
699 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 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 733
   #else
716 734
     float delta_mm[4];
717 735
     delta_mm[X_AXIS] = dx / axis_steps_per_unit[X_AXIS];
@@ -729,6 +747,8 @@ void Planner::check_axes_activity() {
729 747
         square(delta_mm[X_HEAD]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_AXIS])
730 748
       #elif ENABLED(COREXZ)
731 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 752
       #else
733 753
         square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS])
734 754
       #endif

+ 1
- 1
Marlin/planner.h View File

@@ -204,7 +204,7 @@ class Planner {
204 204
        * Used by G92, G28, G29, and other procedures.
205 205
        *
206 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 209
        * Clears previous speed values.
210 210
        */

+ 20
- 13
Marlin/stepper.cpp View File

@@ -204,8 +204,9 @@ void Stepper::wake_up() {
204 204
 /**
205 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 211
 void Stepper::set_directions() {
211 212
 
@@ -649,6 +650,11 @@ void Stepper::set_position(const long& x, const long& y, const long& z, const lo
649 650
     count_position[A_AXIS] = x + z;
650 651
     count_position[Y_AXIS] = y;
651 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 658
   #else
653 659
     // default non-h-bot planning
654 660
     count_position[X_AXIS] = x;
@@ -682,15 +688,16 @@ long Stepper::position(AxisEnum axis) {
682 688
  */
683 689
 float Stepper::get_axis_position_mm(AxisEnum axis) {
684 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 694
       CRITICAL_SECTION_START;
688
-      long pos1 = count_position[A_AXIS],
695
+      long pos1 = count_position[CORE_AXIS_1],
689 696
            pos2 = count_position[CORE_AXIS_2];
690 697
       CRITICAL_SECTION_END;
691 698
       // ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1
692 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 702
     else
696 703
       axis_steps = position(axis);
@@ -715,20 +722,20 @@ void Stepper::quick_stop() {
715 722
 
716 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 727
     float axis_pos = count_position[axis];
721
-    if (axis == A_AXIS)
728
+    if (axis == CORE_AXIS_1)
722 729
       axis_pos = (axis_pos + count_position[CORE_AXIS_2]) / 2;
723 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 732
     endstops_trigsteps[axis] = axis_pos;
726 733
 
727
-  #else // !COREXY && !COREXZ
734
+  #else // !COREXY && !COREXZ && !COREYZ
728 735
 
729 736
     endstops_trigsteps[axis] = count_position[axis];
730 737
 
731
-  #endif // !COREXY && !COREXZ
738
+  #endif // !COREXY && !COREXZ && !COREYZ
732 739
 
733 740
   kill_current_block();
734 741
 }
@@ -747,14 +754,14 @@ void Stepper::report_positions() {
747 754
   #endif
748 755
   SERIAL_PROTOCOL(xpos);
749 756
 
750
-  #if ENABLED(COREXY) || ENABLED(COREXZ)
757
+  #if ENABLED(COREXY) || ENABLED(COREYZ)
751 758
     SERIAL_PROTOCOLPGM(" B:");
752 759
   #else
753 760
     SERIAL_PROTOCOLPGM(" Y:");
754 761
   #endif
755 762
   SERIAL_PROTOCOL(ypos);
756 763
 
757
-  #if ENABLED(COREXZ) || ENABLED(COREXZ)
764
+  #if ENABLED(COREXZ) || ENABLED(COREYZ)
758 765
     SERIAL_PROTOCOLPGM(" C:");
759 766
   #else
760 767
     SERIAL_PROTOCOLPGM(" Z:");

+ 11
- 10
Marlin/temperature.h View File

@@ -306,24 +306,25 @@ class Temperature {
306 306
     #if ENABLED(BABYSTEPPING)
307 307
 
308 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 310
           #if ENABLED(BABYSTEP_XY)
311 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 314
                 babystepsTodo[CORE_AXIS_2] += distance * 2;
315 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 318
                 babystepsTodo[CORE_AXIS_2] -= distance * 2;
319 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 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 328
           #else
328 329
             babystepsTodo[Z_AXIS] += distance;
329 330
           #endif

Loading…
Cancel
Save