delta: Use position_endstop for position_max
There's no reason for the user to specify position_max - it can be inferred on deltas from the endstop positions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
38e9484f9f
commit
29ba92a551
|
@ -9,8 +9,7 @@
|
||||||
|
|
||||||
# The stepper_a section describes the stepper controlling the front
|
# The stepper_a section describes the stepper controlling the front
|
||||||
# left tower (at 210 degrees). This section also controls the homing
|
# left tower (at 210 degrees). This section also controls the homing
|
||||||
# parameters (homing_speed, homing_retract_dist) and maximum tower
|
# parameters (homing_speed, homing_retract_dist) for all towers.
|
||||||
# length (position_max) for all towers.
|
|
||||||
[stepper_a]
|
[stepper_a]
|
||||||
step_pin: ar54
|
step_pin: ar54
|
||||||
dir_pin: ar55
|
dir_pin: ar55
|
||||||
|
@ -19,7 +18,6 @@ step_distance: .01
|
||||||
endstop_pin: ^ar2
|
endstop_pin: ^ar2
|
||||||
homing_speed: 50.0
|
homing_speed: 50.0
|
||||||
position_endstop: 297.05
|
position_endstop: 297.05
|
||||||
position_max: 297.55
|
|
||||||
|
|
||||||
# The stepper_b section describes the stepper controlling the front
|
# The stepper_b section describes the stepper controlling the front
|
||||||
# right tower (at 330 degrees)
|
# right tower (at 330 degrees)
|
||||||
|
|
|
@ -25,7 +25,7 @@ class DeltaKinematics:
|
||||||
self.max_xy2 = min(radius, arm_length - radius)**2
|
self.max_xy2 = min(radius, arm_length - radius)**2
|
||||||
self.limit_xy2 = -1.
|
self.limit_xy2 = -1.
|
||||||
tower_height_at_zeros = math.sqrt(self.arm_length2 - radius**2)
|
tower_height_at_zeros = math.sqrt(self.arm_length2 - radius**2)
|
||||||
self.max_z = self.steppers[0].position_max
|
self.max_z = max([s.position_endstop for s in self.steppers])
|
||||||
self.limit_z = self.max_z - (arm_length - tower_height_at_zeros)
|
self.limit_z = self.max_z - (arm_length - tower_height_at_zeros)
|
||||||
logging.info(
|
logging.info(
|
||||||
"Delta max build height %.2fmm (radius tapered above %.2fmm)" % (
|
"Delta max build height %.2fmm (radius tapered above %.2fmm)" % (
|
||||||
|
@ -101,10 +101,10 @@ class DeltaKinematics:
|
||||||
def home(self, homing_state):
|
def home(self, homing_state):
|
||||||
# All axes are homed simultaneously
|
# All axes are homed simultaneously
|
||||||
homing_state.set_axes([0, 1, 2])
|
homing_state.set_axes([0, 1, 2])
|
||||||
s = self.steppers[0] # Assume homing parameters same for all steppers
|
s = self.steppers[0] # Assume homing speed same for all steppers
|
||||||
self.need_home = False
|
self.need_home = False
|
||||||
# Initial homing
|
# Initial homing
|
||||||
homepos = [0., 0., s.position_endstop, None]
|
homepos = [0., 0., self.max_z, None]
|
||||||
coord = list(homepos)
|
coord = list(homepos)
|
||||||
coord[2] = -1.5 * math.sqrt(self.arm_length2-self.max_xy2)
|
coord[2] = -1.5 * math.sqrt(self.arm_length2-self.max_xy2)
|
||||||
homing_state.home(list(coord), homepos, self.steppers, s.homing_speed)
|
homing_state.home(list(coord), homepos, self.steppers, s.homing_speed)
|
||||||
|
|
Loading…
Reference in New Issue