aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/cartesian.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-07-07 16:57:25 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-07-10 22:49:02 -0400
commit4a527a46cedaa4a7932ba5c1080b7133c69602cd (patch)
treed1d1b92419716f00a353e50374a6090ed89a0f7e /klippy/cartesian.py
parent5829aa8bd796358ce7880dbb6e9574589e62a927 (diff)
downloadkutter-4a527a46cedaa4a7932ba5c1080b7133c69602cd.tar.gz
kutter-4a527a46cedaa4a7932ba5c1080b7133c69602cd.tar.xz
kutter-4a527a46cedaa4a7932ba5c1080b7133c69602cd.zip
stepper: Store max_velocity/max_accel instead of max_step_velocity/accel
All users of max_step_velocity and max_step_accel end up multiplying by step_dist anyway, so it's easier to store max_velocity and max_accel. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/cartesian.py')
-rw-r--r--klippy/cartesian.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/klippy/cartesian.py b/klippy/cartesian.py
index 8be83a71..100ce220 100644
--- a/klippy/cartesian.py
+++ b/klippy/cartesian.py
@@ -21,25 +21,19 @@ class CartKinematics:
self.stepper_pos = [int(newpos[i]*self.steppers[i].inv_step_dist + 0.5)
for i in StepList]
def get_max_xy_speed(self):
- max_xy_speed = min(s.max_step_velocity*s.step_dist
- for s in self.steppers[:2])
- max_xy_accel = min(s.max_step_accel*s.step_dist
- for s in self.steppers[:2])
+ max_xy_speed = min(s.max_velocity for s in self.steppers[:2])
+ max_xy_accel = min(s.max_accel for s in self.steppers[:2])
return max_xy_speed, max_xy_accel
def get_max_speed(self, axes_d, move_d):
# Calculate max speed and accel for a given move
- velocity_factor = min(
- [self.steppers[i].max_step_velocity
- * self.steppers[i].step_dist / abs(axes_d[i])
- for i in StepList if axes_d[i]])
- accel_factor = min(
- [self.steppers[i].max_step_accel
- * self.steppers[i].step_dist / abs(axes_d[i])
- for i in StepList if axes_d[i]])
+ velocity_factor = min([self.steppers[i].max_velocity / abs(axes_d[i])
+ for i in StepList if axes_d[i]])
+ accel_factor = min([self.steppers[i].max_accel / abs(axes_d[i])
+ for i in StepList if axes_d[i]])
return velocity_factor * move_d, accel_factor * move_d
def get_max_e_speed(self):
s = self.steppers[3]
- return s.max_step_velocity*s.step_dist, s.max_step_accel*s.step_dist
+ return s.max_velocity, s.max_accel
def home(self, toolhead, axis):
# Each axis is homed independently and in order
homing_state = homing.Homing(toolhead, self.steppers) # XXX