Rack and pinion: rotation to linear and back

11 min readUpdated Jun 2026

A pinion is a gear that meshes with another. A rack is what you get when you take that mating gear and stretch its radius out to infinity: the teeth, which used to run around a circle, now run along a straight line. The pinion rolls along that line and, as it turns, drives the rack lengthwise. That's the whole mechanism. It's the most direct way to turn rotation into a long, straight displacement, and it's everywhere: a car's steering, a lift, a machine axis, a sliding door. The idea is simple. The hard part, in FDM, is keeping the pinion from climbing out of the rack the first time it pushes under load.

The pinion rolls along a straight line

The kinematics are those of any two gears, with one of them at infinite radius. When the pinion turns one full revolution, its pitch circle has unrolled its entire length against the rack, so the rack advances exactly that circumference: the pinion's tooth count times the pitch. A 20-tooth, module-2 pinion has a circular pitch of π·m ≈ 6.28 mm per tooth, so each revolution moves the rack about 20 · 6.28 ≈ 125.6 mm. That number, the linear travel per revolution, is the mechanism's transmission ratio. You read it straight off the pinion geometry — nothing more to compute.

The ratio is reversible, and it's worth keeping in mind because it changes how you size the mechanism. If you drive the pinion, you push the rack: rotation to linear, the case of a steering gear or a hand-cranked lift. If you push the rack, you turn the pinion: linear to rotation, which is how you read a linear position with a rotary encoder, or how a sliding door drags a mechanism along. In the first direction the pinion is in charge; in the second, the rack is. Reversibility also means the mechanism is not self-locking by design, unlike a fine-pitch lead screw: with a standard pressure angle and low friction, a load pulling on the rack will tend to drive the pinion backward. But "not self-locking" isn't the same as saying it always backdrives: with small modules, high interlayer friction, and large travel per revolution, the return torque may not be enough to overcome static friction. Don't trust the mesh as a brake; if you need the load to stay put, fit a real brake.

Module and pressure angle: the rack shares the gear's profile

The pinion and the rack have to share module and pressure angle, exactly as two gears that mesh together do. The module sets the tooth size — the pitch is π·m — and the pressure angle (20° is the standard) sets the slope of the flank that transmits the load. If they don't match, the teeth won't mate: they touch at one point and clash everywhere else, with tip-against-flank contact that drives up the local load and accelerates wear. The rack isn't a separate profile you have to adapt; it's the same gear tooth with the pitch radius taken to infinity. That's why the flank, which on a gear is an involute curve, becomes on the rack a straight line inclined at exactly the pressure angle, measured against the perpendicular to the pitch line. And that's why a correct rack generator produces straight flanks: it isn't a simplification, it's the geometric limit of the involute as the radius grows without bound.

This gives the rack a convenient property: it can be as long as you like, spliced from sections. But the splice has one condition that's easy to overlook and expensive to discover once the assembly is built.

Orientation: rack flat, pinion flat

Orientation in FDM decides whether the teeth hold or fail. The rack prints with the bar lying along the bed and the teeth pointing up. That way each tooth builds layer on layer from its base, with no overhang, and the flanks that transmit the push run along the extrusion beads instead of crossing the weak interlayer plane. If you printed it on edge, with the teeth sticking out sideways, each flank would be an overhanging surface that the slicer would fill with support or degrade with stair-stepping, and the thrust load would pull the layers apart right at the contact point.

Note, though, that "teeth up" mitigates the layer problem but doesn't eliminate it: the tooth is still a stack of horizontal layers, and the tangential push generates a bending moment at its base that tends to open the interlayer bond right at the root, which is where the moment is greatest. Orientation puts the weak plane in the least-bad spot; it doesn't make it disappear. Give the tooth root enough perimeters so the base works as continuous material and not as a thin weld between two layers.

The pinion prints flat, lying on one of its faces, for the same reason as any gear: the teeth end up in the plane of the layers, and the shaft hole, perpendicular to the bed, comes out more cylindrical than if the part were printed on edge. The full reasoning for why orientation changes the failure mode is in Layer orientation for motion.

That orientation, optimal for printing, nevertheless creates the mechanism's central problem: nothing holds the pinion against the rack. With two gears, both shafts are fixed in a frame and the center distance can't move. Here the pinion travels along a straight rack, and if nothing keeps it at a constant depth, the first tooth it pushes under load will lift it and make it climb out of mesh.

The guide is half the mechanism

The distance from the pinion's shaft to the rack's pitch line has to stay constant over the whole travel. That distance is the mesh depth, and how much the teeth overlap depends on it. If the pinion drifts away, the teeth take contact more and more toward the tip, the overlap drops, and there comes a point where one tooth's tip slides over the other's tip instead of pushing on the flank: the pinion skips a tooth. Once it skips one, it's lost its position reference and tends to skip in a cascade. That's why a parallel guide — a rail, a pair of rods, a carriage that wraps the rack — isn't an accessory: it's what turns the mesh into a working mechanism.

The guide has two forces to overcome, not one. The first is the radial component: the push isn't purely tangential, and the pressure angle adds a component that tends to open the mesh and separate the pinion from the rack. The second, easier to overlook, is a pitching moment: the tangential force is applied at the height of the pitch line, some distance from the guide's supports, and that lever arm twists the pinion carriage. If the guide is short — little separation between its two support points — that moment pitches the carriage and the mesh depth varies again even if the guide has almost no play. Make the guide tight, yes — but give it a long base: separate the supports enough that the moment doesn't translate into pitch.

As for clearances, there are two here, and they shouldn't be confused. One is backlash, the gap between flanks you need so the mesh doesn't seize, exactly the same as in any pair of printed gears: enough that the entering tooth doesn't clash with the exiting one when the material widens in printing, without so much play that the mechanism rattles on reversal. The other is the guide's clearance on its rail: here you want the opposite, the minimum sliding play possible, because any slack in the guide translates directly into mesh-depth variation — the pinion moves away from the rack and back toward it as the carriage wanders — and the tooth skip reappears. Backlash just enough not to seize; guide as tight as you can make it. One caveat depends on the application: on a vertical axis holding a load, loose backlash introduces droop and dead play on reversal, so there you want the minimum viable clearance, not a generous one. Both values come out of the same printer calibration as any other adjustment; it's worked out in Tolerances for moving parts.

Rack and pinion in FDM: the five dimensions that decide
Dimension Criterion If it isn't met
Module and pressure angle Identical on pinion and rack Teeth don't mate, tip contact
Mesh depth Constant over the whole travel (guide) The pinion climbs and skips teeth
Backlash between flanks Just enough to clear the oversize from printing Teeth bind when the material widens
Guide clearance Minimal, sliding without play, long base Depth varies and it skips
Pitch at splice joints Exactly one pitch across the joint Skip or jam at the splice

When it's the right tool

The rack and pinion is what you reach for when you need a long, straight displacement and the other candidates fall short. A lead screw gives a precise straight guide, and a single-start one can be self-locking, but it advances its lead per revolution — typically a few millimeters on single-start screws — while the rack advances a whole circumference. And there's the catch: in a lead screw, speed and self-locking are at odds. To match a rack's speed you'd have to go to a fast-advancing screw (multi-start trapezoidal or ball), which precisely because of its high helix angle stops being self-locking. You can't have both rack-like speed and self-locking in the same screw.

A linkage (an articulated four-bar, a Scott-Russell) gives you linear motion without a guide, but with limited travel: the geometry is only good over a short stretch and curves or binds outside it. The rack, by contrast, gives travel as long as the bar you have, at high speed, in exchange for demanding a robust guide and not self-locking. Steering gears, assisted scissor lifts, machine axes, tables that traverse their full length: that's where it wins.

There are three failure modes worth keeping on hand when something goes wrong. Tooth skip shows up when the guide doesn't hold the depth; it's the most common and almost always a problem of rail stiffness, not of the teeth. A broken rack tooth comes from a strong point load, because the whole force falls on the pair of teeth in contact at that instant and a printed tooth is more fragile between layers than a machined one. And pitch discontinuity at the joints of spliced racks shows up as a tug or a jump always at the same point of the travel. All three are quick to diagnose: if it skips everywhere, it's the guide; if it breaks under load, increase the module or spread the load (more mesh height, a helical or double pinion, or more perimeters at the tooth root); if it always fails at the same point, measure the pitch at that joint.

If you're going to drive the pinion by hand and you're worried about it letting go under the return load, the next step is to decide how you fix the pinion to its shaft without it slipping or cracking the hub: it's in Tolerances for moving parts, where the fit between shaft and hole is what carries the transmitted torque without slipping.