aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2023-01-06 12:43:30 -0500
committerKevin O'Connor <kevin@koconnor.net>2023-01-08 10:40:52 -0500
commitbca2671efb8ae6035bb8600619b7a7c4e76169c3 (patch)
treee8b2ef2cc6754e22dbf5be7a1e154fe035dda383
parent52b33c1b81d2feb8db35a038f59e7f33d9e1727a (diff)
downloadkutter-bca2671efb8ae6035bb8600619b7a7c4e76169c3.tar.gz
kutter-bca2671efb8ae6035bb8600619b7a7c4e76169c3.tar.xz
kutter-bca2671efb8ae6035bb8600619b7a7c4e76169c3.zip
toolhead: Flush in chunks from flush_step_generation()
If note_kinematic_activity() has a time far in the future it could result in a single flush attempt of that time range. Be sure to break up that range into small chunks using the normal _update_move_time() mechanism. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--klippy/toolhead.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py
index 2c37c980..d8b93825 100644
--- a/klippy/toolhead.py
+++ b/klippy/toolhead.py
@@ -341,8 +341,14 @@ class ToolHead:
self.reactor.update_timer(self.flush_timer, self.reactor.NEVER)
self.move_queue.set_flush_time(self.buffer_time_high)
self.idle_flush_print_time = 0.
- flush_time = self.last_kin_move_time + self.kin_flush_delay
- flush_time = max(flush_time, self.print_time - self.kin_flush_delay)
+ # Determine actual last "itersolve" flush time
+ lastf = self.print_time - self.kin_flush_delay
+ # Calculate flush time that includes kinematic scan windows
+ flush_time = max(lastf, self.last_kin_move_time + self.kin_flush_delay)
+ if flush_time > self.print_time:
+ # Flush in small time chunks
+ self._update_move_time(flush_time)
+ # Flush kinematic scan windows and step buffers
self.force_flush_time = max(self.force_flush_time, flush_time)
self._update_move_time(max(self.print_time, self.force_flush_time))
def _flush_lookahead(self):