force_move: Make sure to flush step generation queue after each move

Add toolhead.note_kinematic_activity() call and use it to force the
step generation to be flushed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-11-24 10:59:13 -05:00
parent c188aa982f
commit ade65b90af
3 changed files with 9 additions and 4 deletions

View File

@ -78,10 +78,11 @@ class ForceMove:
print_time = toolhead.get_last_move_time() print_time = toolhead.get_last_move_time()
self.trapq_append(self.trapq, print_time, accel_t, cruise_t, accel_t, self.trapq_append(self.trapq, print_time, accel_t, cruise_t, accel_t,
0., 0., 0., axis_r, 0., 0., 0., cruise_v, accel) 0., 0., 0., axis_r, 0., 0., 0., cruise_v, accel)
print_time += accel_t + cruise_t + accel_t print_time = print_time + accel_t + cruise_t + accel_t
stepper.generate_steps(print_time) stepper.generate_steps(print_time)
self.trapq_free_moves(self.trapq, print_time) self.trapq_free_moves(self.trapq, print_time + 99999.9)
stepper.set_stepper_kinematics(prev_sk) stepper.set_stepper_kinematics(prev_sk)
toolhead.note_kinematic_activity(print_time)
toolhead.dwell(accel_t + cruise_t + accel_t) toolhead.dwell(accel_t + cruise_t + accel_t)
def _lookup_stepper(self, params): def _lookup_stepper(self, params):
name = self.gcode.get_str('STEPPER', params) name = self.gcode.get_str('STEPPER', params)

View File

@ -68,9 +68,11 @@ class ManualStepper:
accel_t, cruise_t, accel_t, accel_t, cruise_t, accel_t,
cp, 0., 0., axis_r, 0., 0., cp, 0., 0., axis_r, 0., 0.,
0., cruise_v, accel) 0., cruise_v, accel)
self.next_cmd_time += accel_t + cruise_t + accel_t self.next_cmd_time = self.next_cmd_time + accel_t + cruise_t + accel_t
self.rail.generate_steps(self.next_cmd_time) self.rail.generate_steps(self.next_cmd_time)
self.trapq_free_moves(self.trapq, self.next_cmd_time) self.trapq_free_moves(self.trapq, self.next_cmd_time + 99999.9)
toolhead = self.printer.lookup_object('toolhead')
toolhead.note_kinematic_activity(self.next_cmd_time)
self.sync_print_time() self.sync_print_time()
def do_homing_move(self, movepos, speed, accel, triggered): def do_homing_move(self, movepos, speed, accel, triggered):
if not self.can_home: if not self.can_home:

View File

@ -504,6 +504,8 @@ class ToolHead:
self.kin_flush_times.append(delay) self.kin_flush_times.append(delay)
new_delay = max(self.kin_flush_times + [0.]) new_delay = max(self.kin_flush_times + [0.])
self.kin_flush_delay = new_delay self.kin_flush_delay = new_delay
def note_kinematic_activity(self, kin_time):
self.last_kin_move_time = max(self.last_kin_move_time, kin_time)
def get_max_velocity(self): def get_max_velocity(self):
return self.max_velocity, self.max_accel return self.max_velocity, self.max_accel
def get_max_axis_halt(self): def get_max_axis_halt(self):