aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/toolhead.py
diff options
context:
space:
mode:
authorDmitry Butyugin <dmbutyugin@google.com>2024-12-06 11:54:26 +0900
committerGitHub <noreply@github.com>2024-12-05 21:54:26 -0500
commit16b4b6b302ac3ffcd55006cd76265aad4e26ecc8 (patch)
tree15e598c259b1b30ee5fe1fefa97ae32f8bc1899c /klippy/toolhead.py
parent7f89668d6c069deaa02d6479e073d11a2389a948 (diff)
downloadkutter-16b4b6b302ac3ffcd55006cd76265aad4e26ecc8.tar.gz
kutter-16b4b6b302ac3ffcd55006cd76265aad4e26ecc8.tar.xz
kutter-16b4b6b302ac3ffcd55006cd76265aad4e26ecc8.zip
resonance_tester: Added a new sweeping_vibrations resonance test method (#6723)
This adds a new resonance test method that can help if a user has some mechanical problems with the printer. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Diffstat (limited to 'klippy/toolhead.py')
-rw-r--r--klippy/toolhead.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py
index ed26092f..256915da 100644
--- a/klippy/toolhead.py
+++ b/klippy/toolhead.py
@@ -47,6 +47,7 @@ class Move:
self.delta_v2 = 2.0 * move_d * self.accel
self.max_smoothed_v2 = 0.
self.smooth_delta_v2 = 2.0 * move_d * toolhead.max_accel_to_decel
+ self.next_junction_v2 = 999999999.9
def limit_speed(self, speed, accel):
speed2 = speed**2
if speed2 < self.max_cruise_v2:
@@ -55,6 +56,8 @@ class Move:
self.accel = min(self.accel, accel)
self.delta_v2 = 2.0 * self.move_d * self.accel
self.smooth_delta_v2 = min(self.smooth_delta_v2, self.delta_v2)
+ def limit_next_junction_speed(self, speed):
+ self.next_junction_v2 = min(self.next_junction_v2, speed**2)
def move_error(self, msg="Move out of range"):
ep = self.end_pos
m = "%s: %.3f %.3f %.3f [%.3f]" % (msg, ep[0], ep[1], ep[2], ep[3])
@@ -64,9 +67,9 @@ class Move:
return
# Allow extruder to calculate its maximum junction
extruder_v2 = self.toolhead.extruder.calc_junction(prev_move, self)
- max_start_v2 = min(
- extruder_v2, self.max_cruise_v2, prev_move.max_cruise_v2,
- prev_move.max_start_v2 + prev_move.delta_v2)
+ max_start_v2 = min(extruder_v2, self.max_cruise_v2,
+ prev_move.max_cruise_v2, prev_move.next_junction_v2,
+ prev_move.max_start_v2 + prev_move.delta_v2)
# Find max velocity using "approximated centripetal velocity"
axes_r = self.axes_r
prev_axes_r = prev_move.axes_r
@@ -462,6 +465,10 @@ class ToolHead:
self.commanded_pos[:] = newpos
self.kin.set_position(newpos, homing_axes)
self.printer.send_event("toolhead:set_position")
+ def limit_next_junction_speed(self, speed):
+ last_move = self.lookahead.get_last()
+ if last_move is not None:
+ last_move.limit_next_junction_speed(speed)
def move(self, newpos, speed):
move = Move(self, self.commanded_pos, newpos, speed)
if not move.move_d: