mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
Adds resonance avoidance ported from qidi slicer (#9403)
* Update tab.cpp for resonance avoidance * update files for resonance avoidance updated gcode.cpp, gcode.hpp, preset.cpp, printconfig.cpp, printconfig.hpp to add resonance avoidance. Based on qidi slicer changes. * Update README.md * Update README.md * Update Tab.cpp * Update Preset.cpp Updating code comments * Update PrintConfig.cpp * Update PrintConfig.hpp * Update .gitattributes * Remove carriage return * Update doc * Move resonance avoidance settings to printer settings * Disable resonance avoidance by default * Update options --------- Co-authored-by: Paul Mourer <paul.mourer@gmail.com> Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
This commit is contained in:
@@ -5404,12 +5404,37 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||
//}
|
||||
if (EXTRUDER_CONFIG(filament_max_volumetric_speed) > 0) {
|
||||
// cap speed with max_volumetric_speed anyway (even if user is not using autospeed)
|
||||
speed = std::min(
|
||||
speed,
|
||||
EXTRUDER_CONFIG(filament_max_volumetric_speed) / _mm3_per_mm
|
||||
);
|
||||
speed = std::min(speed, EXTRUDER_CONFIG(filament_max_volumetric_speed) / _mm3_per_mm);
|
||||
}
|
||||
// ORCA: resonance‑avoidance on short external perimeters
|
||||
{
|
||||
double ref_speed = speed; // stash the pre‑cap speed
|
||||
if (path.role() == erExternalPerimeter
|
||||
&& m_config.resonance_avoidance.value) {
|
||||
|
||||
// if our original speed was above “max”, disable RA for this loop
|
||||
if (ref_speed > m_config.max_resonance_avoidance_speed.value) {
|
||||
m_resonance_avoidance = false;
|
||||
}
|
||||
|
||||
// re‑apply volumetric cap
|
||||
if (EXTRUDER_CONFIG(filament_max_volumetric_speed) > 0) {
|
||||
speed = std::min(
|
||||
speed,
|
||||
EXTRUDER_CONFIG(filament_max_volumetric_speed) / _mm3_per_mm
|
||||
);
|
||||
}
|
||||
|
||||
// if still in avoidance mode and under “max”, clamp to “min”
|
||||
if (m_resonance_avoidance
|
||||
&& speed <= m_config.max_resonance_avoidance_speed.value) {
|
||||
speed = std::min(speed, m_config.min_resonance_avoidance_speed.value);
|
||||
}
|
||||
|
||||
// reset flag for next segment
|
||||
m_resonance_avoidance = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool variable_speed = false;
|
||||
std::vector<ProcessedPoint> new_points {};
|
||||
|
||||
Reference in New Issue
Block a user