Skip to content

Commit

Permalink
🐛 Fix IDEX Duplication Mode Positioning (MarlinFirmware#22914)
Browse files Browse the repository at this point in the history
  • Loading branch information
InsanityAutomation authored and AlexColello committed Jan 14, 2022
1 parent 016c651 commit 17a46cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1194,14 +1194,17 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
case DXC_DUPLICATION_MODE:
if (active_extruder == 0) {
// Restore planner to parked head (T1) X position
float x0_pos = current_position.x;
xyze_pos_t pos_now = current_position;
pos_now.x = inactive_extruder_x;
planner.set_position_mm(pos_now);

// Keep the same X or add the duplication X offset
xyze_pos_t new_pos = pos_now;
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE)
new_pos.x += duplicate_extruder_x_offset;
new_pos.x = x0_pos + duplicate_extruder_x_offset;
else
new_pos.x = _MIN(X_BED_SIZE - x0_pos, X_MAX_POS);

// Move duplicate extruder into the correct position
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Set planner X", inactive_extruder_x, " ... Line to X", new_pos.x);
Expand Down

0 comments on commit 17a46cb

Please sign in to comment.