From 09ce6c62ea94c5f3d88eb2a7a0aa9de91c8a728e Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Mon, 13 Aug 2018 14:51:03 +0200 Subject: [PATCH 1/4] Retraction after ramming is now done without moving the head --- xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp index 3d0dba07a..4009ebf3a 100644 --- a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp +++ b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp @@ -793,11 +793,16 @@ void WipeTowerPrusaMM::toolchange_Unload( float turning_point = (!m_left_to_right ? xl : xr ); float total_retraction_distance = m_cooling_tube_retraction + m_cooling_tube_length/2.f - 15.f; // the 15mm is reserved for the first part after ramming writer.suppress_preview() - .load_move_x_advanced(turning_point, -15.f, 83.f, 50.f) // this is done at fixed speed + .retract(15.f, 5000.f) // feedrate 5000mm/min = 83mm/s + .retract(0.70f * total_retraction_distance, 1.0f * m_filpar[m_current_tool].unloading_speed * 60.f) + .retract(0.20f * total_retraction_distance, 0.5f * m_filpar[m_current_tool].unloading_speed * 60.f) + .retract(0.10f * total_retraction_distance, 0.3f * m_filpar[m_current_tool].unloading_speed * 60.f) + + /*.load_move_x_advanced(turning_point, -15.f, 83.f, 50.f) // this is done at fixed speed .load_move_x_advanced(old_x, -0.70f * total_retraction_distance, 1.0f * m_filpar[m_current_tool].unloading_speed) .load_move_x_advanced(turning_point, -0.20f * total_retraction_distance, 0.5f * m_filpar[m_current_tool].unloading_speed) .load_move_x_advanced(old_x, -0.10f * total_retraction_distance, 0.3f * m_filpar[m_current_tool].unloading_speed) - .travel(old_x, writer.y()) // in case previous move was shortened to limit feedrate + .travel(old_x, writer.y()) // in case previous move was shortened to limit feedrate*/ .resume_preview(); if (new_temperature != 0 && new_temperature != m_old_temperature ) { // Set the extruder temperature, but don't wait. From 74e807f89bb03472924563212e7b11878424f077 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 14 Aug 2018 16:23:23 +0200 Subject: [PATCH 2/4] New experimental parameter to adjust initial loading speed of the filament from the nozzle --- xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp | 2 +- xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp | 6 ++++-- xs/src/libslic3r/Print.cpp | 2 ++ xs/src/libslic3r/PrintConfig.cpp | 8 ++++++++ xs/src/libslic3r/PrintConfig.hpp | 2 ++ xs/src/slic3r/GUI/Preset.cpp | 4 ++-- xs/src/slic3r/GUI/Tab.cpp | 1 + 7 files changed, 20 insertions(+), 5 deletions(-) diff --git a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp index 4009ebf3a..de1f9a59b 100644 --- a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp +++ b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp @@ -793,7 +793,7 @@ void WipeTowerPrusaMM::toolchange_Unload( float turning_point = (!m_left_to_right ? xl : xr ); float total_retraction_distance = m_cooling_tube_retraction + m_cooling_tube_length/2.f - 15.f; // the 15mm is reserved for the first part after ramming writer.suppress_preview() - .retract(15.f, 5000.f) // feedrate 5000mm/min = 83mm/s + .retract(15.f, m_filpar[m_current_tool].unloading_speed_start * 60.f) // feedrate 5000mm/min = 83mm/s .retract(0.70f * total_retraction_distance, 1.0f * m_filpar[m_current_tool].unloading_speed * 60.f) .retract(0.20f * total_retraction_distance, 0.5f * m_filpar[m_current_tool].unloading_speed * 60.f) .retract(0.10f * total_retraction_distance, 0.3f * m_filpar[m_current_tool].unloading_speed * 60.f) diff --git a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp index e1529bcf4..4b96ce17c 100644 --- a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp +++ b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp @@ -66,8 +66,8 @@ public: // Set the extruder properties. void set_extruder(size_t idx, material_type material, int temp, int first_layer_temp, float loading_speed, - float unloading_speed, float delay, int cooling_moves, float cooling_initial_speed, - float cooling_final_speed, std::string ramming_parameters, float nozzle_diameter) + float unloading_speed, float unloading_speed_start, float delay, int cooling_moves, + float cooling_initial_speed, float cooling_final_speed, std::string ramming_parameters, float nozzle_diameter) { //while (m_filpar.size() < idx+1) // makes sure the required element is in the vector m_filpar.push_back(FilamentParameters()); @@ -77,6 +77,7 @@ public: m_filpar[idx].first_layer_temperature = first_layer_temp; m_filpar[idx].loading_speed = loading_speed; m_filpar[idx].unloading_speed = unloading_speed; + m_filpar[idx].unloading_speed_start = unloading_speed_start; m_filpar[idx].delay = delay; m_filpar[idx].cooling_moves = cooling_moves; m_filpar[idx].cooling_initial_speed = cooling_initial_speed; @@ -217,6 +218,7 @@ private: int first_layer_temperature = 0; float loading_speed = 0.f; float unloading_speed = 0.f; + float unloading_speed_start = 0.f; float delay = 0.f ; int cooling_moves = 0; float cooling_initial_speed = 0.f; diff --git a/xs/src/libslic3r/Print.cpp b/xs/src/libslic3r/Print.cpp index 7d2906bcc..4154378ec 100644 --- a/xs/src/libslic3r/Print.cpp +++ b/xs/src/libslic3r/Print.cpp @@ -201,6 +201,7 @@ bool Print::invalidate_state_by_config_options(const std::vectorconfig.first_layer_temperature.get_at(i), this->config.filament_loading_speed.get_at(i), this->config.filament_unloading_speed.get_at(i), + this->config.filament_unloading_speed_start.get_at(i), this->config.filament_toolchange_delay.get_at(i), this->config.filament_cooling_moves.get_at(i), this->config.filament_cooling_initial_speed.get_at(i), diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index d8f2d85a6..cb09a9d09 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -482,6 +482,14 @@ PrintConfigDef::PrintConfigDef() def->min = 0; def->default_value = new ConfigOptionFloats { 90. }; + def = this->add("filament_unloading_speed_start", coFloats); + def->label = L("EXPERIMENTAL: Unloading speed at the start"); + def->tooltip = L("Speed used for unloading the tip of the filament immediately after ramming. "); + def->sidetext = L("mm/s"); + def->cli = "filament-unloading-speed-start=f@"; + def->min = 0; + def->default_value = new ConfigOptionFloats { 83. }; + def = this->add("filament_toolchange_delay", coFloats); def->label = L("Delay after unloading"); def->tooltip = L("Time to wait after the filament is unloaded. " diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index b18603d87..edf7756e8 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -530,6 +530,7 @@ public: ConfigOptionFloats filament_loading_speed; ConfigOptionFloats filament_load_time; ConfigOptionFloats filament_unloading_speed; + ConfigOptionFloats filament_unloading_speed_start; ConfigOptionFloats filament_toolchange_delay; ConfigOptionFloats filament_unload_time; ConfigOptionInts filament_cooling_moves; @@ -596,6 +597,7 @@ protected: OPT_PTR(filament_loading_speed); OPT_PTR(filament_load_time); OPT_PTR(filament_unloading_speed); + OPT_PTR(filament_unloading_speed_start); OPT_PTR(filament_unload_time); OPT_PTR(filament_toolchange_delay); OPT_PTR(filament_cooling_moves); diff --git a/xs/src/slic3r/GUI/Preset.cpp b/xs/src/slic3r/GUI/Preset.cpp index 9f51f7b97..ba27bea8a 100644 --- a/xs/src/slic3r/GUI/Preset.cpp +++ b/xs/src/slic3r/GUI/Preset.cpp @@ -314,8 +314,8 @@ const std::vector& Preset::filament_options() static std::vector s_opts { "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_speed", "extrusion_multiplier", "filament_density", "filament_cost", - "filament_loading_speed", "filament_load_time", "filament_unloading_speed", "filament_unload_time", "filament_toolchange_delay", - "filament_cooling_moves", "filament_cooling_initial_speed", "filament_cooling_final_speed", "filament_ramming_parameters", + "filament_loading_speed", "filament_load_time", "filament_unloading_speed", "filament_unloading_speed_start", "filament_unload_time", + "filament_toolchange_delay", "filament_cooling_moves", "filament_cooling_initial_speed", "filament_cooling_final_speed", "filament_ramming_parameters", "filament_minimal_purge_on_wipe_tower", "temperature", "first_layer_temperature", "bed_temperature", "first_layer_bed_temperature", "fan_always_on", "cooling", "min_fan_speed", "max_fan_speed", "bridge_fan_speed", "disable_fan_first_layers", "fan_below_layer_time", "slowdown_below_layer_time", "min_print_speed", "start_filament_gcode", "end_filament_gcode","compatible_printers", "compatible_printers_condition", diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp index 7c4322c5a..d3307f1f5 100644 --- a/xs/src/slic3r/GUI/Tab.cpp +++ b/xs/src/slic3r/GUI/Tab.cpp @@ -1292,6 +1292,7 @@ void TabFilament::build() optgroup = page->new_optgroup(_(L("Toolchange parameters with single extruder MM printers"))); optgroup->append_single_option_line("filament_loading_speed"); optgroup->append_single_option_line("filament_unloading_speed"); + optgroup->append_single_option_line("filament_unloading_speed_start"); optgroup->append_single_option_line("filament_load_time"); optgroup->append_single_option_line("filament_unload_time"); optgroup->append_single_option_line("filament_toolchange_delay"); From 28c8e176b56e3fbff11a1f7b7f07bc87bcc252b4 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 21 Aug 2018 14:36:24 +0200 Subject: [PATCH 3/4] Yet another experimental parameter to adjust the initial loading speed of a newly loaded filament --- xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp | 9 +++++++-- xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp | 4 +++- xs/src/libslic3r/Print.cpp | 2 ++ xs/src/libslic3r/PrintConfig.cpp | 8 ++++++++ xs/src/libslic3r/PrintConfig.hpp | 2 ++ xs/src/slic3r/GUI/Preset.cpp | 13 ++++++------- xs/src/slic3r/GUI/Tab.cpp | 5 +++-- 7 files changed, 31 insertions(+), 12 deletions(-) diff --git a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp index de1f9a59b..42c06252b 100644 --- a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp +++ b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp @@ -879,10 +879,15 @@ void WipeTowerPrusaMM::toolchange_Load( writer.append("; CP TOOLCHANGE LOAD\n") .suppress_preview() - .load_move_x_advanced(turning_point, 0.2f * edist, 0.3f * m_filpar[m_current_tool].loading_speed) // Acceleration + /*.load_move_x_advanced(turning_point, 0.2f * edist, 0.3f * m_filpar[m_current_tool].loading_speed) // Acceleration .load_move_x_advanced(oldx, 0.5f * edist, m_filpar[m_current_tool].loading_speed) // Fast phase .load_move_x_advanced(turning_point, 0.2f * edist, 0.3f * m_filpar[m_current_tool].loading_speed) // Slowing down - .load_move_x_advanced(oldx, 0.1f * edist, 0.1f * m_filpar[m_current_tool].loading_speed) // Super slow + .load_move_x_advanced(oldx, 0.1f * edist, 0.1f * m_filpar[m_current_tool].loading_speed) // Super slow*/ + + .load(0.2f * edist, 60.f * m_filpar[m_current_tool].loading_speed_start) + .load_move_x_advanced(turning_point, 0.7f * edist, m_filpar[m_current_tool].loading_speed) // Fast phase + .load_move_x_advanced(oldx, 0.1f * edist, 0.1f * m_filpar[m_current_tool].loading_speed) // Super slow*/ + .travel(oldx, writer.y()) // in case last move was shortened to limit x feedrate .resume_preview(); diff --git a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp index 4b96ce17c..305dbc40a 100644 --- a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp +++ b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp @@ -65,7 +65,7 @@ public: // Set the extruder properties. - void set_extruder(size_t idx, material_type material, int temp, int first_layer_temp, float loading_speed, + void set_extruder(size_t idx, material_type material, int temp, int first_layer_temp, float loading_speed, float loading_speed_start, float unloading_speed, float unloading_speed_start, float delay, int cooling_moves, float cooling_initial_speed, float cooling_final_speed, std::string ramming_parameters, float nozzle_diameter) { @@ -76,6 +76,7 @@ public: m_filpar[idx].temperature = temp; m_filpar[idx].first_layer_temperature = first_layer_temp; m_filpar[idx].loading_speed = loading_speed; + m_filpar[idx].loading_speed_start = loading_speed_start; m_filpar[idx].unloading_speed = unloading_speed; m_filpar[idx].unloading_speed_start = unloading_speed_start; m_filpar[idx].delay = delay; @@ -217,6 +218,7 @@ private: int temperature = 0; int first_layer_temperature = 0; float loading_speed = 0.f; + float loading_speed_start = 0.f; float unloading_speed = 0.f; float unloading_speed_start = 0.f; float delay = 0.f ; diff --git a/xs/src/libslic3r/Print.cpp b/xs/src/libslic3r/Print.cpp index 4154378ec..bd14837d9 100644 --- a/xs/src/libslic3r/Print.cpp +++ b/xs/src/libslic3r/Print.cpp @@ -200,6 +200,7 @@ bool Print::invalidate_state_by_config_options(const std::vectorconfig.temperature.get_at(i), this->config.first_layer_temperature.get_at(i), this->config.filament_loading_speed.get_at(i), + this->config.filament_loading_speed_start.get_at(i), this->config.filament_unloading_speed.get_at(i), this->config.filament_unloading_speed_start.get_at(i), this->config.filament_toolchange_delay.get_at(i), diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index cd933deaf..860283fbd 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -473,6 +473,14 @@ PrintConfigDef::PrintConfigDef() def->min = 0; def->default_value = new ConfigOptionFloats { 28. }; + def = this->add("filament_loading_speed_start", coFloats); + def->label = L("EXPERIMENTAL: Loading speed at the start"); + def->tooltip = L("Speed used at the very beginning of loading phase. "); + def->sidetext = L("mm/s"); + def->cli = "filament-loading-speed-start=f@"; + def->min = 0; + def->default_value = new ConfigOptionFloats { 9. }; + def = this->add("filament_unloading_speed", coFloats); def->label = L("Unloading speed"); def->tooltip = L("Speed used for unloading the filament on the wipe tower (does not affect " diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index edf7756e8..fd5392cab 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -528,6 +528,7 @@ public: ConfigOptionFloats filament_cost; ConfigOptionFloats filament_max_volumetric_speed; ConfigOptionFloats filament_loading_speed; + ConfigOptionFloats filament_loading_speed_start; ConfigOptionFloats filament_load_time; ConfigOptionFloats filament_unloading_speed; ConfigOptionFloats filament_unloading_speed_start; @@ -595,6 +596,7 @@ protected: OPT_PTR(filament_cost); OPT_PTR(filament_max_volumetric_speed); OPT_PTR(filament_loading_speed); + OPT_PTR(filament_loading_speed_start); OPT_PTR(filament_load_time); OPT_PTR(filament_unloading_speed); OPT_PTR(filament_unloading_speed_start); diff --git a/xs/src/slic3r/GUI/Preset.cpp b/xs/src/slic3r/GUI/Preset.cpp index ba27bea8a..abf7e7d43 100644 --- a/xs/src/slic3r/GUI/Preset.cpp +++ b/xs/src/slic3r/GUI/Preset.cpp @@ -313,13 +313,12 @@ const std::vector& Preset::filament_options() { static std::vector s_opts { "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_speed", - "extrusion_multiplier", "filament_density", "filament_cost", - "filament_loading_speed", "filament_load_time", "filament_unloading_speed", "filament_unloading_speed_start", "filament_unload_time", - "filament_toolchange_delay", "filament_cooling_moves", "filament_cooling_initial_speed", "filament_cooling_final_speed", "filament_ramming_parameters", - "filament_minimal_purge_on_wipe_tower", "temperature", "first_layer_temperature", "bed_temperature", "first_layer_bed_temperature", - "fan_always_on", "cooling", "min_fan_speed", "max_fan_speed", "bridge_fan_speed", "disable_fan_first_layers", "fan_below_layer_time", - "slowdown_below_layer_time", "min_print_speed", "start_filament_gcode", "end_filament_gcode","compatible_printers", "compatible_printers_condition", - "inherits" + "extrusion_multiplier", "filament_density", "filament_cost", "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_cooling_initial_speed", "filament_cooling_final_speed", "filament_ramming_parameters", "filament_minimal_purge_on_wipe_tower", + "temperature", "first_layer_temperature", "bed_temperature", "first_layer_bed_temperature", "fan_always_on", "cooling", "min_fan_speed", + "max_fan_speed", "bridge_fan_speed", "disable_fan_first_layers", "fan_below_layer_time", "slowdown_below_layer_time", "min_print_speed", + "start_filament_gcode", "end_filament_gcode","compatible_printers", "compatible_printers_condition", "inherits" }; return s_opts; } diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp index d3307f1f5..081c1d249 100644 --- a/xs/src/slic3r/GUI/Tab.cpp +++ b/xs/src/slic3r/GUI/Tab.cpp @@ -1290,9 +1290,10 @@ void TabFilament::build() optgroup->append_line(line); optgroup = page->new_optgroup(_(L("Toolchange parameters with single extruder MM printers"))); - optgroup->append_single_option_line("filament_loading_speed"); - optgroup->append_single_option_line("filament_unloading_speed"); + optgroup->append_single_option_line("filament_loading_speed_start"); + optgroup->append_single_option_line("filament_loading_speed"); optgroup->append_single_option_line("filament_unloading_speed_start"); + optgroup->append_single_option_line("filament_unloading_speed"); optgroup->append_single_option_line("filament_load_time"); optgroup->append_single_option_line("filament_unload_time"); optgroup->append_single_option_line("filament_toolchange_delay"); From be3b8e98daab21fda63bf126a1bcd6d80869706b Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 24 Aug 2018 12:46:32 +0200 Subject: [PATCH 4/4] Edited captions and default values of the new parameters (initial loading and unloading speed) --- xs/src/libslic3r/PrintConfig.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 860283fbd..c2baba027 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -474,12 +474,12 @@ PrintConfigDef::PrintConfigDef() def->default_value = new ConfigOptionFloats { 28. }; def = this->add("filament_loading_speed_start", coFloats); - def->label = L("EXPERIMENTAL: Loading speed at the start"); + def->label = L("Loading speed at the start"); def->tooltip = L("Speed used at the very beginning of loading phase. "); def->sidetext = L("mm/s"); def->cli = "filament-loading-speed-start=f@"; def->min = 0; - def->default_value = new ConfigOptionFloats { 9. }; + def->default_value = new ConfigOptionFloats { 3. }; def = this->add("filament_unloading_speed", coFloats); def->label = L("Unloading speed"); @@ -491,12 +491,12 @@ PrintConfigDef::PrintConfigDef() def->default_value = new ConfigOptionFloats { 90. }; def = this->add("filament_unloading_speed_start", coFloats); - def->label = L("EXPERIMENTAL: Unloading speed at the start"); + def->label = L("Unloading speed at the start"); def->tooltip = L("Speed used for unloading the tip of the filament immediately after ramming. "); def->sidetext = L("mm/s"); def->cli = "filament-unloading-speed-start=f@"; def->min = 0; - def->default_value = new ConfigOptionFloats { 83. }; + def->default_value = new ConfigOptionFloats { 100. }; def = this->add("filament_toolchange_delay", coFloats); def->label = L("Delay after unloading");