Browse Source

📝 Fix X2_MAX_POS comment (#23873)

InsanityAutomation 3 years ago
parent
commit
a9c30cb9c1
No account linked to committer's email address
2 changed files with 19 additions and 23 deletions
  1. 9
    10
      Marlin/Configuration_adv.h
  2. 10
    13
      Marlin/src/module/motion.cpp

+ 9
- 10
Marlin/Configuration_adv.h View File

811
  */
811
  */
812
 //#define DUAL_X_CARRIAGE
812
 //#define DUAL_X_CARRIAGE
813
 #if ENABLED(DUAL_X_CARRIAGE)
813
 #if ENABLED(DUAL_X_CARRIAGE)
814
-  #define X1_MIN_POS X_MIN_POS   // Set to X_MIN_POS
815
-  #define X1_MAX_POS X_BED_SIZE  // Set a maximum so the first X-carriage can't hit the parked second X-carriage
816
-  #define X2_MIN_POS    80       // Set a minimum to ensure the  second X-carriage can't hit the parked first X-carriage
817
-  #define X2_MAX_POS   353       // Set this to the distance between toolheads when both heads are homed
818
-  #define X2_HOME_DIR    1       // Set to 1. The second X-carriage always homes to the maximum endstop position
819
-  #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS.
820
-                      // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
821
-                      // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
822
-                      // without modifying the firmware (through the "M218 T1 X???" command).
823
-                      // Remember: you should set the second extruder x-offset to 0 in your slicer.
814
+  #define X1_MIN_POS X_MIN_POS    // Set to X_MIN_POS
815
+  #define X1_MAX_POS X_BED_SIZE   // A max coordinate so the X1 carriage can't hit the parked X2 carriage
816
+  #define X2_MIN_POS    80        // A min coordinate so the X2 carriage can't hit the parked X1 carriage
817
+  #define X2_MAX_POS   353        // The max position of the X2 carriage, typically also the home position
818
+  #define X2_HOME_DIR    1        // Set to 1. The X2 carriage always homes to the max endstop position
819
+  #define X2_HOME_POS X2_MAX_POS  // Default X2 home position. Set to X2_MAX_POS.
820
+                                  // NOTE: For Dual X Carriage use M218 T1 Xn to override the X2_HOME_POS.
821
+                                  // This allows recalibration of endstops distance without a rebuild.
822
+                                  // Remember to set the second extruder's X-offset to 0 in your slicer.
824
 
823
 
825
   // This is the default power-up mode which can be changed later using M605 S<mode>.
824
   // This is the default power-up mode which can be changed later using M605 S<mode>.
826
   #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE
825
   #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE

+ 10
- 13
Marlin/src/module/motion.cpp View File

125
     );
125
     );
126
     // Transpose from [XYZ][HOTENDS] to [HOTENDS][XYZ]
126
     // Transpose from [XYZ][HOTENDS] to [HOTENDS][XYZ]
127
     HOTEND_LOOP() LOOP_ABC(a) hotend_offset[e][a] = tmp[a][e];
127
     HOTEND_LOOP() LOOP_ABC(a) hotend_offset[e][a] = tmp[a][e];
128
-    #if ENABLED(DUAL_X_CARRIAGE)
129
-      hotend_offset[1].x = _MAX(X2_HOME_POS, X2_MAX_POS);
130
-    #endif
128
+    TERN_(DUAL_X_CARRIAGE, hotend_offset[1].x = _MAX(X2_HOME_POS, X2_MAX_POS));
131
   }
129
   }
132
 #endif
130
 #endif
133
 
131
 
1116
   bool idex_mirrored_mode                = false;                         // Used in mode 3
1114
   bool idex_mirrored_mode                = false;                         // Used in mode 3
1117
 
1115
 
1118
   float x_home_pos(const uint8_t extruder) {
1116
   float x_home_pos(const uint8_t extruder) {
1119
-    if (extruder == 0)
1120
-      return X_HOME_POS;
1121
-    else
1122
-      /**
1123
-       * In dual carriage mode the extruder offset provides an override of the
1124
-       * second X-carriage position when homed - otherwise X2_HOME_POS is used.
1125
-       * This allows soft recalibration of the second extruder home position
1126
-       * without firmware reflash (through the M218 command).
1127
-       */
1128
-      return hotend_offset[1].x > 0 ? hotend_offset[1].x : X2_HOME_POS;
1117
+    if (extruder == 0) return X_HOME_POS;
1118
+
1119
+    /**
1120
+     * In dual carriage mode the extruder offset provides an override of the
1121
+     * second X-carriage position when homed - otherwise X2_HOME_POS is used.
1122
+     * This allows soft recalibration of the second extruder home position
1123
+     * (with M218 T1 Xn) without firmware reflash.
1124
+     */
1125
+    return hotend_offset[1].x > 0 ? hotend_offset[1].x : X2_HOME_POS;
1129
   }
1126
   }
1130
 
1127
 
1131
   void idex_set_mirrored_mode(const bool mirr) {
1128
   void idex_set_mirrored_mode(const bool mirr) {

Loading…
Cancel
Save