Browse Source

Implement reversed CORE options

Scott Lahteine 8 years ago
parent
commit
1864b282c5
7 changed files with 110 additions and 88 deletions
  1. 24
    13
      Marlin/Conditionals_post.h
  2. 1
    1
      Marlin/Marlin_main.cpp
  3. 21
    6
      Marlin/SanityCheck.h
  4. 6
    6
      Marlin/endstops.cpp
  5. 32
    35
      Marlin/planner.cpp
  6. 20
    21
      Marlin/stepper.cpp
  7. 6
    6
      Marlin/temperature.h

+ 24
- 13
Marlin/Conditionals_post.h View File

@@ -45,20 +45,31 @@
45 45
   #define Z_CENTER float((Z_MIN_POS + Z_MAX_POS) * 0.5)
46 46
 
47 47
   /**
48
-   * CoreXY and CoreXZ
48
+   * CoreXY, CoreXZ, and CoreYZ - and their reverse
49 49
    */
50
-  #if ENABLED(COREXY)
51
-    #define CORE_AXIS_1 A_AXIS // XY from A + B
52
-    #define CORE_AXIS_2 B_AXIS
53
-    #define NORMAL_AXIS Z_AXIS
54
-  #elif ENABLED(COREXZ)
55
-    #define CORE_AXIS_1 A_AXIS // XZ from A + C
56
-    #define CORE_AXIS_2 C_AXIS
57
-    #define NORMAL_AXIS Y_AXIS
58
-  #elif ENABLED(COREYZ)
59
-    #define CORE_AXIS_1 B_AXIS // YZ from B + C
60
-    #define CORE_AXIS_2 C_AXIS
61
-    #define NORMAL_AXIS X_AXIS
50
+  #define CORE_IS_XY (ENABLED(COREXY) || ENABLED(COREYX))
51
+  #define CORE_IS_XZ (ENABLED(COREXZ) || ENABLED(COREZX))
52
+  #define CORE_IS_YZ (ENABLED(COREYZ) || ENABLED(COREZY))
53
+  #define IS_CORE (CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ)
54
+  #if IS_CORE
55
+    #if CORE_IS_XY
56
+      #define CORE_AXIS_1 A_AXIS
57
+      #define CORE_AXIS_2 B_AXIS
58
+      #define NORMAL_AXIS Z_AXIS
59
+    #elif CORE_IS_XZ
60
+      #define CORE_AXIS_1 A_AXIS
61
+      #define NORMAL_AXIS Y_AXIS
62
+      #define CORE_AXIS_2 C_AXIS
63
+    #elif CORE_IS_YZ
64
+      #define NORMAL_AXIS X_AXIS
65
+      #define CORE_AXIS_1 B_AXIS
66
+      #define CORE_AXIS_2 C_AXIS
67
+    #endif
68
+    #if (ENABLED(COREYX) || ENABLED(COREZX) || ENABLED(COREZY))
69
+      #define CORESIGN(n) (-(n))
70
+    #else
71
+      #define CORESIGN(n) (n)
72
+    #endif
62 73
   #endif
63 74
 
64 75
   #define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA))

+ 1
- 1
Marlin/Marlin_main.cpp View File

@@ -3044,7 +3044,7 @@ inline void gcode_G4() {
3044 3044
       SERIAL_ECHOLNPGM("Delta");
3045 3045
     #elif IS_SCARA
3046 3046
       SERIAL_ECHOLNPGM("SCARA");
3047
-    #elif ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
3047
+    #elif IS_CORE
3048 3048
       SERIAL_ECHOLNPGM("Core");
3049 3049
     #else
3050 3050
       SERIAL_ECHOLNPGM("Cartesian");

+ 21
- 6
Marlin/SanityCheck.h View File

@@ -57,8 +57,8 @@
57 57
   #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS."
58 58
 #elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
59 59
   #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED."
60
-#elif ENABLED(COREXZ) && ENABLED(Z_LATE_ENABLE)
61
-  #error "Z_LATE_ENABLE can't be used with COREXZ."
60
+#elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE)
61
+  #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY."
62 62
 #elif defined(X_HOME_RETRACT_MM)
63 63
   #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM."
64 64
 #elif defined(SDCARDDETECTINVERTED)
@@ -644,8 +644,23 @@
644 644
 #else
645 645
   #define COUNT_KIN_7 COUNT_KIN_6
646 646
 #endif
647
-#if COUNT_KIN_7 > 1
648
-  #error "Please enable only one of DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREXZ, or COREYZ."
647
+#if ENABLED(COREYX)
648
+  #define COUNT_KIN_8 INCREMENT(COUNT_KIN_7)
649
+#else
650
+  #define COUNT_KIN_8 COUNT_KIN_7
651
+#endif
652
+#if ENABLED(COREZX)
653
+  #define COUNT_KIN_9 INCREMENT(COUNT_KIN_8)
654
+#else
655
+  #define COUNT_KIN_9 COUNT_KIN_8
656
+#endif
657
+#if ENABLED(COREZY)
658
+  #define COUNT_KIN_10 INCREMENT(COUNT_KIN_9)
659
+#else
660
+  #define COUNT_KIN_10 COUNT_KIN_9
661
+#endif
662
+#if COUNT_KIN_10 > 1
663
+  #error "Please enable only one of DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY."
649 664
 #endif
650 665
 
651 666
 /**
@@ -662,8 +677,8 @@
662 677
 #if ENABLED(DUAL_X_CARRIAGE)
663 678
   #if EXTRUDERS == 1
664 679
     #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
665
-  #elif ENABLED(COREXY) || ENABLED(COREXZ)
666
-    #error "DUAL_X_CARRIAGE cannot be used with COREXY or COREXZ."
680
+  #elif CORE_IS_XY || CORE_IS_XZ
681
+    #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, or COREZX."
667 682
   #elif !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR
668 683
     #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
669 684
   #elif !HAS_X_MAX

+ 6
- 6
Marlin/endstops.cpp View File

@@ -268,7 +268,7 @@ void Endstops::update() {
268 268
 
269 269
   #endif
270 270
 
271
-  #if ENABLED(COREXY) || ENABLED(COREXZ)
271
+  #if CORE_IS_XY || CORE_IS_XZ
272 272
     // Head direction in -X axis for CoreXY and CoreXZ bots.
273 273
     // If DeltaA == -DeltaB, the movement is only in Y or Z axis
274 274
     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))) {
@@ -298,11 +298,11 @@ void Endstops::update() {
298 298
             #endif
299 299
           }
300 300
       }
301
-  #if ENABLED(COREXY) || ENABLED(COREXZ)
301
+  #if CORE_IS_XY || CORE_IS_XZ
302 302
     }
303 303
   #endif
304 304
 
305
-  #if ENABLED(COREXY) || ENABLED(COREYZ)
305
+  #if CORE_IS_XY || CORE_IS_YZ
306 306
     // Head direction in -Y axis for CoreXY / CoreYZ bots.
307 307
     // If DeltaA == DeltaB, the movement is only in X or Y axis
308 308
     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))) {
@@ -320,11 +320,11 @@ void Endstops::update() {
320 320
           UPDATE_ENDSTOP(Y, MAX);
321 321
         #endif
322 322
       }
323
-  #if ENABLED(COREXY) || ENABLED(COREYZ)
323
+  #if CORE_IS_XY || CORE_IS_YZ
324 324
     }
325 325
   #endif
326 326
 
327
-  #if ENABLED(COREXZ) || ENABLED(COREYZ)
327
+  #if CORE_IS_XZ || CORE_IS_YZ
328 328
     // Head direction in -Z axis for CoreXZ or CoreYZ bots.
329 329
     // If DeltaA == DeltaB, the movement is only in X or Y axis
330 330
     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))) {
@@ -390,7 +390,7 @@ void Endstops::update() {
390 390
           #endif // !Z_MIN_PROBE_PIN...
391 391
         #endif // Z_MAX_PIN
392 392
       }
393
-  #if ENABLED(COREXZ)
393
+  #if CORE_IS_XZ || CORE_IS_YZ
394 394
     }
395 395
   #endif
396 396
 

+ 32
- 35
Marlin/planner.cpp View File

@@ -674,24 +674,24 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
674 674
 
675 675
   // Compute direction bit-mask for this block
676 676
   uint8_t dm = 0;
677
-  #if ENABLED(COREXY)
678
-    if (da < 0) SBI(dm, X_HEAD); // Save the real Extruder (head) direction in X Axis
679
-    if (db < 0) SBI(dm, Y_HEAD); // ...and Y
677
+  #if CORE_IS_XY
678
+    if (da < 0) SBI(dm, X_HEAD);                // Save the real Extruder (head) direction in X Axis
679
+    if (db < 0) SBI(dm, Y_HEAD);                // ...and Y
680 680
     if (dc < 0) SBI(dm, Z_AXIS);
681
-    if (da + db < 0) SBI(dm, A_AXIS); // Motor A direction
682
-    if (da - db < 0) SBI(dm, B_AXIS); // Motor B direction
683
-  #elif ENABLED(COREXZ)
684
-    if (da < 0) SBI(dm, X_HEAD); // Save the real Extruder (head) direction in X Axis
681
+    if (da + db < 0) SBI(dm, A_AXIS);           // Motor A direction
682
+    if (CORESIGN(da - db) < 0) SBI(dm, B_AXIS); // Motor B direction
683
+  #elif CORE_IS_XZ
684
+    if (da < 0) SBI(dm, X_HEAD);                // Save the real Extruder (head) direction in X Axis
685 685
     if (db < 0) SBI(dm, Y_AXIS);
686
-    if (dc < 0) SBI(dm, Z_HEAD); // ...and Z
687
-    if (da + dc < 0) SBI(dm, A_AXIS); // Motor A direction
688
-    if (da - dc < 0) SBI(dm, C_AXIS); // Motor C direction
689
-  #elif ENABLED(COREYZ)
686
+    if (dc < 0) SBI(dm, Z_HEAD);                // ...and Z
687
+    if (da + dc < 0) SBI(dm, A_AXIS);           // Motor A direction
688
+    if (CORESIGN(da - dc) < 0) SBI(dm, C_AXIS); // Motor C direction
689
+  #elif CORE_IS_YZ
690 690
     if (da < 0) SBI(dm, X_AXIS);
691
-    if (db < 0) SBI(dm, Y_HEAD); // Save the real Extruder (head) direction in Y Axis
692
-    if (dc < 0) SBI(dm, Z_HEAD); // ...and Z
693
-    if (db + dc < 0) SBI(dm, B_AXIS); // Motor B direction
694
-    if (db - dc < 0) SBI(dm, C_AXIS); // Motor C direction
691
+    if (db < 0) SBI(dm, Y_HEAD);                // Save the real Extruder (head) direction in Y Axis
692
+    if (dc < 0) SBI(dm, Z_HEAD);                // ...and Z
693
+    if (db + dc < 0) SBI(dm, B_AXIS);           // Motor B direction
694
+    if (CORESIGN(db - dc) < 0) SBI(dm, C_AXIS); // Motor C direction
695 695
   #else
696 696
     if (da < 0) SBI(dm, X_AXIS);
697 697
     if (db < 0) SBI(dm, Y_AXIS);
@@ -718,19 +718,16 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
718 718
   block->direction_bits = dm;
719 719
 
720 720
   // Number of steps for each axis
721
-  #if ENABLED(COREXY)
722
-    // corexy planning
723
-    // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html
721
+  // See http://www.corexy.com/theory.html
722
+  #if CORE_IS_XY
724 723
     block->steps[A_AXIS] = labs(da + db);
725 724
     block->steps[B_AXIS] = labs(da - db);
726 725
     block->steps[Z_AXIS] = labs(dc);
727
-  #elif ENABLED(COREXZ)
728
-    // corexz planning
726
+  #elif CORE_IS_XZ
729 727
     block->steps[A_AXIS] = labs(da + dc);
730 728
     block->steps[Y_AXIS] = labs(db);
731 729
     block->steps[C_AXIS] = labs(da - dc);
732
-  #elif ENABLED(COREYZ)
733
-    // coreyz planning
730
+  #elif CORE_IS_YZ
734 731
     block->steps[X_AXIS] = labs(da);
735 732
     block->steps[B_AXIS] = labs(db + dc);
736 733
     block->steps[C_AXIS] = labs(db - dc);
@@ -765,7 +762,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
765 762
   block->active_extruder = extruder;
766 763
 
767 764
   //enable active axes
768
-  #if ENABLED(COREXY)
765
+  #if CORE_IS_XY
769 766
     if (block->steps[A_AXIS] || block->steps[B_AXIS]) {
770 767
       enable_x();
771 768
       enable_y();
@@ -773,13 +770,13 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
773 770
     #if DISABLED(Z_LATE_ENABLE)
774 771
       if (block->steps[Z_AXIS]) enable_z();
775 772
     #endif
776
-  #elif ENABLED(COREXZ)
773
+  #elif CORE_IS_XZ
777 774
     if (block->steps[A_AXIS] || block->steps[C_AXIS]) {
778 775
       enable_x();
779 776
       enable_z();
780 777
     }
781 778
     if (block->steps[Y_AXIS]) enable_y();
782
-  #elif ENABLED(COREYZ)
779
+  #elif CORE_IS_YZ
783 780
     if (block->steps[B_AXIS] || block->steps[C_AXIS]) {
784 781
       enable_y();
785 782
       enable_z();
@@ -876,26 +873,26 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
876 873
    * So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head.
877 874
    * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
878 875
    */
879
-  #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
876
+  #if IS_CORE
880 877
     float delta_mm[7];
881
-    #if ENABLED(COREXY)
878
+    #if CORE_IS_XY
882 879
       delta_mm[X_HEAD] = da * steps_to_mm[A_AXIS];
883 880
       delta_mm[Y_HEAD] = db * steps_to_mm[B_AXIS];
884 881
       delta_mm[Z_AXIS] = dc * steps_to_mm[Z_AXIS];
885 882
       delta_mm[A_AXIS] = (da + db) * steps_to_mm[A_AXIS];
886
-      delta_mm[B_AXIS] = (da - db) * steps_to_mm[B_AXIS];
887
-    #elif ENABLED(COREXZ)
883
+      delta_mm[B_AXIS] = CORESIGN(da - db) * steps_to_mm[B_AXIS];
884
+    #elif CORE_IS_XZ
888 885
       delta_mm[X_HEAD] = da * steps_to_mm[A_AXIS];
889 886
       delta_mm[Y_AXIS] = db * steps_to_mm[Y_AXIS];
890 887
       delta_mm[Z_HEAD] = dc * steps_to_mm[C_AXIS];
891 888
       delta_mm[A_AXIS] = (da + dc) * steps_to_mm[A_AXIS];
892
-      delta_mm[C_AXIS] = (da - dc) * steps_to_mm[C_AXIS];
893
-    #elif ENABLED(COREYZ)
889
+      delta_mm[C_AXIS] = CORESIGN(da - dc) * steps_to_mm[C_AXIS];
890
+    #elif CORE_IS_YZ
894 891
       delta_mm[X_AXIS] = da * steps_to_mm[X_AXIS];
895 892
       delta_mm[Y_HEAD] = db * steps_to_mm[B_AXIS];
896 893
       delta_mm[Z_HEAD] = dc * steps_to_mm[C_AXIS];
897 894
       delta_mm[B_AXIS] = (db + dc) * steps_to_mm[B_AXIS];
898
-      delta_mm[C_AXIS] = (db - dc) * steps_to_mm[C_AXIS];
895
+      delta_mm[C_AXIS] = CORESIGN(db - dc) * steps_to_mm[C_AXIS];
899 896
     #endif
900 897
   #else
901 898
     float delta_mm[4];
@@ -910,11 +907,11 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
910 907
   }
911 908
   else {
912 909
     block->millimeters = sqrt(
913
-      #if ENABLED(COREXY)
910
+      #if CORE_IS_XY
914 911
         sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_AXIS])
915
-      #elif ENABLED(COREXZ)
912
+      #elif CORE_IS_XZ
916 913
         sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_HEAD])
917
-      #elif ENABLED(COREYZ)
914
+      #elif CORE_IS_YZ
918 915
         sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_HEAD])
919 916
       #else
920 917
         sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_AXIS])

+ 20
- 21
Marlin/stepper.cpp View File

@@ -968,22 +968,22 @@ void Stepper::set_position(const long &a, const long &b, const long &c, const lo
968 968
 
969 969
   CRITICAL_SECTION_START;
970 970
 
971
-  #if ENABLED(COREXY)
971
+  #if CORE_IS_XY
972 972
     // corexy positioning
973 973
     // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html
974 974
     count_position[A_AXIS] = a + b;
975
-    count_position[B_AXIS] = a - b;
975
+    count_position[B_AXIS] = CORESIGN(a - b);
976 976
     count_position[Z_AXIS] = c;
977
-  #elif ENABLED(COREXZ)
977
+  #elif CORE_IS_XZ
978 978
     // corexz planning
979 979
     count_position[A_AXIS] = a + c;
980 980
     count_position[Y_AXIS] = b;
981
-    count_position[C_AXIS] = a - c;
982
-  #elif ENABLED(COREYZ)
981
+    count_position[C_AXIS] = CORESIGN(a - c);
982
+  #elif CORE_IS_YZ
983 983
     // coreyz planning
984 984
     count_position[X_AXIS] = a;
985 985
     count_position[B_AXIS] = b + c;
986
-    count_position[C_AXIS] = b - c;
986
+    count_position[C_AXIS] = CORESIGN(b - c);
987 987
   #else
988 988
     // default non-h-bot planning
989 989
     count_position[X_AXIS] = a;
@@ -1023,16 +1023,17 @@ long Stepper::position(AxisEnum axis) {
1023 1023
  */
1024 1024
 float Stepper::get_axis_position_mm(AxisEnum axis) {
1025 1025
   float axis_steps;
1026
-  #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
1026
+  #if IS_CORE
1027 1027
     // Requesting one of the "core" axes?
1028 1028
     if (axis == CORE_AXIS_1 || axis == CORE_AXIS_2) {
1029 1029
       CRITICAL_SECTION_START;
1030
-      long pos1 = count_position[CORE_AXIS_1],
1031
-           pos2 = count_position[CORE_AXIS_2];
1032
-      CRITICAL_SECTION_END;
1033 1030
       // ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1
1034 1031
       // ((a1+a2)-(a1-a2))/2 -> (a1+a2-a1+a2)/2 -> (a2+a2)/2 -> a2
1035
-      axis_steps = (pos1 + ((axis == CORE_AXIS_1) ? pos2 : -pos2)) * 0.5f;
1032
+      axis_steps = 0.5f * (
1033
+        axis == CORE_AXIS_2 ? CORESIGN(count_position[CORE_AXIS_1] - count_position[CORE_AXIS_2])
1034
+                            : count_position[CORE_AXIS_1] + count_position[CORE_AXIS_2]
1035
+      );
1036
+      CRITICAL_SECTION_END;
1036 1037
     }
1037 1038
     else
1038 1039
       axis_steps = position(axis);
@@ -1057,14 +1058,12 @@ void Stepper::quick_stop() {
1057 1058
 
1058 1059
 void Stepper::endstop_triggered(AxisEnum axis) {
1059 1060
 
1060
-  #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
1061
+  #if IS_CORE
1061 1062
 
1062
-    float axis_pos = count_position[axis];
1063
-    if (axis == CORE_AXIS_1)
1064
-      axis_pos = (axis_pos + count_position[CORE_AXIS_2]) * 0.5;
1065
-    else if (axis == CORE_AXIS_2)
1066
-      axis_pos = (count_position[CORE_AXIS_1] - axis_pos) * 0.5;
1067
-    endstops_trigsteps[axis] = axis_pos;
1063
+    endstops_trigsteps[axis] = 0.5f * (
1064
+      axis == CORE_AXIS_2 ? CORESIGN(count_position[CORE_AXIS_1] - count_position[CORE_AXIS_2])
1065
+                          : count_position[CORE_AXIS_1] + count_position[CORE_AXIS_2]
1066
+    );
1068 1067
 
1069 1068
   #else // !COREXY && !COREXZ && !COREYZ
1070 1069
 
@@ -1082,21 +1081,21 @@ void Stepper::report_positions() {
1082 1081
        zpos = count_position[Z_AXIS];
1083 1082
   CRITICAL_SECTION_END;
1084 1083
 
1085
-  #if ENABLED(COREXY) || ENABLED(COREXZ) || IS_SCARA
1084
+  #if CORE_IS_XY || CORE_IS_XZ || IS_SCARA
1086 1085
     SERIAL_PROTOCOLPGM(MSG_COUNT_A);
1087 1086
   #else
1088 1087
     SERIAL_PROTOCOLPGM(MSG_COUNT_X);
1089 1088
   #endif
1090 1089
   SERIAL_PROTOCOL(xpos);
1091 1090
 
1092
-  #if ENABLED(COREXY) || ENABLED(COREYZ) || IS_SCARA
1091
+  #if CORE_IS_XY || CORE_IS_YZ || IS_SCARA
1093 1092
     SERIAL_PROTOCOLPGM(" B:");
1094 1093
   #else
1095 1094
     SERIAL_PROTOCOLPGM(" Y:");
1096 1095
   #endif
1097 1096
   SERIAL_PROTOCOL(ypos);
1098 1097
 
1099
-  #if ENABLED(COREXZ) || ENABLED(COREYZ)
1098
+  #if CORE_IS_XZ || CORE_IS_YZ
1100 1099
     SERIAL_PROTOCOLPGM(" C:");
1101 1100
   #else
1102 1101
     SERIAL_PROTOCOLPGM(" Z:");

+ 6
- 6
Marlin/temperature.h View File

@@ -385,7 +385,7 @@ class Temperature {
385 385
     #if ENABLED(BABYSTEPPING)
386 386
 
387 387
       static void babystep_axis(const AxisEnum axis, const int distance) {
388
-        #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
388
+        #if IS_CORE
389 389
           #if ENABLED(BABYSTEP_XY)
390 390
             switch (axis) {
391 391
               case CORE_AXIS_1: // X on CoreXY and CoreXZ, Y on CoreYZ
@@ -393,17 +393,17 @@ class Temperature {
393 393
                 babystepsTodo[CORE_AXIS_2] += distance * 2;
394 394
                 break;
395 395
               case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ and CoreYZ
396
-                babystepsTodo[CORE_AXIS_1] += distance * 2;
397
-                babystepsTodo[CORE_AXIS_2] -= distance * 2;
396
+                babystepsTodo[CORE_AXIS_1] += CORESIGN(distance * 2);
397
+                babystepsTodo[CORE_AXIS_2] -= CORESIGN(distance * 2);
398 398
                 break;
399 399
               case NORMAL_AXIS: // Z on CoreXY, Y on CoreXZ, X on CoreYZ
400 400
                 babystepsTodo[NORMAL_AXIS] += distance;
401 401
                 break;
402 402
             }
403
-          #elif ENABLED(COREXZ) || ENABLED(COREYZ)
403
+          #elif CORE_IS_XZ || CORE_IS_YZ
404 404
             // Only Z stepping needs to be handled here
405
-            babystepsTodo[CORE_AXIS_1] += distance * 2;
406
-            babystepsTodo[CORE_AXIS_2] -= distance * 2;
405
+            babystepsTodo[CORE_AXIS_1] += CORESIGN(distance * 2);
406
+            babystepsTodo[CORE_AXIS_2] -= CORESIGN(distance * 2);
407 407
           #else
408 408
             babystepsTodo[Z_AXIS] += distance;
409 409
           #endif

Loading…
Cancel
Save