"""Frameless torque motor (inner rotor), supplied as a separate stator and rotor: CubeMars RI50 KV100 and RI100 KV105, with or without Hall sensors. The axis is Z. The stator's lamination stack stands on the XY plane and the winding's lead end points along +Z. Two solids: the stator (lamination stack ring with the end windings above and below it, at the drawing's maximum envelope) and the rotor (a ring at its outside diameter, bore and length). The rotor stands flush with the stack's lower face, as the drawings show it (its axial place is set by the user's shaft). No material is set. Not modelled: the notches in the stator's outside, the Hall board's outline and the leads. Dimensions in the README. """ from steve import Model motor = "RI50" # Model: RI50 or RI100 hall = True # With Hall sensors (taller winding on the lead end) # CubeMars 2D drawings "RI50 / RI100 Frameless Torque Motor with / without Hall Sensor" (one page each, linked from the # product pages at cubemars.com). stator_od: stack outside diameter; stator_id: stack bore; stack: stack length; # winding_od: end winding outside diameter (MAX); winding_id: end winding bore (MIN); far: end winding height on the # side away from the leads (MAX); rotor_od, rotor_id, rotor_l: rotor outside diameter, bore and length. MOTORS = { "RI50": {"stator_od": 54.0, "stator_id": 29.6, "stack": 16.0, "winding_od": 53.0, "winding_id": 30.6, "far": 3.0, "rotor_od": 28.6, "rotor_id": 22.0, "rotor_l": 19.0}, "RI100": {"stator_od": 104.0, "stator_id": 57.0, "stack": 13.0, "winding_od": 101.0, "winding_id": 58.0, "far": 4.5, "rotor_od": 55.6, "rotor_id": 45.0, "rotor_l": 15.0}, } # End winding height on the lead end (MAX): with Hall sensors, without. LEAD_END = {"RI50": (8.0, 5.0), "RI100": (8.5, 7.0)} if motor not in MOTORS: raise ValueError(f"Models: {', '.join(MOTORS)}.") m = MOTORS[motor] lead = LEAD_END[motor][0 if hall else 1] model = Model() with model.sketch("stack_sketch", on="XY", name="Lamination stack") as sk: sk.circle("stack_outside", (0, 0), m["stator_od"] / 2) sk.circle("stack_bore", (0, 0), m["stator_id"] / 2) model.extrude("stack", "stack_sketch", distance=m["stack"], op="new", body="stator_body", name="Lamination stack") model.plane("lead_plane", on="XY", offset=m["stack"], name="Stack, lead end") with model.sketch("lead_sketch", on="lead_plane", name="End winding, lead end") as sk: sk.circle("lead_outside", (0, 0), m["winding_od"] / 2) sk.circle("lead_bore", (0, 0), m["winding_id"] / 2) model.extrude("lead_winding", "lead_sketch", distance=lead, op="join", body="stator_body", name="End winding, lead end") with model.sketch("far_sketch", on="XY", name="End winding, far end") as sk: sk.circle("far_outside", (0, 0), m["winding_od"] / 2) sk.circle("far_bore", (0, 0), m["winding_id"] / 2) model.extrude("far_winding", "far_sketch", distance=-m["far"], op="join", body="stator_body", name="End winding, far end") with model.sketch("rotor_sketch", on="XY", name="Rotor") as sk: sk.circle("rotor_outside", (0, 0), m["rotor_od"] / 2) sk.circle("rotor_bore", (0, 0), m["rotor_id"] / 2) model.extrude("rotor", "rotor_sketch", distance=m["rotor_l"], op="new", body="rotor_body", name="Rotor") result = model.result()