Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/libslic3r/GCode/WipeTower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,11 @@ class WipeTowerWriter
return *this;
}

// Set extruder temperature, don't wait by default.
WipeTowerWriter& set_extruder_temp(int temperature, bool wait = false)
// Set extruder temperature, optionally wait.
WipeTowerWriter& set_extruder_temp(int temperature, bool wait)
{
m_gcode += "G4 S0\n"; // to flush planner queue
m_gcode += "M" + std::to_string(wait ? 109 : 104) + " S" + std::to_string(temperature) + "\n";
m_gcode += "M" + std::string(wait ? "109 R" : "104 S") + std::to_string(temperature) + "\n";
return *this;
}

Expand Down Expand Up @@ -639,6 +639,7 @@ void WipeTower::set_extruder(size_t idx, const PrintConfig& config)
m_filpar[idx].cooling_moves = config.filament_cooling_moves.get_at(idx);
m_filpar[idx].cooling_initial_speed = float(config.filament_cooling_initial_speed.get_at(idx));
m_filpar[idx].cooling_final_speed = float(config.filament_cooling_final_speed.get_at(idx));
m_filpar[idx].cooling_wait_for_temp = float(config.filament_cooling_wait_for_temp.get_at(idx));
m_filpar[idx].filament_stamping_loading_speed = float(config.filament_stamping_loading_speed.get_at(idx));
m_filpar[idx].filament_stamping_distance = float(config.filament_stamping_distance.get_at(idx));
}
Expand Down Expand Up @@ -898,13 +899,14 @@ void WipeTower::toolchange_Unload(

const bool do_ramming = m_semm || m_filpar[m_current_tool].multitool_ramming;
const bool cold_ramming = m_is_mk4mmu3;
const int cold_ramming_temperature = old_temperature - 20;

if (do_ramming) {
writer.travel(ramming_start_pos); // move to starting position
if (! m_is_mk4mmu3)
writer.disable_linear_advance();
if (cold_ramming)
writer.set_extruder_temp(old_temperature - 20);
writer.set_extruder_temp(cold_ramming_temperature, false);
}
else
writer.set_position(ramming_start_pos);
Expand Down Expand Up @@ -1042,9 +1044,13 @@ void WipeTower::toolchange_Unload(
writer.retract(stamping_dist_e, m_filpar[m_current_tool].unloading_speed * 60.f);
}

if (m_filpar[m_current_tool].cooling_wait_for_temp && i == number_of_cooling_moves - 2 && cold_ramming) {
// Do at least one full cycle at the cooling temperature before warming up again.
writer.set_extruder_temp(cold_ramming_temperature, true);
}
if (i == number_of_cooling_moves - 1 && change_temp_later) {
// If cold_ramming, the temperature change should be done before the last cooling move.
writer.set_extruder_temp(new_temperature, false);
writer.set_extruder_temp(new_temperature, false);
}

float speed = initial_speed + speed_inc * 2*i;
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/GCode/WipeTower.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ class WipeTower
int cooling_moves = 0;
float cooling_initial_speed = 0.f;
float cooling_final_speed = 0.f;
bool cooling_wait_for_temp = false;
float ramming_line_width_multiplicator = 1.f;
float ramming_step_multiplicator = 1.f;
float max_e_speed = std::numeric_limits<float>::max();
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Preset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ static std::vector<std::string> s_Preset_filament_options {
"filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_abrasive", "filament_notes", "filament_max_volumetric_speed", "filament_infill_max_speed", "filament_infill_max_crossing_speed",
"extrusion_multiplier", "filament_density", "filament_cost", "filament_spool_weight", "filament_loading_speed", "filament_loading_speed_start", "filament_load_time",
"filament_unloading_speed", "filament_unloading_speed_start", "filament_unload_time", "filament_toolchange_delay", "filament_cooling_moves", "filament_stamping_loading_speed", "filament_stamping_distance",
"filament_cooling_initial_speed", "filament_purge_multiplier", "filament_cooling_final_speed", "filament_ramming_parameters", "filament_minimal_purge_on_wipe_tower",
"filament_cooling_initial_speed", "filament_purge_multiplier", "filament_cooling_final_speed", "filament_cooling_wait_for_temp", "filament_ramming_parameters", "filament_minimal_purge_on_wipe_tower",
"filament_multitool_ramming", "filament_multitool_ramming_volume", "filament_multitool_ramming_flow",
"temperature", "idle_temperature", "first_layer_temperature", "bed_temperature", "first_layer_bed_temperature", "fan_always_on", "cooling", "cooling_slowdown_logic",
"cooling_perimeter_transition_distance", "min_fan_speed",
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|| opt_key == "filament_minimal_purge_on_wipe_tower"
|| opt_key == "filament_cooling_initial_speed"
|| opt_key == "filament_cooling_final_speed"
|| opt_key == "filament_cooling_wait_for_temp"
|| opt_key == "filament_purge_multiplier"
|| opt_key == "filament_ramming_parameters"
|| opt_key == "filament_multitool_ramming"
Expand Down
10 changes: 10 additions & 0 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,16 @@ void PrintConfigDef::init_fff_params()
def->mode = comExpert;
def->set_default_value(new ConfigOptionFloats { 3.4 });

def = this->add("filament_cooling_wait_for_temp", coBools);
def->label = L("Wait for the nozzle to cool before the last cooling move");
def->tooltip = L("During the cooling moves, the nozzle gradually approaches the optimal temperature for forming "
"a good filament tip prior to unloading. If the ambient temperature is too high, the nozzle may not "
"reach the desired temperature, resulting in stringing which can cause blobs or misloads later. "
"When checked, the printer will wait for the optimal temperature before finishing the last cooling "
"move to increase the chances of a good tip. This option requires at least 2 cooling moves to work.");
def->mode = comExpert;
def->set_default_value(new ConfigOptionBools { false });

def = this->add("filament_purge_multiplier", coPercents);
def->label = L("Purge volume multiplier");
def->tooltip = L("Purging volume on the wipe tower is determined by 'multimaterial_purging' in Printer Settings. "
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/PrintConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloats, filament_cooling_initial_speed))
((ConfigOptionFloats, filament_minimal_purge_on_wipe_tower))
((ConfigOptionFloats, filament_cooling_final_speed))
((ConfigOptionBools, filament_cooling_wait_for_temp))
((ConfigOptionPercents, filament_purge_multiplier))
((ConfigOptionStrings, filament_ramming_parameters))
((ConfigOptionBools, filament_multitool_ramming))
Expand Down
1 change: 1 addition & 0 deletions src/slic3r/GUI/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2323,6 +2323,7 @@ void TabFilament::build()
optgroup->append_single_option_line("filament_cooling_moves");
optgroup->append_single_option_line("filament_cooling_initial_speed");
optgroup->append_single_option_line("filament_cooling_final_speed");
optgroup->append_single_option_line("filament_cooling_wait_for_temp");
optgroup->append_single_option_line("filament_stamping_loading_speed");
optgroup->append_single_option_line("filament_stamping_distance");
optgroup->append_single_option_line("filament_purge_multiplier");
Expand Down