kinematics: Remove support for identifying Z steppers
The caller can now determine which steppers are connected to cartesian Z movement via the new stepper.is_active_axis() method. It is therefore no longer necessary for the kinematic code to identify these steppers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
d1972b1e9c
commit
8ed0f7c5c3
|
@ -62,8 +62,9 @@ class BLTouchEndstopWrapper:
|
|||
desc=self.cmd_BLTOUCH_DEBUG_help)
|
||||
def _build_config(self):
|
||||
kin = self.printer.lookup_object('toolhead').get_kinematics()
|
||||
for stepper in kin.get_steppers('Z'):
|
||||
self.add_stepper(stepper)
|
||||
for stepper in kin.get_steppers():
|
||||
if stepper.is_active_axis('z'):
|
||||
self.add_stepper(stepper)
|
||||
def handle_connect(self):
|
||||
try:
|
||||
self.raise_probe()
|
||||
|
|
|
@ -241,8 +241,9 @@ class ProbeEndstopWrapper:
|
|||
self.TimeoutError = self.mcu_endstop.TimeoutError
|
||||
def _build_config(self):
|
||||
kin = self.printer.lookup_object('toolhead').get_kinematics()
|
||||
for stepper in kin.get_steppers('Z'):
|
||||
self.add_stepper(stepper)
|
||||
for stepper in kin.get_steppers():
|
||||
if stepper.is_active_axis('z'):
|
||||
self.add_stepper(stepper)
|
||||
def home_prepare(self):
|
||||
toolhead = self.printer.lookup_object('toolhead')
|
||||
start_pos = toolhead.get_position()
|
||||
|
|
|
@ -16,7 +16,7 @@ class ZAdjustHelper:
|
|||
self.handle_connect)
|
||||
def handle_connect(self):
|
||||
kin = self.printer.lookup_object('toolhead').get_kinematics()
|
||||
z_steppers = kin.get_steppers('Z')
|
||||
z_steppers = [s for s in kin.get_steppers() if s.is_active_axis('z')]
|
||||
if len(z_steppers) != self.z_count:
|
||||
raise self.printer.config_error(
|
||||
"%s z_positions needs exactly %d items" % (
|
||||
|
|
|
@ -49,9 +49,7 @@ class CartKinematics:
|
|||
self.printer.lookup_object('gcode').register_command(
|
||||
'SET_DUAL_CARRIAGE', self.cmd_SET_DUAL_CARRIAGE,
|
||||
desc=self.cmd_SET_DUAL_CARRIAGE_help)
|
||||
def get_steppers(self, flags=""):
|
||||
if flags == "Z":
|
||||
return self.rails[2].get_steppers()
|
||||
def get_steppers(self):
|
||||
rails = self.rails
|
||||
if self.dual_carriage_axis is not None:
|
||||
dca = self.dual_carriage_axis
|
||||
|
|
|
@ -39,9 +39,7 @@ class CoreXYKinematics:
|
|||
self.rails[1].set_max_jerk(max_xy_halt_velocity, max_xy_accel)
|
||||
self.rails[2].set_max_jerk(
|
||||
min(max_halt_velocity, self.max_z_velocity), self.max_z_accel)
|
||||
def get_steppers(self, flags=""):
|
||||
if flags == "Z":
|
||||
return self.rails[2].get_steppers()
|
||||
def get_steppers(self):
|
||||
return [s for rail in self.rails for s in rail.get_steppers()]
|
||||
def calc_tag_position(self):
|
||||
pos = [rail.get_tag_position() for rail in self.rails]
|
||||
|
|
|
@ -87,7 +87,7 @@ class DeltaKinematics:
|
|||
math.sqrt(self.max_xy2), math.sqrt(self.slow_xy2),
|
||||
math.sqrt(self.very_slow_xy2)))
|
||||
self.set_position([0., 0., 0.], ())
|
||||
def get_steppers(self, flags=""):
|
||||
def get_steppers(self):
|
||||
return [s for rail in self.rails for s in rail.get_steppers()]
|
||||
def _actuator_to_cartesian(self, spos):
|
||||
sphere_coords = [(t[0], t[1], sp) for t, sp in zip(self.towers, spos)]
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
class NoneKinematics:
|
||||
def __init__(self, toolhead, config):
|
||||
pass
|
||||
def get_steppers(self, flags=""):
|
||||
def get_steppers(self):
|
||||
return []
|
||||
def calc_tag_position(self):
|
||||
return [0, 0, 0]
|
||||
|
|
|
@ -37,9 +37,7 @@ class PolarKinematics:
|
|||
stepper_bed.set_max_jerk(max_halt_velocity, max_accel)
|
||||
rail_arm.set_max_jerk(max_halt_velocity, max_accel)
|
||||
rail_z.set_max_jerk(max_halt_velocity, max_accel)
|
||||
def get_steppers(self, flags=""):
|
||||
if flags == "Z":
|
||||
return self.rails[1].get_steppers()
|
||||
def get_steppers(self):
|
||||
return list(self.steppers)
|
||||
def calc_tag_position(self):
|
||||
bed_angle = self.steppers[0].get_tag_position()
|
||||
|
|
|
@ -77,7 +77,7 @@ class RotaryDeltaKinematics:
|
|||
"Delta max build height %.2fmm (radius tapered above %.2fmm)"
|
||||
% (self.max_z, self.limit_z))
|
||||
self.set_position([0., 0., 0.], ())
|
||||
def get_steppers(self, flags=""):
|
||||
def get_steppers(self):
|
||||
return [s for rail in self.rails for s in rail.get_steppers()]
|
||||
def calc_tag_position(self):
|
||||
spos = [rail.get_tag_position() for rail in self.rails]
|
||||
|
|
|
@ -29,7 +29,7 @@ class WinchKinematics:
|
|||
s.set_max_jerk(max_halt_velocity, max_accel)
|
||||
# Setup boundary checks
|
||||
self.set_position([0., 0., 0.], ())
|
||||
def get_steppers(self, flags=""):
|
||||
def get_steppers(self):
|
||||
return list(self.steppers)
|
||||
def calc_tag_position(self):
|
||||
# Use only first three steppers to calculate cartesian position
|
||||
|
|
Loading…
Reference in New Issue