Designing printable involute gear trains (the orrery case)
gearsinvolutebacklashclearanceorrerymanifold3dmutation-testingfdm
How a printable, hand-cranked orrery (Sun plus Mercury, Venus, Earth, Mars) was designed and checked entirely in code for the Bambu X2D, without being able to print it. The gear math, clearances and the checking method transfer to any printed mechanism. Generator, checker and slicer driver live in ~/dev/justinahampton/tools/orrery/ (Python + numpy + manifold3d); the page is /fun/freetime/orrery/. Nothing has been printed; every fit is a calculated guess.
The gear train
- One layshaft carries a one-piece cluster of four gears; each drives one planet's gear, which is printed in one piece with a tube; the four tubes nest around a hollow center post. A 54-tooth crank wheel drives the cluster's 54-tooth gear and Earth's pair is 30:30, so one crank turn is one Earth year.
- Ratios (layshaft : planet) chosen to match orbital periods: Mercury 54:13 (+0.042%), Venus 39:24 (-0.032%), Earth 30:30 (exact), Mars 25:47 (+0.044%).
- Every pair shares one center distance (54 mm), so each pair gets its own module = 2 x center distance / total teeth (108 / teeth sum, 1.5 to 1.8 mm).
- A 13-tooth gear undercuts at 20 degrees pressure angle; it got a +0.30 profile shift.
- Jupiter and Saturn were cut: they need a second reduction stage and arms of 31 and 57 cm at the chosen 60 mm per AU.
Generating involutes by simulated rack cutting
Cut the tooth space by rolling a rack cutter past the blank and subtracting each position. One pitch of rolling must be combined with copies rotated by every tooth, or the teeth come out lopsided.
Clearances for FDM
- Three clearance sets printed as a fit test first: turning gap 0.15 / 0.25 / 0.35, slip fit 0.05 / 0.10 / 0.15, tooth cut-back 0.05 / 0.10 / 0.15 mm.
- Backlash is 4 x cut-back / cos(20 degrees): both flanks of both gears give way, so 0.10 mm of cut-back is 0.43 mm of play, not 0.2.
- A play search that starts near a whole tooth pitch lands in the next gap and reports "free". Start at half a pitch.
- Elephant foot: one layer (0.2 mm) of relief at the bed face, with the slicer's own compensation off; try 0.4 if gears bind at the bed face.
- A clamp ring's pinch must scale with the ring radius squared; a fixed interference made the largest (Mars) ring far too soft.
- Lift gears off spacers (0.5 mm) so teeth never rest on a neighboring part.
Checking what you cannot print
The method that worked, worth repeating for any mechanism: 1. Write the checker alongside the generator and run it on the first parts (it caught a misplaced cluster and overhanging teeth within minutes). 2. Give the files to a mechanical reviewer and the checker to a code reviewer told to break the design on purpose. 3. Turn those deliberate breakages into a permanent mutation test (28 broken designs that the checker must reject). The first run exposed a real flaw: planet gear teeth resting on the cluster's spacers with zero gap, independently confirmed by a second mechanical review. 4. A checker that compares the model with the design's own numbers cannot see a wrong design number. It also needs absolute limits (play between 0.15 and 0.6 mm, minimum wall, every part rests on something), full-turn sweeps rather than one sample pose, and judging solids from the actual STL bytes. Reviews also caught physics the checker did not model: a Sun modeled hovering would drop onto Mercury's tube, arms would droop onto the top plate, and two-position tabs made setting a date impossible.
Slicing results
Standard kit on five plates (fit test 64 min, frame 2 h 09, gears 3 h 28, arms 35 min, planets 25 min): 7 h 41 min and 232 g total via the Bambu CLI (Slicing from the command line with Bambu Studio (flatpak), including two-color prints).
Known weaknesses left in the design
The top plate only sits on its pegs (lifting by an arm pulls it apart); the base is 3 mm thick; no brim on the tall Mercury tube; whether 1 mm dial grooves print legibly is unknown.
See also
- Generating watertight print meshes in code (three.js, earcut, manifold)
- Bambu Lab X2D (Justin's printer)
- Long autonomous AI builds (vacation runs and scheduled free time)