Skip to content

Commit bca2671

Browse files
committed
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>
1 parent 52b33c1 commit bca2671

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

klippy/toolhead.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,14 @@ def flush_step_generation(self):
341341
self.reactor.update_timer(self.flush_timer, self.reactor.NEVER)
342342
self.move_queue.set_flush_time(self.buffer_time_high)
343343
self.idle_flush_print_time = 0.
344-
flush_time = self.last_kin_move_time + self.kin_flush_delay
345-
flush_time = max(flush_time, self.print_time - self.kin_flush_delay)
344+
# Determine actual last "itersolve" flush time
345+
lastf = self.print_time - self.kin_flush_delay
346+
# Calculate flush time that includes kinematic scan windows
347+
flush_time = max(lastf, self.last_kin_move_time + self.kin_flush_delay)
348+
if flush_time > self.print_time:
349+
# Flush in small time chunks
350+
self._update_move_time(flush_time)
351+
# Flush kinematic scan windows and step buffers
346352
self.force_flush_time = max(self.force_flush_time, flush_time)
347353
self._update_move_time(max(self.print_time, self.force_flush_time))
348354
def _flush_lookahead(self):

0 commit comments

Comments
 (0)