Browse Source

✨ MarkForged YX kinematics (#23163)

John Robertson 2 years ago
parent
commit
e5154ec281
No account linked to committer's email address

+ 1
- 0
Marlin/Configuration.h View File

@@ -756,6 +756,7 @@
756 756
 //#define COREZX
757 757
 //#define COREZY
758 758
 //#define MARKFORGED_XY  // MarkForged. See https://reprap.org/forum/read.php?152,504042
759
+//#define MARKFORGED_YX
759 760
 
760 761
 // Enable for a belt style printer with endless "Z" motion
761 762
 //#define BELTPRINTER

+ 1
- 1
Marlin/src/core/types.h View File

@@ -82,7 +82,7 @@ enum AxisEnum : uint8_t {
82 82
   #undef _EN_ITEM
83 83
 
84 84
   // Core also keeps toolhead directions
85
-  #if EITHER(IS_CORE, MARKFORGED_XY)
85
+  #if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX)
86 86
     , X_HEAD, Y_HEAD, Z_HEAD
87 87
   #endif
88 88
 

+ 2
- 1
Marlin/src/core/utility.cpp View File

@@ -60,7 +60,8 @@ void safe_delay(millis_t ms) {
60 60
       TERN_(DELTA,         "Delta")
61 61
       TERN_(IS_SCARA,      "SCARA")
62 62
       TERN_(IS_CORE,       "Core")
63
-      TERN_(MARKFORGED_XY, "MarkForged")
63
+      TERN_(MARKFORGED_XY, "MarkForgedXY")
64
+      TERN_(MARKFORGED_YX, "MarkForgedYX")
64 65
       TERN_(IS_CARTESIAN,  "Cartesian")
65 66
     );
66 67
 

+ 1
- 1
Marlin/src/feature/backlash.cpp View File

@@ -64,7 +64,7 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const
64 64
   static axis_bits_t last_direction_bits;
65 65
   axis_bits_t changed_dir = last_direction_bits ^ dm;
66 66
   // Ignore direction change unless steps are taken in that direction
67
-  #if DISABLED(CORE_BACKLASH) || ENABLED(MARKFORGED_XY)
67
+  #if DISABLED(CORE_BACKLASH) || EITHER(MARKFORGED_XY, MARKFORGED_YX)
68 68
     if (!da) CBI(changed_dir, X_AXIS);
69 69
     if (!db) CBI(changed_dir, Y_AXIS);
70 70
     if (!dc) CBI(changed_dir, Z_AXIS);

+ 2
- 1
Marlin/src/gcode/host/M360.cpp View File

@@ -162,7 +162,8 @@ void GcodeSuite::M360() {
162 162
     TERN_(DELTA,         "Delta")
163 163
     TERN_(IS_SCARA,      "SCARA")
164 164
     TERN_(IS_CORE,       "Core")
165
-    TERN_(MARKFORGED_XY, "MarkForged")
165
+    TERN_(MARKFORGED_XY, "MarkForgedXY")
166
+    TERN_(MARKFORGED_YX, "MarkForgedYX")
166 167
     TERN_(IS_CARTESIAN,  "Cartesian")
167 168
   );
168 169
 

+ 1
- 1
Marlin/src/inc/Conditionals_LCD.h View File

@@ -1079,7 +1079,7 @@
1079 1079
     #define CORE_AXIS_2 C_AXIS
1080 1080
   #endif
1081 1081
   #define CORESIGN(n) (ANY(COREYX, COREZX, COREZY) ? (-(n)) : (n))
1082
-#elif ENABLED(MARKFORGED_XY)
1082
+#elif EITHER(MARKFORGED_XY, MARKFORGED_YX)
1083 1083
   // Markforged kinematics
1084 1084
   #define CORE_AXIS_1 A_AXIS
1085 1085
   #define CORE_AXIS_2 B_AXIS

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

@@ -193,7 +193,7 @@
193 193
 
194 194
 // Calibration codes only for non-core axes
195 195
 #if EITHER(BACKLASH_GCODE, CALIBRATION_GCODE)
196
-  #if EITHER(IS_CORE, MARKFORGED_XY)
196
+  #if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX)
197 197
     #define CAN_CALIBRATE(A,B) (_AXIS(A) == B)
198 198
   #else
199 199
     #define CAN_CALIBRATE(A,B) true

+ 8
- 8
Marlin/src/inc/SanityCheck.h View File

@@ -914,7 +914,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
914 914
 #if ENABLED(BABYSTEPPING)
915 915
   #if ENABLED(SCARA)
916 916
     #error "BABYSTEPPING is not implemented for SCARA yet."
917
-  #elif BOTH(MARKFORGED_XY, BABYSTEP_XY)
917
+  #elif ENABLED(BABYSTEP_XY) && EITHER(MARKFORGED_XY, MARKFORGED_YX)
918 918
     #error "BABYSTEPPING only implemented for Z axis on MarkForged."
919 919
   #elif BOTH(DELTA, BABYSTEP_XY)
920 920
     #error "BABYSTEPPING only implemented for Z axis on deltabots."
@@ -1459,8 +1459,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1459 1459
 /**
1460 1460
  * Allow only one kinematic type to be defined
1461 1461
  */
1462
-#if MANY(DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, FOAMCUTTER_XYUV)
1463
-  #error "Please enable only one of DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, or FOAMCUTTER_XYUV."
1462
+#if MANY(DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, FOAMCUTTER_XYUV)
1463
+  #error "Please enable only one of DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, or FOAMCUTTER_XYUV."
1464 1464
 #endif
1465 1465
 
1466 1466
 /**
@@ -1958,8 +1958,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1958 1958
 #if ENABLED(DUAL_X_CARRIAGE)
1959 1959
   #if EXTRUDERS < 2
1960 1960
     #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
1961
-  #elif ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY)
1962
-    #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, COREZX, or MARKFORGED_XY."
1961
+  #elif ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX)
1962
+    #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, COREZX, MARKFORGED_YX, or MARKFORGED_XY."
1963 1963
   #elif !GOOD_AXIS_PINS(X2)
1964 1964
     #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
1965 1965
   #elif !HAS_X_MAX
@@ -3201,8 +3201,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
3201 3201
   #error "CoreXZ requires both X and Z to use sensorless homing if either one does."
3202 3202
 #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
3203 3203
   #error "CoreYZ requires both Y and Z to use sensorless homing if either one does."
3204
-#elif ENABLED(MARKFORGED_XY) && X_SENSORLESS != Y_SENSORLESS
3205
-  #error "MARKFORGED_XY requires both X and Y to use sensorless homing if either one does."
3204
+#elif EITHER(MARKFORGED_XY, MARKFORGED_YX) && X_SENSORLESS != Y_SENSORLESS
3205
+  #error "MARKFORGED requires both X and Y to use sensorless homing if either one does."
3206 3206
 #endif
3207 3207
 
3208 3208
 // Other TMC feature requirements
@@ -3462,7 +3462,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
3462 3462
     #error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM."
3463 3463
   #elif !defined(BACKLASH_CORRECTION)
3464 3464
     #error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION."
3465
-  #elif ENABLED(MARKFORGED_XY)
3465
+  #elif EITHER(MARKFORGED_XY, MARKFORGED_YX)
3466 3466
     constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
3467 3467
     static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
3468 3468
                   "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " on a MarkForged system.");

+ 1
- 1
Marlin/src/lcd/menu/menu_backlash.cpp View File

@@ -38,7 +38,7 @@ void menu_backlash() {
38 38
 
39 39
   EDIT_ITEM_FAST(percent, MSG_BACKLASH_CORRECTION, &backlash.correction, all_off, all_on);
40 40
 
41
-  #if DISABLED(CORE_BACKLASH) || ENABLED(MARKFORGED_XY)
41
+  #if DISABLED(CORE_BACKLASH) || EITHER(MARKFORGED_XY, MARKFORGED_YX)
42 42
     #define _CAN_CALI AXIS_CAN_CALIBRATE
43 43
   #else
44 44
     #define _CAN_CALI(A) true

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

@@ -617,7 +617,7 @@ void Endstops::update() {
617 617
   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT_TO(live_state, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
618 618
   #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT))
619 619
 
620
-  #if ENABLED(G38_PROBE_TARGET) && NONE(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY)
620
+  #if ENABLED(G38_PROBE_TARGET) && NONE(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_XY)
621 621
     #define HAS_G38_PROBE 1
622 622
     // For G38 moves check the probe's pin for ALL movement
623 623
     if (G38_move) UPDATE_ENDSTOP_BIT(Z, TERN(USES_Z_MIN_PROBE_PIN, MIN_PROBE, MIN));
@@ -628,12 +628,12 @@ void Endstops::update() {
628 628
   #define X_MAX_TEST() TERN1(DUAL_X_CARRIAGE, TERN0(X_HOME_TO_MAX, stepper.last_moved_extruder == 0) || TERN0(X2_HOME_TO_MAX, stepper.last_moved_extruder != 0))
629 629
 
630 630
   // Use HEAD for core axes, AXIS for others
631
-  #if ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY)
631
+  #if ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_XY)
632 632
     #define X_AXIS_HEAD X_HEAD
633 633
   #else
634 634
     #define X_AXIS_HEAD X_AXIS
635 635
   #endif
636
-  #if ANY(CORE_IS_XY, CORE_IS_YZ, MARKFORGED_XY)
636
+  #if ANY(CORE_IS_XY, CORE_IS_YZ, MARKFORGED_XY, MARKFORGED_YX)
637 637
     #define Y_AXIS_HEAD Y_HEAD
638 638
   #else
639 639
     #define Y_AXIS_HEAD Y_AXIS
@@ -1111,7 +1111,7 @@ void Endstops::update() {
1111 1111
     bool hit = false;
1112 1112
     #if X_SPI_SENSORLESS
1113 1113
       if (tmc_spi_homing.x && (stepperX.test_stall_status()
1114
-        #if ANY(CORE_IS_XY, MARKFORGED_XY) && Y_SPI_SENSORLESS
1114
+        #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && Y_SPI_SENSORLESS
1115 1115
           || stepperY.test_stall_status()
1116 1116
         #elif CORE_IS_XZ && Z_SPI_SENSORLESS
1117 1117
           || stepperZ.test_stall_status()
@@ -1123,7 +1123,7 @@ void Endstops::update() {
1123 1123
     #endif
1124 1124
     #if Y_SPI_SENSORLESS
1125 1125
       if (tmc_spi_homing.y && (stepperY.test_stall_status()
1126
-        #if ANY(CORE_IS_XY, MARKFORGED_XY) && X_SPI_SENSORLESS
1126
+        #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && X_SPI_SENSORLESS
1127 1127
           || stepperX.test_stall_status()
1128 1128
         #elif CORE_IS_YZ && Z_SPI_SENSORLESS
1129 1129
           || stepperZ.test_stall_status()

+ 6
- 6
Marlin/src/module/motion.cpp View File

@@ -1367,7 +1367,7 @@ void prepare_line_to_destination() {
1367 1367
             #if AXIS_HAS_STALLGUARD(X2)
1368 1368
               stealth_states.x2 = tmc_enable_stallguard(stepperX2);
1369 1369
             #endif
1370
-            #if EITHER(CORE_IS_XY, MARKFORGED_XY) && Y_SENSORLESS
1370
+            #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && Y_SENSORLESS
1371 1371
               stealth_states.y = tmc_enable_stallguard(stepperY);
1372 1372
             #elif CORE_IS_XZ && Z_SENSORLESS
1373 1373
               stealth_states.z = tmc_enable_stallguard(stepperZ);
@@ -1380,7 +1380,7 @@ void prepare_line_to_destination() {
1380 1380
             #if AXIS_HAS_STALLGUARD(Y2)
1381 1381
               stealth_states.y2 = tmc_enable_stallguard(stepperY2);
1382 1382
             #endif
1383
-            #if EITHER(CORE_IS_XY, MARKFORGED_XY) && X_SENSORLESS
1383
+            #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && X_SENSORLESS
1384 1384
               stealth_states.x = tmc_enable_stallguard(stepperX);
1385 1385
             #elif CORE_IS_YZ && Z_SENSORLESS
1386 1386
               stealth_states.z = tmc_enable_stallguard(stepperZ);
@@ -1444,7 +1444,7 @@ void prepare_line_to_destination() {
1444 1444
             #if AXIS_HAS_STALLGUARD(X2)
1445 1445
               tmc_disable_stallguard(stepperX2, enable_stealth.x2);
1446 1446
             #endif
1447
-            #if EITHER(CORE_IS_XY, MARKFORGED_XY) && Y_SENSORLESS
1447
+            #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && Y_SENSORLESS
1448 1448
               tmc_disable_stallguard(stepperY, enable_stealth.y);
1449 1449
             #elif CORE_IS_XZ && Z_SENSORLESS
1450 1450
               tmc_disable_stallguard(stepperZ, enable_stealth.z);
@@ -1457,7 +1457,7 @@ void prepare_line_to_destination() {
1457 1457
             #if AXIS_HAS_STALLGUARD(Y2)
1458 1458
               tmc_disable_stallguard(stepperY2, enable_stealth.y2);
1459 1459
             #endif
1460
-            #if EITHER(CORE_IS_XY, MARKFORGED_XY) && X_SENSORLESS
1460
+            #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && X_SENSORLESS
1461 1461
               tmc_disable_stallguard(stepperX, enable_stealth.x);
1462 1462
             #elif CORE_IS_YZ && Z_SENSORLESS
1463 1463
               tmc_disable_stallguard(stepperZ, enable_stealth.z);
@@ -2011,7 +2011,7 @@ void prepare_line_to_destination() {
2011 2011
         do_homing_move(axis, adjDistance, get_homing_bump_feedrate(axis));
2012 2012
       }
2013 2013
 
2014
-    #else // CARTESIAN / CORE / MARKFORGED_XY
2014
+    #else // CARTESIAN / CORE / MARKFORGED_XY / MARKFORGED_YX
2015 2015
 
2016 2016
       set_axis_is_at_home(axis);
2017 2017
       sync_plan_position();
@@ -2041,7 +2041,7 @@ void prepare_line_to_destination() {
2041 2041
         #if ENABLED(SENSORLESS_HOMING)
2042 2042
           planner.synchronize();
2043 2043
           if (false
2044
-            #if EITHER(IS_CORE, MARKFORGED_XY)
2044
+            #if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX)
2045 2045
               || axis != NORMAL_AXIS
2046 2046
             #endif
2047 2047
           ) safe_delay(200);  // Short delay to allow belts to spring back

+ 52
- 47
Marlin/src/module/planner.cpp View File

@@ -1745,7 +1745,7 @@ float Planner::get_axis_position_mm(const AxisEnum axis) {
1745 1745
     else
1746 1746
       axis_steps = stepper.position(axis);
1747 1747
 
1748
-  #elif ENABLED(MARKFORGED_XY)
1748
+  #elif EITHER(MARKFORGED_XY, MARKFORGED_YX)
1749 1749
 
1750 1750
     // Requesting one of the joined axes?
1751 1751
     if (axis == CORE_AXIS_1 || axis == CORE_AXIS_2) {
@@ -1919,42 +1919,28 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1919 1919
 
1920 1920
   // Compute direction bit-mask for this block
1921 1921
   axis_bits_t dm = 0;
1922
-  #if CORE_IS_XY
1923
-    if (da < 0) SBI(dm, X_HEAD);                // Save the toolhead's true direction in X
1924
-    if (db < 0) SBI(dm, Y_HEAD);                // ...and Y
1925
-    if (dc < 0) SBI(dm, Z_AXIS);
1926
-    if (da + db < 0) SBI(dm, A_AXIS);           // Motor A direction
1927
-    if (CORESIGN(da - db) < 0) SBI(dm, B_AXIS); // Motor B direction
1928
-  #elif CORE_IS_XZ
1929
-    if (da < 0) SBI(dm, X_HEAD);                // Save the toolhead's true direction in X
1930
-    if (db < 0) SBI(dm, Y_AXIS);
1931
-    if (dc < 0) SBI(dm, Z_HEAD);                // ...and Z
1932
-    if (da + dc < 0) SBI(dm, A_AXIS);           // Motor A direction
1933
-    if (CORESIGN(da - dc) < 0) SBI(dm, C_AXIS); // Motor C direction
1934
-  #elif CORE_IS_YZ
1935
-    if (da < 0) SBI(dm, X_AXIS);
1936
-    if (db < 0) SBI(dm, Y_HEAD);                // Save the toolhead's true direction in Y
1937
-    if (dc < 0) SBI(dm, Z_HEAD);                // ...and Z
1938
-    if (db + dc < 0) SBI(dm, B_AXIS);           // Motor B direction
1939
-    if (CORESIGN(db - dc) < 0) SBI(dm, C_AXIS); // Motor C direction
1940
-  #elif ENABLED(MARKFORGED_XY)
1941
-    if (da < 0) SBI(dm, X_HEAD);                // Save the toolhead's true direction in X
1942
-    if (db < 0) SBI(dm, Y_HEAD);                // ...and Y
1922
+  #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
1923
+    if (da < 0) SBI(dm, X_HEAD);                  // Save the toolhead's true direction in X
1924
+    if (db < 0) SBI(dm, Y_HEAD);                  // ...and Y
1943 1925
     if (dc < 0) SBI(dm, Z_AXIS);
1944
-    if (da + db < 0) SBI(dm, A_AXIS);           // Motor A direction
1945
-    if (db < 0) SBI(dm, B_AXIS);                // Motor B direction
1946
-  #else
1947
-    LINEAR_AXIS_CODE(
1948
-      if (da < 0) SBI(dm, X_AXIS),
1949
-      if (db < 0) SBI(dm, Y_AXIS),
1950
-      if (dc < 0) SBI(dm, Z_AXIS),
1951
-      if (di < 0) SBI(dm, I_AXIS),
1952
-      if (dj < 0) SBI(dm, J_AXIS),
1953
-      if (dk < 0) SBI(dm, K_AXIS)
1954
-    );
1955 1926
   #endif
1956
-
1957 1927
   #if IS_CORE
1928
+    #if CORE_IS_XY
1929
+      if (da + db < 0) SBI(dm, A_AXIS);           // Motor A direction
1930
+      if (CORESIGN(da - db) < 0) SBI(dm, B_AXIS); // Motor B direction
1931
+    #elif CORE_IS_XZ
1932
+      if (da < 0) SBI(dm, X_HEAD);                // Save the toolhead's true direction in X
1933
+      if (db < 0) SBI(dm, Y_AXIS);
1934
+      if (dc < 0) SBI(dm, Z_HEAD);                // ...and Z
1935
+      if (da + dc < 0) SBI(dm, A_AXIS);           // Motor A direction
1936
+      if (CORESIGN(da - dc) < 0) SBI(dm, C_AXIS); // Motor C direction
1937
+    #elif CORE_IS_YZ
1938
+      if (da < 0) SBI(dm, X_AXIS);
1939
+      if (db < 0) SBI(dm, Y_HEAD);                // Save the toolhead's true direction in Y
1940
+      if (dc < 0) SBI(dm, Z_HEAD);                // ...and Z
1941
+      if (db + dc < 0) SBI(dm, B_AXIS);           // Motor B direction
1942
+      if (CORESIGN(db - dc) < 0) SBI(dm, C_AXIS); // Motor C direction
1943
+    #endif
1958 1944
     #if LINEAR_AXES >= 4
1959 1945
       if (di < 0) SBI(dm, I_AXIS);
1960 1946
     #endif
@@ -1964,11 +1950,25 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1964 1950
     #if LINEAR_AXES >= 6
1965 1951
       if (dk < 0) SBI(dm, K_AXIS);
1966 1952
     #endif
1953
+  #elif ENABLED(MARKFORGED_XY)
1954
+    if (da + db < 0) SBI(dm, A_AXIS);              // Motor A direction
1955
+    if (db < 0) SBI(dm, B_AXIS);                   // Motor B direction
1956
+  #elif ENABLED(MARKFORGED_YX)
1957
+    if (da < 0) SBI(dm, A_AXIS);                   // Motor A direction
1958
+    if (db + da < 0) SBI(dm, B_AXIS);              // Motor B direction
1959
+  #else
1960
+    LINEAR_AXIS_CODE(
1961
+      if (da < 0) SBI(dm, X_AXIS),
1962
+      if (db < 0) SBI(dm, Y_AXIS),
1963
+      if (dc < 0) SBI(dm, Z_AXIS),
1964
+      if (di < 0) SBI(dm, I_AXIS),
1965
+      if (dj < 0) SBI(dm, J_AXIS),
1966
+      if (dk < 0) SBI(dm, K_AXIS)
1967
+    );
1967 1968
   #endif
1968 1969
 
1969
-  TERN_(HAS_EXTRUDERS, if (de < 0) SBI(dm, E_AXIS));
1970
-
1971 1970
   #if HAS_EXTRUDERS
1971
+    if (de < 0) SBI(dm, E_AXIS);
1972 1972
     const float esteps_float = de * e_factor[extruder];
1973 1973
     const uint32_t esteps = ABS(esteps_float) + 0.5f;
1974 1974
   #else
@@ -1998,6 +1998,8 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1998 1998
     block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db + dc), ABS(db - dc), ABS(di), ABS(dj), ABS(dk)));
1999 1999
   #elif ENABLED(MARKFORGED_XY)
2000 2000
     block->steps.set(LINEAR_AXIS_LIST(ABS(da + db), ABS(db), ABS(dc), ABS(di), ABS(dj), ABS(dk)));
2001
+  #elif ENABLED(MARKFORGED_YX)
2002
+    block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db + da), ABS(dc), ABS(di), ABS(dj), ABS(dk)));
2001 2003
   #elif IS_SCARA
2002 2004
     block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db), ABS(dc), ABS(di), ABS(dj), ABS(dk)));
2003 2005
   #else
@@ -2014,15 +2016,18 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2014 2016
    * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
2015 2017
    */
2016 2018
   struct DistanceMM : abce_float_t {
2017
-    #if EITHER(IS_CORE, MARKFORGED_XY)
2019
+    #if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX)
2018 2020
       struct { float x, y, z; } head;
2019 2021
     #endif
2020 2022
   } steps_dist_mm;
2023
+
2024
+  #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
2025
+    steps_dist_mm.head.x = da * mm_per_step[A_AXIS];
2026
+    steps_dist_mm.head.y = db * mm_per_step[B_AXIS];
2027
+    steps_dist_mm.z      = dc * mm_per_step[Z_AXIS];
2028
+  #endif
2021 2029
   #if IS_CORE
2022 2030
     #if CORE_IS_XY
2023
-      steps_dist_mm.head.x = da * mm_per_step[A_AXIS];
2024
-      steps_dist_mm.head.y = db * mm_per_step[B_AXIS];
2025
-      steps_dist_mm.z      = dc * mm_per_step[Z_AXIS];
2026 2031
       steps_dist_mm.a      = (da + db) * mm_per_step[A_AXIS];
2027 2032
       steps_dist_mm.b      = CORESIGN(da - db) * mm_per_step[B_AXIS];
2028 2033
     #elif CORE_IS_XZ
@@ -2048,11 +2053,11 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2048 2053
       steps_dist_mm.k = dk * mm_per_step[K_AXIS];
2049 2054
     #endif
2050 2055
   #elif ENABLED(MARKFORGED_XY)
2051
-    steps_dist_mm.head.x = da * mm_per_step[A_AXIS];
2052
-    steps_dist_mm.head.y = db * mm_per_step[B_AXIS];
2053
-    steps_dist_mm.z      = dc * mm_per_step[Z_AXIS];
2054 2056
     steps_dist_mm.a      = (da - db) * mm_per_step[A_AXIS];
2055 2057
     steps_dist_mm.b      = db * mm_per_step[B_AXIS];
2058
+  #elif ENABLED(MARKFORGED_YX)
2059
+    steps_dist_mm.a      = da * mm_per_step[A_AXIS];
2060
+    steps_dist_mm.b      = (db - da) * mm_per_step[B_AXIS];
2056 2061
   #else
2057 2062
     LINEAR_AXIS_CODE(
2058 2063
       steps_dist_mm.a = da * mm_per_step[A_AXIS],
@@ -2084,7 +2089,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2084 2089
       block->millimeters = millimeters;
2085 2090
     else {
2086 2091
       block->millimeters = SQRT(
2087
-        #if EITHER(CORE_IS_XY, MARKFORGED_XY)
2092
+        #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
2088 2093
           LINEAR_AXIS_GANG(
2089 2094
               sq(steps_dist_mm.head.x), + sq(steps_dist_mm.head.y), + sq(steps_dist_mm.z),
2090 2095
             + sq(steps_dist_mm.i),      + sq(steps_dist_mm.j),      + sq(steps_dist_mm.k)
@@ -2163,7 +2168,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2163 2168
   #endif
2164 2169
 
2165 2170
   // Enable active axes
2166
-  #if EITHER(CORE_IS_XY, MARKFORGED_XY)
2171
+  #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
2167 2172
     if (block->steps.a || block->steps.b) {
2168 2173
       stepper.enable_axis(X_AXIS);
2169 2174
       stepper.enable_axis(Y_AXIS);
@@ -2193,7 +2198,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2193 2198
       if (block->steps.k) stepper.enable_axis(K_AXIS)
2194 2199
     );
2195 2200
   #endif
2196
-  #if EITHER(IS_CORE, MARKFORGED_XY)
2201
+  #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
2197 2202
     #if LINEAR_AXES >= 4
2198 2203
       if (block->steps.i) stepper.enable_axis(I_AXIS);
2199 2204
     #endif
@@ -2551,7 +2556,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2551 2556
      * => normalize the complete junction vector.
2552 2557
      * Elsewise, when needed JD will factor-in the E component
2553 2558
      */
2554
-    if (EITHER(IS_CORE, MARKFORGED_XY) || esteps > 0)
2559
+    if (ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX) || esteps > 0)
2555 2560
       normalize_junction_vector(unit_vec);  // Normalize with XYZE components
2556 2561
     else
2557 2562
       unit_vec *= inverse_millimeters;      // Use pre-calculated (1 / SQRT(x^2 + y^2 + z^2))

+ 11
- 3
Marlin/src/module/stepper.cpp View File

@@ -2212,6 +2212,8 @@ uint32_t Stepper::block_phase_isr() {
2212 2212
           #define Y_CMP(A,B) ((A)!=(B))
2213 2213
         #endif
2214 2214
         #define Y_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && Y_CMP(D_(1),D_(2))) )
2215
+      #elif ENABLED(MARKFORGED_YX)
2216
+        #define Y_MOVE_TEST (current_block->steps.a != current_block->steps.b)
2215 2217
       #else
2216 2218
         #define Y_MOVE_TEST !!current_block->steps.b
2217 2219
       #endif
@@ -2800,7 +2802,7 @@ void Stepper::init() {
2800 2802
  * derive the current XYZE position later on.
2801 2803
  */
2802 2804
 void Stepper::_set_position(const abce_long_t &spos) {
2803
-  #if EITHER(IS_CORE, MARKFORGED_XY)
2805
+  #if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX)
2804 2806
     #if CORE_IS_XY
2805 2807
       // corexy positioning
2806 2808
       // these equations follow the form of the dA and dB equations on https://www.corexy.com/theory.html
@@ -2813,6 +2815,8 @@ void Stepper::_set_position(const abce_long_t &spos) {
2813 2815
       count_position.set(spos.a, spos.b + spos.c, CORESIGN(spos.b - spos.c));
2814 2816
     #elif ENABLED(MARKFORGED_XY)
2815 2817
       count_position.set(spos.a - spos.b, spos.b, spos.c);
2818
+    #elif ENABLED(MARKFORGED_YX)
2819
+      count_position.set(spos.a, spos.b - spos.a, spos.c);
2816 2820
     #endif
2817 2821
     TERN_(HAS_EXTRUDERS, count_position.e = spos.e);
2818 2822
   #else
@@ -2884,6 +2888,10 @@ void Stepper::endstop_triggered(const AxisEnum axis) {
2884 2888
       axis == CORE_AXIS_1
2885 2889
         ? count_position[CORE_AXIS_1] - count_position[CORE_AXIS_2]
2886 2890
         : count_position[CORE_AXIS_2]
2891
+    #elif ENABLED(MARKFORGED_YX)
2892
+      axis == CORE_AXIS_1
2893
+        ? count_position[CORE_AXIS_1]
2894
+        : count_position[CORE_AXIS_2] - count_position[CORE_AXIS_1]
2887 2895
     #else // !IS_CORE
2888 2896
       count_position[axis]
2889 2897
     #endif
@@ -2912,10 +2920,10 @@ int32_t Stepper::triggered_position(const AxisEnum axis) {
2912 2920
   return v;
2913 2921
 }
2914 2922
 
2915
-#if ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, IS_SCARA, DELTA)
2923
+#if ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX, IS_SCARA, DELTA)
2916 2924
   #define SAYS_A 1
2917 2925
 #endif
2918
-#if ANY(CORE_IS_XY, CORE_IS_YZ, MARKFORGED_XY, IS_SCARA, DELTA)
2926
+#if ANY(CORE_IS_XY, CORE_IS_YZ, MARKFORGED_XY, MARKFORGED_YX, IS_SCARA, DELTA)
2919 2927
   #define SAYS_B 1
2920 2928
 #endif
2921 2929
 #if ANY(CORE_IS_XZ, CORE_IS_YZ, DELTA)

Loading…
Cancel
Save