"""Robot joint actuator (motor, planetary gear and driver in one round housing): CubeMars AK series. The axis is Z. The rear cover's face is on the XY plane and the output points along +Z, so the output face is at the overall length. One solid: the rear cover, the housing and the steps of the output end as coaxial cylinders at the drawing's diameters and lengths. On the output end the tapped holes of the housing and of the output flange are drilled at their thread's nominal diameter to the drawing's depth, equally spaced on the drawing's pitch circle, with the first hole on +X, and the centring bore where the drawing gives one. The output flange turns, so its holes have no fixed angle to the housing's. No material is set: the actuator is an assembly of many parts (take its weight from the maker). Not modelled: the rear mounting holes (see the README), locating pin holes, the connectors and the cable. """ import math from steve import Model designation = "AK80-8-KV60" # Actuator model # CubeMars 2D drawings, one page each, linked from each product page at cubemars.com (see the README for dates and links). # steps: (diameter, length) from the rear cover to the output face. Lengths are the drawing's dimensions or differences # of them, e.g. AK80-8: 43.9 overall, 11.2 rear cover, 3 output end of which the last 1 is the diameter 40 boss. # holes: (count, thread diameter, depth, pitch circle diameter) on the output end; each circle starts on the first face, # seen from the output end, that is wide enough to hold it. # bore: (diameter, depth) of the centring bore in the output face, or None. ACTUATORS = { "AK10-9-V3.0-KV60": {"steps": [(71.0, 11.2), (98.0, 40.3), (82.0, 6.0), (55.0, 2.2), (30.0, 2.0)], "holes": [(6, 4.0, 8.0, 90.0), (6, 4.0, 7.0, 24.0)], "bore": None}, "AK40-10-KV170": {"steps": [(53.0, 36.0), (37.0, 1.0)], "holes": [(3, 2.5, 5.0, 47.5), (3, 2.5, 3.0, 27.0)], "bore": None}, "AK60-39-V3.0-KV80": {"steps": [(57.0, 18.5), (79.0, 42.5), (56.0, 5.5), (40.0, 0.5)], "holes": [(8, 3.0, 6.0, 68.0)], "bore": None}, "AK70-10-KV100": {"steps": [(71.0, 11.2), (89.0, 33.05), (77.0, 5.5), (30.0, 0.5)], "holes": [(8, 3.0, 10.0, 83.0), (6, 3.0, 7.0, 25.0)], "bore": (20.0, 2.0)}, "AK80-6-KV100": {"steps": [(71.0, 11.0), (98.0, 24.5), (48.0, 1.7), (37.0, 1.3)], "holes": [(8, 3.0, 4.0, 85.0), (6, 4.0, 6.0, 28.0)], "bore": None}, "AK80-64-KV80": {"steps": [(71.0, 11.2), (98.0, 42.7), (80.0, 7.0), (35.0, 1.0)], "holes": [(8, 3.0, 10.0, 89.0), (6, 4.0, 8.0, 28.0)], "bore": (21.0, 4.5)}, "AK80-8-KV60": {"steps": [(71.0, 11.2), (98.0, 29.7), (61.0, 2.0), (40.0, 1.0)], "holes": [(8, 3.0, 3.5, 85.0), (6, 4.0, 6.0, 28.0)], "bore": (21.0, 5.0)}, } if designation not in ACTUATORS: raise ValueError(f"Models: {', '.join(ACTUATORS)}.") steps = ACTUATORS[designation]["steps"] holes = ACTUATORS[designation]["holes"] bore = ACTUATORS[designation]["bore"] model = Model() z = 0.0 tops = [] # (diameter, z of the step's output-side face) for i, (d, length) in enumerate(steps): on = "XY" if i: model.plane(f"step_{i + 1}_plane", on="XY", offset=z, name=f"Step {i + 1}") on = f"step_{i + 1}_plane" with model.sketch(f"step_{i + 1}_sketch", on=on, name=f"Step {i + 1}") as sk: sk.circle(f"step_{i + 1}_circle", (0, 0), d / 2) model.extrude(f"step_{i + 1}", f"step_{i + 1}_sketch", distance=length, name=f"Diameter {d:g}") z += length tops.append((d, z)) overall = z for n, (count, thread, depth, pcd) in enumerate(holes): face = next(top for d, top in reversed(tops) if d >= pcd + thread) # the first face from the output end that holds the circle model.plane(f"holes_{n + 1}_plane", on="XY", offset=face, name=f"Hole circle {pcd:g}") with model.sketch(f"holes_{n + 1}_sketch", on=f"holes_{n + 1}_plane", name=f"Hole circle {pcd:g}") as sk: for k in range(count): a = 2 * math.pi * k / count sk.circle(f"hole_{n + 1}_{k + 1}", (pcd / 2 * math.cos(a), pcd / 2 * math.sin(a)), thread / 2) model.extrude(f"holes_{n + 1}", f"holes_{n + 1}_sketch", distance=-depth, op="cut", name=f"{count} x M{thread:g}, {depth:g} deep") if bore: model.plane("bore_plane", on="XY", offset=overall, name="Output face") with model.sketch("bore_sketch", on="bore_plane", name="Centring bore") as sk: sk.circle("bore_circle", (0, 0), bore[0] / 2) model.extrude("bore", "bore_sketch", distance=-bore[1], op="cut", name="Centring bore") result = model.result()