mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-16 11:25:56 +08:00
parent
a846f13c47
commit
319d0552ed
@ -30,7 +30,8 @@ group:Short layer time - began to increase base fan speed
|
||||
setting:label$Max fan speed:max_fan_speed
|
||||
group:Very short layer time - began to decrease extrusion rate
|
||||
setting:label$Layer time goal:slowdown_below_layer_time
|
||||
setting:min_print_speed
|
||||
setting:width$4:max_speed_reduction
|
||||
setting:width$4:min_print_speed
|
||||
group:Behavior
|
||||
cooling_description
|
||||
|
||||
|
@ -867,6 +867,7 @@ public:
|
||||
ConfigOption* clone() const override { return new ConfigOptionPercentsTempl(*this); }
|
||||
ConfigOptionPercentsTempl& operator=(const ConfigOption *opt) { this->set(opt); return *this; }
|
||||
bool operator==(const ConfigOptionPercentsTempl &rhs) const { return this->values == rhs.values; }
|
||||
double get_abs_value(size_t i, double ratio_over) const { return is_nil(i) ? 0 : ratio_over * get_at(i) / 100; }
|
||||
|
||||
std::string serialize() const override
|
||||
{
|
||||
|
@ -193,6 +193,11 @@ struct PerExtruderAdjustments
|
||||
if (line.feedrate > min_feedrate) {
|
||||
line.time *= std::max(1.f, line.feedrate / min_feedrate);
|
||||
line.feedrate = min_feedrate;
|
||||
//test to never go over max_time
|
||||
if (line.time > line.time_max) {
|
||||
line.time = line.time_max;
|
||||
line.feedrate = line.length / line.time;
|
||||
}
|
||||
line.slowdown = true;
|
||||
}
|
||||
}
|
||||
@ -206,6 +211,8 @@ struct PerExtruderAdjustments
|
||||
float slowdown_below_layer_time = 0.f;
|
||||
// Minimum print speed allowed for this extruder.
|
||||
float min_print_speed = 0.f;
|
||||
// Max speed reduction allowed for this extruder.
|
||||
float max_speed_reduction = 1;
|
||||
|
||||
// Parsed lines.
|
||||
std::vector<CoolingLine> lines;
|
||||
@ -307,6 +314,7 @@ std::vector<PerExtruderAdjustments> CoolingBuffer::parse_layer_gcode(const std::
|
||||
adj.cooling_slow_down_enabled = config.cooling.get_at(extruder_id);
|
||||
adj.slowdown_below_layer_time = float(config.slowdown_below_layer_time.get_at(extruder_id));
|
||||
adj.min_print_speed = float(config.min_print_speed.get_at(extruder_id));
|
||||
adj.max_speed_reduction = float(config.max_speed_reduction.get_at(extruder_id) / 100);
|
||||
map_extruder_to_per_extruder_adjustment[extruder_id] = i;
|
||||
}
|
||||
|
||||
@ -394,8 +402,11 @@ std::vector<PerExtruderAdjustments> CoolingBuffer::parse_layer_gcode(const std::
|
||||
if (line.length > 0)
|
||||
line.time = line.length / line.feedrate;
|
||||
line.time_max = line.time;
|
||||
if ((line.type & CoolingLine::TYPE_ADJUSTABLE) || active_speed_modifier != size_t(-1))
|
||||
if ((line.type & CoolingLine::TYPE_ADJUSTABLE) || active_speed_modifier != size_t(-1)) {
|
||||
line.time_max = (adjustment->min_print_speed == 0.f) ? FLT_MAX : std::max(line.time, line.length / adjustment->min_print_speed);
|
||||
if(adjustment->max_speed_reduction > 0)
|
||||
line.time_max = std::min(line.time_max, line.time / (1- adjustment->max_speed_reduction));
|
||||
}
|
||||
if (active_speed_modifier < adjustment->lines.size() && (line.type & CoolingLine::TYPE_G1)) {
|
||||
// Inside the ";_EXTRUDE_SET_SPEED" blocks, there must not be a G1 Fxx entry.
|
||||
assert((line.type & CoolingLine::TYPE_HAS_F) == 0);
|
||||
@ -534,8 +545,10 @@ static inline void extruder_range_slow_down_non_proportional(
|
||||
}
|
||||
assert(feedrate > 0.f);
|
||||
// Sort by min_print_speed, maximum speed first.
|
||||
//multiplied by max_speed_reductionto be able to sort them when only this one change.
|
||||
std::sort(by_min_print_speed.begin(), by_min_print_speed.end(),
|
||||
[](const PerExtruderAdjustments *p1, const PerExtruderAdjustments *p2){ return p1->min_print_speed > p2->min_print_speed; });
|
||||
[](const PerExtruderAdjustments *p1, const PerExtruderAdjustments *p2){
|
||||
return (1 - p1->max_speed_reduction) * p1->min_print_speed > (1 - p2->max_speed_reduction) * p2->min_print_speed; });
|
||||
// Slow down, fast moves first.
|
||||
for (;;) {
|
||||
// For each extruder, find the span of lines with a feedrate close to feedrate.
|
||||
@ -552,6 +565,7 @@ static inline void extruder_range_slow_down_non_proportional(
|
||||
// Slow down, limited by max(feedrate_next, min_print_speed).
|
||||
for (auto adj = by_min_print_speed.begin(); adj != by_min_print_speed.end();) {
|
||||
// Slow down at most by time_stretch.
|
||||
//note: the max_speed reduction is used via the max_time, nothing else to do as it's a proportional limit.
|
||||
if ((*adj)->min_print_speed == 0.f) {
|
||||
// All the adjustable speeds are now lowered to the same speed,
|
||||
// and the minimum speed is set to zero.
|
||||
@ -580,7 +594,7 @@ static inline void extruder_range_slow_down_non_proportional(
|
||||
}
|
||||
// Skip the other extruders with nearly the same min_print_speed, as they have been processed already.
|
||||
auto next = adj;
|
||||
for (++ next; next != by_min_print_speed.end() && (*next)->min_print_speed > (*adj)->min_print_speed - EPSILON; ++ next);
|
||||
for (++ next; next != by_min_print_speed.end() && (*next)->min_print_speed > (*adj)->min_print_speed - EPSILON && (*next)->max_speed_reduction < (*adj)->max_speed_reduction + EPSILON; ++ next);
|
||||
adj = next;
|
||||
}
|
||||
if (feedrate_next == 0.f)
|
||||
|
@ -1943,13 +1943,23 @@ void PrintConfigDef::init_fff_params()
|
||||
def->label = L("Max print speed");
|
||||
def->category = OptionCategory::speed;
|
||||
def->tooltip = L("When setting other speed settings to 0 Slic3r will autocalculate the optimal speed "
|
||||
"in order to keep constant extruder pressure. This experimental setting is used "
|
||||
"to set the highest print speed you want to allow.");
|
||||
"in order to keep constant extruder pressure. This experimental setting is used "
|
||||
"to set the highest print speed you want to allow.");
|
||||
def->sidetext = L("mm/s");
|
||||
def->min = 1;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionFloat(80));
|
||||
|
||||
def = this->add("max_speed_reduction", coPercents);
|
||||
def->label = L("Max speed reduction");
|
||||
def->category = OptionCategory::speed;
|
||||
def->tooltip = L("Amount of speed you can reduce per extrusion speed.");
|
||||
def->sidetext = L("%");
|
||||
def->min = 0;
|
||||
def->max = 100;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionPercents{ 90 });
|
||||
|
||||
def = this->add("max_volumetric_speed", coFloat);
|
||||
def->label = L("Max volumetric speed");
|
||||
def->category = OptionCategory::extruders;
|
||||
|
@ -1060,6 +1060,7 @@ public:
|
||||
ConfigOptionInts max_fan_speed;
|
||||
ConfigOptionFloats max_layer_height;
|
||||
ConfigOptionFloat max_print_height;
|
||||
ConfigOptionPercents max_speed_reduction;
|
||||
ConfigOptionFloats milling_diameter;
|
||||
ConfigOptionStrings milling_toolchange_end_gcode;
|
||||
ConfigOptionStrings milling_toolchange_start_gcode;
|
||||
@ -1148,6 +1149,7 @@ protected:
|
||||
OPT_PTR(max_fan_speed);
|
||||
OPT_PTR(max_layer_height);
|
||||
OPT_PTR(max_print_height);
|
||||
OPT_PTR(max_speed_reduction);
|
||||
OPT_PTR(milling_diameter);
|
||||
OPT_PTR(milling_toolchange_end_gcode);
|
||||
OPT_PTR(milling_toolchange_start_gcode);
|
||||
|
@ -457,7 +457,8 @@ const std::vector<std::string>& Preset::print_options()
|
||||
, "bottom_fill_pattern"
|
||||
, "solid_fill_pattern",
|
||||
"infill_every_layers", "infill_only_where_needed", "solid_infill_every_layers", "fill_angle", "bridge_angle",
|
||||
"solid_infill_below_area", "only_retract_when_crossing_perimeters", "infill_first", "max_print_speed",
|
||||
"solid_infill_below_area", "only_retract_when_crossing_perimeters", "infill_first",
|
||||
"max_print_speed",
|
||||
"max_volumetric_speed",
|
||||
#ifdef HAS_PRESSURE_EQUALIZER
|
||||
"max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative",
|
||||
@ -566,7 +567,10 @@ const std::vector<std::string>& Preset::filament_options()
|
||||
"max_fan_speed", "bridge_fan_speed"
|
||||
, "top_fan_speed"
|
||||
, "disable_fan_first_layers"
|
||||
, "fan_below_layer_time", "slowdown_below_layer_time", "min_print_speed",
|
||||
, "fan_below_layer_time",
|
||||
"slowdown_below_layer_time",
|
||||
"max_speed_reduction",
|
||||
"min_print_speed",
|
||||
"start_filament_gcode", "end_filament_gcode",
|
||||
"external_perimeter_fan_speed",
|
||||
// Retract overrides
|
||||
|
@ -26,6 +26,7 @@ std::string PresetHints::cooling_description(const Preset &preset)
|
||||
int disable_fan_first_layers = preset.config.opt_int("disable_fan_first_layers", 0);
|
||||
int slowdown_below_layer_time = preset.config.opt_int("slowdown_below_layer_time", 0);
|
||||
int min_print_speed = int(preset.config.opt_float("min_print_speed", 0) + 0.5);
|
||||
int max_speed_reduc = int(preset.config.opt_float("max_speed_reduction", 0));
|
||||
int fan_below_layer_time = preset.config.opt_int("fan_below_layer_time", 0);
|
||||
|
||||
//if (preset.config.opt_bool("cooling", 0)) {
|
||||
@ -97,9 +98,14 @@ std::string PresetHints::cooling_description(const Preset &preset)
|
||||
}
|
||||
|
||||
out += " " + (boost::format(_utf8(L("print speed will be reduced "
|
||||
"so that no less than %1%s are spent on that layer "
|
||||
"(however, speed will never be reduced below %2%mm/s).")))
|
||||
% slowdown_below_layer_time % min_print_speed).str();
|
||||
"so that no less than %1%s are spent on that layer"))) % slowdown_below_layer_time).str();
|
||||
if(min_print_speed > 0)
|
||||
if(max_speed_reduc > 0)
|
||||
out += " " + (boost::format(_utf8(L("(however, speed will never be reduced below %1%mm/s or up to %2%%% reduction)")))
|
||||
% min_print_speed % max_speed_reduc).str();
|
||||
else
|
||||
out += " " + (boost::format(_utf8(L("(however, speed will never be reduced below %1%mm/s)")))
|
||||
% min_print_speed).str();
|
||||
}
|
||||
|
||||
return out;
|
||||
|
Loading…
x
Reference in New Issue
Block a user