Browse Source

🐛 Fix IDEX + DISABLE_INACTIVE_EXTRUDER (#22925)

InsanityAutomation 2 years ago
parent
commit
15ebe45f36
No account linked to committer's email address
2 changed files with 11 additions and 10 deletions
  1. 1
    0
      Marlin/src/module/motion.cpp
  2. 10
    10
      Marlin/src/module/planner.cpp

+ 1
- 0
Marlin/src/module/motion.cpp View File

@@ -1193,6 +1193,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
1193 1193
         case DXC_MIRRORED_MODE:
1194 1194
         case DXC_DUPLICATION_MODE:
1195 1195
           if (active_extruder == 0) {
1196
+            set_duplication_enabled(false); // Clear stale duplication state
1196 1197
             // Restore planner to parked head (T1) X position
1197 1198
             float x0_pos = current_position.x;
1198 1199
             xyze_pos_t pos_now = current_position;

+ 10
- 10
Marlin/src/module/planner.cpp View File

@@ -2207,23 +2207,23 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2207 2207
 
2208 2208
       #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder
2209 2209
 
2210
+        // Count down all steppers that were recently moved
2210 2211
         LOOP_L_N(i, E_STEPPERS)
2211 2212
           if (g_uc_extruder_last_move[i]) g_uc_extruder_last_move[i]--;
2212 2213
 
2214
+        // Switching Extruder uses one E stepper motor per two nozzles
2213 2215
         #define E_STEPPER_INDEX(E) TERN(SWITCHING_EXTRUDER, (E) / 2, E)
2214 2216
 
2217
+        // Enable all (i.e., both) E steppers for IDEX-style duplication, but only active E steppers for multi-nozzle (i.e., single wide X carriage) duplication
2218
+        #define _IS_DUPE(N) TERN0(HAS_DUPLICATION_MODE, (extruder_duplication_enabled && TERN1(MULTI_NOZZLE_DUPLICATION, TEST(duplication_e_mask, N))))
2219
+
2215 2220
         #define ENABLE_ONE_E(N) do{ \
2216
-          if (E_STEPPER_INDEX(extruder) == N) { \
2217
-            stepper.ENABLE_EXTRUDER(N); \
2218
-            g_uc_extruder_last_move[N] = (BLOCK_BUFFER_SIZE) * 2; \
2219
-            if ((N) == 0 && TERN0(HAS_DUPLICATION_MODE, extruder_duplication_enabled)) \
2220
-              stepper.ENABLE_EXTRUDER(1); \
2221
-          } \
2222
-          else if (!g_uc_extruder_last_move[N]) { \
2223
-            stepper.DISABLE_EXTRUDER(N); \
2224
-            if ((N) == 0 && TERN0(HAS_DUPLICATION_MODE, extruder_duplication_enabled)) \
2225
-              stepper.DISABLE_EXTRUDER(1); \
2221
+          if (N == E_STEPPER_INDEX(extruder) || _IS_DUPE(N)) {    /* N is 'extruder', or N is duplicating */ \
2222
+            stepper.ENABLE_EXTRUDER(N);                           /* Enable the relevant E stepper... */ \
2223
+            g_uc_extruder_last_move[N] = (BLOCK_BUFFER_SIZE) * 2; /* ...and reset its counter */ \
2226 2224
           } \
2225
+          else if (!g_uc_extruder_last_move[N])                   /* Counter expired since last E stepper enable */ \
2226
+            stepper.DISABLE_EXTRUDER(N);                          /* Disable the E stepper */ \
2227 2227
         }while(0);
2228 2228
 
2229 2229
       #else

Loading…
Cancel
Save