瀏覽代碼

✨ MarkForged YX kinematics (#23163)

John Robertson 3 年之前
父節點
當前提交
e5154ec281
沒有連結到貢獻者的電子郵件帳戶。

+ 1
- 0
Marlin/Configuration.h 查看文件

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

+ 1
- 1
Marlin/src/core/types.h 查看文件

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

+ 2
- 1
Marlin/src/core/utility.cpp 查看文件

60
       TERN_(DELTA,         "Delta")
60
       TERN_(DELTA,         "Delta")
61
       TERN_(IS_SCARA,      "SCARA")
61
       TERN_(IS_SCARA,      "SCARA")
62
       TERN_(IS_CORE,       "Core")
62
       TERN_(IS_CORE,       "Core")
63
-      TERN_(MARKFORGED_XY, "MarkForged")
63
+      TERN_(MARKFORGED_XY, "MarkForgedXY")
64
+      TERN_(MARKFORGED_YX, "MarkForgedYX")
64
       TERN_(IS_CARTESIAN,  "Cartesian")
65
       TERN_(IS_CARTESIAN,  "Cartesian")
65
     );
66
     );
66
 
67
 

+ 1
- 1
Marlin/src/feature/backlash.cpp 查看文件

64
   static axis_bits_t last_direction_bits;
64
   static axis_bits_t last_direction_bits;
65
   axis_bits_t changed_dir = last_direction_bits ^ dm;
65
   axis_bits_t changed_dir = last_direction_bits ^ dm;
66
   // Ignore direction change unless steps are taken in that direction
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
     if (!da) CBI(changed_dir, X_AXIS);
68
     if (!da) CBI(changed_dir, X_AXIS);
69
     if (!db) CBI(changed_dir, Y_AXIS);
69
     if (!db) CBI(changed_dir, Y_AXIS);
70
     if (!dc) CBI(changed_dir, Z_AXIS);
70
     if (!dc) CBI(changed_dir, Z_AXIS);

+ 2
- 1
Marlin/src/gcode/host/M360.cpp 查看文件

162
     TERN_(DELTA,         "Delta")
162
     TERN_(DELTA,         "Delta")
163
     TERN_(IS_SCARA,      "SCARA")
163
     TERN_(IS_SCARA,      "SCARA")
164
     TERN_(IS_CORE,       "Core")
164
     TERN_(IS_CORE,       "Core")
165
-    TERN_(MARKFORGED_XY, "MarkForged")
165
+    TERN_(MARKFORGED_XY, "MarkForgedXY")
166
+    TERN_(MARKFORGED_YX, "MarkForgedYX")
166
     TERN_(IS_CARTESIAN,  "Cartesian")
167
     TERN_(IS_CARTESIAN,  "Cartesian")
167
   );
168
   );
168
 
169
 

+ 1
- 1
Marlin/src/inc/Conditionals_LCD.h 查看文件

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

+ 1
- 1
Marlin/src/inc/Conditionals_post.h 查看文件

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

+ 8
- 8
Marlin/src/inc/SanityCheck.h 查看文件

914
 #if ENABLED(BABYSTEPPING)
914
 #if ENABLED(BABYSTEPPING)
915
   #if ENABLED(SCARA)
915
   #if ENABLED(SCARA)
916
     #error "BABYSTEPPING is not implemented for SCARA yet."
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
     #error "BABYSTEPPING only implemented for Z axis on MarkForged."
918
     #error "BABYSTEPPING only implemented for Z axis on MarkForged."
919
   #elif BOTH(DELTA, BABYSTEP_XY)
919
   #elif BOTH(DELTA, BABYSTEP_XY)
920
     #error "BABYSTEPPING only implemented for Z axis on deltabots."
920
     #error "BABYSTEPPING only implemented for Z axis on deltabots."
1459
 /**
1459
 /**
1460
  * Allow only one kinematic type to be defined
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
 #endif
1464
 #endif
1465
 
1465
 
1466
 /**
1466
 /**
1958
 #if ENABLED(DUAL_X_CARRIAGE)
1958
 #if ENABLED(DUAL_X_CARRIAGE)
1959
   #if EXTRUDERS < 2
1959
   #if EXTRUDERS < 2
1960
     #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
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
   #elif !GOOD_AXIS_PINS(X2)
1963
   #elif !GOOD_AXIS_PINS(X2)
1964
     #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
1964
     #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
1965
   #elif !HAS_X_MAX
1965
   #elif !HAS_X_MAX
3201
   #error "CoreXZ requires both X and Z to use sensorless homing if either one does."
3201
   #error "CoreXZ requires both X and Z to use sensorless homing if either one does."
3202
 #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
3202
 #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
3203
   #error "CoreYZ requires both Y and Z to use sensorless homing if either one does."
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
 #endif
3206
 #endif
3207
 
3207
 
3208
 // Other TMC feature requirements
3208
 // Other TMC feature requirements
3462
     #error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM."
3462
     #error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM."
3463
   #elif !defined(BACKLASH_CORRECTION)
3463
   #elif !defined(BACKLASH_CORRECTION)
3464
     #error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION."
3464
     #error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION."
3465
-  #elif ENABLED(MARKFORGED_XY)
3465
+  #elif EITHER(MARKFORGED_XY, MARKFORGED_YX)
3466
     constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
3466
     constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
3467
     static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
3467
     static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
3468
                   "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " on a MarkForged system.");
3468
                   "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " on a MarkForged system.");

+ 1
- 1
Marlin/src/lcd/menu/menu_backlash.cpp 查看文件

38
 
38
 
39
   EDIT_ITEM_FAST(percent, MSG_BACKLASH_CORRECTION, &backlash.correction, all_off, all_on);
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
     #define _CAN_CALI AXIS_CAN_CALIBRATE
42
     #define _CAN_CALI AXIS_CAN_CALIBRATE
43
   #else
43
   #else
44
     #define _CAN_CALI(A) true
44
     #define _CAN_CALI(A) true

+ 5
- 5
Marlin/src/module/endstops.cpp 查看文件

617
   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT_TO(live_state, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
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
   #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT))
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
     #define HAS_G38_PROBE 1
621
     #define HAS_G38_PROBE 1
622
     // For G38 moves check the probe's pin for ALL movement
622
     // For G38 moves check the probe's pin for ALL movement
623
     if (G38_move) UPDATE_ENDSTOP_BIT(Z, TERN(USES_Z_MIN_PROBE_PIN, MIN_PROBE, MIN));
623
     if (G38_move) UPDATE_ENDSTOP_BIT(Z, TERN(USES_Z_MIN_PROBE_PIN, MIN_PROBE, MIN));
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))
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
   // Use HEAD for core axes, AXIS for others
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
     #define X_AXIS_HEAD X_HEAD
632
     #define X_AXIS_HEAD X_HEAD
633
   #else
633
   #else
634
     #define X_AXIS_HEAD X_AXIS
634
     #define X_AXIS_HEAD X_AXIS
635
   #endif
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
     #define Y_AXIS_HEAD Y_HEAD
637
     #define Y_AXIS_HEAD Y_HEAD
638
   #else
638
   #else
639
     #define Y_AXIS_HEAD Y_AXIS
639
     #define Y_AXIS_HEAD Y_AXIS
1111
     bool hit = false;
1111
     bool hit = false;
1112
     #if X_SPI_SENSORLESS
1112
     #if X_SPI_SENSORLESS
1113
       if (tmc_spi_homing.x && (stepperX.test_stall_status()
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
           || stepperY.test_stall_status()
1115
           || stepperY.test_stall_status()
1116
         #elif CORE_IS_XZ && Z_SPI_SENSORLESS
1116
         #elif CORE_IS_XZ && Z_SPI_SENSORLESS
1117
           || stepperZ.test_stall_status()
1117
           || stepperZ.test_stall_status()
1123
     #endif
1123
     #endif
1124
     #if Y_SPI_SENSORLESS
1124
     #if Y_SPI_SENSORLESS
1125
       if (tmc_spi_homing.y && (stepperY.test_stall_status()
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
           || stepperX.test_stall_status()
1127
           || stepperX.test_stall_status()
1128
         #elif CORE_IS_YZ && Z_SPI_SENSORLESS
1128
         #elif CORE_IS_YZ && Z_SPI_SENSORLESS
1129
           || stepperZ.test_stall_status()
1129
           || stepperZ.test_stall_status()

+ 6
- 6
Marlin/src/module/motion.cpp 查看文件

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

+ 52
- 47
Marlin/src/module/planner.cpp 查看文件

1745
     else
1745
     else
1746
       axis_steps = stepper.position(axis);
1746
       axis_steps = stepper.position(axis);
1747
 
1747
 
1748
-  #elif ENABLED(MARKFORGED_XY)
1748
+  #elif EITHER(MARKFORGED_XY, MARKFORGED_YX)
1749
 
1749
 
1750
     // Requesting one of the joined axes?
1750
     // Requesting one of the joined axes?
1751
     if (axis == CORE_AXIS_1 || axis == CORE_AXIS_2) {
1751
     if (axis == CORE_AXIS_1 || axis == CORE_AXIS_2) {
1919
 
1919
 
1920
   // Compute direction bit-mask for this block
1920
   // Compute direction bit-mask for this block
1921
   axis_bits_t dm = 0;
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
     if (dc < 0) SBI(dm, Z_AXIS);
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
   #endif
1926
   #endif
1956
-
1957
   #if IS_CORE
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
     #if LINEAR_AXES >= 4
1944
     #if LINEAR_AXES >= 4
1959
       if (di < 0) SBI(dm, I_AXIS);
1945
       if (di < 0) SBI(dm, I_AXIS);
1960
     #endif
1946
     #endif
1964
     #if LINEAR_AXES >= 6
1950
     #if LINEAR_AXES >= 6
1965
       if (dk < 0) SBI(dm, K_AXIS);
1951
       if (dk < 0) SBI(dm, K_AXIS);
1966
     #endif
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
   #endif
1968
   #endif
1968
 
1969
 
1969
-  TERN_(HAS_EXTRUDERS, if (de < 0) SBI(dm, E_AXIS));
1970
-
1971
   #if HAS_EXTRUDERS
1970
   #if HAS_EXTRUDERS
1971
+    if (de < 0) SBI(dm, E_AXIS);
1972
     const float esteps_float = de * e_factor[extruder];
1972
     const float esteps_float = de * e_factor[extruder];
1973
     const uint32_t esteps = ABS(esteps_float) + 0.5f;
1973
     const uint32_t esteps = ABS(esteps_float) + 0.5f;
1974
   #else
1974
   #else
1998
     block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db + dc), ABS(db - dc), ABS(di), ABS(dj), ABS(dk)));
1998
     block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db + dc), ABS(db - dc), ABS(di), ABS(dj), ABS(dk)));
1999
   #elif ENABLED(MARKFORGED_XY)
1999
   #elif ENABLED(MARKFORGED_XY)
2000
     block->steps.set(LINEAR_AXIS_LIST(ABS(da + db), ABS(db), ABS(dc), ABS(di), ABS(dj), ABS(dk)));
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
   #elif IS_SCARA
2003
   #elif IS_SCARA
2002
     block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db), ABS(dc), ABS(di), ABS(dj), ABS(dk)));
2004
     block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db), ABS(dc), ABS(di), ABS(dj), ABS(dk)));
2003
   #else
2005
   #else
2014
    * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
2016
    * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
2015
    */
2017
    */
2016
   struct DistanceMM : abce_float_t {
2018
   struct DistanceMM : abce_float_t {
2017
-    #if EITHER(IS_CORE, MARKFORGED_XY)
2019
+    #if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX)
2018
       struct { float x, y, z; } head;
2020
       struct { float x, y, z; } head;
2019
     #endif
2021
     #endif
2020
   } steps_dist_mm;
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
   #if IS_CORE
2029
   #if IS_CORE
2022
     #if CORE_IS_XY
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
       steps_dist_mm.a      = (da + db) * mm_per_step[A_AXIS];
2031
       steps_dist_mm.a      = (da + db) * mm_per_step[A_AXIS];
2027
       steps_dist_mm.b      = CORESIGN(da - db) * mm_per_step[B_AXIS];
2032
       steps_dist_mm.b      = CORESIGN(da - db) * mm_per_step[B_AXIS];
2028
     #elif CORE_IS_XZ
2033
     #elif CORE_IS_XZ
2048
       steps_dist_mm.k = dk * mm_per_step[K_AXIS];
2053
       steps_dist_mm.k = dk * mm_per_step[K_AXIS];
2049
     #endif
2054
     #endif
2050
   #elif ENABLED(MARKFORGED_XY)
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
     steps_dist_mm.a      = (da - db) * mm_per_step[A_AXIS];
2056
     steps_dist_mm.a      = (da - db) * mm_per_step[A_AXIS];
2055
     steps_dist_mm.b      = db * mm_per_step[B_AXIS];
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
   #else
2061
   #else
2057
     LINEAR_AXIS_CODE(
2062
     LINEAR_AXIS_CODE(
2058
       steps_dist_mm.a = da * mm_per_step[A_AXIS],
2063
       steps_dist_mm.a = da * mm_per_step[A_AXIS],
2084
       block->millimeters = millimeters;
2089
       block->millimeters = millimeters;
2085
     else {
2090
     else {
2086
       block->millimeters = SQRT(
2091
       block->millimeters = SQRT(
2087
-        #if EITHER(CORE_IS_XY, MARKFORGED_XY)
2092
+        #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
2088
           LINEAR_AXIS_GANG(
2093
           LINEAR_AXIS_GANG(
2089
               sq(steps_dist_mm.head.x), + sq(steps_dist_mm.head.y), + sq(steps_dist_mm.z),
2094
               sq(steps_dist_mm.head.x), + sq(steps_dist_mm.head.y), + sq(steps_dist_mm.z),
2090
             + sq(steps_dist_mm.i),      + sq(steps_dist_mm.j),      + sq(steps_dist_mm.k)
2095
             + sq(steps_dist_mm.i),      + sq(steps_dist_mm.j),      + sq(steps_dist_mm.k)
2163
   #endif
2168
   #endif
2164
 
2169
 
2165
   // Enable active axes
2170
   // Enable active axes
2166
-  #if EITHER(CORE_IS_XY, MARKFORGED_XY)
2171
+  #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
2167
     if (block->steps.a || block->steps.b) {
2172
     if (block->steps.a || block->steps.b) {
2168
       stepper.enable_axis(X_AXIS);
2173
       stepper.enable_axis(X_AXIS);
2169
       stepper.enable_axis(Y_AXIS);
2174
       stepper.enable_axis(Y_AXIS);
2193
       if (block->steps.k) stepper.enable_axis(K_AXIS)
2198
       if (block->steps.k) stepper.enable_axis(K_AXIS)
2194
     );
2199
     );
2195
   #endif
2200
   #endif
2196
-  #if EITHER(IS_CORE, MARKFORGED_XY)
2201
+  #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
2197
     #if LINEAR_AXES >= 4
2202
     #if LINEAR_AXES >= 4
2198
       if (block->steps.i) stepper.enable_axis(I_AXIS);
2203
       if (block->steps.i) stepper.enable_axis(I_AXIS);
2199
     #endif
2204
     #endif
2551
      * => normalize the complete junction vector.
2556
      * => normalize the complete junction vector.
2552
      * Elsewise, when needed JD will factor-in the E component
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
       normalize_junction_vector(unit_vec);  // Normalize with XYZE components
2560
       normalize_junction_vector(unit_vec);  // Normalize with XYZE components
2556
     else
2561
     else
2557
       unit_vec *= inverse_millimeters;      // Use pre-calculated (1 / SQRT(x^2 + y^2 + z^2))
2562
       unit_vec *= inverse_millimeters;      // Use pre-calculated (1 / SQRT(x^2 + y^2 + z^2))

+ 11
- 3
Marlin/src/module/stepper.cpp 查看文件

2212
           #define Y_CMP(A,B) ((A)!=(B))
2212
           #define Y_CMP(A,B) ((A)!=(B))
2213
         #endif
2213
         #endif
2214
         #define Y_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && Y_CMP(D_(1),D_(2))) )
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
       #else
2217
       #else
2216
         #define Y_MOVE_TEST !!current_block->steps.b
2218
         #define Y_MOVE_TEST !!current_block->steps.b
2217
       #endif
2219
       #endif
2800
  * derive the current XYZE position later on.
2802
  * derive the current XYZE position later on.
2801
  */
2803
  */
2802
 void Stepper::_set_position(const abce_long_t &spos) {
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
     #if CORE_IS_XY
2806
     #if CORE_IS_XY
2805
       // corexy positioning
2807
       // corexy positioning
2806
       // these equations follow the form of the dA and dB equations on https://www.corexy.com/theory.html
2808
       // these equations follow the form of the dA and dB equations on https://www.corexy.com/theory.html
2813
       count_position.set(spos.a, spos.b + spos.c, CORESIGN(spos.b - spos.c));
2815
       count_position.set(spos.a, spos.b + spos.c, CORESIGN(spos.b - spos.c));
2814
     #elif ENABLED(MARKFORGED_XY)
2816
     #elif ENABLED(MARKFORGED_XY)
2815
       count_position.set(spos.a - spos.b, spos.b, spos.c);
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
     #endif
2820
     #endif
2817
     TERN_(HAS_EXTRUDERS, count_position.e = spos.e);
2821
     TERN_(HAS_EXTRUDERS, count_position.e = spos.e);
2818
   #else
2822
   #else
2884
       axis == CORE_AXIS_1
2888
       axis == CORE_AXIS_1
2885
         ? count_position[CORE_AXIS_1] - count_position[CORE_AXIS_2]
2889
         ? count_position[CORE_AXIS_1] - count_position[CORE_AXIS_2]
2886
         : count_position[CORE_AXIS_2]
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
     #else // !IS_CORE
2895
     #else // !IS_CORE
2888
       count_position[axis]
2896
       count_position[axis]
2889
     #endif
2897
     #endif
2912
   return v;
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
   #define SAYS_A 1
2924
   #define SAYS_A 1
2917
 #endif
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
   #define SAYS_B 1
2927
   #define SAYS_B 1
2920
 #endif
2928
 #endif
2921
 #if ANY(CORE_IS_XZ, CORE_IS_YZ, DELTA)
2929
 #if ANY(CORE_IS_XZ, CORE_IS_YZ, DELTA)

Loading…
取消
儲存