toolhead: Allow kinematics class to verify the move prior to queuing it

Introduce a check_move() method in the extruder and cartesian
kinematic classes.  This allows the lower level classes to verify the
contents of the move prior to queing that move.

The speed and acceleration handling for special Z and extrude only
moves are also moved from the generic toolhead class to the low-level
classes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-09-30 14:47:45 -04:00
parent e9505697fb
commit 275b386856
3 changed files with 47 additions and 41 deletions

View file

@ -18,10 +18,14 @@ class PrinterExtruder:
self.heater.build_config()
self.stepper.set_max_jerk(9999999.9)
self.stepper.build_config()
def get_max_speed(self):
return self.stepper.max_velocity, self.stepper.max_accel
def motor_off(self, move_time):
self.stepper.motor_enable(move_time, 0)
def check_move(self, move):
if (not move.do_calc_junction
and not move.axes_d[0] and not move.axes_d[1]
and not move.axes_d[2]):
# Extrude only move - limit accel and velocity
move.limit_speed(self.stepper.max_velocity, self.stepper.max_accel)
def move(self, move_time, move):
move_d = move.move_d
inv_accel = 1. / move.accel