kapy academy

Automata

23 min readUpdated Nov 2026

You turn a handle once a second and, within that turn, a bird pops up 12 mm and waits, a woodpecker strikes a log with a sharp knock, and an arm waves through about 55°. All of it comes from one shaft with three cams and a crank: the story is written in the shaft's angles. Designing the automaton means dividing that turn among the figures and making sure each one comes down under its own weight. Each cam is designed as in Cams and followers, and the four-bar as in The four-bar linkage; here you only use them.

The example automaton in 3D and its timing diagram: the bird, the woodpecker and the arm driven by one camshaft
One handle, one camshaft and three figures, with the example's numbers. The bird (A) rises 12 mm and waits; the woodpecker (B) climbs its spiral and drops sharply past the step at 270°, onto the stump's stop; the arm (C) waves on the 20/55/45/60 crank-rocker. On the right, the timing diagram: the blue cursor is the shaft's angle, and the figure moving at each moment is orange. The fall is drawn with the angles of 60 rpm.

One camshaft, many figures

The idea is more than two centuries old. Jaquet-Droz's automata (the Writer, the Draftsman and the Musician), built between 1768 and 1774, keep their program in cams and still run at the Museum of Art and History in Neuchâtel.

The classic layout is a box with a horizontal camshaft turned by the handle. A follower rests on each cam, and from each follower a vertical push rod runs up through a guide in the lid and carries the figure on top. Gravity keeps each follower against its cam: this is gravity closure. No spring is needed, because the figures are light and the handle turns slowly. Further down you work out how fast it can go before that stops holding.

One shaft is one clock: a turn of the handle is a complete cycle, and the shaft angle is time.

One camshaft with six mechanisms in a row, each with its gesture in orange: a bird that rises and falls, one that drops sharply, a disc that turns while rising, a head that nods, an arm that waves and a turntable on a vertical axis
Which part gives each gesture, all on the same camshaft. From left to right: cam with flat-faced follower (rise and fall, with dwells), snail cam with knife-edge follower (drop sharply; a collar stops the fall on the guide), a disc offset 6 mm from the cam's plane (it turns twice per shaft turn while it rises and falls), cam and rocker (nod), crank-rocker (wave) and a 1:1 bevel pair (turn about a vertical axis).

The full menu, with the article for each part:

  • Rise and fall, with dwells. A cam with a flat-faced follower.
  • Drop sharply. A snail cam with a knife-edge follower (below, in "The snail cam").
  • Turn while rising. Offset the follower's disc from the cam's mid-plane. The cam always slides the same way under the disc, so it turns it while they touch, and more so where the load is higher. That figure's rod must be free to turn in its guide: no flat on this one.
  • Nod. A cam that pushes a rocker, or a crank-rocker (The four-bar linkage).
  • Symmetric back-and-forth. An eccentric or a crank-slider (Crank-sliders and eccentrics), or a Scotch yoke if you want pure sinusoidal motion.
  • Push slowly and snap back. Quick-return mechanisms.
  • Advance in steps. Geneva drive or Mutilated gears.
  • Walk. Walking-leg linkages.
  • Turn about a vertical axis. A bevel pair (Bevel gears) takes the shaft's rotation to an axis at 90°.

Rule of thumb: if the gesture has dwells, or the rise differs from the return, use a cam; if it is a continuous back-and-forth, use a crank and links.

The timing diagram

The automaton's blueprint is a timing diagram: one row per action, from 0 to 360°, with every rise, dwell and return. You draw it before any cam, because it fixes the order of the story. Cause comes before effect: the bird pops up and looks, and then the woodpecker strikes; not the other way round.

StrikeA: birdRiseDwellReturnDwellB: woodpeckerDropLands (≈16°)RiseDwellC: arm0306090120150180210240270300330360Shaft angle θ (°)Shaft torque (N·mm)0510150306090120150180210240270300330360Two cams in phaseTwo cams 180° apartRising: T = W·s′·f + μ·F·(Rb + s)Falling: T = −W·s′/(1 + 2μd/L) + μ·F·(Rb + s)
Top, the example's timing diagram: the bird (A) with its cycloidal rise and its dwells, the woodpecker (B) with the spiral, the drop at 270° and the landing about 16° later, and the angle of the arm (C). Bottom, the torque on the shaft with two identical cams, in phase and 180° apart: the offset cancels the torque from the weight and leaves only the friction torque.
The example's timing diagram (shaft angles)
Figure Mechanism 0–120° 120–180° 180–270° 270–300° 300–330° 330–360°
A, bird Cycloidal cam Rises 12 mm Dwell at top Returns Returns Dwell at bottom Dwell at bottom
B, woodpecker Snail cam Rises Rises Rises Drops at 270°, dwell Dwell Rises
C, arm Crank-rocker Swings Swings Swings Swings Swings Swings

B's spiral spans 300°: it starts at 330°, passes through 0° and reaches the top at 270°. Dwells are arcs of constant radius. They cost nothing on the cam, and a figure that pauses before and after each gesture reads far better than one that never stops.

For other rhythms, two lobes on one cam give the gesture twice per turn. With a second shaft geared at a ratio p/q (in lowest terms), the whole thing repeats every q turns of the camshaft: with 20 teeth on the camshaft and 30 on the second shaft, the ratio is 2/3 and the full story repeats every 3 turns. The train arithmetic is in Compound gear trains.

While you are tuning the phase, fix each cam with an M3 set screw bearing on the round shaft, with the nut captive in a pocket in the cam (Fixing a part to a shaft, Captive nuts and clearance holes). That lets you turn it to any angle. Once the story works, mark each cam's position, file a flat at exactly that spot, or move to a D-shaft with each cam's bore rotated to its phase: then nothing slips. A graduated disc on the end of the shaft lets you read the angle as you turn; with marks every 15° and a fine pointer, you can read to about 5° by eye.

Why a figure will not come down

The most common automaton fault is a figure that will not come down, or one that jams the handle as it rises. Both come from the guide, but not from the same force.

A force applied at a distance from the rod's axis tilts the rod in its guide. The rod then bears on both ends of the guide (of length L), with a reaction at each, and each reaction produces friction. With a force F offset by a distance x from the rod's axis, the two reactions are each F·x/L and their friction adds up to 2μF·x/L. It is the sibling of the overhang calculation in Cams and followers, where the force was sideways; here it is axial and off-center.

On the rise, with a flat-faced follower, the contact point is not under the rod's axis: it moves sideways by ds/dθ (in mm per radian) as the follower rises. That shift is the lever arm d. The pressure angle is zero, but you pay for it with d. If the figure's center of gravity is also off-center by e, add it to d. The force the cam must supply to lift a weight W is

F = W / (1 − 2μ(d + e)/L)

and when 2μ(d + e)/L reaches 1 no force will lift it: the rod wedges and the handle jams.

On the return, the d term blocks nothing. The cam is holding the figure back, and the contact force is less than the weight, F = W/(1 + 2μd/L); the friction it creates scales with that force and never exceeds the weight. What stops the figure coming down is the off-center weight: it will not fall on its own if 2μe/L ≥ 1. A fit that is too tight, a printed rod that came out oval, or creep in the plastic gripping it will stop it too.

A. Why the guide wedges on the riseωWe: figure offsetFd = ds/dθGuide LN = F·(d + e)/LμNF = W / (1 − 2μ(d + e)/L)L ≥ 4μ(d + e); to fall on its own, 2μe/L < 1B. Snail cam and knife-edge followerωDwell ≥ 2 × drop angleStepFree fallLands ≈16°C. What does not workFlat face: slides downBackwards: hits and locks
A: the flat-faced follower at the steepest point of the rise, with the contact shifted by d = ds/dθ, the figure's offset e and the guide's two reactions. B: the snail cam with a knife-edge follower, the drop and the dwell after the step. C: a flat face slides down over the edge of the step and, turned backwards, the step locks the cam.

To keep the force below twice the weight, the guide must satisfy L ≥ 4·μ·(d + e). The same rule leaves the return with margin to spare, because that only needs L ≥ 4μe. For printed PLA on PLA, μ runs from 0.3 to 0.5, and with grease it drops to 0.05–0.15. The calculation here uses 0.4, the middle of the range; at 0.5, the example's 20 mm guide is still far from wedging (the force factor goes from 1.85 to 2.35). Never make the guide shorter than 1.5 times the rod diameter (Rod and linear bushing).

The flat face has one more demand: its radius must comfortably exceed the maximum ds/dθ, or the contact runs off the disc. The disc also slides on the cam. That face friction, μ·F, drags on the shaft with a torque μ·F·(Rb + s), where Rb is the base radius and s the lift, and it pushes the rod sideways. With a short overhang c between the guide and the disc (10 mm in this example, half of L), that push opposes the arm d on the rise and unloads the guide, so the rule above stays on the safe side. The torque on the shaft, though, always adds.

The cheapest fix is to center the figure over the rod (e = 0). After that, in this order: a steel or brass rod instead of a printed one, a sliding fit of 0.20 mm per side (0.40 on the diameter, Real printed clearances), and grease, which cuts friction to a quarter or less.

To stop the rod turning and the figure ending up facing the wall, file a flat on the rod and give the guide a matching flat, or use a square section. If you want the figure to turn, offset the disc on purpose and leave the rod round, as in the menu.

How fast gravity can bring a figure down

A gravity-closed figure lifts off when the cam asks it to decelerate or fall faster than its weight can manage. In the cycloidal law (Cams and followers), that downward acceleration peaks at the same value in two places: at the end of the rise, where the figure slows down, and at the start of the return, where it sets off. At the end of the rise, guide friction helps hold the figure; at the start of the return it holds it back. That is why the return is the limit, although the figure can lift off in either place.

The peak the cycloid demands is a = 2π·h·ω²/β², with h the stroke, ω the shaft speed in rad/s and β the segment angle in radians. The acceleration available is g·(1 − 2μe/L). At the lift-off threshold the cam no longer pushes, so the arm d disappears and only the figure's offset counts.

The example's cam A, with h = 12 mm and β = 120°, demands 0.68 m/s² at 60 rpm. Since acceleration grows with ω², the figure lifts off at 228 rpm if it is centered. With the figure 5 mm off-center on the 20 mm guide and μ = 0.4, the effective weight drops to 80 % and it lifts off at around 204 rpm. By hand there is plenty of margin. A geared motor at 200 rpm puts it right at the limit, and sooner if the figure is off-center.

To go faster, in order: a longer β (acceleration falls with β²), less stroke, a centered figure, grease in the guide, or a bought return spring (Using bought steel springs). If you print the spring, print it with its axis vertical; even so, a steel one lasts longer and does not creep.

The snail cam: the strike

The snail cam rises along an Archimedean spiral, with constant ds/dθ, and drops off a radial step. It is the cam of the sudden blow: the woodpecker, the hammer, the lid that snaps shut.

In this example, B rises 10 mm over 300°: ds/dθ = 1.91 mm/rad. With a knife-edge follower at a radius of 15 mm, the pressure angle is about 7°: the rise is gentle and the rod does not wedge.

The drop is a free fall. A figure falling 10 mm takes t = √(2h/g) = 45 ms. Meanwhile the shaft keeps turning: 16° at 60 rpm and 33° at 120 rpm. In free fall the cam does not touch the tip, so only the off-center weight brakes it; a woodpecker's head usually is off-center. If friction from that offset takes 60 % of the weight (2μe/L = 0.6), the drop takes longer and the shaft turns about 26° at 60 rpm. That is why the step needs a dwell after it of at least twice the drop angle. In this example that is 60°, which covers 60 rpm even with that friction but is tight at 120 rpm. Without that dwell the tip lands on the spiral, which is already rising, and the woodpecker gives a second, soft knock.

The figure reaches the bottom at 0.44 m/s, so it needs a stop. Put a TPU stop where it lands (against the log or the box), at a height that halts the tip a little short of the cam's minimum radius, so it does not hammer the cam on every turn.

The follower must be a knife edge or a small roller, never a flat face. A flat face rests on the edge of the step and slides down it: the strike turns into a gradual descent. A roller also rolls over the edge before it lets go, and the larger its radius, the later the drop. Round the tip to a radius of 0.5–1 mm: it wears less and lets go as cleanly.

A snail cam only works one way. Turned backwards, the tip runs head-on into the face of the step, at 90°, and the automaton locks or breaks the tip. Put an arrow on the handle or, better, a ratchet that stops it turning backwards (Ratchet and pawl).

Worked example: a box with three figures

The brief: a hand-turned handle at around 60 rpm, a Ø6 steel shaft in printed bushings, and three figures. All the numbers are choices for this example, not rules.

A, the bird (20 g). A cycloidal rise of 12 mm over 120°, dwells of 60° at top and bottom, and a return over another 120°. Peak ds/dθ is 2h/β = 11.5 mm/rad. With a base radius Rb = 15 mm, the cam runs from Ø30 to Ø54. A flat-faced follower also needs the profile to be convex all the way round: Rb + s + s″ > 0. The worst point is about three quarters of the way up the rise, with s 10.9 mm and s″ −17.2 mm/rad²: 15 + 10.9 − 17.2 = 8.7 > 0, so it holds. The Ø28 face leaves margin over the 11.5 mm shift.

With the figure centered (e ≈ 0), the guide needs L ≥ 4 · 0.4 · 11.5 = 18.4 mm, rounded up to 20 mm, with a 10 mm overhang c. With that guide, 2μd/L = 0.46 and the force factor is f = 1/(1 − 0.46) = 1.85. Halfway up the rise, the torque from the weight is W·s′·f = 0.196 N · 11.5 mm · 1.85 ≈ 4.2 N·mm, and face friction adds μ·F·(Rb + s) = 0.4 · 0.36 N · 21 mm ≈ 3 N·mm. As an upper bound, about 7 N·mm dry; greased, about 3.

B, the woodpecker (15 g). A 10 mm snail over 300°, the drop at 270°, a 60° dwell after it, and a knife-edge follower on a rod with a flat so the beak always points at the log. Torque: 0.147 N · 1.91 mm ≈ 0.3 N·mm.

C, the arm. The 20/55/45/60 crank-rocker from The four-bar linkage: a 20 mm crank, a 55 mm coupler, a 45 mm rocker and a 60 mm ground link. The rocker sweeps 54.6°, and the crank is keyed to the end of the shaft. Driven from the crank, it has no dead center: the transmission angle runs from 45.8° to 105.8° and never reaches 0° or 180°. Driven from the rocker, it would have one. The difference between dead center and the toggle position is in Toggle linkage.

Three-figure box: summary of the example
Figure Mechanism Stroke Cam or links Follower Guide Peak torque
A, bird, 20 g Cycloidal, rises 0–120°, returns 180–300° 12 mm Rb 15, Ø30/Ø54 Flat face Ø28 20 mm, c 10 mm ≈ 7 N·mm dry, ≈ 3 greased
B, woodpecker, 15 g Snail, 300° of spiral, drop at 270° 10 mm Step + 60° dwell Knife edge r 0.5–1 mm 20 mm, rod with flat ≈ 0.3 N·mm
C, arm Crank-rocker 20/55/45/60 54.6° Crank on the end of the shaft — — Transmission angle 45.8–105.8°
Shaft Steel Ø6, ~60 rpm by hand — M3 set screw; flat or D-shaft once the phase is set — Printed bushings Sum of all three

Total torque is a few N·mm: on a handle of 35 mm radius, that is tenths of a newton at your hand. What tires the hand is a wedged guide, never the weight of the figures. Fit a knob about 12 mm in diameter that spins freely on its pin, so it does not rub your palm on every turn (Knobs, handles and grips).

Balancing the torque

The torque on the shaft is the sum of each cam's torque. A figure that rises brakes the shaft; one that falls drives it forward. If you pair one figure's rise with another's return, the torque from the weight cancels and only friction torque is left, and that never cancels: it brakes on the rise and on the return. With two cams like A in phase, dry, the peak adds up to about 14 N·mm. With the two 180° apart, the rising one demands about 7.2 N·mm and the falling one gives back W·s′/(1 + 2μd/L) ≈ 1.5 N·mm, but its face eats 1.1 of that: the net peak ends up near 7 N·mm. The offset halves it; it does not make it disappear.

By hand you barely notice. It matters with a small motor, heavy figures or springs. According to its datasheet, a 28BYJ-48 delivers around 30 N·mm of starting torque (Choosing a motor), and through its gearbox it does not go much past 15 rpm: with it, the story runs about four times slower than by hand. Six figures like A rising together demand over 40 N·mm dry: not enough. Paired at 180°, about 20 N·mm, with little margin; with grease in the guides and on the cams, plenty.

A torque that changes sign has another cost: at each reversal, the backlash in the gears and at the set screw crosses to the other side and knocks. Staggering the cams softens it. To run the box on a wound spring, the mainspring and the governor are covered in Spring motors and flywheels.

Printing and assembly

The box prints as flat panels, with the side panels lying flat: the shaft holes come out vertical and round. If you prefer the box in one piece and upright, the holes end up horizontal, and Ø6.4 is at the limit of what prints cleanly without a roof.

The cams print flat, with the profile in the XY plane and a 0.5 × 45° chamfer on the bed edge so elephant's foot does not rub (The face on the bed). Put the seam where it does no harm (Where the seam goes): on the snail cam, on the face of the step, which the follower never touches and which, being a sharp corner, attracts the seam anyway; on the disc cam, in the bottom dwell, where the load is lowest. The rest of printing a cam is in Cams and followers.

The rods are better bought, in Ø3–4 mm steel or brass: a printed rod standing up is fragile and comes out oval. The guides go in the lid, which is printed flat; give them a sliding fit and a dab of grease. PLA for the box and the figures; PETG or PA for cams that will run for hours (Which plastic for which mechanism, Friction and wear).

A Ø6 steel shaft does not bend under these loads: half a newton at the middle of a 300 mm span deflects it by about 0.02 mm. If the cams in the middle touch before those at the ends, the cause is play in the bushings or a printed shaft. A printed shaft, or a long one carrying many figures, does need a middle support. At 60 rpm, printed bushings are enough (Seating bearings and bushings).

Before you close the lid, turn the shaft with the graduated disc in front of you and set each cam's phase against the diagram.

When it fails

Symptom → cause → fix
Symptom Cause Fix
The figure will not come down, or comes down in jerks Off-center figure (2μe/L close to 1), tight fit or oval printed rod Centered figure, metal rod, sliding fit, grease
The handle jams when a figure rises Guide wedging on the rise: 2μ(d + e)/L close to 1 Longer guide, short overhang, centered figure, grease
Figures jump when you turn fast Lift-off at the end of the rise or the start of the return Slower, longer β, less stroke or a spring
The peck is soft or late Flat face or large roller on the snail cam Knife-edge follower with a rounded tip, r 0.5–1 mm
A second knock after the peck The tip lands on the spiral, which is already rising Dwell after the step ≥ 2 × the drop angle
Locks in one direction Snail cam turned backwards Arrow on the handle, or a ratchet
The story drifts out of order with use The cam slips on the shaft Flat filed at its phase or a D-shaft, 0° mark
A tight spot, or the motor always stalls at the same angle Torque peaks that coincide Stagger the cams
The figure ends up facing the other way The rod turns in its guide Flat on the rod, or a square section
Squeaking and white dust Dry PLA on PLA Grease; PETG or PA cams
The cams in the middle touch before those at the ends Play in the bushings or a printed shaft Ø6 steel shaft, bushings with the right fit, a middle support if the shaft is printed

How to test it

  1. One cam on a test rig. Before printing the box, print a stand with a short length of shaft, one cam, the guide and the figure. The figure must fall on its own through the whole turn, with no help from your finger. If it will not come down here, it will not in the box.
  2. The graduated disc. Turn slowly and note the angle at which each gesture starts and ends. Compare it with the timing diagram: a difference of more than 5–10° means a cam is set at the wrong phase.
  3. Slow motion. Drive the shaft with a drill at low speed or with a motor, raise the rpm a little at a time and film at 240 fps. The first lift-off you see is your real limit; compare it with the calculation.
  4. An hour on a motor. Let it run for an hour, then check the phase marks, the snail cam's step and the follower's tip. The method for long runs is in Testing a mechanism before you trust it.

See also

Design it in KapyCAD

Sketch the mechanism with these dimensions. Each one stays a value you can change after the first test print.

Free plan, no card. Runs in your browser, nothing to install.

Open the editor

Still have a question?