Skip to content

Commit

Permalink
make initial layer travel move acceleration and jerk configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
shyblower committed Sep 23, 2024
1 parent cc950f2 commit 50ed498
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 5 deletions.
12 changes: 12 additions & 0 deletions localization/i18n/OrcaSlicer.pot
Original file line number Diff line number Diff line change
Expand Up @@ -10412,6 +10412,18 @@ msgstr ""
msgid "Travel speed of initial layer"
msgstr ""

msgid "Initial layer travel acceleration"
msgstr ""

msgid "Travel acceleration of initial layer"
msgstr ""

msgid "Initial layer travel jerk"
msgstr ""

msgid "Travel jerk of initial layer"
msgstr ""

msgid "Number of slow layers"
msgstr ""

Expand Down
12 changes: 12 additions & 0 deletions localization/i18n/de/OrcaSlicer_de.po
Original file line number Diff line number Diff line change
Expand Up @@ -11964,6 +11964,18 @@ msgstr "Bewegung"
msgid "Travel speed of initial layer"
msgstr "Bewegungsgeschwindigkeit der ersten Schicht"

msgid "Initial layer travel acceleration"
msgstr "Eilgang Beschleunigung"

msgid "Travel acceleration of initial layer"
msgstr "Eilgang Beschleuinigung der ersten Schicht"

msgid "Initial layer travel jerk"
msgstr "Eilgang Ruck"

msgid "Travel jerk of initial layer"
msgstr "Eilgang Ruck der ersten Schicht"

msgid "Number of slow layers"
msgstr "Anzahl der lansamen Schichten"

Expand Down
12 changes: 12 additions & 0 deletions localization/i18n/en/OrcaSlicer_en.po
Original file line number Diff line number Diff line change
Expand Up @@ -11052,6 +11052,18 @@ msgstr ""
msgid "Travel speed of initial layer"
msgstr ""

msgid "Initial layer travel acceleration"
msgstr ""

msgid "Travel acceleration of initial layer"
msgstr ""

msgid "Initial layer travel jerk"
msgstr ""

msgid "Travel jerk of initial layer"
msgstr ""

#, fuzzy
msgid "Number of slow layers"
msgstr "This is the number of top interface layers."
Expand Down
11 changes: 7 additions & 4 deletions src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5935,11 +5935,14 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string
double jerk_to_set = 0.0;
unsigned int acceleration_to_set = 0;
if (this->on_first_layer()) {
if (m_config.default_acceleration.value > 0 && m_config.initial_layer_acceleration.value > 0) {
acceleration_to_set = (unsigned int) floor(m_config.initial_layer_acceleration.value + 0.5);
unsigned int initial_layer_travel_acceleration = m_config.get_abs_value("initial_layer_travel_acceleration");
double initial_layer_travel_jerk = m_config.get_abs_value("initial_layer_travel_jerk");

if (m_config.default_acceleration.value > 0 && initial_layer_travel_acceleration > 0) {
acceleration_to_set = (unsigned int) floor(initial_layer_travel_acceleration + 0.5);
}
if (m_config.default_jerk.value > 0 && m_config.initial_layer_jerk.value > 0) {
jerk_to_set = m_config.initial_layer_jerk.value;
if (m_config.default_jerk.value > 0 && initial_layer_travel_jerk > 0) {
jerk_to_set = initial_layer_travel_jerk;
}
} else {
if (m_config.default_acceleration.value > 0 && m_config.travel_acceleration.value > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Preset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ static std::vector<std::string> s_Preset_print_options {
"bridge_density", "precise_outer_wall", "overhang_speed_classic", "bridge_acceleration",
"sparse_infill_acceleration", "internal_solid_infill_acceleration", "tree_support_adaptive_layer_height", "tree_support_auto_brim",
"tree_support_brim_width", "gcode_comments", "gcode_label_objects",
"initial_layer_travel_speed", "exclude_object", "slow_down_layers", "infill_anchor", "infill_anchor_max","initial_layer_min_bead_width",
"initial_layer_travel_speed", "initial_layer_travel_acceleration", "initial_layer_travel_jerk", "exclude_object", "slow_down_layers", "infill_anchor", "infill_anchor_max","initial_layer_min_bead_width",
"make_overhang_printable", "make_overhang_printable_angle", "make_overhang_printable_hole_size" ,"notes",
"wipe_tower_cone_angle", "wipe_tower_extra_spacing","wipe_tower_max_purge_speed", "wipe_tower_filament", "wiping_volumes_extruders","wipe_tower_bridging", "wipe_tower_extra_flow","single_extruder_multi_material_priming",
"wipe_tower_rotation_angle", "tree_support_branch_distance_organic", "tree_support_branch_diameter_organic", "tree_support_branch_angle_organic",
Expand Down
2 changes: 2 additions & 0 deletions src/libslic3r/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|| opt_key == "travel_speed_z"
|| opt_key == "initial_layer_speed"
|| opt_key == "initial_layer_travel_speed"
|| opt_key == "initial_layer_travel_acceleration"
|| opt_key == "initial_layer_travel_jerk"
|| opt_key == "slow_down_layers"
|| opt_key == "idle_temperature"
|| opt_key == "wipe_tower_cone_angle"
Expand Down
18 changes: 18 additions & 0 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2514,6 +2514,24 @@ void PrintConfigDef::init_fff_params()
def->min = 1;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(100, true));

def = this->add("initial_layer_travel_acceleration", coFloatOrPercent);
def->label = L("Initial layer travel acceleration");
def->tooltip = L("Travel acceleration of initial layer");
def->sidetext = L("mm/s or %");
def->ratio_over = "travel_acceleration";
def->min = 1;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(100, true));

def = this->add("initial_layer_travel_jerk", coFloatOrPercent);
def->label = L("Initial layer travel jerk");
def->tooltip = L("Travel jerk of initial layer");
def->sidetext = L("mm/s or %");
def->ratio_over = "travel_jerk";
def->min = 1;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(100, true));

def = this->add("slow_down_layers", coInt);
def->label = L("Number of slow layers");
Expand Down
2 changes: 2 additions & 0 deletions src/libslic3r/PrintConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,8 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionBool, accel_to_decel_enable))
((ConfigOptionPercent, accel_to_decel_factor))
((ConfigOptionFloatOrPercent, initial_layer_travel_speed))
((ConfigOptionFloatOrPercent, initial_layer_travel_acceleration))
((ConfigOptionFloatOrPercent, initial_layer_travel_jerk))
((ConfigOptionBool, bbl_calib_mark_logo))
((ConfigOptionBool, disable_m73))

Expand Down
2 changes: 2 additions & 0 deletions src/slic3r/GUI/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2150,6 +2150,8 @@ void TabPrint::build()
optgroup->append_single_option_line("initial_layer_speed");
optgroup->append_single_option_line("initial_layer_infill_speed");
optgroup->append_single_option_line("initial_layer_travel_speed");
optgroup->append_single_option_line("initial_layer_travel_acceleration");
optgroup->append_single_option_line("initial_layer_travel_jerk");
optgroup->append_single_option_line("slow_down_layers");
optgroup = page->new_optgroup(L("Other layers speed"), L"param_speed", 15);
optgroup->append_single_option_line("outer_wall_speed");
Expand Down

0 comments on commit 50ed498

Please sign in to comment.