Browse Source

🐛 Fix IDEX Duplication Mode Positioning (#22914)

Fixing #22538
InsanityAutomation 3 years ago
parent
commit
b3fd0a5050
No account linked to committer's email address
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      Marlin/src/module/motion.cpp

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

1194
         case DXC_DUPLICATION_MODE:
1194
         case DXC_DUPLICATION_MODE:
1195
           if (active_extruder == 0) {
1195
           if (active_extruder == 0) {
1196
             // Restore planner to parked head (T1) X position
1196
             // Restore planner to parked head (T1) X position
1197
+            float x0_pos = current_position.x;
1197
             xyze_pos_t pos_now = current_position;
1198
             xyze_pos_t pos_now = current_position;
1198
             pos_now.x = inactive_extruder_x;
1199
             pos_now.x = inactive_extruder_x;
1199
             planner.set_position_mm(pos_now);
1200
             planner.set_position_mm(pos_now);
1201
             // Keep the same X or add the duplication X offset
1202
             // Keep the same X or add the duplication X offset
1202
             xyze_pos_t new_pos = pos_now;
1203
             xyze_pos_t new_pos = pos_now;
1203
             if (dual_x_carriage_mode == DXC_DUPLICATION_MODE)
1204
             if (dual_x_carriage_mode == DXC_DUPLICATION_MODE)
1204
-              new_pos.x += duplicate_extruder_x_offset;
1205
+              new_pos.x = x0_pos + duplicate_extruder_x_offset;
1206
+            else
1207
+              new_pos.x = _MIN(X_BED_SIZE - x0_pos, X_MAX_POS);
1205
 
1208
 
1206
             // Move duplicate extruder into the correct position
1209
             // Move duplicate extruder into the correct position
1207
             if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Set planner X", inactive_extruder_x, " ... Line to X", new_pos.x);
1210
             if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Set planner X", inactive_extruder_x, " ... Line to X", new_pos.x);

Loading…
Cancel
Save