ted-gooseby

How we design and check parts

Every part of Ted is written as Python code with build123d, not drawn by hand in a CAD program. That means a change like “make the shin 12 mm longer” is one number, and every part that depends on it updates by itself.

Code can still be wrong, though, and our first two prints taught us that the hard way (see the build log). So nothing gets printed until a set of checks has measured it against the real parts.

Building the parts

pip install -r requirements.txt
cd cad
python build_cad.py            # every part -> stl/, plus viewer.html and dims.json
python build_leg2.py           # lays the leg parts flat for printing -> stl/leg3_*.stl
python build_torso_print.py    # lays the torso parts flat -> stl/torso1_*.stl
python export_sim.py           # the MuJoCo twin -> ../sim/biped.xml and biped_backlash.xml

When build_cad.py finishes, open viewer.html to look at the result in 3D.

The checks

Run these before every print. Each one prints a table and a final pass or fail.

Script What it checks
check_fit.py Swings every joint through its full range and looks for parts hitting each other.
check_servo_fit.py Places the real STS3215 3D model at every joint. For every case screw it measures the air gap under the head, how much thread bites into the servo and how far the hole is from the servo’s hole. It also checks the horn plates and the plug clearance as the joints turn.
check_wiring.py Sweeps every servo cable through its joints’ full range to find the longest path, checks it fits the stock 150 mm cable, and checks that no wire passes through a part. It also adds up the mass and works out how level the robot hangs from its tether.
check_torso_fit.py Casts a grid of rays out of every face of every board, the battery and the sensors, and reports the free room to the nearest wall, servo or other board. Every side needs at least 0.2 mm. It also checks the mounting-hole spacing against the makers’ drawings.

They sample surfaces and cast rays rather than filling solids, so each one runs in about 0.5 GB of memory.

Rules we learned

  1. Measure servos from the real 3D model, never the datasheet. The real STS3215 has a raised label strip and a back pad that the datasheet drawing leaves out.
  2. Pockets are slightly bigger, never smaller. Use 0.25 mm of clearance per side. Draw M3 holes at 3.5 mm and M2 clearance holes at 2.4 mm, because the printer prints holes about 0.3 mm small.
  3. Copy the wall shape of a holder that works, not just the hole positions. The SO-101 arm’s holders pocket over the servo’s bumps, and ours didn’t until v3.
  4. Use the boards’ official drawings. The Pi Zero 2 W, the servo board and the IMU are standard parts with published sizes. Only the battery and the depth sensor’s breakout were sized by hand, and both have generous margins.

Sections

section_views.py cuts each leg part through its servo and draws the real servo in dark grey, the printed part in orange and the screw lines in blue. It’s a quick way to see that every wall touches the case rim at the screws.

Leg v3 cross-sections