From 19afdeb647e930c7156f31fc1de011c584a9b621 Mon Sep 17 00:00:00 2001 From: Kelvin Ly Date: Sat, 22 Mar 2025 08:33:09 -0400 Subject: [PATCH] Add features to z nut mount --- gantry.py | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/gantry.py b/gantry.py index 217c21e..8a64a6d 100644 --- a/gantry.py +++ b/gantry.py @@ -457,7 +457,7 @@ class Carriage: class Carrier: - def __init__(self, carriage): + def __init__(self, carriage, z): self.plane = carriage.wp_carrier self.left_spacer = ( cq.Workplane() @@ -521,8 +521,34 @@ class Carrier: .extrude(200) ) - carriage.z_nut = self.ballscrew_model.nut(z_ballscrew_len / 2 + carriage.z) + ballscrew_offset = z_ballscrew_len / 2 + carriage.z / 2 - z + carriage.z_nut = self.ballscrew_model.nut(ballscrew_offset) # TODO add carriage nut mount to carriage + carriage.z_nut_mount = ( + cq.Workplane() + .copyWorkplane(carriage.plate.workplaneFromTagged("carriage_plate")) + .rect(60, 60) + .extrude(36) + .copyWorkplane( + carriage.plate.workplaneFromTagged("carriage_plate").transformed( + rotate=(180, 0, 0) + ) + ) + .rect( + 44, 44 + ) # mounting holes; these need to line up with the x nut mounting holes + .vertices() + .hole(5) + .copyWorkplane( + self.ballscrew_model.w.transformed( + offset=(0, ballscrew_offset, 0), rotate=(90, 0, 0) + ), + ) + .hole(14) # hole for ballscrew + ) + carriage.z_nut_mount = self.ballscrew_model.nutHoles( + carriage.z_nut_mount, ballscrew_offset + ) def assembly(self): return ( @@ -533,7 +559,7 @@ class Carrier: .add(self.ballscrew, name="z ballscrew") .add(self.fixed_bearing, name="z fixed bearing") .add(self.floating_bearing, name="z floating bearing") - .add(self.stepper_mount, name="stepper motor/ballscrew mount") + .add(self.stepper_mount, name="stepper motor-ballscrew mount") ) @@ -574,7 +600,7 @@ class SpindleMount: g = Gantry(cq.Workplane()) c = Carriage(g, 150, -50) -ca = Carrier(c) +ca = Carrier(c, -50) m = SpindleMount(ca, -200) # TODO add ball screws and associated assembly