first layer infill speed

This commit is contained in:
supermerill 2018-12-06 16:00:44 +01:00
parent cb65da2b3a
commit ffb8cdca36
7 changed files with 42 additions and 11 deletions

View File

@ -2403,7 +2403,10 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
}
}
if (this->on_first_layer())
speed = std::min(m_config.get_abs_value("first_layer_speed", speed), speed);
if (path.role() == erInternalInfill || path.role() == erSolidInfill)
speed = std::min(m_config.get_abs_value("first_layer_infill_speed", speed), speed);
else
speed = std::min(m_config.get_abs_value("first_layer_speed", speed), speed);
if (m_volumetric_speed != 0. && speed == 0)
speed = m_volumetric_speed / path.mm3_per_mm;
if (m_config.max_volumetric_speed.value > 0) {

View File

@ -126,6 +126,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
"first_layer_acceleration",
"first_layer_bed_temperature",
"first_layer_speed",
"first_layer_infill_speed",
"gcode_comments",
"gcode_flavor",
"infill_acceleration",

View File

@ -852,17 +852,31 @@ PrintConfigDef::PrintConfigDef()
def->cli = "first-layer-height=s";
def->ratio_over = "layer_height";
def->default_value = new ConfigOptionFloatOrPercent(0.35, false);
def = this->add("first_layer_speed", coFloatOrPercent);
def->label = L("First layer speed");
def->label = L("default");
def->tooltip = L("If expressed as absolute value in mm/s, this speed will be applied to all the print moves "
"of the first layer, regardless of their type. If expressed as a percentage "
"(for example: 40%) it will scale the default speeds.");
"but infill of the first layer, it can be overwrite by the 'default' (default depends of the type of the path) "
"speed if it's lower than that. If expressed as a percentage "
"(for example: 40%) it will scale the 'default' speeds . "
"If expressed as absolute value, it can be overwrite by the 'default' speed if it's lower than that.");
def->sidetext = L("mm/s or %");
def->cli = "first-layer-speed=s";
def->min = 0;
def->default_value = new ConfigOptionFloatOrPercent(30, false);
def = this->add("first_layer_infill_speed", coFloatOrPercent);
def->label = L("infill");
def->tooltip = L("If expressed as absolute value in mm/s, this speed will be applied to infill moves "
"of the first layer, it can be overwrite by the 'default' (solid infill or infill if not bottom) "
"speed if it's lower than that. If expressed as a percentage "
"(for example: 40%) it will scale the 'default' speed. "
"If expressed as absolute value, it can be overwrite by the 'default' speed if it's lower than that.");
def->sidetext = L("mm/s or %");
def->cli = "first-layer-infill-speed=s";
def->min = 0;
def->default_value = new ConfigOptionFloatOrPercent(30, false);
def = this->add("first_layer_temperature", coInts);
def->label = L("First layer");
def->tooltip = L("Extruder temperature for first layer. If you want to control temperature manually "

View File

@ -760,6 +760,7 @@ public:
ConfigOptionInts first_layer_bed_temperature;
ConfigOptionFloatOrPercent first_layer_extrusion_width;
ConfigOptionFloatOrPercent first_layer_speed;
ConfigOptionFloatOrPercent first_layer_infill_speed;
ConfigOptionInts first_layer_temperature;
ConfigOptionFloat infill_acceleration;
ConfigOptionInts max_fan_speed;
@ -831,6 +832,7 @@ protected:
OPT_PTR(first_layer_bed_temperature);
OPT_PTR(first_layer_extrusion_width);
OPT_PTR(first_layer_speed);
OPT_PTR(first_layer_infill_speed);
OPT_PTR(first_layer_temperature);
OPT_PTR(infill_acceleration);
OPT_PTR(max_fan_speed);

View File

@ -310,6 +310,7 @@ const std::vector<std::string>& Preset::print_options()
"support_material_solid_first_layer", "perimeter_loop", "perimeter_loop_seam", "seam_travel"
, "remove_small_gaps"
, "infill_not_connected"
,"first_layer_infill_speed"
};
return s_opts;
}

View File

@ -106,6 +106,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
const auto &support_material_extrusion_width = *print_config.option<ConfigOptionFloatOrPercent>("support_material_extrusion_width");
const auto &top_infill_extrusion_width = *print_config.option<ConfigOptionFloatOrPercent>("top_infill_extrusion_width");
const auto &first_layer_speed = *print_config.option<ConfigOptionFloatOrPercent>("first_layer_speed");
const auto &first_layer_infill_speed = *print_config.option<ConfigOptionFloatOrPercent>("first_layer_infill_speed");
// Index of an extruder assigned to a feature. If set to 0, an active extruder will be used for a multi-material print.
// If different from idx_extruder, it will not be taken into account for this hint.
@ -142,6 +143,12 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
speed_normal = first_layer_speed.get_abs_value(speed_normal);
return (speed_normal > 0.) ? speed_normal : speed_max;
};
auto limit_infill_by_first_layer_speed = [&first_layer_infill_speed, first_layer](double speed_normal, double speed_max) {
if (first_layer && first_layer_infill_speed.value > 0)
// Apply the first layer limit.
speed_normal = first_layer_infill_speed.get_abs_value(speed_normal);
return (speed_normal > 0.) ? speed_normal : speed_max;
};
if (perimeter_extruder_active) {
double external_perimeter_rate = Flow::new_from_config_width(frExternalPerimeter,
first_positive(first_layer_extrusion_width_ptr, external_perimeter_extrusion_width, extrusion_width),
@ -165,7 +172,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
if (! bridging && infill_extruder_active) {
double infill_rate = Flow::new_from_config_width(frInfill,
first_positive(first_layer_extrusion_width_ptr, infill_extrusion_width, extrusion_width),
nozzle_diameter, lh, bfr).mm3_per_mm() * limit_by_first_layer_speed(infill_speed, max_print_speed);
nozzle_diameter, lh, bfr).mm3_per_mm() * limit_infill_by_first_layer_speed(infill_speed, max_print_speed);
if (max_flow < infill_rate) {
max_flow = infill_rate;
max_flow_extrusion_type = _CHB(L("infill"));
@ -175,7 +182,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
double solid_infill_rate = Flow::new_from_config_width(frInfill,
first_positive(first_layer_extrusion_width_ptr, solid_infill_extrusion_width, extrusion_width),
nozzle_diameter, lh, 0).mm3_per_mm() *
(bridging ? bridge_speed : limit_by_first_layer_speed(solid_infill_speed, max_print_speed));
(bridging ? bridge_speed : limit_infill_by_first_layer_speed(solid_infill_speed, max_print_speed));
if (max_flow < solid_infill_rate) {
max_flow = solid_infill_rate;
max_flow_extrusion_type = _CHB(L("solid infill"));
@ -183,7 +190,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
if (! bridging) {
double top_solid_infill_rate = Flow::new_from_config_width(frInfill,
first_positive(first_layer_extrusion_width_ptr, top_infill_extrusion_width, extrusion_width),
nozzle_diameter, lh, bfr).mm3_per_mm() * limit_by_first_layer_speed(top_solid_infill_speed, max_print_speed);
nozzle_diameter, lh, bfr).mm3_per_mm() * limit_infill_by_first_layer_speed(top_solid_infill_speed, max_print_speed);
if (max_flow < top_solid_infill_rate) {
max_flow = top_solid_infill_rate;
max_flow_extrusion_type = _CHB(L("top solid infill"));

View File

@ -913,8 +913,11 @@ void TabPrint::build()
optgroup = page->new_optgroup(_(L("Speed for non-print moves")));
optgroup->append_single_option_line("travel_speed");
optgroup = page->new_optgroup(_(L("Modifiers")));
optgroup->append_single_option_line("first_layer_speed");
optgroup = page->new_optgroup(_(L("Modifiers")));
line = { _(L("First layer speed")), "" };
line.append_option(optgroup->get_option("first_layer_speed"));
line.append_option(optgroup->get_option("first_layer_infill_speed"));
optgroup->append_line(line);
optgroup = page->new_optgroup(_(L("Acceleration control (advanced)")));
optgroup->append_single_option_line("perimeter_acceleration");