diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-04-07 10:49:14 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-04-07 14:47:00 -0400 |
commit | 85ed5cef7fe483d921b1081b4664c35ad4e64967 (patch) | |
tree | debf8f541c7581c55ff2833c0ae2bc42d6e79d4a /klippy/mcu.py | |
parent | df42b0d1ac0b303025c8762fa727d79bc01a28a3 (diff) | |
download | kutter-85ed5cef7fe483d921b1081b4664c35ad4e64967.tar.gz kutter-85ed5cef7fe483d921b1081b4664c35ad4e64967.tar.xz kutter-85ed5cef7fe483d921b1081b4664c35ad4e64967.zip |
stepcompress: Merge stepcompress_delta_const and stepcompress_delta_accel
It's not necessary to have separate C delta kinematic functions for
constant acceleration and constant velocity as constant velocity can
be obtained by using a constant acceleration of zero.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r-- | klippy/mcu.py | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/klippy/mcu.py b/klippy/mcu.py index 26e98d39..d28d21f1 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -128,24 +128,11 @@ class MCU_stepper: if count == STEPCOMPRESS_ERROR_RET: raise error("Internal error in stepcompress") self._commanded_pos += count - def step_delta_const(self, mcu_time, start_pos, dist, cruise_v - , height_base, closestxy_d, closest_height2, movez_r): + def step_delta(self, mcu_time, start_pos, dist, start_v, accel + , height_base, closestxy_d, closest_height2, movez_r): inv_step_dist = self._inv_step_dist height = self._commanded_pos - height_base * inv_step_dist - count = self._ffi_lib.stepcompress_push_delta_const( - self._stepqueue, mcu_time * self._mcu_freq, - -start_pos * inv_step_dist, dist * inv_step_dist, - cruise_v * self._velocity_factor, - height, closestxy_d * inv_step_dist, - closest_height2 * inv_step_dist**2, movez_r) - if count == STEPCOMPRESS_ERROR_RET: - raise error("Internal error in stepcompress") - self._commanded_pos += count - def step_delta_accel(self, mcu_time, start_pos, dist, start_v, accel - , height_base, closestxy_d, closest_height2, movez_r): - inv_step_dist = self._inv_step_dist - height = self._commanded_pos - height_base * inv_step_dist - count = self._ffi_lib.stepcompress_push_delta_accel( + count = self._ffi_lib.stepcompress_push_delta( self._stepqueue, mcu_time * self._mcu_freq, -start_pos * inv_step_dist, dist * inv_step_dist, start_v * self._velocity_factor, accel * self._accel_factor, |