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:
EpiphanyPrinting
2025-06-16 00:14:00 -05:00
committed by GitHub
parent b259ee22b3
commit 3a81a8f358
7 changed files with 83 additions and 7 deletions

View File

@@ -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: resonanceavoidance on short external perimeters
{
double ref_speed = speed; // stash the precap 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;
}
// reapply 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 {};