Episode 07 / Written companion

Free recording track

I designed a robot arm in Python

A parametric arm in build123d, drawn around a torque budget and a print bed, that writes its own physics into the sim.

Read the companion now. The recording is forthcoming; “Free” identifies its planned release track.

A code-defined arm exposes the choices a render hides: link lengths, servo brackets, cable routes, and where the dock’s pad and cradle sit. The torque budget drives them. On the course’s example arm, the stretched pose with the 230 g dummy drone at 32 cm needs about 12.8 kg·cm at the shoulder. Derated by 11/12 for the voltage the cables lose, the 12 V STS3215 has 27.5 kg·cm, a 2.2:1 margin, where the 7.4 V version’s 1.4:1 fails the gate. Its rated torque, the most it can hold without overheating, is 10 kg·cm, so the arm never holds the drone stretched out: on the example arm the pad and cradle sit within about 20 cm of the base axis.

Draw every part for how it prints: pick its orientation while drawing it, lay links flat so their load runs along the printed lines, and fillet inside corners, because a sharp right angle printed upright snaps at a layer line. Draw the arm in its zero pose, pointing straight up with every servo at position 2048, so the Module 7 calibration only trims small offsets. Print one joint first, the sixth servo with its bracket and a weighted lever, which stays on as Module 8’s pendulum bench. The gate checks that every printed part fits a 180 × 180 × 180 mm build volume and that the gripper reaches 0.30 m from the base axis at table height.

Every pitch joint needs a margin of at least 2:1 with the dummy drone at full horizontal reach, from stall torque derated by 11/12, and holding the drone must need at most the rated 10 kg·cm at every joint at the pad, the cradle and every pose the dock path holds. The Module 2 controller must draw the figure-eight with the CAD arm in sim within the nominal gate, and the trainer must review the WireViz plan before the first power-on. Keep cad_to_params.py, which builds link masses and inertias from per-part slicer estimates and weighed servos and writes them into the sim’s Params; solid CAD would overstate the mass of infilled parts. Then dock the drone in sim, from the pad to the cradle and back.

Take this into your next build

The CAD model earns its place in the control stack when it writes the physics the sim runs on.

Put the idea to work

Design the arm in CAD

Design a parametric arm in build123d around real components and the way FDM parts print, have the wiring plan reviewed before the first power-on, and turn slicer estimates and weighed servos into the sim’s Params. Two torque gates check the design: 2:1 against derated stall at full reach, and rated torque for every pose that holds the drone.

Build module 06