ENH: support specific acceleration for outer wall

So we can set lower acceleration for outer wall now.

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: Ib4728bf16f6c540afca62f423c8aab4c9e0c4d02
This commit is contained in:
salt.wei 2022-10-13 22:59:54 +08:00 committed by Lane.Wei
parent 9c32cff1dd
commit 5e024f75b9
8 changed files with 23 additions and 7 deletions

View file

@ -1465,9 +1465,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
// Emit machine envelope limits for the Marlin firmware.
this->print_machine_envelope(file, print);
//BBS: emit printing accelerate if has non-zero value
//BBS: emit outer wall accelerate if has non-zero value
if (m_config.default_acceleration.value > 0) {
float acceleration = m_config.default_acceleration.value;
float acceleration = m_config.outer_wall_acceleration.value > 0 ?
m_config.outer_wall_acceleration.value : m_config.default_acceleration.value;
file.write(m_writer.set_acceleration((unsigned int)floor(acceleration + 0.5)));
}
@ -3538,9 +3539,12 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
acceleration = m_config.first_layer_acceleration_over_raft.value;
} else if (m_config.bridge_acceleration.value > 0 && is_bridge(path.role())) {
acceleration = m_config.bridge_acceleration.value;
} else if (m_config.perimeter_acceleration.value > 0 && is_perimeter(path.role())) {
acceleration = m_config.perimeter_acceleration.value;
#endif
} else if (m_config.outer_wall_acceleration.value > 0
//BBS: FIXME, in fact,we only need to set acceleration for outer wall. But we don't know
//whether the overhang perimeter is outer or not. So using specific acceleration together.
&& (path.role() == erExternalPerimeter || path.role() == erOverhangPerimeter)) {
acceleration = m_config.outer_wall_acceleration.value;
} else if (m_config.top_surface_acceleration.value > 0 && is_top_surface(path.role())) {
acceleration = m_config.top_surface_acceleration.value;
} else {

View file

@ -705,7 +705,7 @@ static std::vector<std::string> s_Preset_print_options {
"inner_wall_speed", "outer_wall_speed", "sparse_infill_speed", "internal_solid_infill_speed",
"top_surface_speed", "support_speed", "support_object_xy_distance", "support_interface_speed",
"bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed",
"initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "skirt_loops", "skirt_distance", "skirt_height", "draft_shield",
"outer_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "skirt_loops", "skirt_distance", "skirt_height", "draft_shield",
"brim_width", "brim_object_gap", "brim_type", "enable_support", "support_type", "support_threshold_angle", "enforce_support_layers",
"raft_layers", "raft_first_layer_density", "raft_first_layer_expansion", "raft_contact_distance", "raft_expansion",
"support_base_pattern", "support_base_pattern_spacing", "support_style",

View file

@ -92,6 +92,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"filament_density",
"filament_cost",
"initial_layer_acceleration",
"outer_wall_acceleration",
"top_surface_acceleration",
// BBS
"cool_plate_temp_initial_layer",

View file

@ -1255,6 +1255,14 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(500));
def = this->add("outer_wall_acceleration", coFloat);
def->label = L("Outer wall");
def->tooltip = L("Acceleration of outer wall. Using a lower value can improve quality");
def->sidetext = L("mm/s²");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(500));
def = this->add("initial_layer_acceleration", coFloat);
def->label = L("Initial layer");
def->tooltip = L("Acceleration of initial layer. Using a lower value can improve build plate adhensive");
@ -3997,7 +4005,7 @@ std::string validate(const FullPrintConfig &cfg)
// config before exporting, leaving this check in would mean that config would be rejected before export
// (although both the UI and the backend handle it).
// --default-acceleration
//if ((cfg.perimeter_acceleration != 0. || cfg.infill_acceleration != 0. || cfg.bridge_acceleration != 0. || cfg.initial_layer_acceleration != 0.) &&
//if ((cfg.outer_wall_acceleration != 0. || cfg.infill_acceleration != 0. || cfg.bridge_acceleration != 0. || cfg.initial_layer_acceleration != 0.) &&
// cfg.default_acceleration == 0.)
// return "Invalid zero value for --default-acceleration when using other acceleration settings";

View file

@ -833,6 +833,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionInts, fan_cooling_layer_time))
((ConfigOptionStrings, filament_colour))
((ConfigOptionFloat, top_surface_acceleration))
((ConfigOptionFloat, outer_wall_acceleration))
((ConfigOptionFloat, initial_layer_acceleration))
((ConfigOptionFloat, initial_layer_line_width))
((ConfigOptionFloat, initial_layer_print_height))