ENH: add option to decide if overhang join cooling

Jira: 7414

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: I223c8b72d025947652a1f36c31c1a0adc3c9d180
This commit is contained in:
qing.zhang 2024-06-19 18:10:16 +08:00 committed by Lane.Wei
parent 04beaae9e3
commit af7f87c238
6 changed files with 50 additions and 5 deletions

View File

@ -4900,14 +4900,14 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
Overhang_threshold_none : EXTRUDER_CONFIG(overhang_fan_threshold) - 1;
if ((EXTRUDER_CONFIG(overhang_fan_threshold) == Overhang_threshold_none && path.role() == erExternalPerimeter)) {
gcode += ";_OVERHANG_FAN_START\n";
comment = ";_EXTRUDE_SET_SPEED";
} else if (path.get_overhang_degree() > overhang_threshold ||
is_bridge(path.role()))
gcode += ";_OVERHANG_FAN_START\n";
else
comment = ";_EXTRUDE_SET_SPEED";
}
else {
int overhang_boundary_for_cooling = EXTRUDER_CONFIG(overhang_threshold_participating_cooling);
if (!is_bridge(path.role()) && path.get_overhang_degree() <= overhang_boundary_for_cooling) {
comment = ";_EXTRUDE_SET_SPEED";
}

View File

@ -859,7 +859,7 @@ static std::vector<std::string> s_Preset_filament_options {
// "bed_type",
//BBS:temperature_vitrification
"temperature_vitrification", "reduce_fan_stop_start_freq", "slow_down_for_layer_cooling", "fan_min_speed",
"fan_max_speed", "enable_overhang_bridge_fan", "overhang_fan_speed", "overhang_fan_threshold", "close_fan_the_first_x_layers", "full_fan_speed_layer", "fan_cooling_layer_time", "slow_down_layer_time", "slow_down_min_speed",
"fan_max_speed", "enable_overhang_bridge_fan", "overhang_fan_speed", "overhang_fan_threshold", "overhang_threshold_participating_cooling","close_fan_the_first_x_layers", "full_fan_speed_layer", "fan_cooling_layer_time", "slow_down_layer_time", "slow_down_min_speed",
"filament_start_gcode", "filament_end_gcode",
//exhaust fan control
"activate_air_filtration","during_print_exhaust_fan_speed","complete_print_exhaust_fan_speed",

View File

@ -90,6 +90,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"enable_overhang_bridge_fan"
"overhang_fan_speed",
"overhang_fan_threshold",
"overhang_threshold_participating_cooling",
"slow_down_for_layer_cooling",
"default_acceleration",
"deretraction_speed",

View File

@ -302,6 +302,17 @@ static const t_config_enum_values s_keys_map_OverhangFanThreshold = {
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(OverhangFanThreshold)
//BBS
static const t_config_enum_values s_keys_map_OverhangThresholdParticipatingCooling = {
{ "0%", Overhang_threshold_participating_cooling_none },
{ "10%", Overhang_threshold_participating_cooling_1_4 },
{ "25%", Overhang_threshold_participating_cooling_2_4 },
{ "50%", Overhang_threshold_participating_cooling_3_4 },
{ "75%", Overhang_threshold_participating_cooling_4_4 },
{ "95%", Overhang_threshold_participating_cooling_bridge }
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(OverhangThresholdParticipatingCooling)
// BBS
static const t_config_enum_values s_keys_map_BedType = {
{ "Default Plate", btDefault },
@ -770,6 +781,28 @@ void PrintConfigDef::init_fff_params()
def->enum_labels.emplace_back("95%");
def->set_default_value(new ConfigOptionEnumsGeneric{ (int)Overhang_threshold_bridge });
def = this->add("overhang_threshold_participating_cooling", coEnums);
def->label = L("Overhang threshold for participating cooling");
def->tooltip = L("Decide which overhang part join the cooling function to slow down the speed."
"Expressed as percentage which indicides how much width of the line without support from lower layer. "
"100% means forcing cooling for all outer wall no matter how much overhang degree");
def->sidetext = "";
def->enum_keys_map = &ConfigOptionEnum<OverhangThresholdParticipatingCooling>::get_enum_values();
def->mode = comAdvanced;
def->enum_values.emplace_back("0%");
def->enum_values.emplace_back("10%");
def->enum_values.emplace_back("25%");
def->enum_values.emplace_back("50%");
def->enum_values.emplace_back("75%");
def->enum_values.emplace_back("100%");
def->enum_labels.emplace_back("0%");
def->enum_labels.emplace_back("10%");
def->enum_labels.emplace_back("25%");
def->enum_labels.emplace_back("50%");
def->enum_labels.emplace_back("75%");
def->enum_labels.emplace_back("100%");
def->set_default_value(new ConfigOptionEnumsGeneric{(int) Overhang_threshold_participating_cooling_bridge});
def = this->add("bridge_angle", coFloat);
def->label = L("Bridge direction");
def->category = L("Strength");

View File

@ -213,6 +213,15 @@ enum OverhangFanThreshold {
Overhang_threshold_bridge
};
enum OverhangThresholdParticipatingCooling {
Overhang_threshold_participating_cooling_none = 0,
Overhang_threshold_participating_cooling_1_4,
Overhang_threshold_participating_cooling_2_4,
Overhang_threshold_participating_cooling_3_4,
Overhang_threshold_participating_cooling_4_4,
Overhang_threshold_participating_cooling_bridge
};
// BBS
enum BedType {
btDefault = 0,
@ -991,6 +1000,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionBools, enable_overhang_bridge_fan))
((ConfigOptionInts, overhang_fan_speed))
((ConfigOptionEnumsGeneric, overhang_fan_threshold))
((ConfigOptionEnumsGeneric, overhang_threshold_participating_cooling))
((ConfigOptionEnum<PrintSequence>,print_sequence))
((ConfigOptionInts, first_layer_print_sequence))
((ConfigOptionInts, other_layers_print_sequence))

View File

@ -3133,6 +3133,7 @@ void TabFilament::build()
optgroup->append_single_option_line("enable_overhang_bridge_fan", "auto-cooling");
optgroup->append_single_option_line("overhang_fan_threshold", "auto-cooling");
optgroup->append_single_option_line("overhang_threshold_participating_cooling", "auto-cooling");
optgroup->append_single_option_line("overhang_fan_speed", "auto-cooling");
optgroup = page->new_optgroup(L("Auxiliary part cooling fan"), L"param_cooling_fan");