diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 50c3352f20..c97fda2403 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1874,8 +1874,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato if (print.config().spiral_mode.value) m_spiral_vase = make_unique(print.config()); - if (print.config().max_volumetric_extrusion_rate_slope_positive.value > 0 || - print.config().max_volumetric_extrusion_rate_slope_negative.value > 0){ + if (print.config().max_volumetric_extrusion_rate_slope.value > 0){ m_pressure_equalizer = make_unique(print.config()); m_enable_extrusion_role_markers = (bool)m_pressure_equalizer; } else @@ -2599,8 +2598,6 @@ void GCode::process_layers( ++layer_to_print_idx; return LayerResult::make_nop_layer_result(); } - //fc.stop(); - //return {}; } else { const std::pair>& layer = layers_to_print[layer_to_print_idx++]; const LayerTools& layer_tools = tool_ordering.tools_for_layer(layer.first); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 8efd6dcc0e..a276ebd7bd 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -29,10 +29,6 @@ #include #include -#ifdef HAS_PRESSURE_EQUALIZER -#include "GCode/PressureEqualizer.hpp" -#endif /* HAS_PRESSURE_EQUALIZER */ - namespace Slic3r { // Forward declarations. diff --git a/src/libslic3r/GCode/PressureEqualizer.cpp b/src/libslic3r/GCode/PressureEqualizer.cpp index 20711f7ca9..d5d28f472a 100644 --- a/src/libslic3r/GCode/PressureEqualizer.cpp +++ b/src/libslic3r/GCode/PressureEqualizer.cpp @@ -26,7 +26,7 @@ static const std::string EXTERNAL_PERIMETER_TAG = ";_EXTERNAL_PERIMETER"; // Maximum segment length to split a long segment if the initial and the final flow rate differ. // Smaller value means a smoother transition between two different flow rates. -static constexpr float max_segment_length = 0.7f; +static constexpr float max_segment_length = 1.0f; // For how many GCode lines back will adjust a flow rate from the latest line. // Bigger values affect the GCode export speed a lot, and smaller values could @@ -37,7 +37,7 @@ static constexpr int max_look_back_limit = 128; // its all one continous extruded line. Above this distance we assume extruder pressure hits 0 // This exists because often there's tiny travel moves between stuff like infill // lines where some extruder pressure will remain (so we should equalize between these small travels) -static constexpr long max_ignored_gap_between_extruding_segments = 3; +static constexpr long max_ignored_gap_between_extruding_segments = 10; PressureEqualizer::PressureEqualizer(const Slic3r::GCodeConfig &config) : m_use_relative_e_distances(config.use_relative_e_distances.value) { @@ -64,9 +64,9 @@ PressureEqualizer::PressureEqualizer(const Slic3r::GCodeConfig &config) : m_use_ // Volumetric rate of a 0.45mm x 0.2mm extrusion at 20mm/s XY movement: 0.45*0.2*20*60=1.8*60 = 108 mm^3/min // Slope of the volumetric rate, changing from 20mm/s to 60mm/s over 2 seconds: (5.4-1.8)*60*60/2=60*60*1.8 = 6480 mm^3/min^2 = 1.8 mm^3/s^2 - if(config.max_volumetric_extrusion_rate_slope_positive.value > 0 || config.max_volumetric_extrusion_rate_slope_negative.value > 0){ - m_max_volumetric_extrusion_rate_slope_positive = float(config.max_volumetric_extrusion_rate_slope_positive.value) * 60.f * 60.f; - m_max_volumetric_extrusion_rate_slope_negative = float(config.max_volumetric_extrusion_rate_slope_negative.value) * 60.f * 60.f; + if(config.max_volumetric_extrusion_rate_slope.value > 0){ + m_max_volumetric_extrusion_rate_slope_positive = float(config.max_volumetric_extrusion_rate_slope.value) * 60.f * 60.f; + m_max_volumetric_extrusion_rate_slope_negative = float(config.max_volumetric_extrusion_rate_slope.value) * 60.f * 60.f; } for (ExtrusionRateSlope &extrusion_rate_slope : m_max_volumetric_extrusion_rate_slopes) { diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 5e3baad3a3..65aeae9c54 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -725,7 +725,7 @@ static std::vector s_Preset_print_options { "ironing_type", "ironing_pattern", "ironing_flow", "ironing_speed", "ironing_spacing", "max_travel_detour_distance", "fuzzy_skin", "fuzzy_skin_thickness", "fuzzy_skin_point_distance", - "max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative", + "max_volumetric_extrusion_rate_slope", "inner_wall_speed", "outer_wall_speed", "sparse_infill_speed", "internal_solid_infill_speed", "top_surface_speed", "support_speed", "support_object_xy_distance", "support_interface_speed", "bridge_speed", "internal_bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 4656e318a1..6a94e7f064 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -128,10 +128,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "fan_max_speed", "printable_height", "slow_down_min_speed", -#ifdef HAS_PRESSURE_EQUALIZER - "max_volumetric_extrusion_rate_slope_positive", - "max_volumetric_extrusion_rate_slope_negative", -#endif /* HAS_PRESSURE_EQUALIZER */ + "max_volumetric_extrusion_rate_slope", "reduce_infill_retraction", "filename_format", "retraction_minimum_travel", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index dab4502946..5c1ffe96b4 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2470,23 +2470,21 @@ def = this->add("filament_loading_speed", coFloats); def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("max_volumetric_extrusion_rate_slope_positive", coFloat); - def->label = L("Max volumetric slope positive"); - def->tooltip = L("This experimental setting is used to limit the speed of change in extrusion rate. " - "A value of 1.8 mm³/s² ensures, that a change from the extrusion rate " - "of 1.8 mm³/s (0.45mm extrusion width, 0.2mm extrusion height, feedrate 20 mm/s) " - "to 5.4 mm³/s (feedrate 60 mm/s) will take at least 2 seconds."); - def->sidetext = L("mm³/s²"); - def->min = 0; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloat(0)); - - def = this->add("max_volumetric_extrusion_rate_slope_negative", coFloat); - def->label = L("Max volumetric slope negative"); - def->tooltip = L("This experimental setting is used to limit the speed of change in extrusion rate. " - "A value of 1.8 mm³/s² ensures, that a change from the extrusion rate " - "of 1.8 mm³/s (0.45mm extrusion width, 0.2mm extrusion height, feedrate 20 mm/s) " - "to 5.4 mm³/s (feedrate 60 mm/s) will take at least 2 seconds."); + def = this->add("max_volumetric_extrusion_rate_slope", coFloat); + def->label = L("Extrusion rate smoothing"); + def->tooltip = L("This parameter smooths out sudden extrusion rate changes that happen when " + "the printer transitions from printing a high flow (high speed/larger width) " + "extrusion to a lower flow (lower speed/smaller width) extrusion and vice versa.\n\n" + "It defines the maximum rate by which the extruded volumetric flow in mm3/sec can change over time. " + "Higher values mean higher extrusion rate changes are allowed, resulting in faster speed transitions.\n\n" + "A value of 0 disables the feature. \n\n" + "For a high speed, high flow direct drive printer (like the Bambu lab or Voron) a sensible value is around " + "5x to 10x the maximum volumetric flow rate the hot end is capable off under ideal conditions. This allows " + "for just enough smoothing to assist pressure advance in areas where sudden flow changes happen. A value of " + "250-300 is a good starting point.\n\n" + "For slower printers without pressure advance, the value should be set much lower. A value of 10-15 is a " + "good starting point for direct drive extruders and 2-3 for Bowden style. \n\n" + "Note: this parameter disables arc fitting."); def->sidetext = L("mm³/s²"); def->min = 0; def->mode = comAdvanced; @@ -4960,9 +4958,6 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va "acceleration", "scale", "rotate", "duplicate", "duplicate_grid", "bed_size", "print_center", "g0", "wipe_tower_per_color_wipe" -#ifndef HAS_PRESSURE_EQUALIZER - , "max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative" -#endif /* HAS_PRESSURE_EQUALIZER */ // BBS , "support_sharp_tails","support_remove_small_overhangs", "support_with_sheath", "tree_support_collision_resolution", "tree_support_with_infill", diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index dead6a4960..beea7a5783 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -27,8 +27,6 @@ #include #include -// #define HAS_PRESSURE_EQUALIZER - namespace Slic3r { enum GCodeFlavor : unsigned char { @@ -883,10 +881,9 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionEnum, gcode_flavor)) ((ConfigOptionString, layer_change_gcode)) -//#ifdef HAS_PRESSURE_EQUALIZER - ((ConfigOptionFloat, max_volumetric_extrusion_rate_slope_positive)) - ((ConfigOptionFloat, max_volumetric_extrusion_rate_slope_negative)) -//#endif + + ((ConfigOptionFloat, max_volumetric_extrusion_rate_slope)) + ((ConfigOptionPercents, retract_before_wipe)) ((ConfigOptionFloats, retraction_length)) ((ConfigOptionFloats, retract_length_toolchange)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index a1cad06ed6..9d8c576c80 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1996,8 +1996,8 @@ void TabPrint::build() optgroup->append_single_option_line("initial_layer_jerk"); optgroup->append_single_option_line("travel_jerk"); - optgroup->append_single_option_line("max_volumetric_extrusion_rate_slope_positive"); - optgroup->append_single_option_line("max_volumetric_extrusion_rate_slope_negative"); + optgroup = page->new_optgroup(L("Advanced"), L"param_advanced", 15); + optgroup->append_single_option_line("max_volumetric_extrusion_rate_slope"); page = add_options_page(L("Support"), "support"); optgroup = page->new_optgroup(L("Support"), L"param_support");