aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2025-04-07 19:50:56 -0400
committerKevin O'Connor <kevin@koconnor.net>2025-05-12 20:15:03 -0400
commit307c03e4804800ecf5833efe3aa097d91a7fa0e7 (patch)
treec11cf4ed3f1ebf40daf2e6291024731074d0cafa /klippy
parent64d6f110a989a67481927ee6cfb6ae411d28377d (diff)
downloadkutter-307c03e4804800ecf5833efe3aa097d91a7fa0e7.tar.gz
kutter-307c03e4804800ecf5833efe3aa097d91a7fa0e7.tar.xz
kutter-307c03e4804800ecf5833efe3aa097d91a7fa0e7.zip
resonance_tester: Support toolhead positions with more than 4 axes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/extras/resonance_tester.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/klippy/extras/resonance_tester.py b/klippy/extras/resonance_tester.py
index 76e56f53..9534f88e 100644
--- a/klippy/extras/resonance_tester.py
+++ b/klippy/extras/resonance_tester.py
@@ -127,7 +127,8 @@ class ResonanceTestExecutor:
def run_test(self, test_seq, axis, gcmd):
reactor = self.printer.get_reactor()
toolhead = self.printer.lookup_object('toolhead')
- X, Y, Z, E = toolhead.get_position()
+ tpos = toolhead.get_position()
+ X, Y = thpos[:2]
# Override maximum acceleration and acceleration to
# deceleration based on the maximum test frequency
systime = reactor.monotonic()
@@ -166,10 +167,10 @@ class ResonanceTestExecutor:
# The move first goes to a complete stop, then changes direction
d_decel = -last_v2 * half_inv_accel
decel_X, decel_Y = axis.get_point(d_decel)
- toolhead.move([X + decel_X, Y + decel_Y, Z, E], abs_last_v)
- toolhead.move([nX, nY, Z, E], abs_v)
+ toolhead.move([X + decel_X, Y + decel_Y] + tpos[2:], abs_last_v)
+ toolhead.move([nX, nY] + tpos[2:], abs_v)
else:
- toolhead.move([nX, nY, Z, E], max(abs_v, abs_last_v))
+ toolhead.move([nX, nY] + tpos[2:], max(abs_v, abs_last_v))
if math.floor(freq) > math.floor(last_freq):
gcmd.respond_info("Testing frequency %.0f Hz" % (freq,))
reactor.pause(reactor.monotonic() + 0.01)
@@ -183,7 +184,7 @@ class ResonanceTestExecutor:
decel_X, decel_Y = axis.get_point(d_decel)
toolhead.cmd_M204(self.gcode.create_gcode_command(
"M204", "M204", {"S": old_max_accel}))
- toolhead.move([X + decel_X, Y + decel_Y, Z, E], abs(last_v))
+ toolhead.move([X + decel_X, Y + decel_Y] + tpos[2:], abs(last_v))
# Restore the original acceleration values
self.gcode.run_script_from_command(
"SET_VELOCITY_LIMIT ACCEL=%.3f MINIMUM_CRUISE_RATIO=%.3f"