toolhead: Specify maximum acceleration and velocity in toolhead class

Change the config file so the maximum accel and velocity are specified
in the "printer" section instead of the individual "stepper" sections.
The underlying code limits the velocity and accel of the toolhead
relative to the print object, so it makes sense to configure the
system that was as well.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-12-01 15:29:26 -05:00
parent fcaf359e89
commit c49d3fdb17
8 changed files with 52 additions and 53 deletions

View file

@ -162,7 +162,8 @@ class ToolHead:
kintypes = {'cartesian': cartesian.CartKinematics,
'delta': delta.DeltaKinematics}
self.kin = config.getchoice('kinematics', kintypes)(printer, config)
self.max_speed, self.max_accel = self.kin.get_max_speed()
self.max_speed = config.getfloat('max_velocity')
self.max_accel = config.getfloat('max_accel')
self.junction_deviation = config.getfloat('junction_deviation', 0.02)
self.move_queue = MoveQueue()
self.commanded_pos = [0., 0., 0., 0.]
@ -176,6 +177,7 @@ class ToolHead:
self.motor_off_time = self.reactor.NEVER
self.flush_timer = self.reactor.register_timer(self.flush_handler)
def build_config(self):
self.kin.set_max_jerk(0.005 * self.max_accel, self.max_accel) # XXX
self.kin.build_config()
# Print time tracking
def update_move_time(self, movetime):