IDEX clean up (#11690)
This commit is contained in:
@ -835,7 +835,8 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS },
|
||||
#endif // !UBL_SEGMENTED
|
||||
|
||||
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
|
||||
bool extruder_duplication_enabled = false; // Used in Dual X mode 2
|
||||
bool extruder_duplication_enabled = false; // Used in Dual X mode 2 & 3
|
||||
bool symmetric_duplication_mode = false; // Used in Dual X mode 2 & 3
|
||||
#endif
|
||||
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
@ -884,15 +885,20 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS },
|
||||
}
|
||||
}
|
||||
// unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
|
||||
for (uint8_t i = 0; i < 3; i++)
|
||||
if (!planner.buffer_line(
|
||||
i == 0 ? raised_parked_position[X_AXIS] : current_position[X_AXIS],
|
||||
i == 0 ? raised_parked_position[Y_AXIS] : current_position[Y_AXIS],
|
||||
i == 2 ? current_position[Z_AXIS] : raised_parked_position[Z_AXIS],
|
||||
current_position[E_AXIS],
|
||||
i == 1 ? PLANNER_XY_FEEDRATE() : planner.max_feedrate_mm_s[Z_AXIS],
|
||||
active_extruder)
|
||||
) break;
|
||||
|
||||
#define CUR_X current_position[X_AXIS]
|
||||
#define CUR_Y current_position[Y_AXIS]
|
||||
#define CUR_Z current_position[Z_AXIS]
|
||||
#define CUR_E current_position[E_AXIS]
|
||||
#define RAISED_X raised_parked_position[X_AXIS]
|
||||
#define RAISED_Y raised_parked_position[Y_AXIS]
|
||||
#define RAISED_Z raised_parked_position[Z_AXIS]
|
||||
|
||||
SERIAL_ECHOLNPGM("dual_x_carriage_unpark()\n");
|
||||
|
||||
if (planner.buffer_line(RAISED_X, RAISED_Y, RAISED_Z, CUR_E, planner.max_feedrate_mm_s[Z_AXIS], active_extruder))
|
||||
if (planner.buffer_line( CUR_X, CUR_Y, RAISED_Z, CUR_E, PLANNER_XY_FEEDRATE(), active_extruder))
|
||||
planner.buffer_line( CUR_X, CUR_Y, CUR_Z, CUR_E, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
||||
delayed_move_time = 0;
|
||||
active_extruder_parked = false;
|
||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
@ -976,7 +982,12 @@ void prepare_move_to_destination() {
|
||||
|
||||
if (
|
||||
#if UBL_SEGMENTED
|
||||
ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s))
|
||||
// ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s)) // This does not seem to work correctly on UBL.
|
||||
#if ENABLED(DELTA) // A Delta case and a Cartesian case can work
|
||||
ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s)) // around the problem until it is fixed.
|
||||
#else
|
||||
prepare_move_to_destination_cartesian()
|
||||
#endif
|
||||
#elif IS_KINEMATIC
|
||||
prepare_kinematic_move_to(destination)
|
||||
#else
|
||||
|
@ -307,6 +307,7 @@ void homeaxis(const AxisEnum axis);
|
||||
*/
|
||||
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
|
||||
extern bool extruder_duplication_enabled; // Used in Dual X mode 2
|
||||
extern bool symmetric_duplication_mode; // Used in Dual X mode 2
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -317,16 +318,16 @@ void homeaxis(const AxisEnum axis);
|
||||
enum DualXMode : char {
|
||||
DXC_FULL_CONTROL_MODE, // DUAL_X_CARRIAGE only
|
||||
DXC_AUTO_PARK_MODE, // DUAL_X_CARRIAGE only
|
||||
DXC_DUPLICATION_MODE
|
||||
DXC_DUPLICATION_MODE,
|
||||
};
|
||||
|
||||
extern DualXMode dual_x_carriage_mode;
|
||||
extern float inactive_extruder_x_pos, // used in mode 0 & 1
|
||||
raised_parked_position[XYZE], // used in mode 1
|
||||
duplicate_extruder_x_offset; // used in mode 2
|
||||
extern bool active_extruder_parked; // used in mode 1 & 2
|
||||
duplicate_extruder_x_offset; // used in mode 2 & 3
|
||||
extern bool active_extruder_parked; // used in mode 1, 2 & 3
|
||||
extern millis_t delayed_move_time; // used in mode 1
|
||||
extern int16_t duplicate_extruder_temp_offset; // used in mode 2
|
||||
extern int16_t duplicate_extruder_temp_offset; // used in mode 2 & 3
|
||||
|
||||
float x_home_pos(const int extruder);
|
||||
|
||||
|
@ -231,6 +231,9 @@ int8_t Stepper::count_direction[NUM_AXIS] = { 0, 0, 0, 0 };
|
||||
#define X_APPLY_DIR(v,ALWAYS) \
|
||||
if (extruder_duplication_enabled || ALWAYS) { \
|
||||
X_DIR_WRITE(v); \
|
||||
if (symmetric_duplication_mode) \
|
||||
X2_DIR_WRITE(!v); \
|
||||
else \
|
||||
X2_DIR_WRITE(v); \
|
||||
} \
|
||||
else { \
|
||||
|
@ -248,7 +248,6 @@ inline void invalid_extruder_error(const uint8_t e) {
|
||||
switch (dual_x_carriage_mode) {
|
||||
case DXC_FULL_CONTROL_MODE: SERIAL_ECHOLNPGM("DXC_FULL_CONTROL_MODE"); break;
|
||||
case DXC_AUTO_PARK_MODE: SERIAL_ECHOLNPGM("DXC_AUTO_PARK_MODE"); break;
|
||||
case DXC_DUPLICATION_MODE: SERIAL_ECHOLNPGM("DXC_DUPLICATION_MODE"); break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -270,15 +269,16 @@ inline void invalid_extruder_error(const uint8_t e) {
|
||||
}
|
||||
#endif
|
||||
// Park old head: 1) raise 2) move to park position 3) lower
|
||||
for (uint8_t i = 0; i < 3; i++)
|
||||
planner.buffer_line(
|
||||
i == 0 ? current_position[X_AXIS] : xhome,
|
||||
current_position[Y_AXIS],
|
||||
i == 2 ? current_position[Z_AXIS] : raised_z,
|
||||
current_position[E_AXIS],
|
||||
planner.max_feedrate_mm_s[i == 1 ? X_AXIS : Z_AXIS],
|
||||
active_extruder
|
||||
);
|
||||
|
||||
#define CUR_X current_position[X_AXIS]
|
||||
#define CUR_Y current_position[Y_AXIS]
|
||||
#define CUR_Z current_position[Z_AXIS]
|
||||
#define CUR_E current_position[E_AXIS]
|
||||
|
||||
planner.buffer_line( CUR_X, CUR_Y, raised_z, CUR_E, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
||||
planner.buffer_line( xhome, CUR_Y, raised_z, CUR_E, planner.max_feedrate_mm_s[X_AXIS], active_extruder);
|
||||
planner.buffer_line( xhome, CUR_Y, CUR_Z, CUR_E, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
||||
|
||||
planner.synchronize();
|
||||
}
|
||||
|
||||
@ -316,20 +316,6 @@ inline void invalid_extruder_error(const uint8_t e) {
|
||||
active_extruder_parked = true;
|
||||
delayed_move_time = 0;
|
||||
break;
|
||||
case DXC_DUPLICATION_MODE:
|
||||
// If the new extruder is the left one, set it "parked"
|
||||
// This triggers the second extruder to move into the duplication position
|
||||
active_extruder_parked = (active_extruder == 0);
|
||||
current_position[X_AXIS] = active_extruder_parked ? inactive_extruder_x_pos : destination[X_AXIS] + duplicate_extruder_x_offset;
|
||||
inactive_extruder_x_pos = destination[X_AXIS];
|
||||
extruder_duplication_enabled = false;
|
||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
if (DEBUGGING(LEVELING)) {
|
||||
SERIAL_ECHOLNPAIR("Set inactive_extruder_x_pos=", inactive_extruder_x_pos);
|
||||
SERIAL_ECHOLNPGM("Clear extruder_duplication_enabled");
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
@ -351,6 +337,11 @@ inline void invalid_extruder_error(const uint8_t e) {
|
||||
void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool no_move/*=false*/) {
|
||||
planner.synchronize();
|
||||
|
||||
#if ENABLED(DUAL_X_CARRIAGE) // Only T0 allowed if the Printer is in DXC_DUPLICATION_MODE
|
||||
if (tmp_extruder != 0 && dual_x_carriage_mode == DXC_DUPLICATION_MODE)
|
||||
return invalid_extruder_error(tmp_extruder);
|
||||
#endif
|
||||
|
||||
#if HAS_LEVELING
|
||||
// Set current position to the physical position
|
||||
const bool leveling_was_active = planner.leveling_active;
|
||||
|
Reference in New Issue
Block a user