From 0dba13d8629a80057ddf4acfb5df9db3be7b72a8 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 30 Jun 2023 14:36:18 +0200 Subject: [PATCH 01/25] First skinnydip implementation --- src/libslic3r/GCode/WipeTower.cpp | 24 +++++++++++++++++++-- src/libslic3r/GCode/WipeTower.hpp | 7 +++++++ src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 5 +++++ src/libslic3r/PrintConfig.cpp | 35 +++++++++++++++++++++++++++++++ src/libslic3r/PrintConfig.hpp | 5 +++++ src/slic3r/GUI/Tab.cpp | 5 +++++ 7 files changed, 80 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index a19371ac89..0d86abd3ec 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -613,6 +613,11 @@ 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].filament_skinnydip_move = config.filament_skinnydip_move.get_at(idx); + m_filpar[idx].filament_skinnydip_loading_speed = float(config.filament_skinnydip_loading_speed.get_at(idx)); + m_filpar[idx].filament_skinnydip_unloading_speed = float(config.filament_skinnydip_unloading_speed.get_at(idx)); + m_filpar[idx].filament_skinnydip_distance = float(config.filament_skinnydip_distance.get_at(idx)); + m_filpar[idx].filament_skinnydip_number_of_dips = config.filament_skinnydip_number_of_dips.get_at(idx); } m_filpar[idx].filament_area = float((M_PI/4.f) * pow(config.filament_diameter.get_at(idx), 2)); // all extruders are assumed to have the same filament diameter at this point @@ -959,17 +964,32 @@ void WipeTower::toolchange_Unload( // Cooling: const int& number_of_moves = m_filpar[m_current_tool].cooling_moves; - if (m_semm && number_of_moves > 0) { + if (m_semm && (number_of_moves > 0 || m_filpar[m_current_tool].filament_skinnydip_number_of_dips > 0)) { const float& initial_speed = m_filpar[m_current_tool].cooling_initial_speed; const float& final_speed = m_filpar[m_current_tool].cooling_final_speed; float speed_inc = (final_speed - initial_speed) / (2.f * number_of_moves - 1.f); + bool skinnydip_done = false; writer.suppress_preview() .travel(writer.x(), writer.y() + y_step); old_x = writer.x(); turning_point = xr-old_x > old_x-xl ? xr : xl; - for (int i=0; i s_Preset_print_options { static std::vector s_Preset_filament_options { "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_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_unloading_speed", "filament_unloading_speed_start", "filament_unload_time", "filament_toolchange_delay", "filament_cooling_moves", "filament_skinnydip_move", "filament_skinnydip_loading_speed", "filament_skinnydip_unloading_speed", "filament_skinnydip_distance", "filament_skinnydip_number_of_dips", "filament_cooling_initial_speed", "filament_cooling_final_speed", "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", "min_fan_speed", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index f69720d6d6..e5ac50e2e9 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -218,6 +218,11 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "filament_unloading_speed_start" || opt_key == "filament_toolchange_delay" || opt_key == "filament_cooling_moves" + || opt_key == "filament_skinnydip_number_of_dips" + || opt_key == "filament_skinnydip_move" + || opt_key == "filament_skinnydip_loading_speed" + || opt_key == "filament_skinnydip_unloading_speed" + || opt_key == "filament_skinnydip_distance" || opt_key == "filament_minimal_purge_on_wipe_tower" || opt_key == "filament_cooling_initial_speed" || opt_key == "filament_cooling_final_speed" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 4404aea7be..cb5c980ac7 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1093,6 +1093,41 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloats { 0. }); + def = this->add("filament_skinnydip_move", coInts); + def->label = L("ELIAS: Skinnydip is performed after N-th cooling move"); + def->tooltip = L("Zero - before cooling. Larger than number of cooling moves - after cooling."); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionInts { 0 }); + + def = this->add("filament_skinnydip_number_of_dips", coInts); + def->label = L("ELIAS: Number of skinnydips"); + def->tooltip = L(""); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionInts { 0 }); + + def = this->add("filament_skinnydip_loading_speed", coFloats); + def->label = L("ELIAS: Skinnydip loading speed"); + def->tooltip = L(""); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloats { 0. }); + + def = this->add("filament_skinnydip_unloading_speed", coFloats); + def->label = L("ELIAS: Skinnydip unloading speed"); + def->tooltip = L(""); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloats { 0. }); + + def = this->add("filament_skinnydip_distance", coFloats); + def->label = L("ELIAS: Skinnydip distance measured from the center of the cooling tube"); + def->tooltip = L(""); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloats { 0. }); + def = this->add("filament_cooling_moves", coInts); def->label = L("Number of cooling moves"); def->tooltip = L("Filament is cooled by being moved back and forth in the " diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index f1dc6b96a4..9ec88ec4f8 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -724,6 +724,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloats, filament_toolchange_delay)) ((ConfigOptionFloats, filament_unload_time)) ((ConfigOptionInts, filament_cooling_moves)) + ((ConfigOptionInts, filament_skinnydip_number_of_dips)) ((ConfigOptionFloats, filament_cooling_initial_speed)) ((ConfigOptionFloats, filament_minimal_purge_on_wipe_tower)) ((ConfigOptionFloats, filament_cooling_final_speed)) @@ -731,6 +732,10 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBools, filament_multitool_ramming)) ((ConfigOptionFloats, filament_multitool_ramming_volume)) ((ConfigOptionFloats, filament_multitool_ramming_flow)) + ((ConfigOptionInts, filament_skinnydip_move)) + ((ConfigOptionFloats, filament_skinnydip_loading_speed)) + ((ConfigOptionFloats, filament_skinnydip_unloading_speed)) + ((ConfigOptionFloats, filament_skinnydip_distance)) ((ConfigOptionBool, gcode_comments)) ((ConfigOptionEnum, gcode_flavor)) ((ConfigOptionEnum, gcode_label_objects)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index c0a232e85d..37fff78e58 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2269,6 +2269,11 @@ 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_skinnydip_number_of_dips"); + optgroup->append_single_option_line("filament_skinnydip_move"); + optgroup->append_single_option_line("filament_skinnydip_loading_speed"); + optgroup->append_single_option_line("filament_skinnydip_unloading_speed"); + optgroup->append_single_option_line("filament_skinnydip_distance"); create_line_with_widget(optgroup.get(), "filament_ramming_parameters", "", [this](wxWindow* parent) { auto ramming_dialog_btn = new wxButton(parent, wxID_ANY, _(L("Ramming settings"))+dots, wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); From 7325d8752f78465dfd03f74a888f4d6f47f41744 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Thu, 3 Aug 2023 16:03:37 +0200 Subject: [PATCH 02/25] Moving the extruder while skinnydipping --- src/libslic3r/GCode/WipeTower.cpp | 35 ++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 0d86abd3ec..051e88ea6b 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -291,6 +291,25 @@ public: return extrude_explicit(end_point, y(), loading_dist, x_speed * 60.f, false, false); } + // Loads filament while also moving towards given point in x-axis. Unlike the previous function, this one respects + // both the loading_speed and x_speed. Can shorten the move. + WipeTowerWriter& load_move_x_advanced_there_and_back(float farthest_x, float e_dist, float e_speed, float x_speed) + { + float old_x = x(); + float time = std::abs(e_dist / e_speed); // time that the whole move must take + float x_max_dist = std::abs(farthest_x - x()); // max x-distance that we can travel + float x_dist = x_speed * time; // totel x-distance to travel during the move + int n = int(x_dist / (2*x_max_dist) + 1.f); // how many there and back moves should we do + float r = 2*n*x_max_dist / x_dist; // actual/required dist if the move is not shortened + + float end_point = x() + (farthest_x > x() ? 1.f : -1.f) * x_max_dist / r; + for (int i=0; i 5) { + //writer.load_move_x_advanced_there_and_back(turning_point, dist_e-5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, 50); + float cent = writer.x(); + writer.load_move_x_advanced(turning_point, 0.5*(dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); + writer.load_move_x_advanced(cent, 0.5*(dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); + writer.travel(cent, writer.y()); + writer.load_move_x_advanced_there_and_back(turning_point, 5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); + } else + writer.load_move_x_advanced_there_and_back(turning_point, dist_e, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); + writer.load_move_x_advanced_there_and_back(turning_point, -dist_e, m_filpar[m_current_tool].filament_skinnydip_unloading_speed, 50); } skinnydip_done = true; } From cddfcb888f18cc13ebdc870cd5008383ec4bc44d Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 12 Jul 2023 14:14:50 +0200 Subject: [PATCH 03/25] Wipe tower: cold ramming --- src/libslic3r/GCode/WipeTower.cpp | 8 +++++++- src/libslic3r/GCode/WipeTower.hpp | 1 + src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 1 + src/libslic3r/PrintConfig.cpp | 7 +++++++ src/libslic3r/PrintConfig.hpp | 1 + src/slic3r/GUI/Tab.cpp | 1 + 7 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 051e88ea6b..fb04b14f7b 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -633,6 +633,7 @@ void WipeTower::set_extruder(size_t idx, const PrintConfig& config) 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].filament_skinnydip_move = config.filament_skinnydip_move.get_at(idx); + m_filpar[idx].filament_cold_ramming = config.filament_cold_ramming.get_at(idx); m_filpar[idx].filament_skinnydip_loading_speed = float(config.filament_skinnydip_loading_speed.get_at(idx)); m_filpar[idx].filament_skinnydip_unloading_speed = float(config.filament_skinnydip_unloading_speed.get_at(idx)); m_filpar[idx].filament_skinnydip_distance = float(config.filament_skinnydip_distance.get_at(idx)); @@ -930,6 +931,11 @@ void WipeTower::toolchange_Unload( } + bool cold_ramming = m_filpar[m_current_tool].filament_cold_ramming; + + if (cold_ramming) + writer.set_extruder_temp(0, false); + // now the ramming itself: while (do_ramming && i < m_filpar[m_current_tool].ramming_speed.size()) { @@ -973,7 +979,7 @@ void WipeTower::toolchange_Unload( // be already set and there is no need to change anything. Also, the temperature could be changed // for wrong extruder. if (m_semm) { - if (new_temperature != 0 && (new_temperature != m_old_temperature || is_first_layer()) ) { // Set the extruder temperature, but don't wait. + if (new_temperature != 0 && (new_temperature != m_old_temperature || is_first_layer() || cold_ramming) ) { // Set the extruder temperature, but don't wait. // If the required temperature is the same as last time, don't emit the M104 again (if user adjusted the value, it would be reset) // However, always change temperatures on the first layer (this is to avoid issues with priming lines turned off). writer.set_extruder_temp(new_temperature, false); diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 69207f8396..b0f8043c4d 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -238,6 +238,7 @@ public: float delay = 0.f ; int filament_skinnydip_move = 0; + bool filament_cold_ramming = false; float filament_skinnydip_loading_speed = 0.f; float filament_skinnydip_unloading_speed = 0.f; float filament_skinnydip_distance = 0.f; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index e8763f1111..60181ee33d 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -478,7 +478,7 @@ static std::vector s_Preset_print_options { static std::vector s_Preset_filament_options { "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_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_skinnydip_move", "filament_skinnydip_loading_speed", "filament_skinnydip_unloading_speed", "filament_skinnydip_distance", "filament_skinnydip_number_of_dips", + "filament_unloading_speed", "filament_unloading_speed_start", "filament_unload_time", "filament_toolchange_delay", "filament_cooling_moves", "filament_skinnydip_move", "filament_cold_ramming", "filament_skinnydip_loading_speed", "filament_skinnydip_unloading_speed", "filament_skinnydip_distance", "filament_skinnydip_number_of_dips", "filament_cooling_initial_speed", "filament_cooling_final_speed", "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", "min_fan_speed", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index e5ac50e2e9..4995177dd7 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -220,6 +220,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "filament_cooling_moves" || opt_key == "filament_skinnydip_number_of_dips" || opt_key == "filament_skinnydip_move" + || opt_key == "filament_cold_ramming" || opt_key == "filament_skinnydip_loading_speed" || opt_key == "filament_skinnydip_unloading_speed" || opt_key == "filament_skinnydip_distance" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index cb5c980ac7..f1a6d88b21 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1093,6 +1093,13 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloats { 0. }); + def = this->add("filament_cold_ramming", coBools); + def->label = L("ELIAS: Cold ramming"); + def->tooltip = L(""); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionBools { false }); + def = this->add("filament_skinnydip_move", coInts); def->label = L("ELIAS: Skinnydip is performed after N-th cooling move"); def->tooltip = L("Zero - before cooling. Larger than number of cooling moves - after cooling."); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 9ec88ec4f8..00c3956609 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -733,6 +733,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloats, filament_multitool_ramming_volume)) ((ConfigOptionFloats, filament_multitool_ramming_flow)) ((ConfigOptionInts, filament_skinnydip_move)) + ((ConfigOptionBools, filament_cold_ramming)) ((ConfigOptionFloats, filament_skinnydip_loading_speed)) ((ConfigOptionFloats, filament_skinnydip_unloading_speed)) ((ConfigOptionFloats, filament_skinnydip_distance)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 37fff78e58..96d47cafdc 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2274,6 +2274,7 @@ void TabFilament::build() optgroup->append_single_option_line("filament_skinnydip_loading_speed"); optgroup->append_single_option_line("filament_skinnydip_unloading_speed"); optgroup->append_single_option_line("filament_skinnydip_distance"); + optgroup->append_single_option_line("filament_cold_ramming"); create_line_with_widget(optgroup.get(), "filament_ramming_parameters", "", [this](wxWindow* parent) { auto ramming_dialog_btn = new wxButton(parent, wxID_ANY, _(L("Ramming settings"))+dots, wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); From 61e20a8cfa87a9254bf44dd06a704f85ba78c419 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Mon, 7 Aug 2023 11:07:14 +0200 Subject: [PATCH 04/25] Wipe tower: skinnydip_extra_move, skinnydip_delay --- src/libslic3r/GCode/WipeTower.cpp | 11 ++++++++++- src/libslic3r/GCode/WipeTower.hpp | 2 ++ src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 2 ++ src/libslic3r/PrintConfig.cpp | 16 ++++++++++++++++ src/libslic3r/PrintConfig.hpp | 2 ++ src/slic3r/GUI/Tab.cpp | 2 ++ 7 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index fb04b14f7b..25ecfea6a5 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -638,6 +638,8 @@ void WipeTower::set_extruder(size_t idx, const PrintConfig& config) m_filpar[idx].filament_skinnydip_unloading_speed = float(config.filament_skinnydip_unloading_speed.get_at(idx)); m_filpar[idx].filament_skinnydip_distance = float(config.filament_skinnydip_distance.get_at(idx)); m_filpar[idx].filament_skinnydip_number_of_dips = config.filament_skinnydip_number_of_dips.get_at(idx); + m_filpar[idx].filament_skinnydip_extra_move = float(config.filament_skinnydip_extra_move.get_at(idx)); + m_filpar[idx].filament_skinnydip_delay = float(config.filament_skinnydip_delay.get_at(idx)); } m_filpar[idx].filament_area = float((M_PI/4.f) * pow(config.filament_diameter.get_at(idx), 2)); // all extruders are assumed to have the same filament diameter at this point @@ -1004,8 +1006,10 @@ void WipeTower::toolchange_Unload( // Skinnydip: if (! skinnydip_done && (m_filpar[m_current_tool].filament_skinnydip_move == i || i == number_of_moves)) { + float dist_e = m_filpar[m_current_tool].filament_skinnydip_distance + m_cooling_tube_length / 2.f; + for (int s=0; s 5) { @@ -1018,6 +1022,11 @@ void WipeTower::toolchange_Unload( } else writer.load_move_x_advanced_there_and_back(turning_point, dist_e, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); writer.load_move_x_advanced_there_and_back(turning_point, -dist_e, m_filpar[m_current_tool].filament_skinnydip_unloading_speed, 50); + + writer.wait(m_filpar[m_current_tool].filament_skinnydip_delay); + if (m_filpar[m_current_tool].filament_skinnydip_extra_move != 0.f) + dist_e += m_filpar[m_current_tool].filament_skinnydip_extra_move; + } skinnydip_done = true; } diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index b0f8043c4d..e94563dfe2 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -242,6 +242,8 @@ public: float filament_skinnydip_loading_speed = 0.f; float filament_skinnydip_unloading_speed = 0.f; float filament_skinnydip_distance = 0.f; + float filament_skinnydip_extra_move = 0.f; + float filament_skinnydip_delay = 0.f; int filament_skinnydip_number_of_dips = 0; int cooling_moves = 0; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 60181ee33d..4f5498a672 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -478,7 +478,7 @@ static std::vector s_Preset_print_options { static std::vector s_Preset_filament_options { "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_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_skinnydip_move", "filament_cold_ramming", "filament_skinnydip_loading_speed", "filament_skinnydip_unloading_speed", "filament_skinnydip_distance", "filament_skinnydip_number_of_dips", + "filament_unloading_speed", "filament_unloading_speed_start", "filament_unload_time", "filament_toolchange_delay", "filament_skinnydip_extra_move", "filament_skinnydip_delay", "filament_cooling_moves", "filament_skinnydip_move", "filament_cold_ramming", "filament_skinnydip_loading_speed", "filament_skinnydip_unloading_speed", "filament_skinnydip_distance", "filament_skinnydip_number_of_dips", "filament_cooling_initial_speed", "filament_cooling_final_speed", "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", "min_fan_speed", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 4995177dd7..93685f842b 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -217,6 +217,8 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "filament_unloading_speed" || opt_key == "filament_unloading_speed_start" || opt_key == "filament_toolchange_delay" + || opt_key == "filament_skinnydip_extra_move" + || opt_key == "filament_skinnydip_delay" || opt_key == "filament_cooling_moves" || opt_key == "filament_skinnydip_number_of_dips" || opt_key == "filament_skinnydip_move" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index f1a6d88b21..0ac216b036 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1135,6 +1135,22 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloats { 0. }); + def = this->add("filament_skinnydip_extra_move", coFloats); + def->label = L("ELIAS Skinnydip extension per dip"); + def->tooltip = L("..."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloats { 0. }); + + def = this->add("filament_skinnydip_delay", coFloats); + def->label = L("ELIAS Skinnydip delay"); + def->tooltip = L("..."); + def->sidetext = L("s"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloats { 0. }); + def = this->add("filament_cooling_moves", coInts); def->label = L("Number of cooling moves"); def->tooltip = L("Filament is cooled by being moved back and forth in the " diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 00c3956609..5050991d51 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -737,6 +737,8 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloats, filament_skinnydip_loading_speed)) ((ConfigOptionFloats, filament_skinnydip_unloading_speed)) ((ConfigOptionFloats, filament_skinnydip_distance)) + ((ConfigOptionFloats, filament_skinnydip_extra_move)) + ((ConfigOptionFloats, filament_skinnydip_delay)) ((ConfigOptionBool, gcode_comments)) ((ConfigOptionEnum, gcode_flavor)) ((ConfigOptionEnum, gcode_label_objects)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 96d47cafdc..d8ebc8ac57 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2274,6 +2274,8 @@ void TabFilament::build() optgroup->append_single_option_line("filament_skinnydip_loading_speed"); optgroup->append_single_option_line("filament_skinnydip_unloading_speed"); optgroup->append_single_option_line("filament_skinnydip_distance"); + optgroup->append_single_option_line("filament_skinnydip_extra_move"); + optgroup->append_single_option_line("filament_skinnydip_delay"); optgroup->append_single_option_line("filament_cold_ramming"); create_line_with_widget(optgroup.get(), "filament_ramming_parameters", "", [this](wxWindow* parent) { From 79b8b180fc0d432f55e1a5a97881c21352ff9c20 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 13 Jun 2023 08:38:07 +0200 Subject: [PATCH 05/25] RammingChart: increase y-range, allow uniform dragging (while holding Ctrl) --- src/slic3r/GUI/RammingChart.cpp | 11 +++++++++-- src/slic3r/GUI/RammingChart.hpp | 16 +++++++--------- src/slic3r/GUI/WipeTowerDialog.cpp | 16 +++++++++++++--- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/slic3r/GUI/RammingChart.cpp b/src/slic3r/GUI/RammingChart.cpp index 54ea436eaa..b1a1ed8c73 100644 --- a/src/slic3r/GUI/RammingChart.cpp +++ b/src/slic3r/GUI/RammingChart.cpp @@ -115,6 +115,7 @@ void Chart::mouse_right_button_clicked(wxMouseEvent& event) { void Chart::mouse_clicked(wxMouseEvent& event) { + m_uniform = (event.GetModifiers() == wxMOD_CONTROL); wxPoint point = event.GetPosition(); int button_index = which_button_is_clicked(point); if ( button_index != -1) { @@ -136,7 +137,13 @@ void Chart::mouse_moved(wxMouseEvent& event) { } int delta_x = pos.x - m_previous_mouse.x; int delta_y = pos.y - m_previous_mouse.y; - m_dragged->move(fixed_x?0:double(delta_x)/m_rect.GetWidth() * visible_area.m_width,-double(delta_y)/m_rect.GetHeight() * visible_area.m_height); + + if (m_uniform) + for (ButtonToDrag& b : m_buttons) + b.move(fixed_x?0:double(delta_x)/m_rect.GetWidth() * visible_area.m_width, m_dragged->get_pos().m_y - b.get_pos().m_y + -double(delta_y)/m_rect.GetHeight() * visible_area.m_height); + else + m_dragged->move(fixed_x?0:double(delta_x)/m_rect.GetWidth() * visible_area.m_width, -double(delta_y)/m_rect.GetHeight() * visible_area.m_height); + m_previous_mouse = pos; recalculate_line(); } @@ -263,7 +270,7 @@ std::vector Chart::get_ramming_speed(float sampling) const { std::vector speeds_out; const int number_of_samples = std::round( visible_area.m_width / sampling); - if (number_of_samples>0) { + if (number_of_samples>0 && !m_line_to_draw.empty()) { const int dx = (m_line_to_draw.size()-1) / number_of_samples; for (int j=0;j0) for (const auto& pair : initial_buttons) @@ -31,7 +31,7 @@ public: recalculate_line(); } void set_xy_range(float x,float y) { - x = int(x/0.5) * 0.5; + x = int(x/0.25) * 0.25; if (x>=0) visible_area.SetRight(x); if (y>=0) visible_area.SetBottom(y); recalculate_line(); @@ -104,20 +104,18 @@ private: } return (-1); } - - + void recalculate_line(); - void recalculate_volume(); - - + wxRect m_rect; // rectangle on screen the chart is mapped into (screen coordinates) wxPoint m_previous_mouse; std::vector m_buttons; std::vector m_line_to_draw; wxRect2DDouble visible_area; ButtonToDrag* m_dragged = nullptr; - float m_total_volume = 0.f; - + float m_total_volume = 0.f; + + bool m_uniform = false; // testing only }; diff --git a/src/slic3r/GUI/WipeTowerDialog.cpp b/src/slic3r/GUI/WipeTowerDialog.cpp index 3b74c10910..da56e2c305 100644 --- a/src/slic3r/GUI/WipeTowerDialog.cpp +++ b/src/slic3r/GUI/WipeTowerDialog.cpp @@ -8,6 +8,7 @@ #include "BitmapCache.hpp" #include "GUI.hpp" #include "I18N.hpp" +#include "slic3r/GUI/format.hpp" #include "GUI_App.hpp" #include "MsgDialog.hpp" @@ -109,11 +110,11 @@ RammingPanel::RammingPanel(wxWindow* parent, const std::string& parameters) #endif sizer_chart->Add(m_chart, 0, wxALL, 5); - m_widget_time = new ::SpinInputDouble(this,"", wxEmptyString, wxDefaultPosition, wxSize(ITEM_WIDTH(), -1), style, 0., 5., 3., 0.5); + m_widget_time = new ::SpinInputDouble(this,"", wxEmptyString, wxDefaultPosition, wxSize(ITEM_WIDTH(), -1), style, 0., 5., 3., 0.25); m_widget_time->SetDigits(2); m_widget_volume = new ::SpinInput(this,"",wxEmptyString,wxDefaultPosition,wxSize(ITEM_WIDTH(), -1),style,0,10000,0); - m_widget_ramming_line_width_multiplicator = new ::SpinInput(this,"",wxEmptyString,wxDefaultPosition,wxSize(ITEM_WIDTH(), -1),style,10,200,100); - m_widget_ramming_step_multiplicator = new ::SpinInput(this,"",wxEmptyString,wxDefaultPosition,wxSize(ITEM_WIDTH(), -1),style,10,200,100); + m_widget_ramming_line_width_multiplicator = new ::SpinInput(this,"",wxEmptyString,wxDefaultPosition,wxSize(ITEM_WIDTH(), -1),style,10,300,100); + m_widget_ramming_step_multiplicator = new ::SpinInput(this,"",wxEmptyString,wxDefaultPosition,wxSize(ITEM_WIDTH(), -1),style,10,300,100); #ifdef _WIN32 update_ui(m_widget_time->GetText()); @@ -133,6 +134,15 @@ RammingPanel::RammingPanel(wxWindow* parent, const std::string& parameters) gsizer_param->Add(m_widget_ramming_line_width_multiplicator); gsizer_param->Add(new wxStaticText(this, wxID_ANY, wxString(_(L("Ramming line spacing")) + " (%):")), 0, wxALIGN_CENTER_VERTICAL); gsizer_param->Add(m_widget_ramming_step_multiplicator); + gsizer_param->AddSpacer(40); + gsizer_param->AddSpacer(40); + + std::string ctrl_str = shortkey_ctrl_prefix(); + if (! ctrl_str.empty() && ctrl_str.back() == '+') + ctrl_str.pop_back(); + // TRN: The placeholder expands to Ctrl or Cmd (on macOS). + gsizer_param->Add(new wxStaticText(this, wxID_ANY, format_wxstr(_L("For constant flow rate, hold %1% while dragging."), ctrl_str)), 0, wxALIGN_CENTER_VERTICAL); + sizer_param->Add(gsizer_param, 0, wxTOP, scale(10)); From a75cb5f7873087d3be93a4deaa31c0197cd26f7d Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Mon, 14 Aug 2023 16:26:46 +0200 Subject: [PATCH 06/25] Allow negative skinnydip extension per dip --- src/libslic3r/PrintConfig.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 0ac216b036..5f762f6b48 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1139,7 +1139,6 @@ void PrintConfigDef::init_fff_params() def->label = L("ELIAS Skinnydip extension per dip"); def->tooltip = L("..."); def->sidetext = L("mm"); - def->min = 0; def->mode = comExpert; def->set_default_value(new ConfigOptionFloats { 0. }); From 18150a82d9b52783e704cdb6aa43fc84e1409656 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 20 Dec 2023 15:03:00 +0100 Subject: [PATCH 07/25] Wipe tower: add G4 S0 before a temp change G-code --- src/libslic3r/GCode/WipeTower.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 25ecfea6a5..8e785d18de 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -352,6 +352,7 @@ public: // Set extruder temperature, don't wait by default. WipeTowerWriter& set_extruder_temp(int temperature, bool wait = false) { + m_gcode += "G4 S0\n"; // to flush planner queue m_gcode += "M" + std::to_string(wait ? 109 : 104) + " S" + std::to_string(temperature) + "\n"; return *this; } From d497757a7d2087508830cc8d570cb285563dbd87 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 20 Dec 2023 15:06:13 +0100 Subject: [PATCH 08/25] Wipe tower: remove extra skinnydip parameters --- src/libslic3r/GCode/WipeTower.cpp | 55 +++++++++++-------------------- src/libslic3r/GCode/WipeTower.hpp | 4 --- src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 4 --- src/libslic3r/PrintConfig.cpp | 29 ---------------- src/libslic3r/PrintConfig.hpp | 4 --- src/slic3r/GUI/Tab.cpp | 4 --- 7 files changed, 20 insertions(+), 82 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 8e785d18de..36da0e821d 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -633,14 +633,10 @@ 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].filament_skinnydip_move = config.filament_skinnydip_move.get_at(idx); - m_filpar[idx].filament_cold_ramming = config.filament_cold_ramming.get_at(idx); m_filpar[idx].filament_skinnydip_loading_speed = float(config.filament_skinnydip_loading_speed.get_at(idx)); m_filpar[idx].filament_skinnydip_unloading_speed = float(config.filament_skinnydip_unloading_speed.get_at(idx)); m_filpar[idx].filament_skinnydip_distance = float(config.filament_skinnydip_distance.get_at(idx)); - m_filpar[idx].filament_skinnydip_number_of_dips = config.filament_skinnydip_number_of_dips.get_at(idx); m_filpar[idx].filament_skinnydip_extra_move = float(config.filament_skinnydip_extra_move.get_at(idx)); - m_filpar[idx].filament_skinnydip_delay = float(config.filament_skinnydip_delay.get_at(idx)); } m_filpar[idx].filament_area = float((M_PI/4.f) * pow(config.filament_diameter.get_at(idx), 2)); // all extruders are assumed to have the same filament diameter at this point @@ -934,11 +930,6 @@ void WipeTower::toolchange_Unload( } - bool cold_ramming = m_filpar[m_current_tool].filament_cold_ramming; - - if (cold_ramming) - writer.set_extruder_temp(0, false); - // now the ramming itself: while (do_ramming && i < m_filpar[m_current_tool].ramming_speed.size()) { @@ -982,7 +973,7 @@ void WipeTower::toolchange_Unload( // be already set and there is no need to change anything. Also, the temperature could be changed // for wrong extruder. if (m_semm) { - if (new_temperature != 0 && (new_temperature != m_old_temperature || is_first_layer() || cold_ramming) ) { // Set the extruder temperature, but don't wait. + if (new_temperature != 0 && (new_temperature != m_old_temperature || is_first_layer()) ) { // Set the extruder temperature, but don't wait. // If the required temperature is the same as last time, don't emit the M104 again (if user adjusted the value, it would be reset) // However, always change temperatures on the first layer (this is to avoid issues with priming lines turned off). writer.set_extruder_temp(new_temperature, false); @@ -992,49 +983,41 @@ void WipeTower::toolchange_Unload( // Cooling: const int& number_of_moves = m_filpar[m_current_tool].cooling_moves; - if (m_semm && (number_of_moves > 0 || m_filpar[m_current_tool].filament_skinnydip_number_of_dips > 0)) { + if (m_semm && number_of_moves > 0) { const float& initial_speed = m_filpar[m_current_tool].cooling_initial_speed; const float& final_speed = m_filpar[m_current_tool].cooling_final_speed; float speed_inc = (final_speed - initial_speed) / (2.f * number_of_moves - 1.f); - bool skinnydip_done = false; writer.suppress_preview() .travel(writer.x(), writer.y() + y_step); old_x = writer.x(); turning_point = xr-old_x > old_x-xl ? xr : xl; - for (int i=0; i<=number_of_moves; ++i) { // the last one is for skinnydip + for (int i=0; i0 && m_filpar[m_current_tool].filament_skinnydip_distance != 0) { float dist_e = m_filpar[m_current_tool].filament_skinnydip_distance + m_cooling_tube_length / 2.f; - for (int s=0; s 5) { - //writer.load_move_x_advanced_there_and_back(turning_point, dist_e-5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, 50); - float cent = writer.x(); - writer.load_move_x_advanced(turning_point, 0.5*(dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); - writer.load_move_x_advanced(cent, 0.5*(dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); - writer.travel(cent, writer.y()); - writer.load_move_x_advanced_there_and_back(turning_point, 5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); - } else - writer.load_move_x_advanced_there_and_back(turning_point, dist_e, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); - writer.load_move_x_advanced_there_and_back(turning_point, -dist_e, m_filpar[m_current_tool].filament_skinnydip_unloading_speed, 50); + // Only last 5mm will be done with the fast x travel. The point is to spread possible blobs + // along the whole wipe tower. + if (dist_e > 5) { + //writer.load_move_x_advanced_there_and_back(turning_point, dist_e-5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, 50); + float cent = writer.x(); + writer.load_move_x_advanced(turning_point, 0.5*(dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); + writer.load_move_x_advanced(cent, 0.5*(dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); + writer.travel(cent, writer.y()); + writer.load_move_x_advanced_there_and_back(turning_point, 5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); + } else + writer.load_move_x_advanced_there_and_back(turning_point, dist_e, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); + writer.load_move_x_advanced_there_and_back(turning_point, -dist_e, m_filpar[m_current_tool].filament_skinnydip_unloading_speed, 50); - writer.wait(m_filpar[m_current_tool].filament_skinnydip_delay); - if (m_filpar[m_current_tool].filament_skinnydip_extra_move != 0.f) - dist_e += m_filpar[m_current_tool].filament_skinnydip_extra_move; - - } - skinnydip_done = true; + if (m_filpar[m_current_tool].filament_skinnydip_extra_move != 0.f) + dist_e += m_filpar[m_current_tool].filament_skinnydip_extra_move; } if (i == number_of_moves) break; - float speed = initial_speed + speed_inc * 2*i; writer.load_move_x_advanced(turning_point, m_cooling_tube_length, speed); speed += speed_inc; diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index e94563dfe2..608e9849c5 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -237,14 +237,10 @@ public: float unloading_speed_start = 0.f; float delay = 0.f ; - int filament_skinnydip_move = 0; - bool filament_cold_ramming = false; float filament_skinnydip_loading_speed = 0.f; float filament_skinnydip_unloading_speed = 0.f; float filament_skinnydip_distance = 0.f; float filament_skinnydip_extra_move = 0.f; - float filament_skinnydip_delay = 0.f; - int filament_skinnydip_number_of_dips = 0; int cooling_moves = 0; float cooling_initial_speed = 0.f; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 4f5498a672..3d5baee74c 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -478,7 +478,7 @@ static std::vector s_Preset_print_options { static std::vector s_Preset_filament_options { "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_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_skinnydip_extra_move", "filament_skinnydip_delay", "filament_cooling_moves", "filament_skinnydip_move", "filament_cold_ramming", "filament_skinnydip_loading_speed", "filament_skinnydip_unloading_speed", "filament_skinnydip_distance", "filament_skinnydip_number_of_dips", + "filament_unloading_speed", "filament_unloading_speed_start", "filament_unload_time", "filament_toolchange_delay", "filament_skinnydip_extra_move", "filament_cooling_moves", "filament_skinnydip_loading_speed", "filament_skinnydip_unloading_speed", "filament_skinnydip_distance", "filament_cooling_initial_speed", "filament_cooling_final_speed", "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", "min_fan_speed", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 93685f842b..4c3db4b657 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -218,11 +218,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "filament_unloading_speed_start" || opt_key == "filament_toolchange_delay" || opt_key == "filament_skinnydip_extra_move" - || opt_key == "filament_skinnydip_delay" || opt_key == "filament_cooling_moves" - || opt_key == "filament_skinnydip_number_of_dips" - || opt_key == "filament_skinnydip_move" - || opt_key == "filament_cold_ramming" || opt_key == "filament_skinnydip_loading_speed" || opt_key == "filament_skinnydip_unloading_speed" || opt_key == "filament_skinnydip_distance" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 5f762f6b48..5bd8b98bb7 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1093,27 +1093,6 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("filament_cold_ramming", coBools); - def->label = L("ELIAS: Cold ramming"); - def->tooltip = L(""); - def->min = 0; - def->mode = comExpert; - def->set_default_value(new ConfigOptionBools { false }); - - def = this->add("filament_skinnydip_move", coInts); - def->label = L("ELIAS: Skinnydip is performed after N-th cooling move"); - def->tooltip = L("Zero - before cooling. Larger than number of cooling moves - after cooling."); - def->min = 0; - def->mode = comExpert; - def->set_default_value(new ConfigOptionInts { 0 }); - - def = this->add("filament_skinnydip_number_of_dips", coInts); - def->label = L("ELIAS: Number of skinnydips"); - def->tooltip = L(""); - def->min = 0; - def->mode = comExpert; - def->set_default_value(new ConfigOptionInts { 0 }); - def = this->add("filament_skinnydip_loading_speed", coFloats); def->label = L("ELIAS: Skinnydip loading speed"); def->tooltip = L(""); @@ -1142,14 +1121,6 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("filament_skinnydip_delay", coFloats); - def->label = L("ELIAS Skinnydip delay"); - def->tooltip = L("..."); - def->sidetext = L("s"); - def->min = 0; - def->mode = comExpert; - def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("filament_cooling_moves", coInts); def->label = L("Number of cooling moves"); def->tooltip = L("Filament is cooled by being moved back and forth in the " diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 5050991d51..092aad5459 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -724,7 +724,6 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloats, filament_toolchange_delay)) ((ConfigOptionFloats, filament_unload_time)) ((ConfigOptionInts, filament_cooling_moves)) - ((ConfigOptionInts, filament_skinnydip_number_of_dips)) ((ConfigOptionFloats, filament_cooling_initial_speed)) ((ConfigOptionFloats, filament_minimal_purge_on_wipe_tower)) ((ConfigOptionFloats, filament_cooling_final_speed)) @@ -732,13 +731,10 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBools, filament_multitool_ramming)) ((ConfigOptionFloats, filament_multitool_ramming_volume)) ((ConfigOptionFloats, filament_multitool_ramming_flow)) - ((ConfigOptionInts, filament_skinnydip_move)) - ((ConfigOptionBools, filament_cold_ramming)) ((ConfigOptionFloats, filament_skinnydip_loading_speed)) ((ConfigOptionFloats, filament_skinnydip_unloading_speed)) ((ConfigOptionFloats, filament_skinnydip_distance)) ((ConfigOptionFloats, filament_skinnydip_extra_move)) - ((ConfigOptionFloats, filament_skinnydip_delay)) ((ConfigOptionBool, gcode_comments)) ((ConfigOptionEnum, gcode_flavor)) ((ConfigOptionEnum, gcode_label_objects)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index d8ebc8ac57..db5305dd3b 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2269,14 +2269,10 @@ 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_skinnydip_number_of_dips"); - optgroup->append_single_option_line("filament_skinnydip_move"); optgroup->append_single_option_line("filament_skinnydip_loading_speed"); optgroup->append_single_option_line("filament_skinnydip_unloading_speed"); optgroup->append_single_option_line("filament_skinnydip_distance"); optgroup->append_single_option_line("filament_skinnydip_extra_move"); - optgroup->append_single_option_line("filament_skinnydip_delay"); - optgroup->append_single_option_line("filament_cold_ramming"); create_line_with_widget(optgroup.get(), "filament_ramming_parameters", "", [this](wxWindow* parent) { auto ramming_dialog_btn = new wxButton(parent, wxID_ANY, _(L("Ramming settings"))+dots, wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); From ecba2ca0074ecd05a8f40cf939aba0ef97aeab3d Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 30 Jun 2023 15:33:11 +0200 Subject: [PATCH 09/25] Wipe tower: increased purge flow parameter --- src/libslic3r/GCode/WipeTower.cpp | 4 ++++ src/libslic3r/GCode/WipeTower.hpp | 1 + src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 1 + src/libslic3r/PrintConfig.cpp | 9 +++++++++ src/libslic3r/PrintConfig.hpp | 1 + src/slic3r/GUI/ConfigManipulation.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 1 + 9 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 36da0e821d..1788017d8a 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -551,6 +551,7 @@ WipeTower::WipeTower(const PrintConfig& config, const PrintRegionConfig& default m_wipe_tower_brim_width(float(config.wipe_tower_brim_width)), m_wipe_tower_cone_angle(float(config.wipe_tower_cone_angle)), m_extra_spacing(float(config.wipe_tower_extra_spacing/100.)), + m_extra_flow(float(config.wipe_tower_extra_flow/100.)), m_y_shift(0.f), m_z_pos(0.f), m_bridging(float(config.wipe_tower_bridging)), @@ -1120,6 +1121,9 @@ void WipeTower::toolchange_Wipe( const float& xl = cleaning_box.ld.x(); const float& xr = cleaning_box.rd.x(); + // MATHIEU TEST: + writer.set_extrusion_flow(m_extrusion_flow * m_extra_flow); + // Variables x_to_wipe and traversed_x are here to be able to make sure it always wipes at least // the ordered volume, even if it means violating the box. This can later be removed and simply // wipe until the end of the assigned area. diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 608e9849c5..0807e6bb77 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -330,6 +330,7 @@ private: bool m_current_layer_finished = false; bool m_left_to_right = true; float m_extra_spacing = 1.f; + float m_extra_flow = 1.f; bool is_first_layer() const { return size_t(m_layer_info - m_plan.begin()) == m_first_layer_idx; } diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 3d5baee74c..4fd6d9d058 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -470,7 +470,7 @@ static std::vector s_Preset_print_options { "elefant_foot_compensation", "xy_size_compensation", "resolution", "gcode_resolution", "arc_fitting", "wipe_tower", "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_cone_angle", "wipe_tower_rotation_angle", "wipe_tower_brim_width", "wipe_tower_bridging", "single_extruder_multi_material_priming", "mmu_segmented_region_max_width", - "mmu_segmented_region_interlocking_depth", "wipe_tower_extruder", "wipe_tower_no_sparse_layers", "wipe_tower_extra_spacing", "compatible_printers", "compatible_printers_condition", "inherits", + "mmu_segmented_region_interlocking_depth", "wipe_tower_extruder", "wipe_tower_no_sparse_layers", "wipe_tower_extra_flow", "wipe_tower_extra_spacing", "compatible_printers", "compatible_printers_condition", "inherits", "perimeter_generator", "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle", "wall_distribution_count", "min_feature_size", "min_bead_width" }; diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 4c3db4b657..615b91d6dc 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -242,6 +242,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "wipe_tower_cone_angle" || opt_key == "wipe_tower_bridging" || opt_key == "wipe_tower_extra_spacing" + || opt_key == "wipe_tower_extra_flow" || opt_key == "wipe_tower_no_sparse_layers" || opt_key == "wipe_tower_extruder" || opt_key == "wiping_volumes_matrix" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 5bd8b98bb7..2859d2cf21 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3361,6 +3361,15 @@ void PrintConfigDef::init_fff_params() def->max = 300.; def->set_default_value(new ConfigOptionPercent(100.)); + def = this->add("wipe_tower_extra_flow", coPercent); + def->label = L("MATHIEU TEST: extra flow"); + def->tooltip = L(""); + def->sidetext = L("%"); + def->mode = comExpert; + def->min = 100.; + def->max = 300.; + def->set_default_value(new ConfigOptionPercent(100.)); + def = this->add("wipe_into_infill", coBool); def->category = L("Wipe options"); def->label = L("Wipe into this object's infill"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 092aad5459..fc209c9b6a 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -878,6 +878,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, wipe_tower_brim_width)) ((ConfigOptionFloat, wipe_tower_cone_angle)) ((ConfigOptionPercent, wipe_tower_extra_spacing)) + ((ConfigOptionPercent, wipe_tower_extra_flow)) ((ConfigOptionFloat, wipe_tower_bridging)) ((ConfigOptionInt, wipe_tower_extruder)) ((ConfigOptionFloats, wiping_volumes_matrix)) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 013689ce63..3e8554885d 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -325,7 +325,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) bool have_wipe_tower = config->opt_bool("wipe_tower"); for (auto el : { "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_brim_width", "wipe_tower_cone_angle", - "wipe_tower_extra_spacing", "wipe_tower_bridging", "wipe_tower_no_sparse_layers", "single_extruder_multi_material_priming" }) + "wipe_tower_extra_spacing", "wipe_tower_extra_flow", "wipe_tower_bridging", "wipe_tower_no_sparse_layers", "single_extruder_multi_material_priming" }) toggle_field(el, have_wipe_tower); bool have_non_zero_mmu_segmented_region_max_width = config->opt_float("mmu_segmented_region_max_width") > 0.; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 2d00674c08..e74ba64cfc 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2127,7 +2127,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) , config(Slic3r::DynamicPrintConfig::new_from_defaults_keys({ "bed_shape", "bed_custom_texture", "bed_custom_model", "complete_objects", "duplicate_distance", "extruder_clearance_radius", "skirts", "skirt_distance", "brim_width", "brim_separation", "brim_type", "variable_layer_height", "nozzle_diameter", "single_extruder_multi_material", - "wipe_tower", "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_brim_width", "wipe_tower_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_extruder", + "wipe_tower", "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_brim_width", "wipe_tower_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_extra_flow", "wipe_tower_extruder", "extruder_colour", "filament_colour", "material_colour", "max_print_height", "printer_model", "printer_notes", "printer_technology", // These values are necessary to construct SlicingParameters by the Canvas3D variable layer height editor. "layer_height", "first_layer_height", "min_layer_height", "max_layer_height", diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index db5305dd3b..7444f7d86a 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1655,6 +1655,7 @@ void TabPrint::build() optgroup->append_single_option_line("wipe_tower_bridging"); optgroup->append_single_option_line("wipe_tower_cone_angle"); optgroup->append_single_option_line("wipe_tower_extra_spacing"); + optgroup->append_single_option_line("wipe_tower_extra_flow"); optgroup->append_single_option_line("wipe_tower_no_sparse_layers"); optgroup->append_single_option_line("single_extruder_multi_material_priming"); From 6149294f407779a7d19c828b7cc5beaf9af4a75d Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 22 Dec 2023 07:32:56 +0100 Subject: [PATCH 10/25] Wipe tower: cold ramming --- src/libslic3r/GCode/WipeTower.cpp | 7 ++++++- src/libslic3r/GCode/WipeTower.hpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 1788017d8a..6b1ee7cca8 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -588,6 +588,8 @@ WipeTower::WipeTower(const PrintConfig& config, const PrintRegionConfig& default m_set_extruder_trimpot = config.high_current_on_filament_swap; } + m_is_mk4mmu3 = boost::icontains(config.printer_model.value, "MK4") && boost::icontains(config.printer_model.value, "MMU"); + // Calculate where the priming lines should be - very naive test not detecting parallelograms etc. const std::vector& bed_points = config.bed_shape.values; BoundingBoxf bb(bed_points); @@ -892,10 +894,13 @@ void WipeTower::toolchange_Unload( float e_done = 0; // measures E move done from each segment const bool do_ramming = m_semm || m_filpar[m_current_tool].multitool_ramming; + const bool cold_ramming = m_is_mk4mmu3; if (do_ramming) { writer.travel(ramming_start_pos); // move to starting position writer.disable_linear_advance(); + if (cold_ramming) + writer.set_extruder_temp(new_temperature - 20); } else writer.set_position(ramming_start_pos); @@ -974,7 +979,7 @@ void WipeTower::toolchange_Unload( // be already set and there is no need to change anything. Also, the temperature could be changed // for wrong extruder. if (m_semm) { - if (new_temperature != 0 && (new_temperature != m_old_temperature || is_first_layer()) ) { // Set the extruder temperature, but don't wait. + if (new_temperature != 0 && (new_temperature != m_old_temperature || is_first_layer() || cold_ramming) ) { // Set the extruder temperature, but don't wait. // If the required temperature is the same as last time, don't emit the M104 again (if user adjusted the value, it would be reset) // However, always change temperatures on the first layer (this is to avoid issues with priming lines turned off). writer.set_extruder_temp(new_temperature, false); diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 0807e6bb77..53c804ffcb 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -270,6 +270,7 @@ private: bool m_semm = true; // Are we using a single extruder multimaterial printer? + bool m_is_mk4mmu3 = false; Vec2f m_wipe_tower_pos; // Left front corner of the wipe tower in mm. float m_wipe_tower_width; // Width of the wipe tower. float m_wipe_tower_depth = 0.f; // Depth of the wipe tower From 443e62889613cff8fa8815301c79d3e795c735d1 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 22 Dec 2023 07:43:13 +0100 Subject: [PATCH 11/25] Wipe tower: keep the head stationary during skinnydip retraction --- src/libslic3r/GCode/WipeTower.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 6b1ee7cca8..f33a426848 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -1016,7 +1016,13 @@ void WipeTower::toolchange_Unload( writer.load_move_x_advanced_there_and_back(turning_point, 5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); } else writer.load_move_x_advanced_there_and_back(turning_point, dist_e, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); - writer.load_move_x_advanced_there_and_back(turning_point, -dist_e, m_filpar[m_current_tool].filament_skinnydip_unloading_speed, 50); + + //writer.load_move_x_advanced_there_and_back(turning_point, -dist_e, m_filpar[m_current_tool].filament_skinnydip_unloading_speed, 50); + // Retract while the print head is stationary, so if there is a blob, it is not dragged along. + writer.retract(dist_e, m_filpar[m_current_tool].filament_skinnydip_unloading_speed * 60.f); + + if (m_is_mk4mmu3) + writer.switch_filament_monitoring(true); if (m_filpar[m_current_tool].filament_skinnydip_extra_move != 0.f) dist_e += m_filpar[m_current_tool].filament_skinnydip_extra_move; From 0a5c3d088a96a74762e2a6ec509800d3d3a6b314 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 22 Dec 2023 08:57:05 +0100 Subject: [PATCH 12/25] Wipe tower: Filament monitoring switch --- src/libslic3r/GCode/WipeTower.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index f33a426848..de92a1b377 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -109,6 +109,11 @@ public: return *this; } + WipeTowerWriter& switch_filament_monitoring(bool enable) { + m_gcode += std::string("G4 S0\n") + "M591 " + (enable ? "S0" : "R") + "\n"; + return *this; + } + // Suppress / resume G-code preview in Slic3r. Slic3r will have difficulty to differentiate the various // filament loading and cooling moves from normal extrusion moves. Therefore the writer // is asked to suppres output of some lines, which look like extrusions. @@ -934,6 +939,9 @@ void WipeTower::toolchange_Unload( sum_of_depths += tch.required_depth; } } + + if (m_is_mk4mmu3) + writer.switch_filament_monitoring(false); // now the ramming itself: @@ -975,6 +983,10 @@ void WipeTower::toolchange_Unload( .retract(0.10f * total_retraction_distance, 0.3f * m_filpar[m_current_tool].unloading_speed * 60.f) .resume_preview(); } + + if (m_is_mk4mmu3) + writer.switch_filament_monitoring(true); + // Wipe tower should only change temperature with single extruder MM. Otherwise, all temperatures should // be already set and there is no need to change anything. Also, the temperature could be changed // for wrong extruder. @@ -1005,6 +1017,13 @@ void WipeTower::toolchange_Unload( if (i>0 && m_filpar[m_current_tool].filament_skinnydip_distance != 0) { float dist_e = m_filpar[m_current_tool].filament_skinnydip_distance + m_cooling_tube_length / 2.f; + // Skinnydip turning point shall be no farther than 20mm from the current nozzle position: + + + + if (m_is_mk4mmu3) + writer.switch_filament_monitoring(false); + // Only last 5mm will be done with the fast x travel. The point is to spread possible blobs // along the whole wipe tower. if (dist_e > 5) { From 98f377c8448f27737f3743630614a389a0780544 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 22 Dec 2023 14:01:21 +0100 Subject: [PATCH 13/25] Wipe tower: keep pressure advance on for MK4 --- src/libslic3r/GCode/WipeTower.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index de92a1b377..f9deccdf5a 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -903,7 +903,8 @@ void WipeTower::toolchange_Unload( if (do_ramming) { writer.travel(ramming_start_pos); // move to starting position - writer.disable_linear_advance(); + if (! m_is_mk4mmu3) + writer.disable_linear_advance(); if (cold_ramming) writer.set_extruder_temp(new_temperature - 20); } From 60dbf28bf22696bf01f4b45781f62a2f05d2e6f1 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 22 Dec 2023 14:11:30 +0100 Subject: [PATCH 14/25] Wipe tower: shorten x move during skinnydip to max of 20mm --- src/libslic3r/GCode/WipeTower.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index f9deccdf5a..4f4d4da31a 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -1019,8 +1019,7 @@ void WipeTower::toolchange_Unload( float dist_e = m_filpar[m_current_tool].filament_skinnydip_distance + m_cooling_tube_length / 2.f; // Skinnydip turning point shall be no farther than 20mm from the current nozzle position: - - + float skinnydip_turning_point = std::clamp(old_x + 20.f * (turning_point - old_x > 0.f ? 1.f : -1.f), xl, xr); if (m_is_mk4mmu3) writer.switch_filament_monitoring(false); @@ -1030,12 +1029,12 @@ void WipeTower::toolchange_Unload( if (dist_e > 5) { //writer.load_move_x_advanced_there_and_back(turning_point, dist_e-5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, 50); float cent = writer.x(); - writer.load_move_x_advanced(turning_point, 0.5*(dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); + writer.load_move_x_advanced(skinnydip_turning_point, 0.5*(dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); writer.load_move_x_advanced(cent, 0.5*(dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); writer.travel(cent, writer.y()); - writer.load_move_x_advanced_there_and_back(turning_point, 5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); + writer.load_move_x_advanced_there_and_back(skinnydip_turning_point, 5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); } else - writer.load_move_x_advanced_there_and_back(turning_point, dist_e, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); + writer.load_move_x_advanced_there_and_back(skinnydip_turning_point, dist_e, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); //writer.load_move_x_advanced_there_and_back(turning_point, -dist_e, m_filpar[m_current_tool].filament_skinnydip_unloading_speed, 50); // Retract while the print head is stationary, so if there is a blob, it is not dragged along. From 8e9251f2f0044bdbe6e2985cbc6b30b0384410c7 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 22 Dec 2023 15:46:43 +0100 Subject: [PATCH 15/25] Wipe tower: separate acceleration control (related to #10854) --- src/libslic3r/GCode/WipeTowerIntegration.cpp | 4 ++++ src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 3 ++- src/libslic3r/PrintConfig.cpp | 9 +++++++++ src/libslic3r/PrintConfig.hpp | 1 + src/slic3r/GUI/ConfigManipulation.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 1 + 7 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode/WipeTowerIntegration.cpp b/src/libslic3r/GCode/WipeTowerIntegration.cpp index 2f37ecbb06..4dd9a78112 100644 --- a/src/libslic3r/GCode/WipeTowerIntegration.cpp +++ b/src/libslic3r/GCode/WipeTowerIntegration.cpp @@ -106,7 +106,11 @@ std::string WipeTowerIntegration::append_tcr(GCodeGenerator &gcodegen, const Wip boost::replace_first(tcr_rotated_gcode, "[deretraction_from_wipe_tower_generator]", deretraction_str); std::string tcr_gcode; unescape_string_cstyle(tcr_rotated_gcode, tcr_gcode); + + if (gcodegen.config().default_acceleration > 0) + gcode += gcodegen.writer().set_print_acceleration(fast_round_up(gcodegen.config().wipe_tower_acceleration.value)); gcode += tcr_gcode; + gcode += gcodegen.writer().set_print_acceleration(fast_round_up(gcodegen.config().default_acceleration.value)); // A phony move to the end position at the wipe tower. gcodegen.writer().travel_to_xy(end_pos.cast()); diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 4fd6d9d058..ae3bedb38e 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -450,7 +450,7 @@ static std::vector s_Preset_print_options { "enable_dynamic_overhang_speeds", "overhang_speed_0", "overhang_speed_1", "overhang_speed_2", "overhang_speed_3", "top_solid_infill_speed", "support_material_speed", "support_material_xy_spacing", "support_material_interface_speed", "bridge_speed", "gap_fill_speed", "gap_fill_enabled", "travel_speed", "travel_speed_z", "first_layer_speed", "first_layer_speed_over_raft", "perimeter_acceleration", "infill_acceleration", - "external_perimeter_acceleration", "top_solid_infill_acceleration", "solid_infill_acceleration", "travel_acceleration", + "external_perimeter_acceleration", "top_solid_infill_acceleration", "solid_infill_acceleration", "travel_acceleration", "wipe_tower_acceleration", "bridge_acceleration", "first_layer_acceleration", "first_layer_acceleration_over_raft", "default_acceleration", "skirts", "skirt_distance", "skirt_height", "draft_shield", "min_skirt_length", "brim_width", "brim_separation", "brim_type", "support_material", "support_material_auto", "support_material_threshold", "support_material_enforce_layers", "raft_layers", "raft_first_layer_density", "raft_first_layer_expansion", "raft_contact_distance", "raft_expansion", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 615b91d6dc..6a5cb1d4f4 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -172,7 +172,8 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "use_relative_e_distances", "use_volumetric_e", "variable_layer_height", - "wipe" + "wipe", + "wipe_tower_acceleration" }; static std::unordered_set steps_ignore; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 2859d2cf21..7f2e58d6bb 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1574,6 +1574,15 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("wipe_tower_acceleration", coFloat); + def->label = L("Wipe tower"); + def->tooltip = L("This is the acceleration your printer will use for wipe tower. Set zero to disable " + "acceleration control for the wipe tower."); + def->sidetext = L("mm/s²"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("travel_acceleration", coFloat); def->label = L("Travel"); def->tooltip = L("This is the acceleration your printer will use for travel moves. Set zero to disable " diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index fc209c9b6a..ee02a96535 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -870,6 +870,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, travel_acceleration)) ((ConfigOptionBools, wipe)) ((ConfigOptionBool, wipe_tower)) + ((ConfigOptionFloat, wipe_tower_acceleration)) ((ConfigOptionFloat, wipe_tower_x)) ((ConfigOptionFloat, wipe_tower_y)) ((ConfigOptionFloat, wipe_tower_width)) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 3e8554885d..a711ad2da4 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -261,7 +261,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) bool have_default_acceleration = config->opt_float("default_acceleration") > 0; for (auto el : { "perimeter_acceleration", "infill_acceleration", "top_solid_infill_acceleration", "solid_infill_acceleration", "external_perimeter_acceleration", - "bridge_acceleration", "first_layer_acceleration" }) + "bridge_acceleration", "first_layer_acceleration", "wipe_tower_acceleration"}) toggle_field(el, have_default_acceleration); bool have_skirt = config->opt_int("skirts") > 0; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 7444f7d86a..464e982a96 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1621,6 +1621,7 @@ void TabPrint::build() optgroup->append_single_option_line("bridge_acceleration"); optgroup->append_single_option_line("first_layer_acceleration"); optgroup->append_single_option_line("first_layer_acceleration_over_raft"); + optgroup->append_single_option_line("wipe_tower_acceleration"); optgroup->append_single_option_line("travel_acceleration"); optgroup->append_single_option_line("default_acceleration"); From 727a67acb44991ba3ef121572e2b9334cefde5c0 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 2 Jan 2024 16:09:48 +0100 Subject: [PATCH 16/25] Wipe tower: MK4 detection now relies on printer_notes field --- src/libslic3r/GCode/WipeTower.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 4f4d4da31a..f64b4aea7c 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -593,7 +593,7 @@ WipeTower::WipeTower(const PrintConfig& config, const PrintRegionConfig& default m_set_extruder_trimpot = config.high_current_on_filament_swap; } - m_is_mk4mmu3 = boost::icontains(config.printer_model.value, "MK4") && boost::icontains(config.printer_model.value, "MMU"); + m_is_mk4mmu3 = boost::icontains(config.printer_notes.value, "PRINTER_MODEL_MK4") && boost::icontains(config.printer_notes.value, "MMU"); // Calculate where the priming lines should be - very naive test not detecting parallelograms etc. const std::vector& bed_points = config.bed_shape.values; From 4900235332e3520794d8e48a053bf1e0b44e7235 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 5 Jan 2024 15:00:52 +0100 Subject: [PATCH 17/25] Wipe tower: various little fixes: - removed skinnydip_unloading_speed, unloading_speed is used instead - the new parameter wipe_tower_extra_flow now automatically adjusts spacing - the extra flow is seen in the preview - skinnydip moves were simplified - for MK4, pressure advance is kept for ramming and disabled for skinnydip - G4 S0/R were swapped - for MK4, the new temperature is set before the last cooling move - range of the ramming dialog increased to 60 mm3/s - fixed skinnydip_extra_move - fixed temperature setting after cold_ramming --- src/libslic3r/GCode/WipeTower.cpp | 74 ++++++++++++++++++------------- src/libslic3r/GCode/WipeTower.hpp | 1 - src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 1 - src/libslic3r/PrintConfig.cpp | 7 --- src/libslic3r/PrintConfig.hpp | 1 - src/slic3r/GUI/RammingChart.hpp | 2 +- src/slic3r/GUI/Tab.cpp | 1 - 8 files changed, 45 insertions(+), 44 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index f64b4aea7c..8495e75404 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -110,7 +110,7 @@ public: } WipeTowerWriter& switch_filament_monitoring(bool enable) { - m_gcode += std::string("G4 S0\n") + "M591 " + (enable ? "S0" : "R") + "\n"; + m_gcode += std::string("G4 S0\n") + "M591 " + (enable ? "R" : "S0") + "\n"; return *this; } @@ -642,7 +642,6 @@ void WipeTower::set_extruder(size_t idx, const PrintConfig& config) 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].filament_skinnydip_loading_speed = float(config.filament_skinnydip_loading_speed.get_at(idx)); - m_filpar[idx].filament_skinnydip_unloading_speed = float(config.filament_skinnydip_unloading_speed.get_at(idx)); m_filpar[idx].filament_skinnydip_distance = float(config.filament_skinnydip_distance.get_at(idx)); m_filpar[idx].filament_skinnydip_extra_move = float(config.filament_skinnydip_extra_move.get_at(idx)); } @@ -988,6 +987,10 @@ void WipeTower::toolchange_Unload( if (m_is_mk4mmu3) writer.switch_filament_monitoring(true); + const int& number_of_cooling_moves = m_filpar[m_current_tool].cooling_moves; + const bool cooling_will_happen = m_semm && number_of_cooling_moves > 0; + bool change_temp_later = false; + // Wipe tower should only change temperature with single extruder MM. Otherwise, all temperatures should // be already set and there is no need to change anything. Also, the temperature could be changed // for wrong extruder. @@ -995,28 +998,34 @@ void WipeTower::toolchange_Unload( if (new_temperature != 0 && (new_temperature != m_old_temperature || is_first_layer() || cold_ramming) ) { // Set the extruder temperature, but don't wait. // If the required temperature is the same as last time, don't emit the M104 again (if user adjusted the value, it would be reset) // However, always change temperatures on the first layer (this is to avoid issues with priming lines turned off). - writer.set_extruder_temp(new_temperature, false); + if (cold_ramming && cooling_will_happen) + change_temp_later = true; + else + writer.set_extruder_temp(new_temperature, false); m_old_temperature = new_temperature; } } // Cooling: - const int& number_of_moves = m_filpar[m_current_tool].cooling_moves; - if (m_semm && number_of_moves > 0) { + if (cooling_will_happen) { const float& initial_speed = m_filpar[m_current_tool].cooling_initial_speed; const float& final_speed = m_filpar[m_current_tool].cooling_final_speed; - float speed_inc = (final_speed - initial_speed) / (2.f * number_of_moves - 1.f); + float speed_inc = (final_speed - initial_speed) / (2.f * number_of_cooling_moves - 1.f); + + if (m_is_mk4mmu3) + writer.disable_linear_advance(); writer.suppress_preview() .travel(writer.x(), writer.y() + y_step); old_x = writer.x(); turning_point = xr-old_x > old_x-xl ? xr : xl; - for (int i=0; i0 && m_filpar[m_current_tool].filament_skinnydip_distance != 0) { - float dist_e = m_filpar[m_current_tool].filament_skinnydip_distance + m_cooling_tube_length / 2.f; // Skinnydip turning point shall be no farther than 20mm from the current nozzle position: float skinnydip_turning_point = std::clamp(old_x + 20.f * (turning_point - old_x > 0.f ? 1.f : -1.f), xl, xr); @@ -1026,28 +1035,28 @@ void WipeTower::toolchange_Unload( // Only last 5mm will be done with the fast x travel. The point is to spread possible blobs // along the whole wipe tower. - if (dist_e > 5) { - //writer.load_move_x_advanced_there_and_back(turning_point, dist_e-5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, 50); + if (skinnydip_dist_e > 5) { float cent = writer.x(); - writer.load_move_x_advanced(skinnydip_turning_point, 0.5*(dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); - writer.load_move_x_advanced(cent, 0.5*(dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); + writer.load_move_x_advanced(skinnydip_turning_point, (skinnydip_dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); + writer.load_move_x_advanced(cent, 5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); writer.travel(cent, writer.y()); - writer.load_move_x_advanced_there_and_back(skinnydip_turning_point, 5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); } else - writer.load_move_x_advanced_there_and_back(skinnydip_turning_point, dist_e, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); + writer.load_move_x_advanced_there_and_back(skinnydip_turning_point, skinnydip_dist_e, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); - //writer.load_move_x_advanced_there_and_back(turning_point, -dist_e, m_filpar[m_current_tool].filament_skinnydip_unloading_speed, 50); // Retract while the print head is stationary, so if there is a blob, it is not dragged along. - writer.retract(dist_e, m_filpar[m_current_tool].filament_skinnydip_unloading_speed * 60.f); + writer.retract(skinnydip_dist_e, m_filpar[m_current_tool].unloading_speed * 60.f); if (m_is_mk4mmu3) writer.switch_filament_monitoring(true); if (m_filpar[m_current_tool].filament_skinnydip_extra_move != 0.f) - dist_e += m_filpar[m_current_tool].filament_skinnydip_extra_move; + skinnydip_dist_e += m_filpar[m_current_tool].filament_skinnydip_extra_move; + } + + 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); } - if (i == number_of_moves) - break; float speed = initial_speed + speed_inc * 2*i; writer.load_move_x_advanced(turning_point, m_cooling_tube_length, speed); @@ -1153,21 +1162,23 @@ void WipeTower::toolchange_Wipe( // MATHIEU TEST: writer.set_extrusion_flow(m_extrusion_flow * m_extra_flow); + const float line_width = m_perimeter_width * m_extra_flow; + writer.change_analyzer_line_width(line_width); // Variables x_to_wipe and traversed_x are here to be able to make sure it always wipes at least // the ordered volume, even if it means violating the box. This can later be removed and simply // wipe until the end of the assigned area. - float x_to_wipe = volume_to_length(wipe_volume, m_perimeter_width, m_layer_height) * (is_first_layer() ? m_extra_spacing : 1.f); - float dy = (is_first_layer() ? 1.f : m_extra_spacing) * m_perimeter_width; // Don't use the extra spacing for the first layer. + float x_to_wipe = volume_to_length(wipe_volume, line_width, m_layer_height) * (is_first_layer() ? m_extra_spacing : 1.f); + float dy = (is_first_layer() ? 1.f : m_extra_spacing) * line_width; // Don't use the extra spacing for the first layer. // All the calculations in all other places take the spacing into account for all the layers. const float target_speed = is_first_layer() ? m_first_layer_speed * 60.f : m_infill_speed * 60.f; float wipe_speed = 0.33f * target_speed; - // if there is less than 2.5*m_perimeter_width to the edge, advance straightaway (there is likely a blob anyway) - if ((m_left_to_right ? xr-writer.x() : writer.x()-xl) < 2.5f*m_perimeter_width) { - writer.travel((m_left_to_right ? xr-m_perimeter_width : xl+m_perimeter_width),writer.y()+dy); + // if there is less than 2.5*line_width to the edge, advance straightaway (there is likely a blob anyway) + if ((m_left_to_right ? xr-writer.x() : writer.x()-xl) < 2.5f*line_width) { + writer.travel((m_left_to_right ? xr-line_width : xl+line_width),writer.y()+dy); m_left_to_right = !m_left_to_right; } @@ -1182,21 +1193,21 @@ void WipeTower::toolchange_Wipe( float traversed_x = writer.x(); if (m_left_to_right) - writer.extrude(xr - (i % 4 == 0 ? 0 : 1.5f*m_perimeter_width), writer.y(), wipe_speed); + writer.extrude(xr - (i % 4 == 0 ? 0 : 1.5f*line_width), writer.y(), wipe_speed); else - writer.extrude(xl + (i % 4 == 1 ? 0 : 1.5f*m_perimeter_width), writer.y(), wipe_speed); + writer.extrude(xl + (i % 4 == 1 ? 0 : 1.5f*line_width), writer.y(), wipe_speed); - if (writer.y()+float(EPSILON) > cleaning_box.lu.y()-0.5f*m_perimeter_width) + if (writer.y()+float(EPSILON) > cleaning_box.lu.y()-0.5f*line_width) break; // in case next line would not fit traversed_x -= writer.x(); x_to_wipe -= std::abs(traversed_x); if (x_to_wipe < WT_EPSILON) { - writer.travel(m_left_to_right ? xl + 1.5f*m_perimeter_width : xr - 1.5f*m_perimeter_width, writer.y(), 7200); + writer.travel(m_left_to_right ? xl + 1.5f*line_width : xr - 1.5f*line_width, writer.y(), 7200); break; } // stepping to the next line: - writer.extrude(writer.x() + (i % 4 == 0 ? -1.f : (i % 4 == 1 ? 1.f : 0.f)) * 1.5f*m_perimeter_width, writer.y() + dy); + writer.extrude(writer.x() + (i % 4 == 0 ? -1.f : (i % 4 == 1 ? 1.f : 0.f)) * 1.5f*line_width, writer.y() + dy); m_left_to_right = !m_left_to_right; } @@ -1210,6 +1221,7 @@ void WipeTower::toolchange_Wipe( m_left_to_right = !m_left_to_right; writer.set_extrusion_flow(m_extrusion_flow); // Reset the extrusion flow. + writer.change_analyzer_line_width(m_perimeter_width); } @@ -1584,7 +1596,7 @@ void WipeTower::save_on_last_wipe() float width = m_wipe_tower_width - 3*m_perimeter_width; // width we draw into float length_to_save = finish_layer().total_extrusion_length_in_plane(); float length_to_wipe = volume_to_length(toolchange.wipe_volume, - m_perimeter_width, m_layer_info->height) - toolchange.first_wipe_line - length_to_save; + m_perimeter_width, m_layer_info->height) / m_extra_flow - toolchange.first_wipe_line - length_to_save; length_to_wipe = std::max(length_to_wipe,0.f); float depth_to_wipe = m_perimeter_width * (std::floor(length_to_wipe/width) + ( length_to_wipe > 0.f ? 1.f : 0.f ) ); @@ -1634,7 +1646,7 @@ void WipeTower::generate(std::vector> & return; plan_tower(); - for (int i=0;i<5;++i) { + for (int i = 0; i<5; ++i) { save_on_last_wipe(); plan_tower(); } diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 53c804ffcb..6250c8b3fd 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -238,7 +238,6 @@ public: float delay = 0.f ; float filament_skinnydip_loading_speed = 0.f; - float filament_skinnydip_unloading_speed = 0.f; float filament_skinnydip_distance = 0.f; float filament_skinnydip_extra_move = 0.f; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index ae3bedb38e..ad3eb97af6 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -478,7 +478,7 @@ static std::vector s_Preset_print_options { static std::vector s_Preset_filament_options { "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_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_skinnydip_extra_move", "filament_cooling_moves", "filament_skinnydip_loading_speed", "filament_skinnydip_unloading_speed", "filament_skinnydip_distance", + "filament_unloading_speed", "filament_unloading_speed_start", "filament_unload_time", "filament_toolchange_delay", "filament_skinnydip_extra_move", "filament_cooling_moves", "filament_skinnydip_loading_speed", "filament_skinnydip_distance", "filament_cooling_initial_speed", "filament_cooling_final_speed", "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", "min_fan_speed", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 6a5cb1d4f4..252476a7e7 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -221,7 +221,6 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "filament_skinnydip_extra_move" || opt_key == "filament_cooling_moves" || opt_key == "filament_skinnydip_loading_speed" - || opt_key == "filament_skinnydip_unloading_speed" || opt_key == "filament_skinnydip_distance" || opt_key == "filament_minimal_purge_on_wipe_tower" || opt_key == "filament_cooling_initial_speed" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 7f2e58d6bb..95b1cc9c42 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1100,13 +1100,6 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("filament_skinnydip_unloading_speed", coFloats); - def->label = L("ELIAS: Skinnydip unloading speed"); - def->tooltip = L(""); - def->min = 0; - def->mode = comExpert; - def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("filament_skinnydip_distance", coFloats); def->label = L("ELIAS: Skinnydip distance measured from the center of the cooling tube"); def->tooltip = L(""); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index ee02a96535..a802640a25 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -732,7 +732,6 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloats, filament_multitool_ramming_volume)) ((ConfigOptionFloats, filament_multitool_ramming_flow)) ((ConfigOptionFloats, filament_skinnydip_loading_speed)) - ((ConfigOptionFloats, filament_skinnydip_unloading_speed)) ((ConfigOptionFloats, filament_skinnydip_distance)) ((ConfigOptionFloats, filament_skinnydip_extra_move)) ((ConfigOptionBool, gcode_comments)) diff --git a/src/slic3r/GUI/RammingChart.hpp b/src/slic3r/GUI/RammingChart.hpp index 33faa2eed1..78904418e4 100644 --- a/src/slic3r/GUI/RammingChart.hpp +++ b/src/slic3r/GUI/RammingChart.hpp @@ -23,7 +23,7 @@ public: { SetBackgroundStyle(wxBG_STYLE_PAINT); m_rect = wxRect(wxPoint(legend_side,0),rect.GetSize()-wxSize(legend_side,legend_side)); - visible_area = wxRect2DDouble(0.0, 0.0, sampling*ramming_speed_size, 40.); + visible_area = wxRect2DDouble(0.0, 0.0, sampling*ramming_speed_size, 60.); m_buttons.clear(); if (initial_buttons.size()>0) for (const auto& pair : initial_buttons) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 464e982a96..94d7a11fdb 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2272,7 +2272,6 @@ void TabFilament::build() optgroup->append_single_option_line("filament_cooling_initial_speed"); optgroup->append_single_option_line("filament_cooling_final_speed"); optgroup->append_single_option_line("filament_skinnydip_loading_speed"); - optgroup->append_single_option_line("filament_skinnydip_unloading_speed"); optgroup->append_single_option_line("filament_skinnydip_distance"); optgroup->append_single_option_line("filament_skinnydip_extra_move"); From 02982073b645d4162dd7700de1bb754a9a84cd6a Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 12 Jan 2024 15:25:30 +0100 Subject: [PATCH 18/25] Wipe tower: cold ramming should use temperature of the old tool, not the new one --- src/libslic3r/GCode/WipeTower.cpp | 10 ++++++---- src/libslic3r/GCode/WipeTower.hpp | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 8495e75404..8e3bad58c2 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -757,7 +757,7 @@ std::vector WipeTower::prime( toolchange_Wipe(writer, cleaning_box , 20.f); box_coordinates box = cleaning_box; box.translate(0.f, writer.y() - cleaning_box.ld.y() + m_perimeter_width); - toolchange_Unload(writer, box , m_filpar[m_current_tool].material, m_filpar[tools[idx_tool + 1]].first_layer_temperature); + toolchange_Unload(writer, box , m_filpar[m_current_tool].material, m_filpar[m_current_tool].first_layer_temperature, m_filpar[tools[idx_tool + 1]].first_layer_temperature); cleaning_box.translate(prime_section_width, 0.f); writer.travel(cleaning_box.ld, 7200); } @@ -845,14 +845,15 @@ WipeTower::ToolChangeResult WipeTower::tool_change(size_t tool) // Ram the hot material out of the melt zone, retract the filament into the cooling tubes and let it cool. if (tool != (unsigned int)-1){ // This is not the last change. toolchange_Unload(writer, cleaning_box, m_filpar[m_current_tool].material, - is_first_layer() ? m_filpar[tool].first_layer_temperature : m_filpar[tool].temperature); + (is_first_layer() ? m_filpar[m_current_tool].first_layer_temperature : m_filpar[m_current_tool].temperature), + (is_first_layer() ? m_filpar[tool].first_layer_temperature : m_filpar[tool].temperature)); toolchange_Change(writer, tool, m_filpar[tool].material); // Change the tool, set a speed override for soluble and flex materials. toolchange_Load(writer, cleaning_box); writer.travel(writer.x(), writer.y()-m_perimeter_width); // cooling and loading were done a bit down the road toolchange_Wipe(writer, cleaning_box, wipe_volume); // Wipe the newly loaded filament until the end of the assigned wipe area. ++ m_num_tool_changes; } else - toolchange_Unload(writer, cleaning_box, m_filpar[m_current_tool].material, m_filpar[m_current_tool].temperature); + toolchange_Unload(writer, cleaning_box, m_filpar[m_current_tool].material, m_filpar[m_current_tool].temperature, m_filpar[m_current_tool].temperature); m_depth_traversed += wipe_area; @@ -879,6 +880,7 @@ void WipeTower::toolchange_Unload( WipeTowerWriter &writer, const box_coordinates &cleaning_box, const std::string& current_material, + const int old_temperature, const int new_temperature) { float xl = cleaning_box.ld.x() + 1.f * m_perimeter_width; @@ -905,7 +907,7 @@ void WipeTower::toolchange_Unload( if (! m_is_mk4mmu3) writer.disable_linear_advance(); if (cold_ramming) - writer.set_extruder_temp(new_temperature - 20); + writer.set_extruder_temp(old_temperature - 20); } else writer.set_position(ramming_start_pos); diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 6250c8b3fd..487d0bc2d4 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -401,6 +401,7 @@ private: WipeTowerWriter &writer, const box_coordinates &cleaning_box, const std::string& current_material, + const int old_temperature, const int new_temperature); void toolchange_Change( From ba37505ab02ac7471e605c9b3feb5c3c84ece9cb Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 31 Jan 2024 23:29:29 +0100 Subject: [PATCH 19/25] Wipe tower: - fixed depth calculation for nonzero extra spacing - ixed issues with non-unity extra flow (incorrect wiping volumes, overlaps) - minimum purge on wipe tower now has to be purged before finish_layer is called --- src/libslic3r/GCode/WipeTower.cpp | 36 +++++++++++++++++-------------- src/libslic3r/GCode/WipeTower.hpp | 9 ++++---- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 8e3bad58c2..3f939b306a 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -555,8 +555,9 @@ WipeTower::WipeTower(const PrintConfig& config, const PrintRegionConfig& default m_wipe_tower_rotation_angle(float(config.wipe_tower_rotation_angle)), m_wipe_tower_brim_width(float(config.wipe_tower_brim_width)), m_wipe_tower_cone_angle(float(config.wipe_tower_cone_angle)), - m_extra_spacing(float(config.wipe_tower_extra_spacing/100.)), m_extra_flow(float(config.wipe_tower_extra_flow/100.)), + m_extra_spacing_wipe(float(config.wipe_tower_extra_spacing/100. * config.wipe_tower_extra_flow/100.)), + m_extra_spacing_ramming(float(config.wipe_tower_extra_spacing/100.)), m_y_shift(0.f), m_z_pos(0.f), m_bridging(float(config.wipe_tower_bridging)), @@ -629,6 +630,7 @@ void WipeTower::set_extruder(size_t idx, const PrintConfig& config) m_filpar[idx].is_soluble = config.wipe_tower_extruder == 0 ? config.filament_soluble.get_at(idx) : (idx != size_t(config.wipe_tower_extruder - 1)); m_filpar[idx].temperature = config.temperature.get_at(idx); m_filpar[idx].first_layer_temperature = config.first_layer_temperature.get_at(idx); + m_filpar[idx].filament_minimal_purge_on_wipe_tower = config.filament_minimal_purge_on_wipe_tower.get_at(idx); // If this is a single extruder MM printer, we will use all the SE-specific config values. // Otherwise, the defaults will be used to turn off the SE stuff. @@ -887,7 +889,7 @@ void WipeTower::toolchange_Unload( float xr = cleaning_box.rd.x() - 1.f * m_perimeter_width; const float line_width = m_perimeter_width * m_filpar[m_current_tool].ramming_line_width_multiplicator; // desired ramming line thickness - const float y_step = line_width * m_filpar[m_current_tool].ramming_step_multiplicator * m_extra_spacing; // spacing between lines in mm + const float y_step = line_width * m_filpar[m_current_tool].ramming_step_multiplicator * m_extra_spacing_ramming; // spacing between lines in mm const Vec2f ramming_start_pos = Vec2f(xl, cleaning_box.ld.y() + m_depth_traversed + y_step/2.f); @@ -928,7 +930,7 @@ void WipeTower::toolchange_Unload( if (tch.old_tool == m_current_tool) { sum_of_depths += tch.ramming_depth; float ramming_end_y = sum_of_depths; - ramming_end_y -= (y_step/m_extra_spacing-m_perimeter_width) / 2.f; // center of final ramming line + ramming_end_y -= (y_step/m_extra_spacing_ramming-m_perimeter_width) / 2.f; // center of final ramming line if ( (m_current_shape == SHAPE_REVERSED && ramming_end_y < sparse_beginning_y - 0.5f*m_perimeter_width ) || (m_current_shape == SHAPE_NORMAL && ramming_end_y > sparse_beginning_y + 0.5f*m_perimeter_width ) ) @@ -1076,7 +1078,7 @@ void WipeTower::toolchange_Unload( // this is to align ramming and future wiping extrusions, so the future y-steps can be uniform from the start: // the perimeter_width will later be subtracted, it is there to not load while moving over just extruded material - Vec2f pos = Vec2f(end_of_ramming.x(), end_of_ramming.y() + (y_step/m_extra_spacing-m_perimeter_width) / 2.f + m_perimeter_width); + Vec2f pos = Vec2f(end_of_ramming.x(), end_of_ramming.y() + (y_step/m_extra_spacing_ramming-m_perimeter_width) / 2.f + m_perimeter_width); if (do_ramming) writer.travel(pos, 2400.f); else @@ -1171,8 +1173,8 @@ void WipeTower::toolchange_Wipe( // the ordered volume, even if it means violating the box. This can later be removed and simply // wipe until the end of the assigned area. - float x_to_wipe = volume_to_length(wipe_volume, line_width, m_layer_height) * (is_first_layer() ? m_extra_spacing : 1.f); - float dy = (is_first_layer() ? 1.f : m_extra_spacing) * line_width; // Don't use the extra spacing for the first layer. + float x_to_wipe = volume_to_length(wipe_volume, m_perimeter_width, m_layer_height) / m_extra_flow; + float dy = (is_first_layer() ? m_extra_flow : m_extra_spacing_wipe) * m_perimeter_width; // Don't use the extra spacing for the first layer, but do use the spacing resulting from increased flow. // All the calculations in all other places take the spacing into account for all the layers. const float target_speed = is_first_layer() ? m_first_layer_speed * 60.f : m_infill_speed * 60.f; @@ -1535,16 +1537,15 @@ void WipeTower::plan_toolchange(float z_par, float layer_height_par, unsigned in float length_to_extrude = volume_to_length(0.25f * std::accumulate(m_filpar[old_tool].ramming_speed.begin(), m_filpar[old_tool].ramming_speed.end(), 0.f), m_perimeter_width * m_filpar[old_tool].ramming_line_width_multiplicator, layer_height_par); - depth = (int(length_to_extrude / width) + 1) * (m_perimeter_width * m_filpar[old_tool].ramming_line_width_multiplicator * m_filpar[old_tool].ramming_step_multiplicator); + depth = (int(length_to_extrude / width) + 1) * (m_perimeter_width * m_filpar[old_tool].ramming_line_width_multiplicator * m_filpar[old_tool].ramming_step_multiplicator) * m_extra_spacing_ramming; float ramming_depth = depth; length_to_extrude = width*((length_to_extrude / width)-int(length_to_extrude / width)) - width; float first_wipe_line = -length_to_extrude; - length_to_extrude += volume_to_length(wipe_volume, m_perimeter_width, layer_height_par); + length_to_extrude = (volume_to_length(wipe_volume, m_perimeter_width, layer_height_par) - first_wipe_line) / m_extra_flow; length_to_extrude = std::max(length_to_extrude,0.f); - depth += (int(length_to_extrude / width) + 1) * m_perimeter_width; - depth *= m_extra_spacing; - + depth += (int(length_to_extrude / width) + 1) * m_perimeter_width * m_extra_spacing_wipe; + m_plan.back().tool_changes.push_back(WipeTowerInfo::ToolChange(old_tool, new_tool, depth, ramming_depth, first_wipe_line, wipe_volume)); } @@ -1596,14 +1597,17 @@ void WipeTower::save_on_last_wipe() if (i == idx) { float width = m_wipe_tower_width - 3*m_perimeter_width; // width we draw into - float length_to_save = finish_layer().total_extrusion_length_in_plane(); - float length_to_wipe = volume_to_length(toolchange.wipe_volume, - m_perimeter_width, m_layer_info->height) / m_extra_flow - toolchange.first_wipe_line - length_to_save; + float length_to_save = finish_layer().total_extrusion_length_in_plane() / m_extra_flow; + float length_to_wipe = (volume_to_length(toolchange.wipe_volume, + m_perimeter_width, m_layer_info->height) - toolchange.first_wipe_line) / m_extra_flow; + float minimum_length = volume_to_length(m_filpar[toolchange.new_tool].filament_minimal_purge_on_wipe_tower, m_perimeter_width, m_layer_info->height) / m_extra_flow; + + length_to_wipe = std::max(length_to_wipe - length_to_save, minimum_length); length_to_wipe = std::max(length_to_wipe,0.f); - float depth_to_wipe = m_perimeter_width * (std::floor(length_to_wipe/width) + ( length_to_wipe > 0.f ? 1.f : 0.f ) ); + float depth_to_wipe = m_extra_spacing_wipe * m_perimeter_width * (int(length_to_wipe / width) + ( length_to_wipe > 0.f ? 1 : 0 )); - toolchange.required_depth = (toolchange.ramming_depth + depth_to_wipe) * m_extra_spacing; + toolchange.required_depth = toolchange.ramming_depth + depth_to_wipe; } } } diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 487d0bc2d4..6d3950afd3 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -240,7 +240,7 @@ public: float filament_skinnydip_loading_speed = 0.f; float filament_skinnydip_distance = 0.f; float filament_skinnydip_extra_move = 0.f; - + int cooling_moves = 0; float cooling_initial_speed = 0.f; float cooling_final_speed = 0.f; @@ -252,6 +252,7 @@ public: float filament_area; bool multitool_ramming; float multitool_ramming_time = 0.f; + float filament_minimal_purge_on_wipe_tower = 0.f; }; private: @@ -329,8 +330,9 @@ private: float m_depth_traversed = 0.f; // Current y position at the wipe tower. bool m_current_layer_finished = false; bool m_left_to_right = true; - float m_extra_spacing = 1.f; float m_extra_flow = 1.f; + float m_extra_spacing_wipe = 1.f; + float m_extra_spacing_ramming = 1.f; bool is_first_layer() const { return size_t(m_layer_info - m_plan.begin()) == m_first_layer_idx; } @@ -350,9 +352,6 @@ private: // Calculates depth for all layers and propagates them downwards void plan_tower(); - // Goes through m_plan and recalculates depths and width of the WT to make it exactly square - experimental - void make_wipe_tower_square(); - // Goes through m_plan, calculates border and finish_layer extrusions and subtracts them from last wipe void save_on_last_wipe(); From c4d4c7f22e323b3296e2616416866006ab690784 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 7 Feb 2024 12:25:16 +0100 Subject: [PATCH 20/25] Wipe tower: tweaking MK4 specific behaviour --- src/libslic3r/GCode/WipeTower.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 3f939b306a..6dd01730f8 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -944,8 +944,10 @@ void WipeTower::toolchange_Unload( } } - if (m_is_mk4mmu3) + if (m_is_mk4mmu3) { writer.switch_filament_monitoring(false); + writer.wait(1.5f); + } // now the ramming itself: @@ -988,9 +990,6 @@ void WipeTower::toolchange_Unload( .resume_preview(); } - if (m_is_mk4mmu3) - writer.switch_filament_monitoring(true); - const int& number_of_cooling_moves = m_filpar[m_current_tool].cooling_moves; const bool cooling_will_happen = m_semm && number_of_cooling_moves > 0; bool change_temp_later = false; @@ -1034,9 +1033,6 @@ void WipeTower::toolchange_Unload( // Skinnydip turning point shall be no farther than 20mm from the current nozzle position: float skinnydip_turning_point = std::clamp(old_x + 20.f * (turning_point - old_x > 0.f ? 1.f : -1.f), xl, xr); - if (m_is_mk4mmu3) - writer.switch_filament_monitoring(false); - // Only last 5mm will be done with the fast x travel. The point is to spread possible blobs // along the whole wipe tower. if (skinnydip_dist_e > 5) { @@ -1050,9 +1046,6 @@ void WipeTower::toolchange_Unload( // Retract while the print head is stationary, so if there is a blob, it is not dragged along. writer.retract(skinnydip_dist_e, m_filpar[m_current_tool].unloading_speed * 60.f); - if (m_is_mk4mmu3) - writer.switch_filament_monitoring(true); - if (m_filpar[m_current_tool].filament_skinnydip_extra_move != 0.f) skinnydip_dist_e += m_filpar[m_current_tool].filament_skinnydip_extra_move; } @@ -1103,6 +1096,9 @@ void WipeTower::toolchange_Change( //writer.append("[end_filament_gcode]\n"); writer.append("[toolchange_gcode_from_wipe_tower_generator]\n"); + if (m_is_mk4mmu3) + writer.switch_filament_monitoring(true); + // Travel to where we assume we are. Custom toolchange or some special T code handling (parking extruder etc) // gcode could have left the extruder somewhere, we cannot just start extruding. We should also inform the // postprocessor that we absolutely want to have this in the gcode, even if it thought it is the same as before. From 030cd934c5d59a5f7c701072602f76c84e57a84d Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 7 Feb 2024 12:49:43 +0100 Subject: [PATCH 21/25] Wipe tower: removed skinnydip_extra_move --- src/libslic3r/GCode/WipeTower.cpp | 4 ---- src/libslic3r/GCode/WipeTower.hpp | 1 - src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 1 - src/libslic3r/PrintConfig.cpp | 7 ------- src/libslic3r/PrintConfig.hpp | 1 - src/slic3r/GUI/Tab.cpp | 1 - 7 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 6dd01730f8..245ea9271c 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -645,7 +645,6 @@ void WipeTower::set_extruder(size_t idx, const PrintConfig& config) m_filpar[idx].cooling_final_speed = float(config.filament_cooling_final_speed.get_at(idx)); m_filpar[idx].filament_skinnydip_loading_speed = float(config.filament_skinnydip_loading_speed.get_at(idx)); m_filpar[idx].filament_skinnydip_distance = float(config.filament_skinnydip_distance.get_at(idx)); - m_filpar[idx].filament_skinnydip_extra_move = float(config.filament_skinnydip_extra_move.get_at(idx)); } m_filpar[idx].filament_area = float((M_PI/4.f) * pow(config.filament_diameter.get_at(idx), 2)); // all extruders are assumed to have the same filament diameter at this point @@ -1045,9 +1044,6 @@ void WipeTower::toolchange_Unload( // Retract while the print head is stationary, so if there is a blob, it is not dragged along. writer.retract(skinnydip_dist_e, m_filpar[m_current_tool].unloading_speed * 60.f); - - if (m_filpar[m_current_tool].filament_skinnydip_extra_move != 0.f) - skinnydip_dist_e += m_filpar[m_current_tool].filament_skinnydip_extra_move; } if (i == number_of_cooling_moves - 1 && change_temp_later) { diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 6d3950afd3..c6c4add480 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -239,7 +239,6 @@ public: float filament_skinnydip_loading_speed = 0.f; float filament_skinnydip_distance = 0.f; - float filament_skinnydip_extra_move = 0.f; int cooling_moves = 0; float cooling_initial_speed = 0.f; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index ad3eb97af6..d3edc2bbb9 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -478,7 +478,7 @@ static std::vector s_Preset_print_options { static std::vector s_Preset_filament_options { "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_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_skinnydip_extra_move", "filament_cooling_moves", "filament_skinnydip_loading_speed", "filament_skinnydip_distance", + "filament_unloading_speed", "filament_unloading_speed_start", "filament_unload_time", "filament_toolchange_delay", "filament_cooling_moves", "filament_skinnydip_loading_speed", "filament_skinnydip_distance", "filament_cooling_initial_speed", "filament_cooling_final_speed", "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", "min_fan_speed", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 252476a7e7..3640631dff 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -218,7 +218,6 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "filament_unloading_speed" || opt_key == "filament_unloading_speed_start" || opt_key == "filament_toolchange_delay" - || opt_key == "filament_skinnydip_extra_move" || opt_key == "filament_cooling_moves" || opt_key == "filament_skinnydip_loading_speed" || opt_key == "filament_skinnydip_distance" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 95b1cc9c42..4e41745d9b 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1107,13 +1107,6 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("filament_skinnydip_extra_move", coFloats); - def->label = L("ELIAS Skinnydip extension per dip"); - def->tooltip = L("..."); - def->sidetext = L("mm"); - def->mode = comExpert; - def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("filament_cooling_moves", coInts); def->label = L("Number of cooling moves"); def->tooltip = L("Filament is cooled by being moved back and forth in the " diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index a802640a25..8919b2a5a3 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -733,7 +733,6 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloats, filament_multitool_ramming_flow)) ((ConfigOptionFloats, filament_skinnydip_loading_speed)) ((ConfigOptionFloats, filament_skinnydip_distance)) - ((ConfigOptionFloats, filament_skinnydip_extra_move)) ((ConfigOptionBool, gcode_comments)) ((ConfigOptionEnum, gcode_flavor)) ((ConfigOptionEnum, gcode_label_objects)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 94d7a11fdb..45c0d5a6be 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2273,7 +2273,6 @@ void TabFilament::build() optgroup->append_single_option_line("filament_cooling_final_speed"); optgroup->append_single_option_line("filament_skinnydip_loading_speed"); optgroup->append_single_option_line("filament_skinnydip_distance"); - optgroup->append_single_option_line("filament_skinnydip_extra_move"); create_line_with_widget(optgroup.get(), "filament_ramming_parameters", "", [this](wxWindow* parent) { auto ramming_dialog_btn = new wxButton(parent, wxID_ANY, _(L("Ramming settings"))+dots, wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); From 0736f68e7766abeab5fc16b8b57d2b90eb3cf20f Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 7 Feb 2024 14:28:21 +0100 Subject: [PATCH 22/25] Wipe tower: rebranded skinnydip to stamping --- src/libslic3r/GCode/WipeTower.cpp | 25 ++++++++++++------------- src/libslic3r/GCode/WipeTower.hpp | 4 ++-- src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 4 ++-- src/libslic3r/PrintConfig.cpp | 15 ++++++++------- src/libslic3r/PrintConfig.hpp | 4 ++-- src/slic3r/GUI/Tab.cpp | 4 ++-- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 245ea9271c..9d85845cc2 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -643,8 +643,8 @@ 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].filament_skinnydip_loading_speed = float(config.filament_skinnydip_loading_speed.get_at(idx)); - m_filpar[idx].filament_skinnydip_distance = float(config.filament_skinnydip_distance.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)); } m_filpar[idx].filament_area = float((M_PI/4.f) * pow(config.filament_diameter.get_at(idx), 2)); // all extruders are assumed to have the same filament diameter at this point @@ -1022,28 +1022,28 @@ void WipeTower::toolchange_Unload( .travel(writer.x(), writer.y() + y_step); old_x = writer.x(); turning_point = xr-old_x > old_x-xl ? xr : xl; - float skinnydip_dist_e = m_filpar[m_current_tool].filament_skinnydip_distance + m_cooling_tube_length / 2.f; + float stamping_dist_e = m_filpar[m_current_tool].filament_stamping_distance + m_cooling_tube_length / 2.f; for (int i=0; i0 && m_filpar[m_current_tool].filament_skinnydip_distance != 0) { + // Stamping - happens after every cooling move except for the last one. + if (i>0 && m_filpar[m_current_tool].filament_stamping_distance != 0) { - // Skinnydip turning point shall be no farther than 20mm from the current nozzle position: - float skinnydip_turning_point = std::clamp(old_x + 20.f * (turning_point - old_x > 0.f ? 1.f : -1.f), xl, xr); + // Stamping turning point shall be no farther than 20mm from the current nozzle position: + float stamping_turning_point = std::clamp(old_x + 20.f * (turning_point - old_x > 0.f ? 1.f : -1.f), xl, xr); // Only last 5mm will be done with the fast x travel. The point is to spread possible blobs // along the whole wipe tower. - if (skinnydip_dist_e > 5) { + if (stamping_dist_e > 5) { float cent = writer.x(); - writer.load_move_x_advanced(skinnydip_turning_point, (skinnydip_dist_e - 5), m_filpar[m_current_tool].filament_skinnydip_loading_speed, 200); - writer.load_move_x_advanced(cent, 5, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); + writer.load_move_x_advanced(stamping_turning_point, (stamping_dist_e - 5), m_filpar[m_current_tool].filament_stamping_loading_speed, 200); + writer.load_move_x_advanced(cent, 5, m_filpar[m_current_tool].filament_stamping_loading_speed, m_travel_speed); writer.travel(cent, writer.y()); } else - writer.load_move_x_advanced_there_and_back(skinnydip_turning_point, skinnydip_dist_e, m_filpar[m_current_tool].filament_skinnydip_loading_speed, m_travel_speed); + writer.load_move_x_advanced_there_and_back(stamping_turning_point, stamping_dist_e, m_filpar[m_current_tool].filament_stamping_loading_speed, m_travel_speed); // Retract while the print head is stationary, so if there is a blob, it is not dragged along. - writer.retract(skinnydip_dist_e, m_filpar[m_current_tool].unloading_speed * 60.f); + writer.retract(stamping_dist_e, m_filpar[m_current_tool].unloading_speed * 60.f); } if (i == number_of_cooling_moves - 1 && change_temp_later) { @@ -1156,7 +1156,6 @@ void WipeTower::toolchange_Wipe( const float& xl = cleaning_box.ld.x(); const float& xr = cleaning_box.rd.x(); - // MATHIEU TEST: writer.set_extrusion_flow(m_extrusion_flow * m_extra_flow); const float line_width = m_perimeter_width * m_extra_flow; writer.change_analyzer_line_width(line_width); diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index c6c4add480..09c5598fbf 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -237,8 +237,8 @@ public: float unloading_speed_start = 0.f; float delay = 0.f ; - float filament_skinnydip_loading_speed = 0.f; - float filament_skinnydip_distance = 0.f; + float filament_stamping_loading_speed = 0.f; + float filament_stamping_distance = 0.f; int cooling_moves = 0; float cooling_initial_speed = 0.f; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index d3edc2bbb9..c62f6d8161 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -478,7 +478,7 @@ static std::vector s_Preset_print_options { static std::vector s_Preset_filament_options { "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_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_skinnydip_loading_speed", "filament_skinnydip_distance", + "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_cooling_final_speed", "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", "min_fan_speed", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 3640631dff..0263657885 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -219,8 +219,8 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "filament_unloading_speed_start" || opt_key == "filament_toolchange_delay" || opt_key == "filament_cooling_moves" - || opt_key == "filament_skinnydip_loading_speed" - || opt_key == "filament_skinnydip_distance" + || opt_key == "filament_stamping_loading_speed" + || opt_key == "filament_stamping_distance" || opt_key == "filament_minimal_purge_on_wipe_tower" || opt_key == "filament_cooling_initial_speed" || opt_key == "filament_cooling_final_speed" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 4e41745d9b..4af003b9f3 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1093,16 +1093,17 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("filament_skinnydip_loading_speed", coFloats); - def->label = L("ELIAS: Skinnydip loading speed"); - def->tooltip = L(""); + def = this->add("filament_stamping_loading_speed", coFloats); + def->label = L("Stamping loading speed"); + def->tooltip = L("Speed used for stamping."); def->min = 0; def->mode = comExpert; def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("filament_skinnydip_distance", coFloats); - def->label = L("ELIAS: Skinnydip distance measured from the center of the cooling tube"); - def->tooltip = L(""); + def = this->add("filament_stamping_distance", coFloats); + def->label = L("Stamping distance measured from the center of the cooling tube"); + def->tooltip = L("If set to nonzero value, filament is moved toward the nozzle between the individual cooling moves (\"stamping\"). " + "This option configures how long this movement should be before the filament is retracted again."); def->min = 0; def->mode = comExpert; def->set_default_value(new ConfigOptionFloats { 0. }); @@ -3357,7 +3358,7 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionPercent(100.)); def = this->add("wipe_tower_extra_flow", coPercent); - def->label = L("MATHIEU TEST: extra flow"); + def->label = L("Extra flow for purging"); def->tooltip = L(""); def->sidetext = L("%"); def->mode = comExpert; diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 8919b2a5a3..6e4793bf7d 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -731,8 +731,8 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBools, filament_multitool_ramming)) ((ConfigOptionFloats, filament_multitool_ramming_volume)) ((ConfigOptionFloats, filament_multitool_ramming_flow)) - ((ConfigOptionFloats, filament_skinnydip_loading_speed)) - ((ConfigOptionFloats, filament_skinnydip_distance)) + ((ConfigOptionFloats, filament_stamping_loading_speed)) + ((ConfigOptionFloats, filament_stamping_distance)) ((ConfigOptionBool, gcode_comments)) ((ConfigOptionEnum, gcode_flavor)) ((ConfigOptionEnum, gcode_label_objects)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 45c0d5a6be..a80df44e5f 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2271,8 +2271,8 @@ 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_skinnydip_loading_speed"); - optgroup->append_single_option_line("filament_skinnydip_distance"); + optgroup->append_single_option_line("filament_stamping_loading_speed"); + optgroup->append_single_option_line("filament_stamping_distance"); create_line_with_widget(optgroup.get(), "filament_ramming_parameters", "", [this](wxWindow* parent) { auto ramming_dialog_btn = new wxButton(parent, wxID_ANY, _(L("Ramming settings"))+dots, wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); From 27918866576de3de0b88b059bafa03d74c548e26 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 7 Feb 2024 15:26:09 +0100 Subject: [PATCH 23/25] Wipe tower: changed default value for stamping speed --- src/libslic3r/GCode/WipeTower.hpp | 3 +-- src/libslic3r/PrintConfig.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 09c5598fbf..c09b53519e 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -319,8 +319,7 @@ private: // State of the wipe tower generator. unsigned int m_num_layer_changes = 0; // Layer change counter for the output statistics. unsigned int m_num_tool_changes = 0; // Tool change change counter for the output statistics. - ///unsigned int m_idx_tool_change_in_layer = 0; // Layer change counter in this layer. Counting up to m_max_color_changes. - bool m_print_brim = true; + // A fill-in direction (positive Y, negative Y) alternates with each layer. wipe_shape m_current_shape = SHAPE_NORMAL; size_t m_current_tool = 0; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 4af003b9f3..508d7e574e 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1098,7 +1098,7 @@ void PrintConfigDef::init_fff_params() def->tooltip = L("Speed used for stamping."); def->min = 0; def->mode = comExpert; - def->set_default_value(new ConfigOptionFloats { 0. }); + def->set_default_value(new ConfigOptionFloats { 20. }); def = this->add("filament_stamping_distance", coFloats); def->label = L("Stamping distance measured from the center of the cooling tube"); From 2385a65bd3e6e82d33913fb25360e27be96395e2 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 13 Feb 2024 10:44:49 +0100 Subject: [PATCH 24/25] Wipe tower: Fixed issues with overlapping extrusions: The commit contains quite a bit of refactoring, but the key change is at the end of save_on_last_wipe. It was missing the subtraction of the wipe volume from the respective member variable, so the tower would attempt to wipe too much volume into the shrunk area. --- src/libslic3r/GCode/WipeTower.cpp | 54 ++++++++++++++++++++----------- src/libslic3r/GCode/WipeTower.hpp | 10 ++---- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 9d85845cc2..1cd4135472 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -29,6 +29,20 @@ namespace Slic3r { +// Calculates length of extrusion line to extrude given volume +static float volume_to_length(float volume, float line_width, float layer_height) +{ + return std::max(0.f, volume / (layer_height * (line_width - layer_height * (1.f - float(M_PI) / 4.f)))); +} + +static float length_to_volume(float length, float line_width, float layer_height) +{ + return std::max(0.f, length * layer_height * (line_width - layer_height * (1.f - float(M_PI) / 4.f))); +} + + + + class WipeTowerWriter { public: @@ -805,7 +819,7 @@ WipeTower::ToolChangeResult WipeTower::tool_change(size_t tool) for (const auto &b : m_layer_info->tool_changes) if ( b.new_tool == tool ) { wipe_volume = b.wipe_volume; - wipe_area = b.required_depth * m_layer_info->extra_spacing; + wipe_area = b.required_depth; break; } } @@ -1507,6 +1521,17 @@ std::vector> WipeTower::extract_wipe_volumes(const PrintConfi return wipe_volumes; } +static float get_wipe_depth(float volume, float layer_height, float perimeter_width, float extra_flow, float extra_spacing, float width) +{ + float length_to_extrude = (volume_to_length(volume, perimeter_width, layer_height)) / extra_flow; + length_to_extrude = std::max(length_to_extrude,0.f); + + return (int(length_to_extrude / width) + 1) * perimeter_width * extra_spacing; +} + + + + // Appends a toolchange into m_plan and calculates neccessary depth of the corresponding box void WipeTower::plan_toolchange(float z_par, float layer_height_par, unsigned int old_tool, unsigned int new_tool, float wipe_volume) @@ -1523,21 +1548,17 @@ void WipeTower::plan_toolchange(float z_par, float layer_height_par, unsigned in return; // this is an actual toolchange - let's calculate depth to reserve on the wipe tower - float depth = 0.f; float width = m_wipe_tower_width - 3*m_perimeter_width; float length_to_extrude = volume_to_length(0.25f * std::accumulate(m_filpar[old_tool].ramming_speed.begin(), m_filpar[old_tool].ramming_speed.end(), 0.f), m_perimeter_width * m_filpar[old_tool].ramming_line_width_multiplicator, layer_height_par); - depth = (int(length_to_extrude / width) + 1) * (m_perimeter_width * m_filpar[old_tool].ramming_line_width_multiplicator * m_filpar[old_tool].ramming_step_multiplicator) * m_extra_spacing_ramming; - float ramming_depth = depth; - length_to_extrude = width*((length_to_extrude / width)-int(length_to_extrude / width)) - width; - float first_wipe_line = -length_to_extrude; - length_to_extrude = (volume_to_length(wipe_volume, m_perimeter_width, layer_height_par) - first_wipe_line) / m_extra_flow; - length_to_extrude = std::max(length_to_extrude,0.f); + float ramming_depth = (int(length_to_extrude / width) + 1) * (m_perimeter_width * m_filpar[old_tool].ramming_line_width_multiplicator * m_filpar[old_tool].ramming_step_multiplicator) * m_extra_spacing_ramming; + float first_wipe_line = - (width*((length_to_extrude / width)-int(length_to_extrude / width)) - width); - depth += (int(length_to_extrude / width) + 1) * m_perimeter_width * m_extra_spacing_wipe; + float first_wipe_volume = length_to_volume(first_wipe_line, m_perimeter_width * m_extra_flow, layer_height_par); + float wiping_depth = get_wipe_depth(wipe_volume - first_wipe_volume, layer_height_par, m_perimeter_width, m_extra_flow, m_extra_spacing_wipe, width); - m_plan.back().tool_changes.push_back(WipeTowerInfo::ToolChange(old_tool, new_tool, depth, ramming_depth, first_wipe_line, wipe_volume)); + m_plan.back().tool_changes.push_back(WipeTowerInfo::ToolChange(old_tool, new_tool, ramming_depth + wiping_depth, ramming_depth, first_wipe_line, wipe_volume)); } @@ -1588,17 +1609,14 @@ void WipeTower::save_on_last_wipe() if (i == idx) { float width = m_wipe_tower_width - 3*m_perimeter_width; // width we draw into - float length_to_save = finish_layer().total_extrusion_length_in_plane() / m_extra_flow; - float length_to_wipe = (volume_to_length(toolchange.wipe_volume, - m_perimeter_width, m_layer_info->height) - toolchange.first_wipe_line) / m_extra_flow; - float minimum_length = volume_to_length(m_filpar[toolchange.new_tool].filament_minimal_purge_on_wipe_tower, m_perimeter_width, m_layer_info->height) / m_extra_flow; - length_to_wipe = std::max(length_to_wipe - length_to_save, minimum_length); - - length_to_wipe = std::max(length_to_wipe,0.f); - float depth_to_wipe = m_extra_spacing_wipe * m_perimeter_width * (int(length_to_wipe / width) + ( length_to_wipe > 0.f ? 1 : 0 )); + float volume_to_save = length_to_volume(finish_layer().total_extrusion_length_in_plane(), m_perimeter_width, m_layer_info->height); + float volume_left_to_wipe = std::max(m_filpar[toolchange.new_tool].filament_minimal_purge_on_wipe_tower, toolchange.wipe_volume_total - volume_to_save); + float volume_we_need_depth_for = std::max(0.f, volume_left_to_wipe - length_to_volume(toolchange.first_wipe_line, m_perimeter_width*m_extra_flow, m_layer_info->height)); + float depth_to_wipe = get_wipe_depth(volume_we_need_depth_for, m_layer_info->height, m_perimeter_width, m_extra_flow, m_extra_spacing_wipe, width); toolchange.required_depth = toolchange.ramming_depth + depth_to_wipe; + toolchange.wipe_volume = volume_left_to_wipe; } } } diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index c09b53519e..f99018fbe0 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -342,10 +342,6 @@ private: return layer_height * ( m_perimeter_width - layer_height * (1.f-float(M_PI)/4.f)) / filament_area(); } - // Calculates length of extrusion line to extrude given volume - float volume_to_length(float volume, float line_width, float layer_height) const { - return std::max(0.f, volume / (layer_height * (line_width - layer_height * (1.f - float(M_PI) / 4.f)))); - } // Calculates depth for all layers and propagates them downwards void plan_tower(); @@ -363,19 +359,19 @@ private: float ramming_depth; float first_wipe_line; float wipe_volume; + float wipe_volume_total; ToolChange(size_t old, size_t newtool, float depth=0.f, float ramming_depth=0.f, float fwl=0.f, float wv=0.f) - : old_tool{old}, new_tool{newtool}, required_depth{depth}, ramming_depth{ramming_depth}, first_wipe_line{fwl}, wipe_volume{wv} {} + : old_tool{old}, new_tool{newtool}, required_depth{depth}, ramming_depth{ramming_depth}, first_wipe_line{fwl}, wipe_volume{wv}, wipe_volume_total{wv} {} }; float z; // z position of the layer float height; // layer height float depth; // depth of the layer based on all layers above - float extra_spacing; float toolchanges_depth() const { float sum = 0.f; for (const auto &a : tool_changes) sum += a.required_depth; return sum; } std::vector tool_changes; WipeTowerInfo(float z_par, float layer_height_par) - : z{z_par}, height{layer_height_par}, depth{0}, extra_spacing{1.f} {} + : z{z_par}, height{layer_height_par}, depth{0} {} }; std::vector m_plan; // Stores information about all layers and toolchanges for the future wipe tower (filled by plan_toolchange(...)) From 2c06490145e4737da920d099a3ff65688e7d5b64 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 28 Feb 2024 15:47:34 +0100 Subject: [PATCH 25/25] Fixed visual glitch in RammingChart --- src/slic3r/GUI/RammingChart.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/RammingChart.cpp b/src/slic3r/GUI/RammingChart.cpp index b1a1ed8c73..cb3944bc45 100644 --- a/src/slic3r/GUI/RammingChart.cpp +++ b/src/slic3r/GUI/RammingChart.cpp @@ -138,11 +138,13 @@ void Chart::mouse_moved(wxMouseEvent& event) { int delta_x = pos.x - m_previous_mouse.x; int delta_y = pos.y - m_previous_mouse.y; + double new_y = m_dragged->get_pos().m_y - double(delta_y) / m_rect.GetHeight() * visible_area.m_height; + if (m_uniform) for (ButtonToDrag& b : m_buttons) - b.move(fixed_x?0:double(delta_x)/m_rect.GetWidth() * visible_area.m_width, m_dragged->get_pos().m_y - b.get_pos().m_y + -double(delta_y)/m_rect.GetHeight() * visible_area.m_height); + b.move(fixed_x?0:double(delta_x)/m_rect.GetWidth() * visible_area.m_width, new_y - b.get_pos().m_y); else - m_dragged->move(fixed_x?0:double(delta_x)/m_rect.GetWidth() * visible_area.m_width, -double(delta_y)/m_rect.GetHeight() * visible_area.m_height); + m_dragged->move(fixed_x?0:double(delta_x)/m_rect.GetWidth() * visible_area.m_width, new_y - m_dragged->get_pos().m_y); m_previous_mouse = pos; recalculate_line();