aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/shaper_calibrate.py
diff options
context:
space:
mode:
authorDmitry Butyugin <dmbutyugin@google.com>2023-04-19 23:11:10 +0200
committerKevinOConnor <kevin@koconnor.net>2023-05-25 12:52:29 -0400
commit624d360a34709c2d83bdc0bc32b983740db5739c (patch)
treedc13b980206360a1e5d953a09a55c4676900cd42 /klippy/extras/shaper_calibrate.py
parent16c53992d62e17a6dcdef7a8a0a5fbfb57ea7111 (diff)
downloadkutter-624d360a34709c2d83bdc0bc32b983740db5739c.tar.gz
kutter-624d360a34709c2d83bdc0bc32b983740db5739c.tar.xz
kutter-624d360a34709c2d83bdc0bc32b983740db5739c.zip
resonance_tester: Apply input shaper params on SHAPER_CALIBRATE
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Diffstat (limited to 'klippy/extras/shaper_calibrate.py')
-rw-r--r--klippy/extras/shaper_calibrate.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/klippy/extras/shaper_calibrate.py b/klippy/extras/shaper_calibrate.py
index 4ac58970..af77845c 100644
--- a/klippy/extras/shaper_calibrate.py
+++ b/klippy/extras/shaper_calibrate.py
@@ -334,6 +334,18 @@ class ShaperCalibrate:
configfile.set('input_shaper', 'shaper_freq_'+axis,
'%.1f' % (shaper_freq,))
+ def apply_params(self, input_shaper, axis, shaper_name, shaper_freq):
+ if axis == 'xy':
+ self.apply_params(input_shaper, 'x', shaper_name, shaper_freq)
+ self.apply_params(input_shaper, 'y', shaper_name, shaper_freq)
+ return
+ gcode = self.printer.lookup_object("gcode")
+ axis = axis.upper()
+ input_shaper.cmd_SET_INPUT_SHAPER(gcode.create_gcode_command(
+ "SET_INPUT_SHAPER", "SET_INPUT_SHAPER", {
+ "SHAPER_TYPE_" + axis: shaper_name,
+ "SHAPER_FREQ_" + axis: shaper_freq}))
+
def save_calibration_data(self, output, calibration_data, shapers=None):
try:
with open(output, "w") as csvfile: