mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
Adjust resonance avoidance speed calculation (#11462)
* Adjust resonance avoidance speed calculation * Only adjust if it's strictly below max * If the speed is over half of the set speed range, use the max speed to prevent slowdowns Signed-off-by: Kuran Kaname <celtare21@gmail.com> * update comment --------- Signed-off-by: Kuran Kaname <celtare21@gmail.com> Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
@@ -6186,10 +6186,15 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||
);
|
||||
}
|
||||
|
||||
// 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);
|
||||
// if still in avoidance mode and under "max", adjust speed:
|
||||
// - speeds in lower half of range: clamp down to "min"
|
||||
// - speeds in upper half of range: boost up to "max" if (m_resonance_avoidance && speed < m_config.max_resonance_avoidance_speed.value) {
|
||||
if (speed < m_config.min_resonance_avoidance_speed.value +
|
||||
((m_config.max_resonance_avoidance_speed.value - m_config.min_resonance_avoidance_speed.value) / 2)) {
|
||||
speed = std::min(speed, m_config.min_resonance_avoidance_speed.value);
|
||||
} else {
|
||||
speed = m_config.max_resonance_avoidance_speed.value;
|
||||
}
|
||||
}
|
||||
|
||||
// reset flag for next segment
|
||||
|
||||
Reference in New Issue
Block a user