aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-10-28 23:35:22 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-11-06 15:51:51 -0500
commit746b928c8bd5208fd7bbde15472e9dcb40b9f351 (patch)
tree159f81006d2f4afcbe1629625bbf4c8491d8f036 /klippy
parent4b5cbc18a4a17f7a3c107693a4d7c1d32f0238c5 (diff)
downloadkutter-746b928c8bd5208fd7bbde15472e9dcb40b9f351.tar.gz
kutter-746b928c8bd5208fd7bbde15472e9dcb40b9f351.tar.xz
kutter-746b928c8bd5208fd7bbde15472e9dcb40b9f351.zip
winch: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/chelper/kin_winch.c3
-rw-r--r--klippy/kinematics/winch.py15
2 files changed, 6 insertions, 12 deletions
diff --git a/klippy/chelper/kin_winch.c b/klippy/chelper/kin_winch.c
index 47a1ba92..c6501d27 100644
--- a/klippy/chelper/kin_winch.c
+++ b/klippy/chelper/kin_winch.c
@@ -1,6 +1,6 @@
// Cable winch stepper kinematics
//
-// Copyright (C) 2018 Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2018-2019 Kevin O'Connor <kevin@koconnor.net>
//
// This file may be distributed under the terms of the GNU GPLv3 license.
@@ -37,5 +37,6 @@ winch_stepper_alloc(double anchor_x, double anchor_y, double anchor_z)
hs->anchor.y = anchor_y;
hs->anchor.z = anchor_z;
hs->sk.calc_position_cb = winch_stepper_calc_position;
+ hs->sk.active_flags = AF_X | AF_Y | AF_Z;
return &hs->sk;
}
diff --git a/klippy/kinematics/winch.py b/klippy/kinematics/winch.py
index 132d0964..30e18949 100644
--- a/klippy/kinematics/winch.py
+++ b/klippy/kinematics/winch.py
@@ -1,6 +1,6 @@
# Code for handling the kinematics of cable winch robots
#
-# Copyright (C) 2018 Kevin O'Connor <kevin@koconnor.net>
+# Copyright (C) 2018-2019 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import stepper, mathutil
@@ -20,13 +20,14 @@ class WinchKinematics:
a = tuple([stepper_config.getfloat('anchor_' + n) for n in 'xyz'])
self.anchors.append(a)
s.setup_itersolve('winch_stepper_alloc', *a)
+ s.set_trapq(toolhead.get_trapq())
+ toolhead.register_move_handler(s.generate_steps)
# Setup stepper max halt velocity
max_velocity, max_accel = toolhead.get_max_velocity()
max_halt_velocity = toolhead.get_max_axis_halt()
for s in self.steppers:
s.set_max_jerk(max_halt_velocity, max_accel)
# Setup boundary checks
- self.need_motor_enable = True
self.set_position([0., 0., 0.], ())
def get_steppers(self, flags=""):
return list(self.steppers)
@@ -44,19 +45,11 @@ class WinchKinematics:
def motor_off(self, print_time):
for s in self.steppers:
s.motor_enable(print_time, 0)
- self.need_motor_enable = True
- def _check_motor_enable(self, print_time):
- for s in self.steppers:
- s.motor_enable(print_time, 1)
- self.need_motor_enable = False
def check_move(self, move):
# XXX - boundary checks and speed limits not implemented
pass
def move(self, print_time, move):
- if self.need_motor_enable:
- self._check_motor_enable(print_time)
- for s in self.steppers:
- s.step_itersolve(move.cmove)
+ pass
def get_status(self):
# XXX - homed_checks and rail limits not implemented
return {'homed_axes': 'XYZ'}