IDEX Improvements (#11848)
This commit is contained in:
@ -369,7 +369,7 @@ void GcodeSuite::G28(const bool always_home_all) {
|
||||
*/
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
|
||||
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) {
|
||||
if (dxc_is_duplicating()) {
|
||||
|
||||
// Always home the 2nd (right) extruder first
|
||||
active_extruder = 1;
|
||||
@ -387,7 +387,10 @@ void GcodeSuite::G28(const bool always_home_all) {
|
||||
delayed_move_time = 0;
|
||||
active_extruder_parked = true;
|
||||
extruder_duplication_enabled = IDEX_saved_duplication_state;
|
||||
extruder_duplication_enabled = false;
|
||||
|
||||
dual_x_carriage_mode = IDEX_saved_mode;
|
||||
stepper.set_directions();
|
||||
}
|
||||
|
||||
#endif // DUAL_X_CARRIAGE
|
||||
|
@ -44,9 +44,9 @@
|
||||
* units x-offset and an optional differential hotend temperature of
|
||||
* mmm degrees. E.g., with "M605 S2 X100 R2" the second extruder will duplicate
|
||||
* the first with a spacing of 100mm in the x direction and 2 degrees hotter.
|
||||
* M605 S3 : Enable Symmetric Duplication mode. The second extruder will duplicate the first extruder's
|
||||
* M605 S3 : Enable Scaled Duplication mode. The second extruder will duplicate the first extruder's
|
||||
* movement similar to the M605 S2 mode. However, the second extruder will be producing
|
||||
* a mirror image of the first extruder. The initial x-offset and temperature differential are
|
||||
* a scaled image of the first extruder. The initial x-offset and temperature differential are
|
||||
* set with M605 S2 [Xnnn] [Rmmm] and then followed with a M605 S3 to start the mirrored movement.
|
||||
* M605 W : IDEX What? command.
|
||||
*
|
||||
@ -56,7 +56,27 @@
|
||||
planner.synchronize();
|
||||
|
||||
if (parser.seen('S')) {
|
||||
const DualXMode previous_mode = dual_x_carriage_mode;
|
||||
|
||||
dual_x_carriage_mode = (DualXMode)parser.value_byte();
|
||||
scaled_duplication_mode = false;
|
||||
|
||||
if (dual_x_carriage_mode == DXC_SCALED_DUPLICATION_MODE) {
|
||||
if (previous_mode != DXC_DUPLICATION_MODE) {
|
||||
SERIAL_ECHOPGM("Printer must be in DXC_DUPLICATION_MODE prior to \n");
|
||||
SERIAL_ECHOPGM("specifying DXC_SCALED_DUPLICATION_MODE.\n");
|
||||
dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
|
||||
return;
|
||||
}
|
||||
scaled_duplication_mode = true;
|
||||
stepper.set_directions();
|
||||
float x_jog = current_position[X_AXIS] - .1;
|
||||
for (uint8_t i = 2; --i;) {
|
||||
planner.buffer_line(x_jog, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate_mm_s, 0);
|
||||
x_jog += .1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
switch (dual_x_carriage_mode) {
|
||||
case DXC_FULL_CONTROL_MODE:
|
||||
@ -73,6 +93,7 @@
|
||||
}
|
||||
active_extruder_parked = false;
|
||||
extruder_duplication_enabled = false;
|
||||
stepper.set_directions();
|
||||
delayed_move_time = 0;
|
||||
}
|
||||
else if (!parser.seen('W')) // if no S or W parameter, the DXC mode gets reset to the user's default
|
||||
@ -82,21 +103,45 @@
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM("IDEX mode: ");
|
||||
switch (dual_x_carriage_mode) {
|
||||
case DXC_FULL_CONTROL_MODE: SERIAL_ECHOPGM("DXC_FULL_CONTROL_MODE"); break;
|
||||
case DXC_AUTO_PARK_MODE: SERIAL_ECHOPGM("DXC_AUTO_PARK_MODE"); break;
|
||||
case DXC_DUPLICATION_MODE: SERIAL_ECHOPGM("DXC_DUPLICATION_MODE"); break;
|
||||
case DXC_FULL_CONTROL_MODE: SERIAL_ECHOPGM("DXC_FULL_CONTROL_MODE"); break;
|
||||
case DXC_AUTO_PARK_MODE: SERIAL_ECHOPGM("DXC_AUTO_PARK_MODE"); break;
|
||||
case DXC_DUPLICATION_MODE: SERIAL_ECHOPGM("DXC_DUPLICATION_MODE"); break;
|
||||
case DXC_SCALED_DUPLICATION_MODE: SERIAL_ECHOPGM("DXC_SCALED_DUPLICATION_MODE"); break;
|
||||
}
|
||||
SERIAL_ECHOPAIR("\nActive Ext: ", int(active_extruder));
|
||||
if (!active_extruder_parked) SERIAL_ECHOPGM(" NOT ");
|
||||
SERIAL_ECHOLNPGM(" parked.");
|
||||
SERIAL_ECHOPAIR("active_extruder_x_pos: ", current_position[X_AXIS]);
|
||||
SERIAL_ECHOPAIR(" inactive_extruder_x_pos: ", inactive_extruder_x_pos);
|
||||
SERIAL_ECHOPAIR("\nT0 Home X: ", x_home_pos(0));
|
||||
SERIAL_ECHOPAIR("\nT1 Home X: ", x_home_pos(1));
|
||||
SERIAL_ECHOPGM(" parked.");
|
||||
SERIAL_ECHOPAIR("\nactive_extruder_x_pos: ", current_position[X_AXIS]);
|
||||
SERIAL_ECHOPAIR("\ninactive_extruder_x_pos: ", inactive_extruder_x_pos);
|
||||
SERIAL_ECHOPAIR("\nextruder_duplication_enabled: ", int(extruder_duplication_enabled));
|
||||
SERIAL_ECHOPAIR("\nduplicate_extruder_x_offset: ", duplicate_extruder_x_offset);
|
||||
SERIAL_ECHOPAIR("\nduplicate_extruder_temp_offset: ", duplicate_extruder_temp_offset);
|
||||
SERIAL_ECHOPAIR("\ndelayed_move_time: ", delayed_move_time);
|
||||
SERIAL_ECHOPAIR("\nX1 Home X: ", x_home_pos(0));
|
||||
SERIAL_ECHOPAIR("\nX1_MIN_POS=", int(X1_MIN_POS));
|
||||
SERIAL_ECHOPAIR("\nX1_MAX_POS=", int(X1_MAX_POS));
|
||||
SERIAL_ECHOPAIR("\nX2 Home X: ", x_home_pos(1));
|
||||
SERIAL_ECHOPAIR("\nX2_MIN_POS=", int(X2_MIN_POS));
|
||||
SERIAL_ECHOPAIR("\nX2_MAX_POS=", int(X2_MAX_POS));
|
||||
SERIAL_ECHOPAIR("\nX2_HOME_DIR=", int(X2_HOME_DIR));
|
||||
SERIAL_ECHOPAIR("\nX2_HOME_POS=", int(X2_HOME_POS));
|
||||
SERIAL_ECHOPAIR("\nDEFAULT_DUAL_X_CARRIAGE_MODE=", STRINGIFY(DEFAULT_DUAL_X_CARRIAGE_MODE));
|
||||
SERIAL_ECHOPAIR("\nTOOLCHANGE_PARK_ZLIFT=", float(TOOLCHANGE_PARK_ZLIFT));
|
||||
SERIAL_ECHOPAIR("\nTOOLCHANGE_UNPARK_ZLIFT=", float(TOOLCHANGE_UNPARK_ZLIFT));
|
||||
SERIAL_ECHOPAIR("\nDEFAULT_DUPLICATION_X_OFFSET=", int(DEFAULT_DUPLICATION_X_OFFSET));
|
||||
|
||||
SERIAL_EOL();
|
||||
for (uint8_t i = 0; i < 2; i++) {
|
||||
SERIAL_ECHOPAIR(" nozzle:", int(i));
|
||||
LOOP_XYZ(j) {
|
||||
SERIAL_ECHOPGM(" hotend_offset[");
|
||||
SERIAL_CHAR(axis_codes[j]);
|
||||
SERIAL_ECHOPAIR("_AXIS][", int(i));
|
||||
SERIAL_ECHOPAIR("]=", hotend_offset[j][i]);
|
||||
}
|
||||
SERIAL_EOL();
|
||||
}
|
||||
SERIAL_EOL();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ void GcodeSuite::M7219() {
|
||||
SERIAL_ECHOPGM("led_line[");
|
||||
if (r < 10) SERIAL_CHAR(' ');
|
||||
SERIAL_ECHO(int(r));
|
||||
SERIAL_ECHO("]=");
|
||||
SERIAL_ECHOPGM("]=");
|
||||
for (uint8_t b = 8; b--;) SERIAL_CHAR('0' + TEST(max7219.led_line[r], b));
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
@ -56,6 +56,19 @@ void GcodeSuite::M600() {
|
||||
|
||||
if (get_target_extruder_from_command()) return;
|
||||
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
int8_t DXC_ext = target_extruder;
|
||||
if (!parser.seen('T')) { // If no tool index is specified, M600 was (probably) sent in response to filament runout.
|
||||
// In this case, for duplicating modes set DXC_ext to the extruder that ran out.
|
||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
||||
if (dxc_is_duplicating())
|
||||
DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_INVERTING) ? 1 : 0;
|
||||
#else
|
||||
DXC_ext = active_extruder;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
// Show initial "wait for start" message
|
||||
#if ENABLED(ULTIPANEL)
|
||||
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT, ADVANCED_PAUSE_MODE_PAUSE_PRINT, target_extruder);
|
||||
@ -63,14 +76,18 @@ void GcodeSuite::M600() {
|
||||
|
||||
#if ENABLED(HOME_BEFORE_FILAMENT_CHANGE)
|
||||
// Don't allow filament change without homing first
|
||||
if (axis_unhomed_error()) home_all_axes();
|
||||
if (axis_unhomed_error()) gcode.home_all_axes();
|
||||
#endif
|
||||
|
||||
#if EXTRUDERS > 1
|
||||
// Change toolhead if specified
|
||||
uint8_t active_extruder_before_filament_change = active_extruder;
|
||||
if (active_extruder != target_extruder)
|
||||
tool_change(target_extruder, 0, true);
|
||||
const uint8_t active_extruder_before_filament_change = active_extruder;
|
||||
if (
|
||||
active_extruder != target_extruder
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
&& dual_x_carriage_mode != DXC_DUPLICATION_MODE && dual_x_carriage_mode != DXC_SCALED_DUPLICATION_MODE
|
||||
#endif
|
||||
) tool_change(target_extruder, 0, true);
|
||||
#endif
|
||||
|
||||
// Initial retract before move to filament change position
|
||||
@ -113,9 +130,9 @@ void GcodeSuite::M600() {
|
||||
|
||||
const bool job_running = print_job_timer.isRunning();
|
||||
|
||||
if (pause_print(retract, park_point, unload_length, true)) {
|
||||
wait_for_filament_reload(beep_count);
|
||||
resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count);
|
||||
if (pause_print(retract, park_point, unload_length, true DXC_PASS)) {
|
||||
wait_for_filament_reload(beep_count DXC_PASS);
|
||||
resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count DXC_PASS);
|
||||
}
|
||||
|
||||
#if EXTRUDERS > 1
|
||||
|
@ -81,7 +81,11 @@ void GcodeSuite::M701() {
|
||||
const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS)
|
||||
: filament_change_load_length[active_extruder]);
|
||||
load_filament(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, FILAMENT_CHANGE_ALERT_BEEPS,
|
||||
true, thermalManager.wait_for_heating(target_extruder), ADVANCED_PAUSE_MODE_LOAD_FILAMENT);
|
||||
true, thermalManager.wait_for_heating(target_extruder), ADVANCED_PAUSE_MODE_LOAD_FILAMENT
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
, target_extruder
|
||||
#endif
|
||||
);
|
||||
|
||||
// Restore Z axis
|
||||
if (park_point.z > 0)
|
||||
|
@ -139,12 +139,12 @@ inline bool _enqueuecommand(const char* cmd, bool say_ok=false
|
||||
*/
|
||||
bool enqueue_and_echo_command(const char* cmd) {
|
||||
|
||||
//SERIAL_ECHO("enqueue_and_echo_command(\"");
|
||||
//SERIAL_ECHOPGM("enqueue_and_echo_command(\"");
|
||||
//SERIAL_ECHO(cmd);
|
||||
//SERIAL_ECHO("\") \n");
|
||||
//SERIAL_ECHOPGM("\") \n");
|
||||
|
||||
if (*cmd == 0 || *cmd == '\n' || *cmd == '\r') {
|
||||
//SERIAL_ECHO("Null command found... Did not queue!\n");
|
||||
//SERIAL_ECHOPGM("Null command found... Did not queue!\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ void GcodeSuite::M104() {
|
||||
thermalManager.setTargetHotend(temp, e);
|
||||
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && e == 0)
|
||||
if (dxc_is_duplicating() && e == 0)
|
||||
thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1);
|
||||
#endif
|
||||
|
||||
@ -103,7 +103,7 @@ void GcodeSuite::M109() {
|
||||
thermalManager.setTargetHotend(temp, target_extruder);
|
||||
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
|
||||
if (dxc_is_duplicating() && target_extruder == 0)
|
||||
thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1);
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user