#503 filament_max_speed

This commit is contained in:
supermerill 2020-09-24 19:24:37 +02:00 committed by supermerill
parent 6614605350
commit c1a535e02c
7 changed files with 39 additions and 14 deletions

View File

@ -21,6 +21,7 @@ group:Filament properties
setting:filament_soluble
setting:filament_shrink
group:Print speed override
setting:filament_max_speed
setting:filament_max_volumetric_speed
volumetric_speed_description

View File

@ -4165,12 +4165,17 @@ std::string GCode::_before_extrude(const ExtrusionPath &path, const std::string
m_config.max_volumetric_speed.value / path.mm3_per_mm
);
}
if (EXTRUDER_CONFIG_WITH_DEFAULT(filament_max_volumetric_speed,0) > 0) {
if (EXTRUDER_CONFIG_WITH_DEFAULT(filament_max_volumetric_speed, 0) > 0) {
// cap speed with max_volumetric_speed anyway (even if user is not using autospeed)
speed = std::min(
speed,
EXTRUDER_CONFIG_WITH_DEFAULT(filament_max_volumetric_speed, speed) / path.mm3_per_mm
);
);
}
if (EXTRUDER_CONFIG_WITH_DEFAULT(filament_max_speed, 0) > 0) {
speed = std::min(
speed,
EXTRUDER_CONFIG_WITH_DEFAULT(filament_max_speed, speed));
}
double F = speed * 60; // convert mm/sec to mm/min

View File

@ -1285,6 +1285,9 @@ void WipeTower::toolchange_Wipe(
float x_to_wipe = volume_to_length(wipe_volume, m_perimeter_width, m_layer_height);
float dy = m_extra_spacing*m_perimeter_width;
float wipe_speed = 1600.f;
if (this->m_config->filament_max_speed.get_at(this->m_current_tool) > 0) {
wipe_speed = this->m_config->filament_max_speed.get_at(this->m_current_tool);
}
// if there is less than 2.5*m_perimeter_width to the edge, advance straightaway (there is likely a blob anyway)
if ((m_left_to_right ? xr-writer.x() : writer.x()-xl) < 2.5f*m_perimeter_width) {
@ -1294,7 +1297,7 @@ void WipeTower::toolchange_Wipe(
// now the wiping itself:
for (int i = 0; true; ++i) {
if (i!=0) {
if (i!=0 && this->m_config->filament_max_speed.get_at(this->m_current_tool) > 0) {
if (wipe_speed < 1610.f) wipe_speed = 1800.f;
else if (wipe_speed < 1810.f) wipe_speed = 2200.f;
else if (wipe_speed < 2210.f) wipe_speed = 4200.f;

View File

@ -187,7 +187,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
|| opt_key == "draft_shield"
|| opt_key == "skirt_distance"
|| opt_key == "min_skirt_length"
|| opt_key == "complete_objects_one_skirt"
|| opt_key == "complete_objects_one_skirt"
|| opt_key == "ooze_prevention"
|| opt_key == "wipe_tower_x"
|| opt_key == "wipe_tower_y"
@ -231,17 +231,18 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
|| opt_key == "filament_cooling_initial_speed"
|| opt_key == "filament_cooling_final_speed"
|| opt_key == "filament_ramming_parameters"
|| opt_key == "filament_max_speed"
|| opt_key == "filament_max_volumetric_speed"
|| opt_key == "filament_use_skinnydip" // skinnydip params start
|| opt_key == "filament_use_fast_skinnydip"
|| opt_key == "filament_use_skinnydip" // skinnydip params start
|| opt_key == "filament_use_fast_skinnydip"
|| opt_key == "filament_skinnydip_distance"
|| opt_key == "filament_melt_zone_pause"
|| opt_key == "filament_cooling_zone_pause"
|| opt_key == "filament_toolchange_temp"
|| opt_key == "filament_enable_toolchange_temp"
|| opt_key == "filament_enable_toolchange_part_fan"
|| opt_key == "filament_toolchange_part_fan_speed"
|| opt_key == "filament_dip_insertion_speed"
|| opt_key == "filament_enable_toolchange_temp"
|| opt_key == "filament_enable_toolchange_part_fan"
|| opt_key == "filament_toolchange_part_fan_speed"
|| opt_key == "filament_dip_insertion_speed"
|| opt_key == "filament_dip_extraction_speed" //skinnydip params end
|| opt_key == "gcode_flavor"
|| opt_key == "high_current_on_filament_swap"

View File

@ -1101,16 +1101,27 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionStrings { "" });
def = this->add("filament_max_speed", coFloats);
def->label = L("Max speed");
def->category = OptionCategory::filament;
def->tooltip = L("Maximum speed allowed for this filament. Limits the maximum "
"speed of a print to the minimum of the print speed and the filament speed. "
"Set to zero for no limit.");
def->sidetext = L("mm³/s");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats{ 0. });
def = this->add("filament_max_volumetric_speed", coFloats);
def->label = L("Max volumetric speed");
def->category = OptionCategory::filament;
def->tooltip = L("Maximum volumetric speed allowed for this filament. Limits the maximum volumetric "
"speed of a print to the minimum of print and filament volumetric speed. "
"Set to zero for no limit.");
"speed of a print to the minimum of print and filament volumetric speed. "
"Set to zero for no limit.");
def->sidetext = L("mm³/s");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 0. });
def->set_default_value(new ConfigOptionFloats{ 0. });
def = this->add("filament_max_wipe_tower_speed", coFloats);
def->label = L("Max speed on the wipe tower");

View File

@ -895,6 +895,7 @@ public:
ConfigOptionFloats filament_density;
ConfigOptionFloats filament_diameter;
ConfigOptionBools filament_soluble;
ConfigOptionFloats filament_max_speed;
ConfigOptionFloats filament_max_volumetric_speed;
ConfigOptionFloats filament_max_wipe_tower_speed;
ConfigOptionStrings filament_type;
@ -995,6 +996,7 @@ protected:
OPT_PTR(filament_type);
OPT_PTR(filament_soluble);
OPT_PTR(filament_cost);
OPT_PTR(filament_max_speed);
OPT_PTR(filament_max_volumetric_speed);
OPT_PTR(filament_max_wipe_tower_speed);
OPT_PTR(filament_loading_speed);

View File

@ -558,7 +558,9 @@ const std::vector<std::string>& Preset::print_options()
const std::vector<std::string>& Preset::filament_options()
{
static std::vector<std::string> s_opts {
"filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_speed",
"filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes",
"filament_max_speed",
"filament_max_volumetric_speed",
"filament_max_wipe_tower_speed",
"extrusion_multiplier", "filament_density", "filament_cost", "filament_loading_speed", "filament_loading_speed_start", "filament_load_time",
"filament_unloading_speed", "filament_toolchange_delay", "filament_unloading_speed_start", "filament_unload_time", "filament_cooling_moves",