|
@@ -790,6 +790,11 @@ void tool_change_prime() {
|
790
|
790
|
|
791
|
791
|
const bool ok = TERN1(TOOLCHANGE_PARK, all_axes_homed() && toolchange_settings.enable_park);
|
792
|
792
|
|
|
793
|
+ #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
|
|
794
|
+ // Store and stop fan. Restored on any exit.
|
|
795
|
+ REMEMBER(fan, thermalManager.fan_speed[TOOLCHANGE_FS_FAN], 0);
|
|
796
|
+ #endif
|
|
797
|
+
|
793
|
798
|
// Z raise
|
794
|
799
|
if (ok) {
|
795
|
800
|
// Do a small lift to avoid the workpiece in the move back (below)
|
|
@@ -820,11 +825,10 @@ void tool_change_prime() {
|
820
|
825
|
#endif
|
821
|
826
|
|
822
|
827
|
// Cool down with fan
|
823
|
|
- #if TOOLCHANGE_FS_FAN >= 0 && HAS_FAN
|
824
|
|
- const int16_t fansp = thermalManager.fan_speed[TOOLCHANGE_FS_FAN];
|
|
828
|
+ #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
|
825
|
829
|
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
|
826
|
830
|
gcode.dwell(toolchange_settings.fan_time * 1000);
|
827
|
|
- thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = fansp;
|
|
831
|
+ thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0;
|
828
|
832
|
#endif
|
829
|
833
|
|
830
|
834
|
// Move back
|
|
@@ -933,6 +937,11 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
933
|
937
|
if (new_tool != old_tool) {
|
934
|
938
|
destination = current_position;
|
935
|
939
|
|
|
940
|
+ #if BOTH(TOOLCHANGE_FILAMENT_SWAP, HAS_FAN) && TOOLCHANGE_FS_FAN >= 0
|
|
941
|
+ // Store and stop fan. Restored on any exit.
|
|
942
|
+ REMEMBER(fan, thermalManager.fan_speed[TOOLCHANGE_FS_FAN], 0);
|
|
943
|
+ #endif
|
|
944
|
+
|
936
|
945
|
// Z raise before retraction
|
937
|
946
|
#if ENABLED(TOOLCHANGE_ZRAISE_BEFORE_RETRACT) && DISABLED(SWITCHING_NOZZLE)
|
938
|
947
|
if (can_move_away && TERN1(TOOLCHANGE_PARK, toolchange_settings.enable_park)) {
|
|
@@ -1104,11 +1113,10 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
1104
|
1113
|
#endif
|
1105
|
1114
|
|
1106
|
1115
|
// Cool down with fan
|
1107
|
|
- #if TOOLCHANGE_FS_FAN >= 0 && HAS_FAN
|
1108
|
|
- const int16_t fansp = thermalManager.fan_speed[TOOLCHANGE_FS_FAN];
|
|
1116
|
+ #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
|
1109
|
1117
|
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
|
1110
|
1118
|
gcode.dwell(toolchange_settings.fan_time * 1000);
|
1111
|
|
- thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = fansp;
|
|
1119
|
+ thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0;
|
1112
|
1120
|
#endif
|
1113
|
1121
|
}
|
1114
|
1122
|
#endif
|
|
@@ -1157,6 +1165,11 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
1157
|
1165
|
unscaled_e_move(toolchange_settings.extra_resume + TOOLCHANGE_FS_WIPE_RETRACT, MMM_TO_MMS(toolchange_settings.unretract_speed));
|
1158
|
1166
|
current_position.e = 0;
|
1159
|
1167
|
sync_plan_position_e(); // New extruder primed and set to 0
|
|
1168
|
+
|
|
1169
|
+ // Restart Fan
|
|
1170
|
+ #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
|
|
1171
|
+ RESTORE(fan);
|
|
1172
|
+ #endif
|
1160
|
1173
|
}
|
1161
|
1174
|
#endif
|
1162
|
1175
|
|
|
@@ -1257,6 +1270,9 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
1257
|
1270
|
thermalManager.wait_for_hotend(active_extruder);
|
1258
|
1271
|
#endif
|
1259
|
1272
|
|
|
1273
|
+ // Migrate Linear Advance K factor to the new extruder
|
|
1274
|
+ TERN_(LIN_ADVANCE, planner.extruder_advance_K[active_extruder] = planner.extruder_advance_K[migration_extruder]);
|
|
1275
|
+
|
1260
|
1276
|
// Perform the tool change
|
1261
|
1277
|
tool_change(migration_extruder);
|
1262
|
1278
|
|