Counting and measuring mobility
There are two ways to find out how many degrees of freedom a mechanism has, and the interesting thing about them is how little they have in common.
One counts links and joints. It works on a sketch, needs no dimensions, and gives the same answer for every four-bar ever built regardless of the four lengths.
The other takes the constraint equations, differentiates them, and measures the rank of the resulting matrix. It needs every dimension, knows nothing about what a link is, and would give a different answer for a four-bar whose lengths happened to be degenerate.
Neither can be derived from the other, which is exactly why both are computed here.
The counting route
Grübler’s criterion is : three freedoms per link, less three for bolting one to the frame, less two for every joint that permits one relative motion and one for every joint that permits two.
Its virtue is that it is a statement about topology. Change every length in a four-bar and the answer stays 1. That makes it the right tool at the point in a design where the dimensions do not exist yet, and it is why mechanism synthesis begins with it.
Its inputs, however, are not facts. They are modelling decisions, and the formula is silent about which decision is right.
How many links is a rigid coupler carrying three pins? One. Written as two distance constraints between three points it looks like two bars pinned together, and gives a different count. Both descriptions produce the same motion.
How many joints is a pin where three links meet? Two, not one. Three links pinned coaxially can rotate independently of each other, and the rule is that a joint connecting k links counts as k − 1. Missing this is the commonest arithmetic error in the subject.
What kind of joint is a roller in a slot? One-freedom if it rolls without slipping, two-freedom if it can also slide. The drawing is identical.
Because of all that, the topology on this site is declared by each mechanism rather than inferred from its constraint list. An earlier version inferred it, and gave a slider-crank −2 degrees of freedom — a number no mechanism has, produced by counting a slider block as no link at all.
The measuring route
The solve that positions a mechanism writes every constraint as an expression that must equal zero, and forms the matrix of partial derivatives of those expressions with respect to the free coordinates. That is the constraint Jacobian, and it is needed for Newton–Raphson whether or not anyone is interested in mobility.
Its rank is the number of linearly independent constraints — how many freedoms are genuinely removed, as opposed to how many equations were written. Mobility is then the number of free coordinates minus the rank.
For the four-bar: four free coordinates, three independent constraints once the input is replaced by the link it stands for, so mobility 1. The number came out of arithmetic on a matrix of derivatives, with nothing anywhere in the calculation that knows what a bar is.
The independence is the point. There is no path by which an error in the topology count could propagate into the rank measurement, or the reverse.
Where the two must be made to line up
One subtlety needs stating, because getting it wrong makes the comparison meaningless in a way that looks like a discovery.
The driving input is a constraint too — it pins the crank pin to a particular angle — so a mechanism with its input applied has mobility 0 by construction. To compare against Grübler, which describes the mechanism without its input, the driving constraint has to be removed.
Removing it is not the same as deleting it. A crank constraint fixes a joint’s position, which encodes the input angle and the link; deleting it removes the link as well. That gave a four-bar two degrees of freedom instead of one, and the disagreement looked exactly like Grübler being wrong when it was the measurement that was. The fix is to substitute the bar the crank stands for.
That kind of error is the reason to be suspicious of a disagreement before celebrating it.
Rank is a decision about zero
In exact arithmetic, rank is the number of nonzero pivots after elimination. In floating point nothing is exactly zero, so rank needs a threshold, and a threshold is a choice.
This site uses a relative one — scaled by the largest entry — and reports how close the decision was. The gap is the ratio between the smallest accepted pivot and the largest rejected one. A gap in the millions means the rank is unambiguous. A gap near one means the matrix is nearly singular and the answer depends on where the line was drawn.
The second case is not a numerical embarrassment to be tuned away. It is what a mechanism looks like at a singular configuration, and reporting the gap is how a figure can say whether it was near one rather than pretending the question does not arise.
What each route can see
Laying it out plainly is the most useful thing in this essay.
| Grübler | Jacobian | |
|---|---|---|
| needs dimensions | no | yes |
| needs the topology classified | yes | no |
| sees redundant constraints | no | yes |
| works before the design exists | yes | no |
| depends on a tolerance | no | yes |
| gives one answer for a whole family | yes | no |
Neither column is better. The formula is the right tool early and the measurement is the right tool once there is something to measure, and the cases where they part company are the ones worth knowing about.
The disagreement, and what it means
There is exactly one row of the audit where the two differ, and the pattern generalises: Grübler is wrong precisely when a constraint is redundant because of the dimensions.
Three bars between two frames, all parallel and all the same length, is the standard example. Any two of them fix the motion completely; the third writes down constraint equations that are already implied. Grübler counts the third bar’s joints and subtracts for them, and arrives at zero. The Jacobian finds that its rows are linear combinations of rows already present, does not count them twice, and arrives at one.
The mechanisms in this family are not curiosities. They are common, useful, and built on purpose, and the redundancy is usually there for stiffness or for load sharing rather than by mistake.
What this does not settle
Mobility is a count, and a count is not a guarantee.
A mobility of one does not mean the mechanism can move from where it is. A non-Grashof four-bar has mobility 1 and cannot turn through a full revolution; it rocks between dead centres. Mobility is a statement about the constraints at a configuration, and the range of motion is a different question, answered by sweeping.
It does not mean the mechanism can be assembled at all. Four bars whose longest exceeds the sum of the other three has mobility 1 by the count and no configurations whatever. The solver’s answer to that is to refuse every position, which is the correct one.
It says nothing about how well the mechanism works. The transmission angle is where that question lives, and it depends on the dimensions in a way that mobility does not.
The general shape of the habit
Two independent routes to one number is not a technique specific to mobility. It is the pattern this whole site is built on, because it is the only arrangement in which agreement is evidence rather than repetition.
The same shape appears in Grashof’s condition predicted and then swept, in a gear’s ratio derived from the base radii and tested on the drawn flank, and in an epicyclic ratio computed two ways. In every case one route knows the formula and the other knows the object, and the interesting output is not the agreement but the occasional failure of it.
The joints the count has to be told about
Every mobility count begins by classifying the joints, and that classification is where most errors enter — before any arithmetic happens.
In the plane a pin removes two freedoms and a slide removes two, so the two are interchangeable as far as the count goes and completely different as far as the mechanism goes. A rolling contact without slipping removes two. A contact that can slip removes one. A pin-in-slot removes one.
The one-freedom-removed joints are the higher pairs, and the arithmetic treats them differently — which is why Grübler’s criterion has two terms rather than one, and why a cam-and-follower has to be counted as a higher pair unless the roller is modelled explicitly, in which case it becomes two lower pairs and an extra link and the count comes out the same.
That last equivalence is a good check on whether a count has been done honestly. The same physical mechanism modelled two ways must give the same mobility, and if it does not, one of the two models has a joint misclassified.
The trap is that classification is a modelling decision and not an observation. A gear mesh is a higher pair if the teeth are ignored and something else entirely if they are not. A pin with clearance is a pin at the accuracy of this analysis and two freedoms at the accuracy of a vibration analysis. What the count reports depends on what the counter decided the machine was, which the rank test does too — but the rank test at least reports its decision as a matrix that can be inspected.
Why the crank is substituted rather than removed
The count implemented here has a detail worth stating, because getting it wrong produced a wrong answer that looked plausible.
A crank in this library is a constraint that fixes both the length of a link and its angle: it drives the mechanism. For a mobility count the driving part must be set aside — mobility is the number of inputs the mechanism needs, so counting it with an input already applied answers a different question.
The first implementation removed the crank constraint entirely. That deleted the link as well as the drive, and a four-bar with one link missing reported two degrees of freedom, which is the right answer to the wrong mechanism.
The fix is to substitute a plain bar for the crank: keep the length constraint, drop the angle constraint. The link is still there, the drive is not, and the four-bar reports one.
That is the kind of error that is invisible in a count and visible in a figure, and this site had it the other way round — the figures were right and the count was wrong — which is why both routes exist. Two methods that agree are evidence; one method is a claim. The same reasoning caught a reversed velocity solution and a circular gear test, and it is the only habit on this site that has caught bugs in every subject it has been applied to.
When the count is the right tool
Most of this essay argues for the measured route, so it is worth stating plainly where counting wins, because it usually does.
Design sketching. Grübler’s criterion is arithmetic on two integers and can be done on a napkin. A proposed mechanism that counts to zero when one degree of freedom was wanted has a problem worth finding before any coordinates exist, and the count finds it in seconds.
Topology search. Enumerating candidate mechanisms — how many links, arranged how — is a combinatorial problem in which each candidate must be screened cheaply. The count screens; the rank test would require choosing dimensions for every candidate, which is the expensive part of the design.
Communication. “A four-bar has one degree of freedom” is a true and useful thing to say, and saying “the constraint Jacobian has rank seven at every configuration sampled, with a singular-value gap of six orders” is not an improvement for most purposes.
The count’s weakness is precisely bounded: it assumes the constraints are independent, which is true for a mechanism whose dimensions are in general position and often false for one whose dimensions were chosen. So the practical rule is to count first, and to measure when the mechanism has parallel links, equal lengths, symmetry or concurrency — that is, whenever the design has put dimensions in special position on purpose.
Measuring also answers questions the count cannot pose at all. Where does the mobility change? What direction is the extra freedom? Is this configuration near a singularity? Those are the questions that matter once a mechanism exists, and they are all readings of a Jacobian at a configuration rather than of a formula about a family.