diff --git a/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json b/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json index 785be05e5b..e9e490bbc7 100644 --- a/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json +++ b/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json @@ -45,8 +45,8 @@ "5000" ], "machine_max_acceleration_travel": [ - "9000", - "9000" + "20000", + "20000" ], "machine_max_acceleration_x": [ "20000", diff --git a/resources/profiles/Creality/machine/Creality K1 Max (0.8 nozzle).json b/resources/profiles/Creality/machine/Creality K1 Max (0.8 nozzle).json index 8792552a67..d1873d19e9 100644 --- a/resources/profiles/Creality/machine/Creality K1 Max (0.8 nozzle).json +++ b/resources/profiles/Creality/machine/Creality K1 Max (0.8 nozzle).json @@ -17,7 +17,7 @@ "machine_max_acceleration_e": ["5000", "5000"], "machine_max_acceleration_extruding": ["20000", "20000"], "machine_max_acceleration_retracting": ["5000", "5000"], - "machine_max_acceleration_travel": ["9000", "9000"], + "machine_max_acceleration_travel": ["20000", "20000"], "machine_max_acceleration_x": ["20000", "20000"], "machine_max_acceleration_y": ["20000", "20000"], "machine_max_acceleration_z": ["500", "500"], diff --git a/resources/profiles/Custom/machine/fdm_klipper_common.json b/resources/profiles/Custom/machine/fdm_klipper_common.json index cbc6f7052f..af307008b9 100644 --- a/resources/profiles/Custom/machine/fdm_klipper_common.json +++ b/resources/profiles/Custom/machine/fdm_klipper_common.json @@ -8,7 +8,7 @@ "machine_max_acceleration_e": ["5000", "5000"], "machine_max_acceleration_extruding": ["20000", "20000"], "machine_max_acceleration_retracting": ["5000", "5000"], - "machine_max_acceleration_travel": ["9000", "9000"], + "machine_max_acceleration_travel": ["20000", "20000"], "machine_max_acceleration_x": ["20000", "20000"], "machine_max_acceleration_y": ["20000", "20000"], "machine_max_acceleration_z": ["500", "200"], diff --git a/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M 0.4 Nozzle.json b/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M 0.4 Nozzle.json index 1aa184ecfb..357fcbd4df 100644 --- a/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M 0.4 Nozzle.json +++ b/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M 0.4 Nozzle.json @@ -21,7 +21,7 @@ "machine_max_acceleration_e": [ "5000", "5000" ], "machine_max_acceleration_extruding": [ "20000", "20000" ], "machine_max_acceleration_retracting": [ "5000", "5000" ], - "machine_max_acceleration_travel": [ "9000", "9000" ], + "machine_max_acceleration_travel": [ "20000", "20000" ], "machine_max_acceleration_x": [ "20000", "20000" ], "machine_max_acceleration_y": [ "20000", "20000" ], "machine_max_acceleration_z": [ "500", "500" ], diff --git a/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M 0.6 Nozzle.json b/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M 0.6 Nozzle.json index 1060695656..4b64972d17 100644 --- a/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M 0.6 Nozzle.json +++ b/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M 0.6 Nozzle.json @@ -21,7 +21,7 @@ "machine_max_acceleration_e": [ "5000", "5000" ], "machine_max_acceleration_extruding": [ "20000", "20000" ], "machine_max_acceleration_retracting": [ "5000", "5000" ], - "machine_max_acceleration_travel": [ "9000", "9000" ], + "machine_max_acceleration_travel": [ "20000", "20000" ], "machine_max_acceleration_x": [ "20000", "20000" ], "machine_max_acceleration_y": [ "20000", "20000" ], "machine_max_acceleration_z": [ "500", "500" ], diff --git a/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M Pro 0.4 Nozzle.json b/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M Pro 0.4 Nozzle.json index a9f60c7168..2fc9672f16 100644 --- a/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M Pro 0.4 Nozzle.json +++ b/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M Pro 0.4 Nozzle.json @@ -21,7 +21,7 @@ "machine_max_acceleration_e": [ "5000", "5000" ], "machine_max_acceleration_extruding": [ "20000", "20000" ], "machine_max_acceleration_retracting": [ "5000", "5000" ], - "machine_max_acceleration_travel": [ "9000", "9000" ], + "machine_max_acceleration_travel": [ "20000", "20000" ], "machine_max_acceleration_x": [ "20000", "20000" ], "machine_max_acceleration_y": [ "20000", "20000" ], "machine_max_acceleration_z": [ "500", "500" ], diff --git a/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M Pro 0.6 Nozzle.json b/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M Pro 0.6 Nozzle.json index 6c830eb2db..a46ee605d0 100644 --- a/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M Pro 0.6 Nozzle.json +++ b/resources/profiles/Flashforge/machine/Flashforge Adventurer 5M Pro 0.6 Nozzle.json @@ -21,7 +21,7 @@ "machine_max_acceleration_e": [ "5000", "5000" ], "machine_max_acceleration_extruding": [ "20000", "20000" ], "machine_max_acceleration_retracting": [ "5000", "5000" ], - "machine_max_acceleration_travel": [ "9000", "9000" ], + "machine_max_acceleration_travel": [ "20000", "20000" ], "machine_max_acceleration_x": [ "20000", "20000" ], "machine_max_acceleration_y": [ "20000", "20000" ], "machine_max_acceleration_z": [ "500", "500" ], diff --git a/resources/profiles/Kingroon/machine/fdm_machine_common.json b/resources/profiles/Kingroon/machine/fdm_machine_common.json index 0ff7eb5a0c..b29d6a2250 100644 --- a/resources/profiles/Kingroon/machine/fdm_machine_common.json +++ b/resources/profiles/Kingroon/machine/fdm_machine_common.json @@ -27,7 +27,7 @@ "machine_max_acceleration_e": ["5000", "5000"], "machine_max_acceleration_extruding": ["1250", "20000"], "machine_max_acceleration_retracting": ["1250", "5000"], - "machine_max_acceleration_travel": ["9000", "9000"], + "machine_max_acceleration_travel": ["20000", "20000"], "machine_max_acceleration_x": ["3000", "20000"], "machine_max_acceleration_y": ["3000", "20000"], "machine_max_acceleration_z": ["200", "200"], diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index c5712316b1..c79d7f5541 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -1,4 +1,5 @@ #include "ExtrusionEntity.hpp" +#include "PrintConfig.hpp" #include "libslic3r/libslic3r.h" #include "libslic3r/Utils.hpp" #include "libslic3r/Print.hpp" @@ -973,7 +974,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config) if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper || m_flavor == gcfRepRapFirmware) { m_time_processor.machine_limits = reinterpret_cast(config); - if (m_flavor == gcfMarlinLegacy) { + if (m_flavor == gcfMarlinLegacy || m_flavor == gcfKlipper) { // Legacy Marlin does not have separate travel acceleration, it uses the 'extruding' value instead. m_time_processor.machine_limits.machine_max_acceleration_travel = m_time_processor.machine_limits.machine_max_acceleration_extruding; } @@ -993,13 +994,18 @@ void GCodeProcessor::apply_config(const PrintConfig& config) for (size_t i = 0; i < static_cast(PrintEstimatedStatistics::ETimeMode::Count); ++i) { float max_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_extruding, i); m_time_processor.machines[i].max_acceleration = max_acceleration; - m_time_processor.machines[i].acceleration = (max_acceleration > 0.0f) ? max_acceleration : DEFAULT_ACCELERATION; + m_time_processor.machines[i].acceleration = (max_acceleration > 0.0f) ? max_acceleration : DEFAULT_ACCELERATION; float max_retract_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_retracting, i); m_time_processor.machines[i].max_retract_acceleration = max_retract_acceleration; - m_time_processor.machines[i].retract_acceleration = (max_retract_acceleration > 0.0f) ? max_retract_acceleration : DEFAULT_RETRACT_ACCELERATION; + m_time_processor.machines[i].retract_acceleration = (max_retract_acceleration > 0.0f) ? max_retract_acceleration : + DEFAULT_RETRACT_ACCELERATION; float max_travel_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_travel, i); + if (!GCodeWriter::supports_separate_travel_acceleration(config.gcode_flavor.value)){ + max_travel_acceleration = 0; + } m_time_processor.machines[i].max_travel_acceleration = max_travel_acceleration; - m_time_processor.machines[i].travel_acceleration = (max_travel_acceleration > 0.0f) ? max_travel_acceleration : DEFAULT_TRAVEL_ACCELERATION; + m_time_processor.machines[i].travel_acceleration = (max_travel_acceleration > 0.0f) ? max_travel_acceleration : + DEFAULT_TRAVEL_ACCELERATION; } const ConfigOptionFloat* initial_layer_print_height = config.option("initial_layer_print_height"); @@ -1242,7 +1248,7 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config) // Legacy Marlin does not have separate travel acceleration, it uses the 'extruding' value instead. - const ConfigOptionFloats* machine_max_acceleration_travel = config.option(m_flavor == gcfMarlinLegacy + const ConfigOptionFloats* machine_max_acceleration_travel = config.option(m_flavor == gcfMarlinLegacy || m_flavor == gcfKlipper ? "machine_max_acceleration_extruding" : "machine_max_acceleration_travel"); if (machine_max_acceleration_travel != nullptr) @@ -1261,13 +1267,15 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config) for (size_t i = 0; i < static_cast(PrintEstimatedStatistics::ETimeMode::Count); ++i) { float max_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_extruding, i); m_time_processor.machines[i].max_acceleration = max_acceleration; - m_time_processor.machines[i].acceleration = (max_acceleration > 0.0f) ? max_acceleration : DEFAULT_ACCELERATION; + m_time_processor.machines[i].acceleration = (max_acceleration > 0.0f) ? max_acceleration : DEFAULT_ACCELERATION; float max_retract_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_retracting, i); m_time_processor.machines[i].max_retract_acceleration = max_retract_acceleration; - m_time_processor.machines[i].retract_acceleration = (max_retract_acceleration > 0.0f) ? max_retract_acceleration : DEFAULT_RETRACT_ACCELERATION; + m_time_processor.machines[i].retract_acceleration = (max_retract_acceleration > 0.0f) ? max_retract_acceleration : + DEFAULT_RETRACT_ACCELERATION; float max_travel_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_travel, i); m_time_processor.machines[i].max_travel_acceleration = max_travel_acceleration; - m_time_processor.machines[i].travel_acceleration = (max_travel_acceleration > 0.0f) ? max_travel_acceleration : DEFAULT_TRAVEL_ACCELERATION; + m_time_processor.machines[i].travel_acceleration = (max_travel_acceleration > 0.0f) ? max_travel_acceleration : + DEFAULT_TRAVEL_ACCELERATION; } if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware) { diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index e5113a48e1..d93a8af119 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -19,7 +19,7 @@ namespace Slic3r { bool GCodeWriter::full_gcode_comment = true; const double GCodeWriter::slope_threshold = 3 * PI / 180; -bool supports_separate_travel_acceleration(GCodeFlavor flavor) +bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) { return (flavor == gcfRepetier || flavor == gcfMarlinFirmware || flavor == gcfRepRapFirmware); } diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index 1a26abac5f..bbaa069da0 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -116,6 +116,8 @@ public: void set_is_first_layer(bool bval) { m_is_first_layer = bval; } GCodeFlavor get_gcode_flavor() const { return config.gcode_flavor; } + // Returns whether this flavor supports separate print and travel acceleration. + static bool supports_separate_travel_acceleration(GCodeFlavor flavor); private: // Extruders are sorted by their ID, so that binary search is possible. std::vector m_extruders; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 61a5abb488..888311abb9 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2597,7 +2597,7 @@ def = this->add("filament_loading_speed", coFloats); def->min = 0; def->readonly = false; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloats{ 1500., 1250. }); + def->set_default_value(new ConfigOptionFloats{ 0., 0. }); def = this->add("fan_max_speed", coInts); def->label = L("Fan speed"); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 38e767257c..ac2c6cd0e0 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3434,7 +3434,7 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/) { size_t n_before_extruders = 2; // Count of pages before Extruder pages auto flavor = m_config->option>("gcode_flavor")->value; - bool is_marlin_flavor = (flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware || flavor == gcfKlipper); + bool is_marlin_flavor = (flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware || flavor == gcfKlipper || flavor == gcfRepRapFirmware); /* ! Freeze/Thaw in this function is needed to avoid call OnPaint() for erased pages * and be cause of application crash, when try to change Preset in moment, @@ -3461,8 +3461,8 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/) m_pages.insert(m_pages.begin() + n_before_extruders, page); } - if (is_marlin_flavor) - n_before_extruders++; +if (is_marlin_flavor) + n_before_extruders++; size_t n_after_single_extruder_MM = 2; // Count of pages after single_extruder_multi_material page if (from_initial_build) { @@ -3829,12 +3829,11 @@ void TabPrinter::toggle_options() if (m_active_page->title() == L("Motion ability")) { auto gcf = m_config->option>("gcode_flavor")->value; - assert(gcf == gcfMarlinLegacy || gcf == gcfMarlinFirmware || gcf == gcfKlipper); bool silent_mode = m_config->opt_bool("silent_mode"); int max_field = silent_mode ? 2 : 1; for (int i = 0; i < max_field; ++i) - toggle_option("machine_max_acceleration_travel", gcf == gcfMarlinFirmware, i); - toggle_line("machine_max_acceleration_travel", gcf == gcfMarlinFirmware); + toggle_option("machine_max_acceleration_travel", gcf != gcfMarlinLegacy && gcf != gcfKlipper, i); + toggle_line("machine_max_acceleration_travel", gcf != gcfMarlinLegacy && gcf != gcfKlipper); } }