From b3e9b82280557c9803c270854edb4935287a840e Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 2 Mar 2018 15:52:16 +0100 Subject: [PATCH] (Un)loading speed and time delay parameters introduced into GUI and conf. layer (not yet into wipe tower generator) --- xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp | 21 ++++++++-------- xs/src/libslic3r/PrintConfig.cpp | 27 +++++++++++++++++++++ xs/src/libslic3r/PrintConfig.hpp | 6 +++++ xs/src/slic3r/GUI/Preset.cpp | 9 +++---- xs/src/slic3r/GUI/Tab.cpp | 12 +++++---- 5 files changed, 55 insertions(+), 20 deletions(-) diff --git a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp index 2e3e7c0a7a..c146f6030f 100644 --- a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp +++ b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp @@ -845,7 +845,11 @@ void WipeTowerPrusaMM::toolchange_Unload( //writer.retract(15, 5000).retract(50, 5400).retract(15, 3000).retract(12, 2000); // Pull the filament end to the BEGINNING of the cooling tube - writer.retract(15, 5000).retract(m_cooling_tube_retraction+m_cooling_tube_length/2.f-42, 5400).retract(15, 3000).retract(12, 2000); + float unloading_feedrate = 5400.f; // Alex's original feedrate was 5400 + writer.retract(15, 5000) // just after ramming - fixed speed + .retract(m_cooling_tube_retraction+m_cooling_tube_length/2.f-42, unloading_feedrate) + .retract(15, unloading_feedrate*0.55f) + .retract(12, unloading_feedrate*0.35f); if (new_temperature != 0) // Set the extruder temperature, but don't wait. @@ -953,17 +957,14 @@ void WipeTowerPrusaMM::toolchange_Load( float oldx = writer.x(); // the nozzle is in place to do the first wiping moves, we will remember the position float oldy = writer.y(); - writer.append("; CP TOOLCHANGE LOAD\n") - // Load the filament while moving left / right, + // Load the filament while moving left / right, // so the excess material will not create a blob at a single position. + float loading_feedrate = 3000.f; + writer.append("; CP TOOLCHANGE LOAD\n") .suppress_preview() - // Accelerate the filament loading - .load_move_x(xr, 20, 1400) - // Fast loading phase - //.load_move_x(xl, 40, 3000) - Alex - .load_move_x(xl,m_parking_pos_retraction-50-2,3000) // loading is 2mm shorter that previous retraction - // Slowing down - .load_move_x(xr, 20, 1600) + .load_move_x(xr, 20, 1400) // Accelerate the filament loading + .load_move_x(xl,m_parking_pos_retraction-50-2,3000) // Fast phase - loading is 2mm shorter that previous retraction + .load_move_x(xr, 20, 1600) // Slowing down .load_move_x(xl, 10, 1000) .travel(oldx,oldy) .resume_preview(); diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 1886d52b88..cebb0832b2 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -448,6 +448,33 @@ PrintConfigDef::PrintConfigDef() def->min = 0; def->default_value = new ConfigOptionFloats { 0. }; + def = this->add("filament_loading_speed", coFloats); + def->label = _L("Loading speed"); + def->tooltip = _L("Speed used for loading the filament on the wipe tower. "); + def->sidetext = _L("mm\u00B3/s"); + def->cli = "filament-loading-speed=f@"; + def->min = 0; + def->default_value = new ConfigOptionFloats { 0. }; + + 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 " + " initial part of unloading just after ramming). "); + def->sidetext = _L("mm\u00B3/s"); + def->cli = "filament-unloading-speed=f@"; + def->min = 0; + def->default_value = new ConfigOptionFloats { 0. }; + + def = this->add("filament_toolchange_delay", coFloats); + def->label = _L("Delay after unloading"); + def->tooltip = _L("Time to wait after the filament is unloaded. " + "May help to get reliable toolchanges with flexible materials " + "that may need more time to shrink to original dimensions. "); + def->sidetext = _L("s"); + def->cli = "filament-toolchange-delay=f@"; + def->min = 0; + def->default_value = new ConfigOptionFloats { 0. }; + def = this->add("filament_diameter", coFloats); def->label = _L("Diameter"); def->tooltip = _L("Enter your filament diameter here. Good precision is required, so use a caliper " diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index c556a2d69c..4078324192 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -466,6 +466,9 @@ public: ConfigOptionBools filament_soluble; ConfigOptionFloats filament_cost; ConfigOptionFloats filament_max_volumetric_speed; + ConfigOptionFloats filament_loading_speed; + ConfigOptionFloats filament_unloading_speed; + ConfigOptionFloats filament_toolchange_delay; ConfigOptionBool gcode_comments; ConfigOptionEnum gcode_flavor; ConfigOptionString layer_gcode; @@ -518,6 +521,9 @@ protected: OPT_PTR(filament_soluble); OPT_PTR(filament_cost); OPT_PTR(filament_max_volumetric_speed); + OPT_PTR(filament_loading_speed); + OPT_PTR(filament_unloading_speed); + OPT_PTR(filament_toolchange_delay); OPT_PTR(gcode_comments); OPT_PTR(gcode_flavor); OPT_PTR(layer_gcode); diff --git a/xs/src/slic3r/GUI/Preset.cpp b/xs/src/slic3r/GUI/Preset.cpp index c363647cb5..1cfd73bab9 100644 --- a/xs/src/slic3r/GUI/Preset.cpp +++ b/xs/src/slic3r/GUI/Preset.cpp @@ -210,11 +210,10 @@ 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", "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" + "extrusion_multiplier", "filament_density", "filament_cost", "filament_loading_speed", "filament_unloading_speed", "filament_toolchange_delay", + "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" }; return s_opts; } diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp index 790f5dc4b3..92504f7149 100644 --- a/xs/src/slic3r/GUI/Tab.cpp +++ b/xs/src/slic3r/GUI/Tab.cpp @@ -441,7 +441,6 @@ void TabPrint::build() optgroup->append_single_option_line("ooze_prevention"); optgroup->append_single_option_line("standby_temperature_delta"); - if (true) { optgroup = page->new_optgroup(_L("Wipe tower")); optgroup->append_single_option_line("wipe_tower"); optgroup->append_single_option_line("wipe_tower_x"); @@ -449,8 +448,8 @@ void TabPrint::build() optgroup->append_single_option_line("wipe_tower_width"); optgroup->append_single_option_line("wipe_tower_per_color_wipe"); optgroup->append_single_option_line("wipe_tower_rotation_angle"); - Line line{ _L("Advanced"), "" }; - line.widget = [this](wxWindow* parent){ + line = { _L("Advanced"), "" }; + line.widget = [this](wxWindow* parent){ m_wipe_tower_btn = new wxButton(parent, wxID_ANY, _L("Advanced settings")+"\u2026", wxDefaultPosition, wxDefaultSize, wxBU_LEFT | wxBU_EXACTFIT); auto sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add(m_wipe_tower_btn); @@ -468,8 +467,6 @@ void TabPrint::build() return sizer; }; optgroup->append_line(line); - } - optgroup = page->new_optgroup(_L("Advanced")); optgroup->append_single_option_line("interface_shells"); @@ -867,6 +864,11 @@ void TabFilament::build() }; optgroup->append_line(line); + optgroup = page->new_optgroup(_L("Toolchange behaviour")); + optgroup->append_single_option_line("filament_loading_speed"); + optgroup->append_single_option_line("filament_unloading_speed"); + optgroup->append_single_option_line("filament_toolchange_delay"); + page = add_options_page(_L("Custom G-code"), "cog.png"); optgroup = page->new_optgroup(_L("Start G-code"), 0); Option option = optgroup->get_option("start_filament_gcode");