Two routes to a Jacobian
Assumes The chain that does not close and Every motion is a screw.
Everything this field says about velocity, singularity, redundancy and error comes out of one matrix. It is worth building carefully, and it is worth building twice.
The construction is short. Column i of an open chain’s Jacobian is joint i’s home screw, carried by the product of the joints in front of it. For a revolute joint a screw is an axis — a line in space, with zero pitch — so the matrix is a list of lines, and the lines are drawn in every figure in this field.
That description is unavailable elsewhere on this site. A four-bar’s Jacobian is the derivative of its closure equations — a matrix of partial derivatives with no picture attached. An arm’s is geometry, and the difference shows up immediately: a rank deficiency here is visible, as two lines coinciding or three lines meeting, rather than as a determinant that has gone small.
The other route
A second computation, sharing no arithmetic with the first: perturb one joint by either way, take the tool’s pose before and after, and read off the twist that carries one to the other as the logarithm of the relative transform, divided by . No screw is ever mentioned. The forward map is treated as a black box that turns six numbers into a rigid transform.
Over twelve configurations of four arms — the planar three-link, the six-joint elbow, the seven-joint shoulder-elbow-wrist and the SCARA — the two agree to in the worst entry of any column. That is the noise floor of a central difference at , and it is what agreement looks like.
They did not agree at first, and the disagreement is the most useful thing in this essay.
Five parts in a hundred thousand
The first run reported a worst-case difference of .
That is not a tolerance question. A central difference has an error of order times a third derivative, which at is around ; a rounding-driven error is around . Five parts in a hundred thousand is seven orders of magnitude too large to be either, so one of the two routes was wrong, and the assertion could not say which.
The fault was in neither. It was in logSE3, which converts a rigid transform to the twist that generates it, and which every spatial loop on this site has used since the expansion phase. Its translation part carries a correction factor whose coefficient is written
and whose value as is . Read it as a floating-point expression rather than as algebra and it is a cancellation nested inside a cancellation: the bracket subtracts from one a ratio that tends to one, and the ratio’s denominator is , which at small is itself computed by subtracting two numbers that are nearly equal.
The arithmetic is easy to follow and worth following. At , is about and carries an absolute error of about , so a relative error of . That error passes straight into the ratio, and the bracket — whose true value is — comes out as roughly instead. Divided by , comes back at where it should be . Below the denominator underflows to zero outright and is NaN.
The guard against all this fired only below — past the underflow, and four orders of magnitude past the point where the answer had stopped being right.
Why nothing had noticed
The window where the coefficient is wrong runs from about up to about in the rotation angle, and this site had never asked for a logarithm in it.
A loop’s Newton residual starts at and lands at in three or four steps. It crosses the bad window between two iterations rather than stopping in it, and a step taken with a slightly wrong linearisation still converges — Newton is forgiving about the direction of a step as long as it is roughly right, and the correction term this coefficient scales is second order in the residual anyway. Six phases of figures are unaffected, and that was checked rather than assumed: the built output is byte-identical before and after the repair.
A finite difference lands in the window every single time. A difference step is a rotation of a few microradians. The moment this field asked its first question, the bug had nowhere to hide.
That is a pattern worth naming, because it is the third time this site has met it. A defect can be invisible not because it is small but because nothing has ever evaluated the function in the region where it is wrong. The ticks() helper returned an empty array for a descending domain and two figures in the fleet had carried no gridlines since the day they were drawn. The logSO3 branch guard fired near zero as well as near π and reported the right magnitude about an invented axis. Now this. In every case the repair was a line, the finding was the region, and what exposed it was a new caller with different habits.
The fix is in lib/spatial.js, beside the function, and it is a series expansion — — used below , where the closed form’s error and the series’ truncation are both about . The rule about where a fix belongs is not an abstraction on this site; it is the difference between one repaired function and a workaround in one figure with the same bug live everywhere else.
Which rows, and about which point
There is a second trap in this matrix and it cost an afternoon.
A twist is a screw, and a screw’s linear part is the velocity of the point of the body currently at the origin — not of the tool. To get the tool’s velocity the angular part has to be crossed with the tool’s position and added on. The Jacobian therefore comes in two forms that differ in three of their six rows, and both are correct about different questions.
The inverse solver mixes them if nobody is careful. Its error term is naturally written as the logarithm of the pose error, which is a screw about the origin; its Jacobian is naturally written with the linear rows referred to the tool, because that is what a position task means. Combine those two and the Newton step is not the linearisation of anything: it converges, slowly, to a pose that is not the one asked for, and the failure looks exactly like a stiff problem.
The repair is to state the error in the same terms as the matrix — an angular part from the logarithm of the relative rotation, and a linear part that is the straight-line displacement of the tool point. It is not more work; it is the same work with the two halves matched. And it is the kind of mistake that only announces itself if something independent checks the answer, which is why the inverse solutions in this field are all run forward again before they are drawn.
Selecting rows is the other half of the same idea. A planar arm controls three quantities, a SCARA four, a six-joint arm six; asking any of the first two for all six rows reports a rank deficiency that is a fact about the question rather than about the mechanism. So the task states its rows and everything downstream — the singular values, the null space, the inverse solve — uses the same selection.
The condition number is not a property of the arm
One more warning belongs here, because the singular values of this matrix are about to be used for several arguments and one thing must not be asked of them.
The Jacobian mixes units. Its top three rows turn joint rates into an angular velocity, in radians per second; its bottom three turn the same rates into a linear velocity, in metres per second. A singular value is therefore a mixture of the two, and the ratio of the largest to the smallest — the condition number, which is the number people quote — depends on the length in which the arm is measured.
Measure it. The arm above, at one posture, has singular values running from 2.407 to 0.367, a condition number of 6.55. Write the identical arm in millimetres instead of metres and the singular values run from 1828 to 0.565, a condition number of 3234. Same arm, same posture, same physics, a factor of five hundred in the number.
What does not change is the rank: 6 in both, and 5 at each of the three singular postures in both. A rank is a count of independent directions and no rescaling of a column or a row can alter it, which is the same argument the practice field made about a seating fixture — where it also had to be checked rather than assumed.
So the rules this field works under are: a rank is quoted; a smallest singular value is quoted with its units and its arm; a condition number is compared only between postures of the same arm in the same units. The essays that follow keep to that, and the one number that crosses between arms is a fitted exponent, which is dimensionless.
The same caution applies to the two forms of the matrix. Writing the twist in the tool’s own frame rather than the base’s — the body Jacobian — gives a matrix related to this one by an adjoint, which is not an orthogonal transformation, so the singular values differ there too. The rank does not.
Two singular sets, and only one belongs to the arm
Now the distinction this essay exists for.
A singularity of the mechanism is a configuration at which the Jacobian loses rank: the tool cannot be moved in some direction, by any combination of joint rates, at that posture. It is a property of the arm and of nothing else, and no change of coordinates removes it.
A singularity of a parameterisation is a place where the numbers chosen to describe an orientation stop being able to describe its rate of change. Three Euler angles are the standard case: the map from angle rates to angular velocity is a matrix whose determinant is , so at it has rank two and one angular velocity has no representation. Nothing has happened to the body.
The two are told apart by measuring both at once. At the joint values
the arm’s Jacobian has rank 6 and its smallest singular value is 0.502 — this arm’s condition number there is about as good as it gets. The z-y-z rate matrix at the same posture has rank 2, at a middle angle of . A controller working in those angles would report an infinite demand; the arm is standing there perfectly capable of moving in every direction at once.
Finding that posture took a search rather than a guess, and the reason is worth recording. For this arm, with the fourth joint anywhere but zero, the tool’s axis can only line up with the base’s when the fifth joint is at zero — which is the wrist singularity. The two events coincide almost everywhere, and a posture picked casually to show the distinction demonstrates nothing at all. They separate only along the surface where the fourth joint reads zero, and that is where the search found them.
What agreement between two routes is worth
It is worth being precise about what the check at the top of this essay establishes, because “two routes agree” is a phrase this site uses constantly and it does not always mean the same thing.
Both routes here compute the same derivative of the same forward map. If the forward map were wrong — if a joint axis were entered in the wrong direction — both would be wrong together and both would agree beautifully. So the agreement does not establish that the arm is the arm intended. It establishes that the screw construction is a correct derivative of the product of exponentials, which is a statement about the algebra rather than about the machine.
That is still worth having, and this essay is the evidence: the check caught a defect neither route contained, in a shared function, by being the first thing on the site to evaluate it in a particular range. But the other half of the discipline has to come from somewhere else, and in this field it comes from the round trip — an inverse solve’s answer is run forward and compared with what was asked for, which does test the map itself.
The general form is worth stating once. Two computations of one quantity test the arithmetic between them. A computation and a measurement of the same quantity by a different definition test the model. The lever-arm figure above is the second kind: the column’s linear part is computed from screws, and the perpendicular distance from the tool to the axis is a length taken off the geometry, and they agree to because ω × r is that perpendicular. Had a joint’s axis been entered wrongly, the two would have parted.
The lines are the argument
There is a reason this field draws the axes in every scene rather than only in the singularity essays.
At a wrist singularity the fourth and sixth axes are the same line, and two identical columns are a rank deficiency that can be seen. At an elbow singularity the arm is straight and the two axes that would move the wrist outward have become parallel with nothing between them. At a shoulder singularity the wrist centre sits on the surface the base axis cannot reach past, and the two ways of facing it have merged.
Each of those is a sentence about lines. Written as a determinant, all three are “the matrix went singular”, which is true and says nothing about which direction was lost or why.
Where this goes
Three things are now available that were not before, and they are the next three essays’ subjects.
The singular values of this matrix say how fast the tool can be moved in each direction for a bounded joint rate, and their smallest is how close the arm is to losing a direction entirely. The null space says which joint motions do nothing at all, which is empty for a six-joint arm and one-dimensional for a seven-joint one. And the columns say what an error at each joint costs at the tool, which turns out to be a length measurable off the drawing with a ruler.
All three are readings of one matrix, computed one way and checked another.
It is worth naming what the agreement of the two routes cannot see, because a check is worth exactly its independence. One route builds the Jacobian from the joint screws; the other differences the forward kinematics. Those share the forward map itself — the product of exponentials — and nothing else. So a defect in the forward map is invisible here: both routes would be wrong together, one because it differenced a wrong function and the other because the screws it read are the same screws the product uses. What the comparison does cover is everything downstream of the map, which is where the defect actually was. The lesson is the ordinary one about redundancy and it is worth stating in its exact form: two routes check what they do not share, so the useful question about any pair of routes is what is common to both — and the answer here is one function, which therefore needs a check of a different kind entirely.
What this makes readable
Essays that name this one as a prerequisite.
- A straight line at constant speed One path to the tool
- Where the arm loses a direction One path to the tool
About the same objects
Not linked from either essay — found by the objects both name.
- Locked, and still moving jacobian · rank · screw · singularity
- A straight line at constant speed jacobian · serial manipulator · singularity
- Bennett, and the condition that moves it rank · screw · twist
- Pin the tool and it is a loop open chain · rank · singularity
- The distance between two poses screw · serial manipulator · twist
- The formula is repaired by the thing it replaced rank · screw · twist
What links here
The 8 of 14 essays linking to this one that name the most of the same objects.
- Four numbers or a screw One path to the tool
- The wrist is three joints and one point One path to the tool
- Where the arm loses a direction One path to the tool
- The freedom that does nothing One path to the tool
- The instrument that is not a derivative What a joint is
- The test is a program, not a rank Contacts that only push
- A machine with one dyad in it The chain before the lengths
- An offset trades the rise for the return Prescribed motion
The objects this essay names
Each one links to every other essay that touches it.
Euler anglesFinite differenceGimbal lockJacobianOpen chainRankScrewSerial manipulatorSingularityTwistVelocity field