A gap with corners in it
Assumes A gap is a number.
Take one number — the smallest gap over every tested pair — and compute it at every position of a mechanism’s drive. What comes back is a function, and it is the first function on this site with corners in it.
That sounds like a small observation and it decides most of how this field is built: which instrument finds the minimum, why a check at the ends is worthless, why the sample count has to be defended, and why the identity of the closest pair is drawn in every figure rather than the number alone.
The machine, so the numbers have somewhere to live
The site’s own crank rocker — ground 4, crank 1, coupler 3.5, rocker 3 — with a post bolted to the frame at (1.35, 2.5), a third of a unit wide and a little over a unit tall, standing where the coupler sweeps. Links 0.16 wide. Three moving parts, one obstacle, four pairs tested.
Over a full turn at 360 solved positions the smallest gap is +0.104, at a crank angle of 2.11 radians. The machine runs. At the start of the turn the gap is over half a unit; at the three-quarter point it is over half a unit again. Nothing at either end of the sweep, and nothing at any of the dead centres, is within a factor of five of the worst instant.
That is the first thing the function says, and it is not new to this field. interference.js recorded it when the applied field first needed bodies: a cabinet door’s closest approach to its carcase is a quarter of the way open, and a check at shut and at ninety degrees reports a healthy gap at both. The reason is the same in both cases. The extremum of a clearance is set by where two particular features happen to line up, and that has nothing to do with where the mechanism’s own motion has its extremes.
Where the corners come from
At any configuration the gap is realised by a witness pair: a specific edge of one part and a specific vertex or edge of the other. Each such pair contributes a smooth function of the crank angle — the distance between two features carried by two links, both of which are smooth functions of a configuration that is itself a smooth function of the angle away from a singularity.
The gap is the minimum over all of those functions. A minimum of finitely many smooth functions is smooth wherever one of them is strictly smallest, and has a corner wherever two of them cross. So the corners are exactly the configurations at which the closest pair changes hands, and there are as many of them as there are changes.
On the machine above there are four, and they are the coupler handing the post over to the rocker, taking it back, and handing it over again as the crank comes round. At 3,600 samples there are still four, in the same four places: the corners are a property of the geometry rather than of the sampling.
This is why every figure in this field draws the witness segment and colours the curve by the pair. A plot of the gap alone shows a kink and cannot say what a kink is. A plot coloured by the witness says here the rocker becomes the nearest thing to the post, which is a sentence about the machine and is what a designer acts on: the fix for one corner is not the fix for the next.
How many corners a machine has
The count is worth reading across the catalogue, because it says something about how much structure the function has and therefore how much a designer has to keep in their head.
At 180 samples over their drives: the four-bar with a post, four; the slider crank, two; Watt’s linkage, one; Peaucellier’s cell, one; the plain four-bar, none. The plain machines have no corners for an uninteresting reason — their single tested pair is the same pair at every angle, because there is only one pair worth being closest. Corners arrive with obstacles and with link counts, which is to say with machines rather than with mechanisms.
The number is stable under refinement, which is the check that it is a count of something rather than an artefact. Doubling the samples on the four-bar with a post leaves four; quadrupling leaves four. That is not automatic: a corner where two features are nearly tied over a long stretch can be counted twice by a sweep that samples the tie, and the check for it is that the count does not move when the sampling does.
Why the usual instruments are the wrong ones
This site has three ways of finding an extremum of something over a motion and none of them applies.
Setting a derivative to zero. The transmission angle’s worst value, the limit positions of a rocker, the stationary points of a path curvature — all of them are found by differentiating something smooth. At a corner the derivative does not exist, and the minimum of this function is very often exactly at a corner: the crossing of two feature distances is a perfectly ordinary place for the smallest of them to be smallest.
Reading it off the geometry. A dead centre is where the crank and coupler are collinear, and it can be written down from the lengths. There is no closed form for which pair of features is closest, because the answer depends on the shapes as well as on the lengths, and the shapes are polygons rather than a formula.
Checking the ends. Answered above. Both ends of this machine’s turn read five times the worst value.
What is left is bracketing: sample, find the smallest sample, and search inside the bracket it sits in with a method that needs only continuity. Golden section does this — it maintains an interval, evaluates inside it, and shrinks it towards the minimum — and it asks nothing of the derivative.
What the refinement is worth
On the machine above, refining the minimum from a 180-sample sweep moves it by 1.5 × 10⁻⁵, from 0.10415 to 0.10414. That is negligible, and the reason is that the minimum there sits in a smooth stretch: the function is locally a parabola and 180 samples over a turn already resolve it to five figures.
Refinement earns its place on the machines where the minimum is at a corner. There the function is locally a V rather than a parabola, and the error of a sampled minimum is proportional to the sample spacing rather than to its square: on a turn sampled 180 times, that is the difference between five significant figures and three. It also earns its place on the machines whose minimum is narrow — a small obstacle, passed quickly — where the sampled answer can be wrong by more than the whole quantity, which is the subject of the next essay.
The choice of golden section rather than something cleverer is the same choice made everywhere else on this site: use the method whose assumptions the object satisfies. A parabolic fit converges faster and assumes a smooth minimum; on a V it converges to the wrong place with confidence.
Every frame is marched, not jumped to
There is a trap in sweeping a mechanism that this site has fallen into once already and it is worth restating where the sweeps are dense.
A configuration here is a Newton solve on the loop-closure equations, and Newton finds a solution near where it starts. Ask for a configuration half a turn from the last one and it converges — to a different assembly, with every bar satisfied to 10⁻¹⁴ and the picture wrong. The computing field met this inside a drag figure: a frame went out with its tracing point 10⁻⁴ off the curve and every constraint met, which is precisely the failure that field is about, arriving in an illustration.
So every frame in this field is solved from the frame before it, in steps of at most 0.03 radians, and a slider stop half an arc away is marched to rather than set. It is what a physical mechanism does — it cannot jump branches — and it costs a handful of extra Newton iterations per stop.
The cost of getting it wrong here would be worse than a wrong picture. The gap function would have a discontinuity at the jump, the minimum might be on the far side of it, and the discontinuity would look exactly like a corner.
A function with a sign, over a whole family
The same function, computed on every machine in the catalogue at the standard width, is a compact summary of what a planar mechanism does with its material.
Almost all of them are negative for the whole drive: the four-bar at −0.432, Watt’s linkage at −0.432, the drag link at −0.432, Peaucellier at −0.432. The repetition is the depth saturating, as the previous essay describes — two long bars fully crossed have to be moved apart by a whole width and the number stops growing.
Chebyshev’s linkage is positive, at +0.380 over its own arc, and it is the one machine in the catalogue that could be built in a single plane. Its two long arms cross on the page and never occupy the same place at the same instant, which is the distinction the next-but-one essay turns into a graph.
The slider crank is a third case: two corners and a negative minimum, at −0.140, and the pair involved is the connecting rod against the lower guide rail. That is a genuine design statement rather than a saturated one — the rod fouls the mouth of the guide, by an amount a designer could remove by shortening the block or opening the mouth.
The corner and the singularity are not the same thing
This site has a standing interest in the places where a smooth description of a mechanism stops being smooth, and it now has two of them. They should not be confused.
A singularity is a configuration at which the constraint Jacobian loses rank: two solutions of the closure equations have come together, the mechanism cannot be driven through, and the velocity solve blows up. It is a property of the lengths and the joints. Nothing about the material enters it, and no change to the bodies moves it — thinning every link by half leaves every dead centre exactly where it was.
A corner of the gap function is a configuration at which two pairs of features are equidistant. The Jacobian is perfectly well conditioned there, the mechanism drives through without noticing, every velocity is finite, and the only thing that happens is that the answer to a question asked after the solve changes which pair it is about. It is a property of the shapes, and moving one obstacle by a millimetre moves it or removes it.
The two coincide only by accident. On the machine here the corners are at 0.9, 2.5, 3.4 and 5.6 radians and the dead centres are elsewhere, and there is no reason for them to be related: one is about the rank of a matrix and the other about which of two distances is smaller.
Keeping them apart matters because both are drawn as kinks. A reader who has spent five fields learning that a kink in a plot of a mechanism’s behaviour means a singularity will read this function wrongly, and the two have opposite implications for what to do about them.
What the function is not
It is not the mechanism’s own state. Nothing in the constraint equations, the Jacobian, the mobility or the assembly branch changes when a gap goes negative. A configuration with the parts inside each other is a perfectly good solution of the closure equations and the solver returns it without complaint. That is the whole reason this field has to exist as a separate pass rather than as a constraint.
It is not a distance in configuration space. It is measured in the units of the mechanism’s lengths, between two points of the plane, at a configuration. The distance from a configuration to the nearest one that collides is a different quantity in a different space, and it is not computed here.
And it is not differentiable, so it should not be reported as though it were. The temptation to quote a rate — the gap closes at 0.3 per radian — is real, and it is only true between corners. Where it matters most, at the worst instant, it is often exactly where the rate does not exist.
Reading the same function at two widths
One more property, and it is the one the width search leans on: the function only ever moves down as the links get fatter.
Every body grows with the width, and growing a body cannot open a gap. So the gap at a configuration is a decreasing function of the width, and therefore so is its minimum over the drive. That makes the width a parameter that can be bisected on, with a unique crossing, rather than searched with a method that has to worry about which root it found.
It also means the corners move with the width, and can appear and disappear. At a small width the coupler is nearest the post throughout and there are no corners; as the width grows the rocker’s own body catches up and a corner appears; wider still, the rocker governs a whole stretch of the turn. The identity of the pair that limits a machine is a function of how thick it is made, which is not a statement any of the site’s earlier fields could formulate at all.
What the corners are good for
There is a use for the corner structure beyond knowing which instrument to point at the minimum, and it is the reason this essay comes before the sampling one.
A corner is where a small design change stops helping. Between corners, the worst gap is governed by one pair of features, and moving that pair apart improves the machine. At a corner two pairs are equal, and past it the other pair governs: moving the first apart buys nothing at all. A designer thinning a coupler to clear a post is buying improvement right up to the angle where the rocker becomes the closest thing, and not one unit past it.
That is the geometric version of a fact every optimiser knows about minimax problems, and it arrives here without an optimiser: the gap is a min of smooth functions, so its own maximisation over a design parameter runs into an equioscillation the moment two features tie. The approximate synthesis essay meets the same structure from the other direction, and the two are the same phenomenon in different variables.
There is a second use, and it belongs to whoever has to report a clearance rather than fix it. The corner count is a measure of how many independent things are nearly critical at once. A machine whose worst gap is governed by one pair over its whole drive has one problem; a machine with four corners, all of them within a tenth of the minimum, has four, and improving any one of them moves the answer by nothing. That distinction is invisible in a single number and obvious in the coloured curve, and it is the reason this field’s summary tables carry the corner count beside the minimum.
The practical form of it is short. Read the witness, not just the number. A clearance report that says −0.02 tells a designer that something must change; a clearance report that says −0.02, coupler against post, at 2.1 radians, with the rocker second at −0.01, tells them that thinning the coupler alone buys them one hundredth of a unit and no more.
What this makes readable
Essays that name this one as a prerequisite.
- A sweep that missed nothing Links with a width
- Free space comes in pieces Links with a width
- The crank that cannot turn all the way Links with a width
About the same objects
Not linked from either essay — found by the objects both name.
- A link that takes up room clearance · interference · link body · signed clearance · witness pair
- A clearance inside a tolerance box clearance · interference · link body · signed clearance
- A link may be bent interference · link body · signed clearance · witness pair
- A shape with a dent in it interference · link body · signed clearance
- The regions overlap and the parts never meet interference · signed clearance · witness pair
- Where the boundary moved interference · link body · signed clearance
What links here
Essays that link to this one from their own argument.
- A sweep that missed nothing Links with a width
- The gap is a straight line in the metal Links with a width
- Free space comes in pieces Links with a width
- Six things a body is not Drawn wrongly
- A body is all size Links with a width
- The room a machine sweeps Links with a width
- The linkage, put back from two curves The motion, not the mechanism
The objects this essay names
Each one links to every other essay that touches it.
ClearanceInterferenceLimit positionLink bodyNewton–RaphsonSigned clearanceWitness pair