aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/resonance_tester.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2023-12-03 18:50:44 -0500
committerKevin O'Connor <kevin@koconnor.net>2024-03-13 21:31:37 -0400
commit0105aa330f2a4865b01cbbc548cba1322be5371e (patch)
treeaac2527aed98d2aa5dcef13d1b16ac6efda704ff /klippy/extras/resonance_tester.py
parent18de421c4acbdb00946df35dfb412dedb159abca (diff)
downloadkutter-0105aa330f2a4865b01cbbc548cba1322be5371e.tar.gz
kutter-0105aa330f2a4865b01cbbc548cba1322be5371e.tar.xz
kutter-0105aa330f2a4865b01cbbc548cba1322be5371e.zip
toolhead: Replace max_accel_to_decel with minimum_cruise_ratio
The user facing max_accel_to_decel setting is complicated and confusing. Replace it with a new minimum_cruise_ratio parameter. Internally this user-facing parameter will calculate the existing low-level "accel_to_decel" mechanism. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/resonance_tester.py')
-rw-r--r--klippy/extras/resonance_tester.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/klippy/extras/resonance_tester.py b/klippy/extras/resonance_tester.py
index d249412c..fe8717d5 100644
--- a/klippy/extras/resonance_tester.py
+++ b/klippy/extras/resonance_tester.py
@@ -77,11 +77,11 @@ class VibrationPulseTest:
systime = self.printer.get_reactor().monotonic()
toolhead_info = toolhead.get_status(systime)
old_max_accel = toolhead_info['max_accel']
- old_max_accel_to_decel = toolhead_info['max_accel_to_decel']
+ old_minimum_cruise_ratio = toolhead_info['minimum_cruise_ratio']
max_accel = self.freq_end * self.accel_per_hz
self.gcode.run_script_from_command(
- "SET_VELOCITY_LIMIT ACCEL=%.3f ACCEL_TO_DECEL=%.3f" % (
- max_accel, max_accel))
+ "SET_VELOCITY_LIMIT ACCEL=%.3f MINIMUM_CRUISE_RATIO=0"
+ % (max_accel,))
input_shaper = self.printer.lookup_object('input_shaper', None)
if input_shaper is not None and not gcmd.get_int('INPUT_SHAPING', 0):
input_shaper.disable_shaping()
@@ -108,8 +108,8 @@ class VibrationPulseTest:
gcmd.respond_info("Testing frequency %.0f Hz" % (freq,))
# Restore the original acceleration values
self.gcode.run_script_from_command(
- "SET_VELOCITY_LIMIT ACCEL=%.3f ACCEL_TO_DECEL=%.3f" % (
- old_max_accel, old_max_accel_to_decel))
+ "SET_VELOCITY_LIMIT ACCEL=%.3f MINIMUM_CRUISE_RATIO=%.3f"
+ % (old_max_accel, old_minimum_cruise_ratio))
# Restore input shaper if it was disabled for resonance testing
if input_shaper is not None:
input_shaper.enable_shaping()