Enhance IDEX toolchange auto-return w/ no park, full control (#14117)

This commit is contained in:
InsanityAutomation
2019-06-23 21:00:48 -04:00
committed by Scott Lahteine
parent 3d9d72e8db
commit aa0383a83b
92 changed files with 137 additions and 42 deletions

View File

@ -242,7 +242,7 @@ void GcodeSuite::G28(const bool always_home_all) {
#if DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE)
const uint8_t old_tool_index = active_extruder;
#endif
tool_change(0, 0, true);
tool_change(0, true);
#endif
#if HAS_DUPLICATION_MODE
@ -428,7 +428,7 @@ void GcodeSuite::G28(const bool always_home_all) {
#else
#define NO_FETCH true
#endif
tool_change(old_tool_index, 0, NO_FETCH);
tool_change(old_tool_index, NO_FETCH);
#endif
ui.refresh();

View File

@ -80,7 +80,7 @@ void ac_home() {
void ac_setup(const bool reset_bed) {
#if HOTENDS > 1
tool_change(0, 0, true);
tool_change(0, true);
#endif
planner.synchronize();
@ -104,7 +104,7 @@ void ac_cleanup(
#endif
clean_up_after_endstop_or_probe_move();
#if HOTENDS > 1
tool_change(old_tool_index, 0, true);
tool_change(old_tool_index, true);
#endif
}

View File

@ -109,7 +109,7 @@ void GcodeSuite::G34() {
// Always home with tool 0 active
#if HOTENDS > 1
const uint8_t old_tool_index = active_extruder;
tool_change(0, 0, true);
tool_change(0, true);
#endif
#if HAS_DUPLICATION_MODE
@ -263,7 +263,7 @@ void GcodeSuite::G34() {
// Restore the active tool after homing
#if HOTENDS > 1
tool_change(old_tool_index, 0, (
tool_change(old_tool_index, (
#if ENABLED(PARKING_EXTRUDER)
false // Fetch the previous toolhead
#else

View File

@ -68,7 +68,6 @@ void GcodeSuite::T(const uint8_t tool_index) {
tool_change(
tool_index,
MMM_TO_MMS(parser.linearval('F')),
(tool_index == active_extruder) || parser.boolval('S')
);

View File

@ -109,7 +109,7 @@ void GcodeSuite::M600() {
#if ENABLED(DUAL_X_CARRIAGE)
&& dual_x_carriage_mode != DXC_DUPLICATION_MODE && dual_x_carriage_mode != DXC_MIRRORED_MODE
#endif
) tool_change(target_extruder, 0, false);
) tool_change(target_extruder, false);
#endif
// Initial retract before move to filament change position
@ -170,7 +170,7 @@ void GcodeSuite::M600() {
#if EXTRUDERS > 1
// Restore toolhead if it was changed
if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, 0, false);
tool_change(active_extruder_before_filament_change, false);
#endif
#if ENABLED(MIXING_EXTRUDER)

View File

@ -92,7 +92,7 @@ void GcodeSuite::M701() {
// Change toolhead if specified
uint8_t active_extruder_before_filament_change = active_extruder;
if (active_extruder != target_extruder)
tool_change(target_extruder, 0, false);
tool_change(target_extruder, false);
#endif
// Lift Z axis
@ -121,7 +121,7 @@ void GcodeSuite::M701() {
#if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2)
// Restore toolhead if it was changed
if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, 0, false);
tool_change(active_extruder_before_filament_change, false);
#endif
#if ENABLED(MIXING_EXTRUDER)
@ -191,7 +191,7 @@ void GcodeSuite::M702() {
// Change toolhead if specified
uint8_t active_extruder_before_filament_change = active_extruder;
if (active_extruder != target_extruder)
tool_change(target_extruder, 0, false);
tool_change(target_extruder, false);
#endif
// Lift Z axis
@ -205,7 +205,7 @@ void GcodeSuite::M702() {
#if EXTRUDERS > 1 && ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
if (!parser.seenval('T')) {
HOTEND_LOOP() {
if (e != active_extruder) tool_change(e, 0, false);
if (e != active_extruder) tool_change(e, false);
unload_filament(-fc_settings[e].unload_length, true, PAUSE_MODE_UNLOAD_FILAMENT);
}
}
@ -231,7 +231,7 @@ void GcodeSuite::M702() {
#if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2)
// Restore toolhead if it was changed
if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, 0, false);
tool_change(active_extruder_before_filament_change, false);
#endif
#if ENABLED(MIXING_EXTRUDER)