Linkages

The slider-crank

Replace one pin of a four-bar with a slide and you get the mechanism in every reciprocating engine ever built. Its stroke is exactly twice the crank throw and does not depend on the connecting rod at all. Everything else about the motion depends on the rod, including the part that is always described as a sine wave and is not.

A four-bar has four pin joints. Replace one of them with a joint that slides along a line instead of rotating about a point, and the mechanism becomes a slider-crank.

That is not an analogy. In the constraint list the change is literal: three of the four constraints stay as they were, and the fourth becomes “this joint lies on this line” instead of “this joint is this far from that one”. The mobility count is unchanged — four links, four one-freedom joints, mobility 1 — because a slide removes exactly as much freedom as a pin.

Slider-crank at 50°Crank 1, connecting rod 3. The slider's travel is 2.0000 — exactly twice the crank throw, which is the one thing about this mechanism that does not depend on the rod length. Everything else does: the rod length decides how far the piston's motion departs from a sine wave, and that departure is the second harmonic every engine balancer has to deal with.Astroke = 2.000 = 2 × crankpositioned by solving, not by drawing
Fig. 1 Crank 1, connecting rod 3. Turn the crank and the slider travels along its guide. The total travel is exactly 2.0000, which is twice the crank throw and does not depend on the rod at all.

The stroke, and the one thing that is simple

The slider reaches its extremes when the crank and rod are collinear — stretched out and folded back. Those positions are at distances (b+a)(b + a) and (ba)(b - a) from the crank centre, so the stroke is

(b+a)(ba)=2a(b + a) - (b - a) = 2a

The rod length cancels. That is why engine capacity is quoted from the crank throw and the bore and never from the connecting rod, and it is the only quantity in this mechanism with so clean an answer.

Measured on the linkage above, across 180 solved positions, the travel is 2.0000 against a crank of 1 — which is a check on the solver rather than news about the mechanism, and is the kind of thing worth asserting precisely because it is known.

The part that is not a sine wave

Every introduction to this mechanism says the piston moves harmonically. It does not, and the departure is not small.

The piston’s position is

x=acosθ+b2a2sin2θx = a\cos\theta + \sqrt{b^2 - a^2\sin^2\theta}

The first term is the sine wave. The second is the rod’s contribution, and it is only constant in the limit of an infinitely long rod.

The piston that is not a sine waveEvery introduction to the slider-crank says the piston moves harmonically, and it does not. Plotted is the difference between the solved piston position and a pure cosine of the same amplitude, for four connecting-rod ratios. At L/r = 2 the departure reaches 0.268 of a crank radius; at L/r = 6 it is 0.084, and only in the limit of an infinitely long rod does it vanish. The shape of that residual is the second harmonic, it is why engine balance shafts run at twice crankshaft speed, and it is a direct consequence of a rod having a length.-0.200-0.10000100200300crank angle (degrees)piston position − pure sineL/r = 2L/r = 3L/r = 4L/r = 6solved piston position minus a pure cosinethe residual is the second harmonic
Fig. 2 The difference between the solved piston position and a pure cosine of the same amplitude, for four rod-to-crank ratios. At L/r = 2 it reaches 0.256 of a crank radius; at L/r = 6 it is 0.083. It never reaches zero for any real rod.

Expanding the square root gives the shape of the residual: it is dominated by a term in cos2θ\cos 2\theta — the second harmonic, at twice crankshaft frequency.

That term is why engine balance shafts exist and why they run at twice crankshaft speed. A four-cylinder inline engine cancels its primary imbalance by arrangement and cannot cancel the secondary, which is a direct consequence of the connecting rod having a finite length. Two counter-rotating shafts at double speed are the standard fix, and they are there because of the square root above.

Offset, and why an engine might want one

The slide need not pass through the crank centre. Offsetting it changes the mechanism qualitatively rather than quantitatively.

With no offset the motion is symmetric: the crank angles for the two extremes are 180° apart, so the outward and return strokes take equal time. Offset the slide and they do not — one stroke takes more crank rotation than the other, which is called quick return and is the basis of shaping machines, where the cutting stroke should be slow and the return fast.

The stroke also stops being exactly 2a2a. With offset ee it becomes (b+a)2e2(ba)2e2\sqrt{(b+a)^2 - e^2} - \sqrt{(b-a)^2 - e^2}, which is slightly longer, and the clean result above is revealed as the special case it always was.

A four-bar at 60°, solvedGround 4, crank 1, coupler 3.5, rocker 3. Every joint position here is the output of a Newton–Raphson solve on the loop-closure equations, converged to 0.0e+0 — not a placement that looked right. Grashof's condition classifies these lengths as a crank rocker, and sweeping the crank through 360° confirms it: 120 of 120 positions assemble. The transmission angle at this instant is 66.9°.ABO₂O₄crank (input)couplerrocker (output)crank rocker · residual 0.0e+0positioned by solving, not by drawing
Fig. 3 The mechanism the slider-crank is a modification of. The relationship runs both ways: a slider-crank is a four-bar whose output pivot has been moved infinitely far away, so that the rocker’s arc becomes a straight line.

The inversions

As with any four-link chain, fixing a different link gives a different machine, and the slider-crank’s inversions are all in use.

Fix the frame and it is an engine or a pump: rotation in, reciprocation out, or the reverse.

Fix the crank and the whole assembly rotates about the crank pin — this is the Whitworth quick-return mechanism, used in shapers.

Fix the connecting rod and the result is the oscillating-cylinder engine, which was common in early steam launches because it needs no separate valve gear.

Fix the slider and the crank rotates about a point on the slide — the hand pump arrangement.

Four machines, one chain, and Grashof’s condition has nothing to say about any of them because the classification is about four pin joints.

Mobility with a slide in it

Worth checking, because the slider block is the link most often forgotten.

Four links: frame, crank, connecting rod, slider block. Four one-freedom joints: three pins and one slide. So 3(41)2(4)=13(4-1) - 2(4) = 1, and the Jacobian agrees.

An earlier version of this site’s machinery inferred the topology from the constraint list rather than being told it, and counted the slider block as no link at all — arriving at −2 degrees of freedom, which is not a number any mechanism has. The topology is now declared, because what counts as a link is a modelling decision rather than something a list of equations reveals.

Three bars and four barsOn the left, two bars to a common point: three links, three joints, and Grübler gives 3(3−1) − 2(3) = 0. The Jacobian agrees — two free coordinates, rank 2, nothing left over — and the shape cannot change without a bar changing length. On the right, one more bar and one more joint gives mobility 1, and the whole of this site follows from that difference. The triangle is why bridges are triangulated and the quadrilateral is why machines are not.mobility 0 — a structuremobility 1 — a mechanismtriangle: 2 coordinates, rank 2, 0 freeone bar apart
Fig. 4 The mobility question in its simplest form. A slide costs exactly what a pin costs, so exchanging one for the other leaves the count untouched — which is why a slider-crank and a four-bar are the same mechanism as far as this arithmetic is concerned.

What this mechanism is for

Converting between rotation and reciprocation, in both directions, and the direction matters.

Driven from the crank, the mechanism always works: every crank angle gives a piston position. Driven from the piston, it has two positions — the two extremes — where the crank torque is zero and the mechanism will not start. That is why a single-cylinder engine needs a flywheel to carry it through top dead centre, and why steam locomotives put their cranks at ninety degrees on opposite sides so that one cylinder is always able to push.

Those dead positions are the slider-crank’s toggles, and they are the same phenomenon as a four-bar’s with the same double character: no torque available, and infinite mechanical advantage the other way.

Arriving at a dwellThe rise ends at 120° and the follower then stands still, so its acceleration must be zero from there on. Simple harmonic motion arrives at 6.854e-3 per degree² and drops to nothing instantly — an impulsive jerk, which in a real train is a shock the whole mechanism feels. Cycloidal motion arrives at 2.056e-4, 33 times smaller, because its acceleration is a sine that reaches zero exactly where the dwell begins. That is the only reason to prefer it, and it is enough.-0.008-0.006-0.004-0.0020100110120130140cam angle (degrees)acceleration (per degree²)dwell beginssimple harmoniccycloidalharmonic arrives at 6.85e-3, cycloidal at 2.06e-4a factor of 33
Fig. 5 A different way of prescribing motion. A cam can give the follower any displacement law, including one that arrives at a dwell without an acceleration step; a slider-crank gives the law its geometry produces and no other.
Two things that are not the same configurationThe mechanical advantage of a four-bar, from the velocity solution: for a lossless mechanism it is the reciprocal of the output-to-input speed ratio, so wherever the output momentarily stops the force ratio diverges. It reaches 1673 at 222° — a toggle, where crank and coupler line up, and the reason a knee-joint clamp holds with almost no effort. The transmission angle is at its worst somewhere else entirely: 46.5° at 0°, 222° away, where coupler and rocker line up instead. Both get called "the mechanism jamming" and they are opposite situations — one is enormous force output, the other is force going into the bearings.0153045600100200300crank angle (degrees)mechanical advantage (clipped at 60)toggle: advantage 1673worst μ = 46°four-bar 3.4/1.2/3/2.4, 720 solved positions222° apart
Fig. 6 The slider-crank has toggles too, at both ends of the stroke, and they are why a single-cylinder engine needs a flywheel.

Piston acceleration, and the term that will not go away

The position of the piston is the crank projection plus a square root, and the square root is where all the trouble lives. Differentiating twice gives an acceleration with two dominant terms: one at the crank frequency and one at twice it.

The second term is proportional to the ratio of crank radius to connecting-rod length. Make the rod infinitely long and it vanishes, the motion becomes an exact sine, and the acceleration has only the first term. Real rods are three to four crank radii long, so the second term is a quarter to a third of the first, and it is not small.

That second-order term is the reason engine balancing is a subject rather than a step. A rotating mass can be balanced by a counterweight, exactly, at every speed. A reciprocating mass cannot: the first-order part can be traded against a counterweight — which introduces a horizontal shake in exchange for reducing the vertical one — but the second-order part is at twice the shaft frequency and no mass on the shaft can cancel it.

Engine configurations are, to a large extent, arrangements that make these terms cancel between cylinders. A flat-four cancels first order and leaves a rocking couple. A straight-six cancels both, in both orders, which is why it has the reputation it has. A V-twin at 90° cancels first order for any firing interval, which is why the angle is not a styling decision.

None of that is a linkage calculation and all of it follows from the linkage. The measured departure from harmonic motion is the same quantity, read as a force rather than as a displacement.

Ratio and rod length

Two numbers describe a slider-crank up to scale: the crank radius and the rod length, usually quoted as the ratio between them. Every property of the mechanism follows.

Short rod. More second-order content, more asymmetry between the two halves of the stroke, higher side thrust on the piston, and a shorter engine. Motorcycles and some racing engines accept these costs for the packaging.

Long rod. Smoother motion, lower side thrust, less piston-skirt wear, a taller engine and more reciprocating mass in the rod itself. Slow-speed marine diesels go to ratios of five or more.

The side thrust is the part that is easy to overlook. The rod pushes on the piston along its own axis, and that axis is not the cylinder axis except at the two dead centres. The transverse component is carried by the cylinder wall, and it is largest where the rod angle is largest — near mid-stroke, and on one side going down and the other side coming up.

That is why cylinder bores wear oval rather than round, why the wear axis is perpendicular to the crankshaft, and why offsetting the wrist pin buys anything at all: it shifts where in the cycle the thrust changes sides, so the transition happens when the gas pressure is low.

The transmission angle of a slider-crank is the complement of the rod angle, so “low side thrust” and “good transmission angle” are the same statement about the same geometry, arrived at from load and from motion respectively.

The piston that is not a sine waveEvery introduction to the slider-crank says the piston moves harmonically, and it does not. Plotted is the difference between the solved piston position and a pure cosine of the same amplitude, for four connecting-rod ratios. At L/r = 2 the departure reaches 0.268 of a crank radius; at L/r = 6 it is 0.084, and only in the limit of an infinitely long rod does it vanish. The shape of that residual is the second harmonic, it is why engine balance shafts run at twice crankshaft speed, and it is a direct consequence of a rod having a length.-0.200-0.10000100200300crank angle (degrees)piston position − pure sineL/r = 2L/r = 3L/r = 4L/r = 6solved piston position minus a pure cosinethe residual is the second harmonic
Fig. 7 The departure from a sine, plotted. The second-order term is what this residual mostly is, and it is what an engine’s balance shafts exist to cancel.

The scotch yoke, which is the harmonic motion the slider-crank is not

If the departure from a sine is the slider-crank’s defining feature, the obvious question is what mechanism does produce an exact sine, and the answer is a mechanism that is used and rarely.

A scotch yoke replaces the connecting rod with a pin running in a transverse slot. The slider’s position is then exactly the crank projection — a pure sine, with pure cosine velocity and pure negative-sine acceleration, no second-order term, and perfect symmetry between the halves of the stroke.

That would seem to solve the balance problem outright, since a reciprocating mass in pure harmonic motion can be balanced by a counter-rotating mass exactly. And scotch yokes exist in pumps and in a few engines, and are otherwise absent from machinery, for a reason that is entirely about the joint rather than the motion.

The pin bears against the slot wall across a small contact, and the whole side thrust — which in a slider-crank is carried by the piston skirt over a large area — is concentrated there. The sliding velocity at that contact is high and the load reverses every stroke. It wears, and it is hard to lubricate.

So the trade is exact harmonic motion against a bad bearing, and machinery has consistently taken the awkward motion and the good bearing. That is a common shape: the kinematically clean solution loses to the one whose contacts are better, which is the same reason the involute beat the cycloid on tooling rather than on contact mechanics, in the opposite direction.

Solving it as a linkage rather than with the closed form

The slider-crank has a closed-form solution — the position is a projection plus a square root — and this site solves it numerically anyway, which is worth justifying since the closed form is exact and cheap.

The reason is uniformity. The slider is one constraint type among several here, and a mechanism with a slide in it goes through the same solver as one without, which means the same residual check, the same Jacobian, the same mobility measurement and the same velocity solution. Special-casing the slider-crank would give a second code path that the assertions do not cover.

The closed form is then used as the independent check, which is the arrangement this site prefers everywhere: the general method produces the figures, and the special-case formula proves the general method right where it applies. The two agree to arithmetic noise across the sweep.

That arrangement caught something. The topology of a mechanism with a slide has to be declared rather than inferred from the constraint list, because a slide contributes constraints that an automatic count misreads. Inferred, the slider-crank came out at minus two degrees of freedom — a number with no meaning, produced by a routine that was working correctly on the wrong input. It is the kind of error that a closed-form solution would never have exposed, because the closed form does not count anything.

The mechanism the whole industrial world runs on

It is worth pausing on how much of the built world is this one linkage, because the ubiquity is not incidental to why it is worth solving carefully.

Every reciprocating engine — petrol, diesel, steam, Stirling — is a slider-crank, usually several in parallel. Every reciprocating compressor and most reciprocating pumps are the same mechanism run backwards, with the slider driven and the crank driven by it. Presses, shapers, riveters, and the mechanism inside a sewing machine are slider-cranks. So is a piston-driven hydraulic ram viewed as its inversion.

The reason is that it is the simplest mechanism converting between continuous rotation and bounded translation, and both of those are things machinery needs constantly: rotation is what motors and turbines produce and what shafts transmit, and translation is what pistons, cutters and rams do.

The alternatives all cost more. A scotch yoke has a worse bearing. A cam and follower needs a machined profile and a return spring. A rack and pinion translates without bounds and needs reversal. A Geneva or ratchet indexes rather than reciprocates. The slider-crank needs one pin, one rod and a bore, and the bore is required anyway if the machine has a piston in it.

That is why the mechanism’s imperfections matter so much. The second-order acceleration term is not a curiosity in an obscure linkage; it is a force present in every engine ever built, and the entire discipline of engine balancing exists to arrange for those forces to cancel between cylinders. The side thrust is why cylinder bores wear the shape they wear.

A mechanism this common repays being exact about. Nothing in this essay is new, and all of it follows from one square root that everyone knows is there.