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

@ -28,17 +28,14 @@ class DeltaKinematics:
(cos(210.)*radius, sin(210.)*radius),
(cos(330.)*radius, sin(330.)*radius),
(cos(90.)*radius, sin(90.)*radius)]
def build_config(self):
def set_max_jerk(self, max_xy_halt_velocity, max_accel):
# XXX - this sets conservative values
for stepper in self.steppers:
stepper.set_max_jerk(0.005 * stepper.max_accel) # XXX
stepper.set_max_jerk(max_xy_halt_velocity, max_accel)
def build_config(self):
for stepper in self.steppers:
stepper.build_config()
self.set_position([0., 0., 0.])
def get_max_speed(self):
# XXX - this returns conservative values
max_xy_speed = min(s.max_velocity for s in self.steppers)
max_xy_accel = min(s.max_accel for s in self.steppers)
return max_xy_speed, max_xy_accel
def cartesian_to_actuator(self, coord):
return [int((math.sqrt(self.arm_length2
- (self.towers[i][0] - coord[0])**2