diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-09-03 15:17:02 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-09-03 15:45:04 -0400 |
commit | 7a81bfc4a4651c913add10e34e7431513cf8a5f5 (patch) | |
tree | 7f3a40804dd52154d864cc71e7a120cddecf4725 /klippy/corexy.py | |
parent | 0d13834293d0b5db2fc3407bd603dbfaa691402d (diff) | |
download | kutter-7a81bfc4a4651c913add10e34e7431513cf8a5f5.tar.gz kutter-7a81bfc4a4651c913add10e34e7431513cf8a5f5.tar.xz kutter-7a81bfc4a4651c913add10e34e7431513cf8a5f5.zip |
toolhead: Eliminate set_max_jerk() from kinematic classes
Allow the kinematic classes to query the max velocity, max accel, and
max halt velocity from the toolhead class instead of having the
toolhead class call into the kinematic classes with those values.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/corexy.py')
-rw-r--r-- | klippy/corexy.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/klippy/corexy.py b/klippy/corexy.py index 2069d16b..b22a8dac 100644 --- a/klippy/corexy.py +++ b/klippy/corexy.py @@ -9,22 +9,25 @@ import stepper, homing StepList = (0, 1, 2) class CoreXYKinematics: - def __init__(self, printer, config): + def __init__(self, toolhead, printer, config): self.steppers = [stepper.PrinterHomingStepper( printer, config.getsection('stepper_' + n), n) for n in ['x', 'y', 'z']] self.steppers[0].mcu_endstop.add_stepper(self.steppers[1].mcu_stepper) self.steppers[1].mcu_endstop.add_stepper(self.steppers[0].mcu_stepper) + max_velocity, max_accel = toolhead.get_max_velocity() self.max_z_velocity = config.getfloat( - 'max_z_velocity', 9999999.9, above=0.) + 'max_z_velocity', max_velocity, above=0., maxval=max_velocity) self.max_z_accel = config.getfloat( - 'max_z_accel', 9999999.9, above=0.) + 'max_z_accel', max_accel, above=0., maxval=max_accel) self.need_motor_enable = True self.limits = [(1.0, -1.0)] * 3 - def set_max_jerk(self, max_xy_halt_velocity, max_velocity, max_accel): + # Setup stepper max halt velocity + max_xy_halt_velocity = toolhead.get_max_axis_halt(max_accel) self.steppers[0].set_max_jerk(max_xy_halt_velocity, max_accel) self.steppers[1].set_max_jerk(max_xy_halt_velocity, max_accel) - self.steppers[2].set_max_jerk(0., self.max_z_accel) + max_z_halt_velocity = toolhead.get_max_axis_halt(self.max_z_accel) + self.steppers[2].set_max_jerk(max_z_halt_velocity, self.max_z_accel) def set_position(self, newpos): pos = (newpos[0] + newpos[1], newpos[0] - newpos[1], newpos[2]) for i in StepList: |