More than one input

Two shafts that must be in line

Asking a two-stage gear train for a ratio is easy. Asking it for a ratio and for its input and output shafts to be coaxial is asking for a solution of two equations in four integers, and there is no reason for one to exist. A twelve-to-one reverted train needs a sixty-three-tooth wheel before it has any solution at all — while sixteen to one, a larger ratio, manages with fifty-six.

Assumes The reductions a planetary cannot give and A clock is a factorisation.

An ordinary two-stage gear train has three shafts: input, layshaft, output. The ratio is the product of the two pairs and any ratio at all can be had by choosing them, subject only to keeping each pair within reason.

Now add one requirement. The input and output shafts must be in line — the same axis, one hollow through the other, or the output emerging from the far end of the case where the input went in. That is a reverted train, and it is what a clock’s motion work, a lathe’s back gear, a coaxial reduction box and the drive through many machine tool heads all are.

The requirement sounds like packaging. It is arithmetic, and it is severe.

Reverted trains of 12 : 1. A reverted train has its input and output shafts in line, which means the two stages share one centre distance — so the tooth counts must satisfy z₁ + z₂ = z₃ + z₄ and give the ratio asked for. Two equations in four integers, and there is no reason for a solution to exist. For 12 : 1 there is none at all until the wheels are allowed to reach 63 teeth; below that the coaxial condition and the ratio simply cannot both be met. This is the same kind of arithmetic as the clock trains of the timing field, with one extra equation, and the extra equation is what a shaft position costs.
Fig. 1 How many exact twelve-to-one reverted trains exist as the largest permitted wheel grows. None until a wheel is allowed 63 teeth, and then a handful. The two conditions — the ratio, and one shared centre distance — are two equations in four integers, and integers do not have to oblige.

Two equations in four integers

If the input and output shafts are coincident, the layshaft is at some distance from that axis, and both pairs of gears span that same distance. At a common module, the centre distance of a pair is half the sum of its tooth counts. So

z1+z2  =  z3+z4z_1 + z_2 \;=\; z_3 + z_4

and the ratio requirement is

z2z4z1z3  =  N.\frac{z_2\,z_4}{z_1\,z_3} \;=\; N.

Four unknowns, two equations, and both have to be satisfied in whole numbers. That is a Diophantine problem, and Diophantine problems are the ones that either have solutions or emphatically do not.

The site met this shape once before, in the timing field, where the question was which ratios can be made exactly by two pairs of cuttable wheels. Sixty had 404 answers and the sidereal ratio had none at all. Here there is one further equation, and it is worth being precise about the difference: that essay’s constraint was on the product, and this one adds a constraint on the two sums. A shaft position, expressed as arithmetic.

The enumeration

Sweep every z1,z2,z3z_1, z_2, z_3 from 14 to 120 teeth, compute z4z_4 from the sum condition, and keep the quadruples whose products give the target exactly. All comparisons are integer comparisons: nothing is compared as a decimal anywhere, so “exact” means exact.

target solutions smallest largest-wheel the smallest solution
2 118 21 14 · 21 / 15 · 20
3 120 30 15 · 30 / 18 · 27
4 119 28 14 · 28 / 14 · 28
5 84 42 14 · 42 / 21 · 35
6 80 36 14 · 36 / 15 · 35
8 54 48 15 · 48 / 18 · 45
9 53 42 14 · 42 / 14 · 42
12 40 63 14 · 63 / 21 · 56
16 31 56 14 · 56 / 14 · 56
20 14 75 15 · 75 / 18 · 72
25 13 70 14 · 70 / 14 · 70
36 7 84 14 · 84 / 14 · 84

Read the third column down and something is wrong with the expected pattern. The largest wheel a target needs generally grows with the target — 21 teeth for 2 : 1, 84 for 36 : 1 — but not monotonically. Twelve to one needs a 63-tooth wheel, while sixteen to one manages with 56 and nine to one with 42. A ratio between two others needs a bigger gearbox than either of them.

The reason is that 12 is not a square

Look at the fourth column. Four of the twelve targets have a smallest solution with z1=z3z_1 = z_3 and z2=z4z_2 = z_4two identical stages — and every one of those targets is a perfect square: 4, 9, 16, 25, 36.

That is not a coincidence and it is not about squares of integers particularly. If the two stages are identical then each contributes the same ratio r=z2/z1r = z_2/z_1 and the target is r2r^2. So a reverted train with identical stages exists exactly when the target is the square of a rational that can be realised as a ratio of two tooth counts in range. Sixteen is 424^2 and the stages can both be 14 : 56; twenty-five is 525^2 and both can be 14 : 70.

Twelve is not the square of a rational. So its two stages are forced to be different, and the sum condition then has to be satisfied by two genuinely different pairs. That is a much harder demand: two distinct factorisations of one number, whose tooth counts happen to add to the same total. The smallest is 146314 \cdot 63 against 215621 \cdot 56, both summing to 77, with stage ratios of 4.5 and 2.667 whose product is exactly 12.

The enumeration confirms it directly: across all targets, the number of identical-stage solutions is 47, 27, 17, 11 and 7 for the five square targets, and zero for every non-square. It is one of the cleanest structural facts in this phase and it fell out of a table that was assembled to answer a different question.

Reverted trains of 16 : 1. A reverted train has its input and output shafts in line, which means the two stages share one centre distance — so the tooth counts must satisfy z₁ + z₂ = z₃ + z₄ and give the ratio asked for. Two equations in four integers, and there is no reason for a solution to exist. For 16 : 1 there is none at all until the wheels are allowed to reach 56 teeth; below that the coaxial condition and the ratio simply cannot both be met. This is the same kind of arithmetic as the clock trains of the timing field, with one extra equation, and the extra equation is what a shaft position costs.
Fig. 2 The same count for sixteen to one, which is a perfect square. Solutions appear far earlier and there are more of them, because the identical-stage family is available and each of its members is a solution.

What the constraint costs

Set the sum condition aside for a moment. Without it, a twelve-to-one two-stage train is trivial: 20 : 60 and 15 : 60, done, largest wheel 60, and a hundred other answers. With it, no answer exists at all until a wheel is allowed 63 teeth.

Three teeth on the largest wheel does not sound like much. What it means physically is that the requirement to bring the output shaft back onto the input’s axis has, on its own, made the gearbox bigger — and it has done so for a reason that no drawing shows and no layout study would find, because the reason is that 12 has no two factorisations whose factor-sums agree below that size.

That is the general shape of this field’s harder results. A condition stated as a position — put the output shaft here — turns into a condition on integers, and the integers refuse.

Where the solutions sit

The count alone hides the structure, and the list is worth looking at. For twelve to one with wheels between 14 and 100 there are twenty-four, and the first six are

1463/2156,1496/4070,1590/3570,1595/3872,1664/2060,1672/2464.14\cdot63/21\cdot56, \quad 14\cdot96/40\cdot70, \quad 15\cdot90/35\cdot70, \quad 15\cdot95/38\cdot72, \quad 16\cdot64/20\cdot60, \quad 16\cdot72/24\cdot64 .

Two things about that list. The stage ratios are wildly uneven — 4.5 against 2.667 in the first, 6.86 against 1.75 in the second — because the sum condition rewards a large-with-small pairing on one stage and a middling one on the other. And the sums themselves are all different: 77, 110, 105, 110, 80, 88. Each solution is its own centre distance, so choosing between them is choosing the size of the gearbox as much as the wheels in it.

That is the practical shape of a Diophantine design problem. There is no continuum to slide along and no gradient to follow; there is a finite list, its members are far apart, and the choice is discrete in every variable at once.

Reverted trains of 4 : 1. A reverted train has its input and output shafts in line, which means the two stages share one centre distance — so the tooth counts must satisfy z₁ + z₂ = z₃ + z₄ and give the ratio asked for. Two equations in four integers, and there is no reason for a solution to exist. For 4 : 1 there is none at all until the wheels are allowed to reach 28 teeth; below that the coaxial condition and the ratio simply cannot both be met. This is the same kind of arithmetic as the clock trains of the timing field, with one extra equation, and the extra equation is what a shaft position costs.
Fig. 3 Four to one, a perfect square, so the identical-stage family is available and solutions are abundant from small wheels upward. Compare it with twelve, where the same count of wheels buys nothing at all.

The two escapes

Two things a designer actually does, and both are visible in the arithmetic.

Use two modules. If the two pairs are cut at different modules m1m_1 and m2m_2, the sum condition becomes m1(z1+z2)=m2(z3+z4)m_1(z_1+z_2) = m_2(z_3+z_4), and the second module can be chosen to make almost anything fit. This is exactly the escape the compound epicyclic uses for its half-tooth centre distance discrepancy. It costs two cutters and two sets of spares rather than one, which is a real cost in a production gearbox and no cost at all in a one-off.

Use profile shift. Move the cutter out on one pair and it will run happily at a centre distance away from its nominal, at the price of a changed operating pressure angle and changed tooth thicknesses. This is the technique the teeth field owns, and it is doing here what it does there: absorbing a discrepancy that arithmetic will not.

Both escapes have the same character. The exact ratio is preserved — it is a count and cannot be moved — and the geometry is bent to accommodate it. That asymmetry is worth naming, because it is why gear design feels the way it does: the ratios are rigid and the lengths are negotiable, which is the exact opposite of every linkage problem on this site, where the lengths are given and the motion is whatever follows.

The condition read as a lattice

There is a way of seeing why the sum condition is so restrictive that makes the arithmetic feel less arbitrary.

Fix the sum S=z1+z2=z3+z4S = z_1 + z_2 = z_3 + z_4. Then each stage is a pair of positive integers adding to SS, and its ratio is z2/(Sz2)z_2/(S - z_2) — a function of one integer. So for a given SS the available stage ratios are a finite ladder of S2zmin+1S - 2z_{\min} + 1 values, and the question becomes: does that ladder contain two members whose product is the target?

For S=77S = 77 and wheels at least 14, the ladder runs 63/14=4.563/14 = 4.5, 62/15=4.13362/15 = 4.133, … down to 14/63=0.22214/63 = 0.222: fifty values. Twelve is in the set of pairwise products exactly once, which is why 1463/215614\cdot63/21\cdot56 is the smallest solution and why it took until S=77S = 77 to find one.

Seen that way, the difficulty is a collision problem: how likely is a particular number to be a product of two members of a short ladder of rationals? For a perfect square it is guaranteed the moment N\sqrt{N} itself is in the ladder, which is why squares are easy. For anything else it is a matter of the target’s factorisations lining up with the ladder’s spacing, and the ladder’s spacing is decided by SS.

That also explains the non-monotonicity in the table. A larger target does not need a longer ladder; it needs a ladder containing the right pair, and whether one exists is a fact about the target’s divisors rather than about its size.

The balanced solution

Among the solutions for a target there is usually a preference: make the two stage ratios as equal as possible, so that neither wheel is much larger than the other and the layshaft sits sensibly. That is the standard rule for a two-stage train, and for a free train the answer is N\sqrt{N} per stage.

For a reverted train it is not available in general, since equal stages need a square target. The enumeration’s most balanced twelve-to-one is

1664  /  2060,16 \cdot 64 \;/\; 20 \cdot 60,

with stage ratios 4 and 3, both summing to 80. Against the ideal of 12=3.464\sqrt{12} = 3.464 each, the split is 15.5% high and 13.4% low, which is as close as four integers summing in pairs will get in this range.

Why the clock got a different answer

The clock-train essay asked a question of the same family and got a much more generous answer — 404 exact two-pair trains for a ratio of sixty — and the difference between the two results is worth pinning down, because it is entirely one equation.

That essay’s condition was on the product alone: find z1z3z_1z_3 and z2z4z_2z_4 with z2z4=60z1z3z_2z_4 = 60\,z_1z_3, with all four counts cuttable. Four unknowns, one equation, and a large solution set — the enumeration’s job was to count them rather than to find one.

This essay adds z1+z2=z3+z4z_1 + z_2 = z_3 + z_4. That is a second equation on the same four unknowns, and it cuts the solution set from a three-parameter family to a one-parameter one — which is why sixty went from hundreds of answers to, in the reverted case, whatever the sums allow.

The pattern is worth carrying: each geometric requirement stated as a position becomes one Diophantine equation, and each equation costs roughly a dimension of the solution set. A ratio is one. Coaxial shafts is two. A ratio, coaxial shafts and a specified centre distance would be three, and at that point there is generally nothing at all.

The 2 : 1 that a planetary could not give

One cross-reference worth making explicit, because it closes a loop opened in the previous essay.

No single planetary gear set can give a reduction of 2, in any configuration, with any tooth counts. The reachable set has a hole from 1.630 to 2.586 and 2 is in the middle of it.

A reverted train can, easily: 1421/152014 \cdot 21 / 15 \cdot 20, largest wheel 21 teeth, exact, coaxial in and out, and one of a hundred and eighteen solutions. The two mechanisms are close cousins — both put the output back on the input’s axis, both use two meshes — and one of them can do the most ordinary reduction there is while the other cannot do it at all.

The difference is in which conditions bind. A planetary’s ring must exceed its sun by two whole planets, which forces zR/zS>1z_R/z_S > 1 and puts a floor of 2 under everything. A reverted train has no such relation between its wheels; its constraint is on two sums rather than on a difference of radii, and a sum can be satisfied by a large wheel with a small one as easily as by two middling ones.

Reverted trains of 6 : 1. A reverted train has its input and output shafts in line, which means the two stages share one centre distance — so the tooth counts must satisfy z₁ + z₂ = z₃ + z₄ and give the ratio asked for. Two equations in four integers, and there is no reason for a solution to exist. For 6 : 1 there is none at all until the wheels are allowed to reach 36 teeth; below that the coaxial condition and the ratio simply cannot both be met. This is the same kind of arithmetic as the clock trains of the timing field, with one extra equation, and the extra equation is what a shaft position costs.
Fig. 4 Six to one, which is not a square either, so its stages must differ — and yet it manages at 36 teeth where twelve needs 63. There is no simple rule ordering the difficulty of targets; it is a fact about each number’s factorisations and the sums they produce, and the only way to know is to count.
Reverted trains of 9 : 1. A reverted train has its input and output shafts in line, which means the two stages share one centre distance — so the tooth counts must satisfy z₁ + z₂ = z₃ + z₄ and give the ratio asked for. Two equations in four integers, and there is no reason for a solution to exist. For 9 : 1 there is none at all until the wheels are allowed to reach 42 teeth; below that the coaxial condition and the ratio simply cannot both be met. This is the same kind of arithmetic as the clock trains of the timing field, with one extra equation, and the extra equation is what a shaft position costs.
Fig. 5 Nine to one, a perfect square, which admits two identical stages of 14 : 42 and therefore has solutions from 42 teeth up. Set beside twelve’s 63, the ordering of difficulty has nothing to do with the ordering of the ratios.

Ask for a ratio, not for a number

The non-monotonicity is the most practically useful thing in this essay and it is easy to read as a curiosity. Twelve to one needing a sixty-three-tooth wheel where sixteen to one manages with fifty-six is not a fact about twelve; it is a fact about asking for twelve exactly.

A design requirement almost never is exactly twelve. It is about twelve, arrived at from a motor speed and a wanted output speed, both of which carry their own latitude. And the cost of the requirement varies wildly across that latitude — the neighbours of a hard target are frequently easy, because the difficulty is a collision property of one integer and its neighbours are different integers with no reason to behave alike.

So the useful output of this search is not a solution for the target. It is a table of nearby targets and what each one costs, in largest tooth count, and the designer picks from it. A requirement of twelve that could tolerate 11.67 or 12.25 may be met with a much smaller gearbox, and nothing in the specification as written says whether it can — which makes the latitude the single most valuable piece of information the designer holds and the one least often written down.

That reframes the whole class of problem this field keeps meeting. A Diophantine requirement is expensive when it is exact and cheap when it is nearly exact, and the difference between the two is enormous rather than marginal: exact solutions are scattered and approximate ones are dense. The designer’s real question is therefore never can this ratio be achieved but how much does the last decimal place cost.

Which is also why the two escapes work as well as they do. Two modules and profile shift are both ways of relaxing the sum condition slightly, and a slightly relaxed Diophantine condition is not a slightly easier problem — it is a qualitatively different one, because the lattice points no longer have to land exactly and the density argument changes character. Neither escape is a fudge; both are the recognition that one of the two conditions was never as hard as it was written.

The exception is the case where the exactness is genuine, and it is worth marking so the argument is not read as licence. A clock’s train must divide a day exactly, because the error accumulates and there is no latitude anywhere in the requirement. That is the situation this field’s arithmetic is really for, and it is rarer than the number of exact ratios in specifications would suggest.

So the rule is short. Find out what the latitude is before running the search, because it decides which of two very different problems is being solved — and a requirement stated as an integer with no tolerance is a requirement nobody has examined.

What the check has to be able to lose

The gate asserts three things about the search and the third is the one that would catch a broken enumeration.

That a twelve-to-one reverted train has no solution with wheels up to 60 teeth — a claim that fails if the search is over-generous. That it has solutions at 100 — a claim that fails if the search is broken rather than the ratio hard, which is the failure mode that would otherwise make the first claim look profound. And that every returned quadruple actually satisfies both equations, checked one at a time, so that a solution which met the ratio and not the centre distance would be refused rather than counted.

The last is not decorative, and the way it is written is the point. The obvious way to test the ratio is to divide — compute z2 * z4 / (z1 * z3) and compare it with the target — and a comparison of two doubles needs a tolerance, and any tolerance at all admits quadruples whose product is nearly right. “Nearly right” is not a category a gear train has: a train either delivers 12 exactly or delivers something else for ever. The test is therefore written as z2 * z4 === target * z1 * z3, an equality of integers, and the whole enumeration is a count of exact solutions rather than a count of solutions within a tolerance nobody stated.

About the same objects

Not linked from either essay — found by the objects both name.

What links here

The 8 of 9 essays linking to this one that name the most of the same objects.

The objects this essay names

Each one links to every other essay that touches it.

Centre distanceDesign ruleDiophantineEnumerationExact arithmeticGear trainReverted trainTransmission relationVelocity ratioWheel train