Add Resonance Avoidance

This commit is contained in:
QIDI TECH
2024-06-13 16:28:33 +08:00
parent 5b7a66b64c
commit e21feab522
7 changed files with 55 additions and 2 deletions

View File

@@ -3427,6 +3427,12 @@ std::string GCodeGenerator::_extrude(
// cap speed with max_volumetric_speed anyway (even if user is not using autospeed)
speed = cap_speed(speed, path_attr.mm3_per_mm, m_config, m_writer.extruder()->id());
//Y27
if (path_attr.role == ExtrusionRole::ExternalPerimeter && m_config.opt_bool("resonance_avoidance")) {
if (speed < m_config.opt_float("max_resonance_avoidance_speed")) {
speed = std::min(speed, m_config.opt_float("min_resonance_avoidance_speed"));
}
}
double F = speed * 60; // convert mm/sec to mm/min
// extrude arc or line

View File

@@ -565,6 +565,8 @@ static std::vector<std::string> s_Preset_printer_options {
"bed_exclude_area",
//Y25
"wipe_device",
//Y27
"resonance_avoidance", "min_resonance_avoidance_speed", "max_resonance_avoidance_speed",
//Y16
"chamber_temperature", "auxiliary_fan", "chamber_fan"
};

View File

@@ -226,6 +226,10 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|| opt_key == "single_extruder_multi_material"
//Y25
|| opt_key == "wipe_device"
//Y27
|| opt_key == "resonance_avoidance"
|| opt_key == "min_resonance_avoidance_speed"
|| opt_key == "max_resonance_avoidance_speed"
|| opt_key == "temperature"
|| opt_key == "idle_temperature"
|| opt_key == "wipe_tower"

View File

@@ -2996,6 +2996,30 @@ void PrintConfigDef::init_fff_params()
def->mode = comExpert;
def->set_default_value(new ConfigOptionBool(false));
//Y27
def = this->add("resonance_avoidance", coBool);
def->label = L("Resonance avoidance");
def->tooltip = L("By reducing the speed of the outer wall to avoid the resonance zone of the printer, ringing on the surface of the model are avoided. "
"Turn this option off when testing ringing.");
def->mode = comExpert;
def->set_default_value(new ConfigOptionBool(true));
def = this->add("min_resonance_avoidance_speed", coFloat);
def->label = L("Min");
def->tooltip = L("Minimum speed of resonance avoidance.");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comExpert;
def->set_default_value(new ConfigOptionFloat(70));
def = this->add("max_resonance_avoidance_speed", coFloat);
def->label = L("Max");
def->tooltip = L("Maximum speed of resonance avoidance.");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comExpert;
def->set_default_value(new ConfigOptionFloat(115));
def = this->add("single_extruder_multi_material_priming", coBool);
def->label = L("Prime all printing extruders");
def->tooltip = L("If enabled, all printing extruders will be primed at the front edge of the print bed at the start of the print.");

View File

@@ -535,7 +535,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionInt, raft_layers))
((ConfigOptionEnum<SeamPosition>, seam_position))
//Y21
((ConfigOptionPercent, seam_gap))
((ConfigOptionPercent, seam_gap))
((ConfigOptionBool, staggered_inner_seams))
// ((ConfigOptionFloat, seam_preferred_direction))
// ((ConfigOptionFloat, seam_preferred_direction_jitter))
@@ -785,6 +785,10 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionBool, single_extruder_multi_material))
//Y25
((ConfigOptionBool, wipe_device))
//Y27
((ConfigOptionBool, resonance_avoidance))
((ConfigOptionFloat, min_resonance_avoidance_speed))
((ConfigOptionFloat, max_resonance_avoidance_speed))
((ConfigOptionBool, single_extruder_multi_material_priming))
((ConfigOptionBool, wipe_tower_no_sparse_layers))
((ConfigOptionString, toolchange_gcode))

View File

@@ -2736,6 +2736,12 @@ void TabPrinter::build_fff()
Option option(def, "extruders_count");
optgroup->append_single_option_line(option);
optgroup->append_single_option_line("single_extruder_multi_material");
//Y27
optgroup->append_single_option_line("resonance_avoidance");
Line line = { L("Resonance Avoidance Speed"), "" };
line.append_option(optgroup->get_option("min_resonance_avoidance_speed"));
line.append_option(optgroup->get_option("max_resonance_avoidance_speed"));
optgroup->append_line(line);
optgroup->m_on_change = [this, optgroup_wk = ConfigOptionsGroupWkp(optgroup)](t_config_option_key opt_key, boost::any value) {
auto optgroup_sh = optgroup_wk.lock();
@@ -3607,6 +3613,10 @@ void TabPrinter::toggle_options()
toggle_option("toolchange_gcode", have_multiple_extruders);
if (m_active_page->title() == "General") {
toggle_option("single_extruder_multi_material", have_multiple_extruders);
//Y27
bool resonance_avoidance = m_config->opt_bool("resonance_avoidance");
toggle_option("min_resonance_avoidance_speed", resonance_avoidance);
toggle_option("max_resonance_avoidance_speed", resonance_avoidance);
bool is_marlin_flavor = flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware;
// Disable silent mode for non-marlin firmwares.