Linear Algebra · Theory · M8
M8-T6 — Jacobian Inverse and Pseudoinverse
Resolved-rate control is a linear solve at every tick. Which solve you use depends on whether J is square, wide or nearly singular.
Differential kinematics gives the hand velocity from joint speeds. Control needs the reverse: given a desired hand velocity, find joint speeds. The answer is the Jacobian inverse when it exists, and the Moore-Penrose pseudoinverse of Module 6 when it does not. This lesson shows how each behaves on a real arm and why checking the singular values first matters.
Learning objectives
After this lesson, you should be able to:
- Solve ṗ = J q̇ by J⁻¹ for a square nonsingular Jacobian and verify the result.
- Use the pseudoinverse J⁺ = Jᵀ(JJᵀ)⁻¹ for a redundant arm and show that it gives the minimum joint-speed solution.
- Contrast the transpose, inverse and pseudoinverse methods and their costs and failure modes.
- Close the loop on position error to turn a velocity solver into an inverse-kinematics controller.
Introduction and motivation
A seven-joint arm must move its gripper along a path. At each control tick the planner supplies a desired hand velocity, and the controller must turn it into seven joint speeds. There are infinitely many solutions; which one should it take? The shortest one is smooth, uses the least motion and is exactly what the pseudoinverse delivers. For a six-joint arm the same step uses the plain inverse, until the arm approaches a singularity.
The intuition
The equation J q̇ = ṗ is a linear system, so Modules 3 and 6 tell us everything. Square and invertible: one answer. More joints than task dimensions: many answers, so choose the shortest. Too few effective directions: no exact answer, so choose the best fit. The pseudoinverse covers all three in one formula, which is why it is the workhorse of resolved-rate control.
Interactive figure. A three-joint planar arm whose hand stays fixed while a null-space slider rearranges the joints. The readout shows the Jacobian, its null direction and the hand drift. This figure needs JavaScript to be interactive.
Geometric and physical interpretation
Geometric view. The solutions of J q̇ = ṗ form an affine subspace: one particular solution plus the whole null space of J. The pseudoinverse solution J⁺ṗ is the point of that subspace closest to the origin, i.e. the one perpendicular to the null space, and it lies in the row space of J. Physical view. Minimum joint-speed means minimum kinetic-like effort in a weighted sense, so the motion is smooth and avoids needless self-motion; the leftover freedom is kept for secondary tasks (null-space lesson).
The mathematics
- J
- the m × n Jacobian at the current configuration.
- J⁻¹
- the ordinary inverse (square, nonsingular).
- J⁺
- the Moore-Penrose pseudoinverse (Module 6).
- ṗdes
- the desired hand velocity, possibly plus a correction K(pdes − p) from position error.
Square, nonsingular
q̇ = J⁻¹ ṗ (n = m, det J ≠ 0)
What it means. The unique solution. Cost is a linear solve; the condition number of J measures how much noise in ṗ is amplified in q̇.
Redundant: the pseudoinverse
q̇ = J⁺ ṗ = Jᵀ (J Jᵀ)⁻¹ ṗ (n > m, rank J = m)
What it means. Among all q̇ with J q̇ = ṗ, this one has the smallest ‖q̇‖. Compute it with the SVD, J⁺ = V Σ⁺ Uᵀ, rather than the explicit formula.
Closing the loop
q̇ = J⁺ ( ṗdes + K (pdes − p) )
What it means. The correction term pulls the hand back toward the desired position, removing the drift that integrating velocities alone would cause.
Square and nonsingular: J⁻¹. Redundant: J⁺ gives the shortest joint-speed vector. Always add position feedback, and check the singular values before inverting.
Step-by-step derivation: the minimum-norm solution and the transpose method
- Solution set. If
q̇₀is any solution ofJ q̇ = ṗ, then every solution isq̇₀ + zwithz ∈ null(J)(Module 3). For a redundant arm the null space has dimensionn − m ≥ 1. - Shortest solution. Minimise
½‖q̇‖²subject toJ q̇ = ṗ. With a Lagrange multiplier λ:q̇ − Jᵀλ = 0, soq̇ = Jᵀλlies in the row space. - Solve for λ. Substitute into the constraint:
J Jᵀ λ = ṗ, soλ = (JJᵀ)⁻¹ṗ(JJᵀ is invertible when J has full row rank) andq̇ = Jᵀ(JJᵀ)⁻¹ ṗ = J⁺ṗ. - Check with the SVD.
J = UΣVᵀgivesJ⁺ = VΣ⁺UᵀandJᵀ(JJᵀ)⁻¹ = VΣᵀUᵀ (UΣΣᵀUᵀ)⁻¹ = VΣᵀ(ΣΣᵀ)⁻¹Uᵀ = VΣ⁺Uᵀ✓ (Module 6). - Jacobian transpose method. Instead of inverting, move along
q̇ = α Jᵀ ewheree = p_des − p. This decreases½‖e‖²becaused/dt ½‖e‖² = −eᵀ J q̇ = −α‖Jᵀe‖² ≤ 0. It needs no inverse and never blows up at a singularity, but converges slowly. - Cost. The inverse of a 6 × 6 matrix or an SVD of a 6 × 7 matrix is microseconds; the cost matters only for very large systems or kHz loops on small processors.
- Feedback. An open-loop velocity command integrates errors (the linearisation and the numerical integration both drift). Adding
K(p_des − p)makes the position error obeyė = −K e, an exponential decay with rate K when J⁺J behaves as identity on the task space.
Weighted pseudoinverse. To prefer some joints over others (a big shoulder over a light wrist) minimise q̇ᵀ W q̇ instead: q̇ = W⁻¹Jᵀ(J W⁻¹ Jᵀ)⁻¹ṗ. It is the weighted least squares of Module 5 applied to velocities.
When it fails. If J loses rank (singularity) JJᵀ becomes singular and J⁺ jumps or explodes; the next two lessons handle it. Even for full rank, a small σ gives enormous q̇ for a hand velocity along the weak direction.
A worked example: square inverse, pseudoinverse and the transpose
- Square case.
J = [[−0.8, −0.8], [1.1, 0]](the two-link arm atq = (0°, 90°)),det = 0.88,J⁻¹ = (1/0.88)[[0, 0.8], [−1.1, −0.8]]. Forṗ = (0.4, 0.55):q̇ = (0.8·0.55, −1.1·0.4 − 0.8·0.55)/0.88 = (0.5, −1.0)rad/s. Check:J q̇ = (−0.4 + 0.8, 0.55) = (0.4, 0.55)✓. - Redundant case. Three-link arm, links 1.1, 0.8, 0.7 at
q = (0°, 90°, 0°):J = [[−1.5, −1.5, −0.7], [1.1, 0, 0]]. For the sameṗ = (0.4, 0.55), the second row givesq̇₁ = 0.5; the first row then needs−1.5 q̇₂ − 0.7 q̇₃ = 1.15. - Pseudoinverse solution.
q̇ = J⁺ṗ = (0.5, −0.630, −0.294), with‖q̇‖ = 0.856. Check:−1.5·0.5 − 1.5(−0.630) − 0.7(−0.294) = −0.75 + 0.944 + 0.206 = 0.400✓. - Another valid solution.
q̇ = (0.5, −0.767, 0)(only the first two joints help the wrist) also satisfies the equation, but‖q̇‖ = 0.915 > 0.856, so the pseudoinverse solution is indeed shorter. - The null space. The difference of the two solutions lies in the null space, spanned by
n = (0, −0.423, 0.906)(for exampleJ n = 0since the first row gives0.634 − 0.634 = 0). - Transpose method. For the square arm with position error
e = (0.1, 0):Jᵀ e = (−0.08, −0.08). A stepq̇ = α Jᵀ ewith α = 1 moves the hand byJ q̇ = (0.128, −0.088). Its dot product with e is positive (0.0128), so the error shrinks to first order, but the hand also drifts sideways: the direction is only roughly right, which is why the method converges slowly.
Robotics application
Manipulators. Resolved-rate controllers in industrial and collaborative arms run q̇ = J⁺(ṗ_des + K e) at 1 kHz; the library routines (KDL, MoveIt, Pinocchio) use the SVD or damped inverse underneath.
LiDAR scan matching. The Gauss-Newton step Δx = (JᵀJ)⁻¹Jᵀr is the pseudoinverse of the tall Jacobian applied to the residual, the left-inverse case of Module 5; see nonlinear least squares and ICP fundamentals.
UAVs. A drone with a manipulator uses the stacked Jacobian of body and arm; control allocation among redundant rotors uses a pseudoinverse of the allocation matrix; see fault detection, isolation and recovery for redistributing control after a motor failure.
Mobile robots and SLAM. Whole-body controllers for mobile manipulators use J⁺ to coordinate base and arm; pose-graph optimisers solve for state updates by pseudoinverse-like steps when the system is gauge-deficient; see pose graphs.
Engineering implications and limitations
Practical rules
- Compute J⁺ with the SVD (or a QR / damped solve), never with explicit inverses of JJᵀ. The SVD exposes the singular values and handles rank loss gracefully.
- Check σmin before inverting. If it is below a threshold, switch to damping or truncation; do not discover the singularity from an exploding joint speed.
- Always include position feedback. Open-loop velocity integration drifts, and singular transits make the drift large.
- Saturate and scale. If any joint speed exceeds its limit, scale the whole vector q̇ down uniformly so the hand direction is preserved.
- Scale mixed units. Position (m) and orientation (rad) rows should be weighted, otherwise “shortest” q̇ favours the wrong rows.
- Keep the secondary freedom. For redundant arms the formula
J⁺ṗ + (I − J⁺J)zkeeps all solutions available (null-space lesson).
Limits
The pseudoinverse is a local, instantaneous solution. It does not avoid joint limits or obstacles, and a path computed by repeated J⁺ steps may end in different configurations for the same hand pose (it is not a function of the hand pose alone).
Common misconceptions
“The pseudoinverse solves J q̇ = ṗ exactly.”
It does so only if ṗ is in the column space of J. Otherwise it gives the best least-squares fit.
“A redundant arm has no solution, or exactly one.”
It has infinitely many; the pseudoinverse picks the shortest, not the only one.
“J⁺ṗ is the best solution for every purpose.”
It minimises ‖q̇‖ only; it ignores joint limits, obstacles and unit scaling.
“If J is invertible there is no risk.”
Near-singular J gives enormous q̇ for some ṗ even when det ≠ 0.
Engineering takeaways
- Square nonsingular J: q̇ = J⁻¹ṗ is the unique solution.
- Redundant J (wide): q̇ = J⁺ṗ = Jᵀ(JJᵀ)⁻¹ṗ is the minimum-norm solution among infinitely many; compute it via the SVD.
- The Jacobian transpose method needs no inverse and is safe at singularities but slow.
- Add position feedback q̇ = J⁺(ṗdes + Ke) to cancel drift; saturate by uniform scaling.
- Check the singular values first; near singularities switch to damping.
References and further reading
Primary papers and authoritative documentation.
- Modern Robotics (Lynch and Park), free preprint: chapter 6.2, numerical inverse kinematics: Newton-Raphson and the pseudoinverse
- Buss, Introduction to Inverse Kinematics with Jacobian Transpose, Pseudoinverse and Damped Least Squares: Jacobian transpose, pseudoinverse and damped least-squares methods for inverse kinematics; the site did not load when we last checked
- Boyd and Vandenberghe, Introduction to Applied Linear Algebra (VMLS): least-norm solutions and the pseudoinverse; the site did not load when we last checked
- MIT 18.06SC Linear Algebra (OCW): lecture on the pseudoinverse and least squares
Knowledge check
Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
For J = [[1, 0, 1], [0, 1, 1]] find the minimum-norm q̇ for ṗ = (2, 2).
Explanation
JJᵀ = [[2, 1], [1, 2]], (JJᵀ)⁻¹ṗ = (1/3)[[2, −1], [−1, 2]](2, 2) = (2/3, 2/3). q̇ = Jᵀ(2/3, 2/3) = (2/3, 2/3, 4/3). Check: J q̇ = (2/3 + 4/3, 2/3 + 4/3) = (2, 2) ✓, norm √(4/9 + 4/9 + 16/9) = 1.633.
Question 2
Show that adding (1, 1, −1) to the answer above still solves the equation and is longer.
Explanation
(1, 1, −1) is in the null space: J(1, 1, −1) = (1 − 1, 1 − 1) = (0, 0). The new vector (5/3, 5/3, 1/3) has norm √(51)/3 = 2.380 > 1.633, as the minimum-norm property requires.
Question 3
A controller using q̇ = J⁻¹ṗ demands 40 rad/s at one joint as the arm stretches out. What happened and what should be done?
Explanation
The arm is near a singularity: σmin of J is small, so the weak hand direction needs enormous joint speeds. Detect it from σmin (or det J) and switch to damped least squares or limit the speed by uniform scaling; do not rely on saturation of single joints, which would change the hand direction.
What’s next
Both the inverse and the pseudoinverse have a weak spot: configurations where the Jacobian loses rank. The next lesson finds those singularities, explains what the arm cannot do there, and measures how close it is to them.
Related content
Nothing below is required to finish this lesson.
- BeforeM8-T5: Differential Kinematics
Relate joint velocities to hand velocity with the Jacobian, and joint torques to hand forces with its transpose.
- BeforeM6-T7: The Moore-Penrose Pseudoinverse
Build the pseudoinverse from the SVD and use it to solve rank-deficient and underdetermined systems.
- LabM8-L1: Interactive Robotic Arm and Inverse Kinematics
Drive a two-link arm to targets by inverse kinematics, watch the pseudoinverse blow up near a singularity, and fix it with damping.
Get notified when the next lesson and new labs are released.
One email per new lesson or lab.