From 6920a88e58c1bc78247ba2b52685c218b7489eb8 Mon Sep 17 00:00:00 2001 From: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com> Date: Thu, 9 May 2024 16:21:06 +0100 Subject: [PATCH] SEMM: Introduced parameter to control the maximum speed used for purging in the purge tower (#5304) * Max wipe tower purge print speed for SEMM * Max wipe tower purge print speed for SEMM * Merge branch 'dev-branch' of https://github.com/igiannakas/OrcaSlicer into dev-branch * Updated float calculation * Updated float calculation * Updated tooltip * Updated label --- src/libslic3r/GCode/WipeTower2.cpp | 5 +++-- src/libslic3r/GCode/WipeTower2.hpp | 1 + src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 1 + src/libslic3r/PrintConfig.cpp | 12 ++++++++++++ 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, 22 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower2.cpp b/src/libslic3r/GCode/WipeTower2.cpp index 5dd5fa0f63..0013cb99cc 100644 --- a/src/libslic3r/GCode/WipeTower2.cpp +++ b/src/libslic3r/GCode/WipeTower2.cpp @@ -550,7 +550,8 @@ WipeTower2::WipeTower2(const PrintConfig& config, const PrintRegionConfig& defau m_infill_speed(default_region_config.sparse_infill_speed), m_perimeter_speed(default_region_config.inner_wall_speed), m_current_tool(initial_tool), - wipe_volumes(wiping_matrix) + wipe_volumes(wiping_matrix), + m_wipe_tower_max_purge_speed(float(config.wipe_tower_max_purge_speed)) { // Read absolute value of first layer speed, if given as percentage, // it is taken over following default. Speeds from config are not @@ -1099,7 +1100,7 @@ void WipeTower2::toolchange_Wipe( // All the calculations in all other places take the spacing into account for all the layers. // If spare layers are excluded->if 1 or less toolchange has been done, it must be sill the first layer, too.So slow down. - const float target_speed = is_first_layer() || (m_num_tool_changes <= 1 && m_no_sparse_layers) ? m_first_layer_speed * 60.f : std::min(5400.f, m_infill_speed * 60.f); + const float target_speed = is_first_layer() || (m_num_tool_changes <= 1 && m_no_sparse_layers) ? m_first_layer_speed * 60.f : std::min(m_wipe_tower_max_purge_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) diff --git a/src/libslic3r/GCode/WipeTower2.hpp b/src/libslic3r/GCode/WipeTower2.hpp index 8fd5d5de31..cb1c11b4e9 100644 --- a/src/libslic3r/GCode/WipeTower2.hpp +++ b/src/libslic3r/GCode/WipeTower2.hpp @@ -189,6 +189,7 @@ private: int m_old_temperature = -1; // To keep track of what was the last temp that we set (so we don't issue the command when not neccessary) float m_travel_speed = 0.f; float m_infill_speed = 0.f; + float m_wipe_tower_max_purge_speed = 90.f; float m_perimeter_speed = 0.f; float m_first_layer_speed = 0.f; size_t m_first_layer_idx = size_t(-1); diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index a5f4a2f4f5..f6426739de 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -816,7 +816,7 @@ static std::vector s_Preset_print_options { "tree_support_brim_width", "gcode_comments", "gcode_label_objects", "initial_layer_travel_speed", "exclude_object", "slow_down_layers", "infill_anchor", "infill_anchor_max","initial_layer_min_bead_width", "make_overhang_printable", "make_overhang_printable_angle", "make_overhang_printable_hole_size" ,"notes", - "wipe_tower_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_extruder", "wiping_volumes_extruders","wipe_tower_bridging", "single_extruder_multi_material_priming", + "wipe_tower_cone_angle", "wipe_tower_extra_spacing","wipe_tower_max_purge_speed", "wipe_tower_extruder", "wiping_volumes_extruders","wipe_tower_bridging", "single_extruder_multi_material_priming", "wipe_tower_rotation_angle", "tree_support_branch_distance_organic", "tree_support_branch_diameter_organic", "tree_support_branch_angle_organic", "hole_to_polyhole", "hole_to_polyhole_threshold", "hole_to_polyhole_twisted", "mmu_segmented_region_max_width", "mmu_segmented_region_interlocking_depth", "small_area_infill_flow_compensation", "small_area_infill_flow_compensation_model", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 9dfe1f9659..93bbc7c94b 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -304,6 +304,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "slow_down_layers" || opt_key == "wipe_tower_cone_angle" || opt_key == "wipe_tower_extra_spacing" + || opt_key == "wipe_tower_max_purge_speed" || opt_key == "wipe_tower_extruder" || opt_key == "wiping_volumes_extruders" || opt_key == "enable_filament_ramming" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 8f5e000ed0..07b461e60c 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -4757,6 +4757,18 @@ def = this->add("filament_loading_speed", coFloats); def->min = 100.; def->max = 300.; def->set_default_value(new ConfigOptionPercent(100.)); + + def = this->add("wipe_tower_max_purge_speed", coFloat); + def->label = L("Maximum print speed when purging"); + def->tooltip = L("The maximum print speed when purging in the wipe tower. If the sparse infill speed " + "or calculated speed from the filament max volumetric speed is lower, the lowest speed will be used instead.\n" + "Increasing this speed may affect the tower's stability, as purging can be performed over " + "sparse layers. Before increasing this parameter beyond the default of 90mm/sec, make sure your printer can reliably " + "bridge at the increased speeds."); + def->sidetext = L("mm/s"); + def->mode = comAdvanced; + def->min = 10; + def->set_default_value(new ConfigOptionFloat(90.)); def = this->add("wipe_tower_extruder", coInt); def->label = L("Wipe tower extruder"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 7630cbe598..74d630004d 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1240,6 +1240,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( // Orca: mmu support ((ConfigOptionFloat, wipe_tower_cone_angle)) ((ConfigOptionPercent, wipe_tower_extra_spacing)) + ((ConfigOptionFloat, wipe_tower_max_purge_speed)) ((ConfigOptionInt, wipe_tower_extruder)) ((ConfigOptionFloats, wiping_volumes_extruders)) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index d871e7cbcf..db02032451 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -678,7 +678,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co bool purge_in_primetower = preset_bundle->printers.get_edited_preset().config.opt_bool("purge_in_prime_tower"); - for (auto el : {"wipe_tower_rotation_angle", "wipe_tower_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_bridging", "wipe_tower_no_sparse_layers"}) + for (auto el : {"wipe_tower_rotation_angle", "wipe_tower_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_max_purge_speed", "wipe_tower_bridging", "wipe_tower_no_sparse_layers"}) toggle_line(el, have_prime_tower && purge_in_primetower); toggle_line("prime_volume",have_prime_tower && !purge_in_primetower); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index cdeae514fc..f812ae2b06 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2706,7 +2706,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) "brim_width", "wall_loops", "wall_filament", "sparse_infill_density", "sparse_infill_filament", "top_shell_layers", "enable_support", "support_filament", "support_interface_filament", "support_top_z_distance", "support_bottom_z_distance", "raft_layers", - "wipe_tower_rotation_angle", "wipe_tower_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_extruder", + "wipe_tower_rotation_angle", "wipe_tower_cone_angle", "wipe_tower_extra_spacing","wipe_tower_max_purge_speed", "wipe_tower_extruder", "best_object_pos" })) , sidebar(new Sidebar(q)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index c0f2c02d3c..01f7c8adac 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2283,6 +2283,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_max_purge_speed"); optgroup->append_single_option_line("wipe_tower_no_sparse_layers"); // optgroup->append_single_option_line("single_extruder_multi_material_priming");