Followup fixes for singlenozzle, etc. (#17712)

This commit is contained in:
studiodyne
2020-04-28 07:21:23 +02:00
committed by GitHub
parent 4f003fc7a7
commit 89b17b5463
10 changed files with 61 additions and 34 deletions

View File

@ -47,11 +47,12 @@
bool toolchange_extruder_ready[EXTRUDERS];
#endif
#if ENABLED(SINGLENOZZLE)
#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
uint16_t singlenozzle_temp[EXTRUDERS];
#if HAS_FAN
uint8_t singlenozzle_fan_speed[EXTRUDERS];
#endif
#endif
#if BOTH(HAS_FAN, SINGLENOZZLE_STANDBY_FAN)
uint8_t singlenozzle_fan_speed[EXTRUDERS];
#endif
#if ENABLED(MAGNETIC_PARKING_EXTRUDER) || defined(EVENT_GCODE_AFTER_TOOLCHANGE) || (ENABLED(PARKING_EXTRUDER) && PARKING_EXTRUDER_SOLENOIDS_DELAY > 0)
@ -822,7 +823,7 @@ void tool_change_prime() {
#if TOOLCHANGE_FS_FAN >= 0 && HAS_FAN
const int16_t fansp = thermalManager.fan_speed[TOOLCHANGE_FS_FAN];
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
safe_delay(toolchange_settings.fan_time * 1000);
gcode.dwell(toolchange_settings.fan_time * 1000);
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = fansp;
#endif
@ -934,7 +935,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
// Z raise before retraction
#if ENABLED(TOOLCHANGE_ZRAISE_BEFORE_RETRACT) && DISABLED(SWITCHING_NOZZLE)
if (can_move_away && TERN1(toolchange_settings.enable_park)) {
if (can_move_away && TERN1(TOOLCHANGE_PARK, toolchange_settings.enable_park)) {
// Do a small lift to avoid the workpiece in the move back (below)
current_position.z += toolchange_settings.z_raise;
#if HAS_SOFTWARE_ENDSTOPS
@ -956,8 +957,12 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD);
if (ENABLED(SINGLENOZZLE)) { active_extruder = new_tool; return; }
}
else
unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed));
else {
// If first new tool, toolchange without unloading the old not initialized 'Just prime/init the new'
if (first_tool_is_primed)
unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed));
first_tool_is_primed = true; // The first new tool will be primed by toolchanging
}
}
#endif
@ -1059,15 +1064,16 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
const bool should_move = safe_to_move && !no_move && IsRunning();
if (should_move) {
#if ENABLED(SINGLENOZZLE)
#if HAS_FAN
singlenozzle_fan_speed[old_tool] = thermalManager.fan_speed[0];
thermalManager.fan_speed[0] = singlenozzle_fan_speed[new_tool];
#endif
#if BOTH(HAS_FAN, SINGLENOZZLE_STANDBY_FAN)
singlenozzle_fan_speed[old_tool] = thermalManager.fan_speed[0];
thermalManager.fan_speed[0] = singlenozzle_fan_speed[new_tool];
#endif
#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
singlenozzle_temp[old_tool] = thermalManager.temp_hotend[0].target;
if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) {
thermalManager.setTargetHotend(singlenozzle_temp[new_tool], 0);
TERN_(AUTOTEMP, planner.autotemp_update());
TERN_(HAS_DISPLAY, thermalManager.set_heating_message(0));
(void)thermalManager.wait_for_hotend(0, false); // Wait for heating or cooling
}
@ -1101,7 +1107,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
#if TOOLCHANGE_FS_FAN >= 0 && HAS_FAN
const int16_t fansp = thermalManager.fan_speed[TOOLCHANGE_FS_FAN];
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
safe_delay(toolchange_settings.fan_time * 1000);
gcode.dwell(toolchange_settings.fan_time * 1000);
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = fansp;
#endif
}
@ -1245,10 +1251,9 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
// Migrate the temperature to the new hotend
#if HAS_MULTI_HOTEND
thermalManager.setTargetHotend(thermalManager.degTargetHotend(active_extruder), migration_extruder);
#if HAS_DISPLAY
thermalManager.set_heating_message(0);
#endif
thermalManager.setTargetHotend(thermalManager.temp_hotend[active_extruder].target, migration_extruder);
TERN_(AUTOTEMP, planner.autotemp_update());
TERN_(HAS_DISPLAY, thermalManager.set_heating_message(0));
thermalManager.wait_for_hotend(active_extruder);
#endif