aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/kinematics/polar.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-06-20 15:44:45 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-06-28 10:00:40 -0400
commite5f74a64ed814bec1bdff11a50566d8f40229216 (patch)
tree8d155cd2599601ad652a86dd76932e238723ebeb /klippy/kinematics/polar.py
parentd9d94c858ad6c75ff3171fa0cde0140891619ce3 (diff)
downloadkutter-e5f74a64ed814bec1bdff11a50566d8f40229216.tar.gz
kutter-e5f74a64ed814bec1bdff11a50566d8f40229216.tar.xz
kutter-e5f74a64ed814bec1bdff11a50566d8f40229216.zip
polar: Add initial support for multiple bed rotations
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/kinematics/polar.py')
-rw-r--r--klippy/kinematics/polar.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/klippy/kinematics/polar.py b/klippy/kinematics/polar.py
index 2930152c..70b314eb 100644
--- a/klippy/kinematics/polar.py
+++ b/klippy/kinematics/polar.py
@@ -1,6 +1,6 @@
# Code for handling the kinematics of polar 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 logging, math
@@ -122,8 +122,15 @@ class PolarKinematics:
axes_d = move.axes_d
cmove = move.cmove
if axes_d[0] or axes_d[1]:
- self.steppers[0].step_itersolve(cmove)
self.rails[0].step_itersolve(cmove)
+ stepper_bed = self.steppers[0]
+ stepper_bed.step_itersolve(cmove)
+ # Normalize the stepper_bed angle
+ angle = stepper_bed.get_commanded_position()
+ if angle < -math.pi:
+ stepper_bed.set_commanded_position(angle + 2. * math.pi)
+ elif angle > math.pi:
+ stepper_bed.set_commanded_position(angle - 2. * math.pi)
if axes_d[2]:
self.rails[1].step_itersolve(cmove)