← all notes

Unit 5 · Differential Kinematics and Statics

The Jacobian, explained - velocities, singularities, ellipses and forces

Units 3 and 4 were about positions. Unit 5 adds time (velocities) and forces. One matrix runs the whole unit: the Jacobian JJ. Once you can read it, most questions here are one matrix-vector product.

The four equations of the whole course, side by side:

XE=FK(q),q=IK(XE),X˙E=J q˙,τ=JTFEX_E = FK(q), \qquad q = IK(X_E), \qquad \dot X_E = J\,\dot q, \qquad \tau = J^T F_E

Positions forward and back, velocities forward (and back with J−1J^{-1}), forces (and back with (JT)−1(J^T)^{-1}). Using these both ways is important for the exam.

Where JJ comes from: the chain rule

The hand position depends on the joints, and the joints depend on time: XE=FK(q(t))X_E = FK(q(t)). To get the hand velocity, differentiate with the chain rule, outside times inside:

X˙E=ddtFK(q(t))=∂FK(q)∂q⏟J(q)  dqdt⏟q˙\dot X_E = \frac{d}{dt}FK\bigl(q(t)\bigr) = \underbrace{\frac{\partial FK(q)}{\partial q}}_{J(q)}\;\underbrace{\frac{dq}{dt}}_{\dot q}

Two kinds of derivative, two reasons:

Reading a Jacobian

J=[∂x∂q1∂x∂q2∂x∂q3∂y∂q1∂y∂q2∂y∂q3]J = \begin{bmatrix} \frac{\partial x}{\partial q_1} & \frac{\partial x}{\partial q_2} & \frac{\partial x}{\partial q_3} \\[4pt] \frac{\partial y}{\partial q_1} & \frac{\partial y}{\partial q_2} & \frac{\partial y}{\partial q_3} \end{bmatrix}

A 2×32\times3 Jacobian means 3 joints, 2-D workspace, so the robot is redundant.

Stacked arms vs plain math functions

For a real serial arm every link rides on the one before it. Turn q1q_1 and the whole arm swings. That is why the angles add up inside the trig:

x=a1cos⁡q1+a2cos⁡(q1+q2)+a3cos⁡(q1+q2+q3)x = a_1\cos q_1 + a_2\cos(q_1 + q_2) + a_3\cos(q_1 + q_2 + q_3)

So when you differentiate, q1q_1 shows up in every term (column 1 gets all three links), q2q_2 in the last two, q3q_3 only in the last one. Forgetting that is the classic mistake.

For the 2-link arm this gives

J=[−a1s1−a2s12−a2s12a1c1+a2c12a2c12],det⁡J=a1a2sin⁡q2J = \begin{bmatrix} -a_1 s_1 - a_2 s_{12} & -a_2 s_{12} \\ a_1 c_1 + a_2 c_{12} & a_2 c_{12} \end{bmatrix}, \qquad \det J = a_1 a_2 \sin q_2

But sometimes the exam just hands you a function like FK(q)=[sin⁡q1+sin⁡q2, cos⁡q1+cos⁡q2]TFK(q) = [\sin q_1 + \sin q_2,\ \cos q_1 + \cos q_2]^T. That is not a stacked arm, it is plain maths, and q1q_1, q2q_2 are independent. Differentiate exactly what is written. I started doing it right, thought “it can’t be that easy”, and changed it. It was that easy.

Singularities

A configuration is singular when JJ loses rank: some direction becomes impossible for the hand, like a knee locked straight. Checking for it is important for the exam, and there are three ways, fastest first:

  1. Look at the columns. A zero column, two equal columns, or one column being a combination of others (col 1 + col 2 = col 3, or 2 col1−4 col2=col32\,\text{col}_1 - 4\,\text{col}_2 = \text{col}_3) means singular. Zero calculation.
  2. Square JJ: det⁡J=0\det J = 0. Laplace expansion along the row with the most zeros.
  3. Non-square JJ: det⁡(JJT)=0\det(JJ^T) = 0. A rectangle has no determinant, but JJTJJ^T is square. This also works for square matrices, since det⁡(JJT)=(det⁡J)2\det(JJ^T) = (\det J)^2.

To find singular configurations, write det⁡J\det J in terms of qq and set it to zero. For the 2-link arm the algebra collapses with sin⁡Acos⁡B−cos⁡Asin⁡B=sin⁡(A−B)\sin A\cos B - \cos A\sin B = \sin(A - B) to sin⁡q2=0\sin q_2 = 0, so q2=kπq_2 = k\pi: arm fully stretched or fully folded. (If you get sin⁡(−q2)=0\sin(-q_2) = 0, you just subtracted in the other order. Same answer.)

When a joint does nothing

“Name a configuration where q1q_1 has no effect on the hand velocity” means: make column 1 all zeros. For the 2-link arm with equal links, column 1 is [−s1−s12, c1+c12]T[-s_1 - s_{12},\ c_1 + c_{12}]^T. Adding π\pi to an angle flips the sign of both sine and cosine, so with q2=πq_2 = \pi:

−sin⁡q1−sin⁡(q1+π)=−sin⁡q1+sin⁡q1=0,cos⁡q1+cos⁡(q1+π)=cos⁡q1−cos⁡q1=0-\sin q_1 - \sin(q_1 + \pi) = -\sin q_1 + \sin q_1 = 0, \qquad \cos q_1 + \cos(q_1 + \pi) = \cos q_1 - \cos q_1 = 0

Physically the arm is folded back on itself, the tip sits right on the axis of joint 1, and spinning joint 1 just spins the tip in place.

Same idea with rows: J=[00−2−1]J = \begin{bmatrix} 0 & 0 \\ -2 & -1 \end{bmatrix} has a zero first row, so the hand can move along yy but not at all along xx. That was a whole exam question and the answer is literally “parallel to yy, not along xx”.

Why near-singular is dangerous

Inverse differential kinematics, q˙=J−1X˙E\dot q = J^{-1}\dot X_E, needs J−1J^{-1}, and the 2×22\times2 inverse has det⁡J\det J in the denominator:

J−1=1det⁡J[d−b−ca]J^{-1} = \frac{1}{\det J}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}

With det⁡J=−0.001\det J = -0.001 that is a factor of 1000. Some hand directions still need normal joint speeds (like [−1,1]T[-1, 1]^T), others suddenly need [−1000,2000]T[-1000, 2000]^T rad/s. In real life that strips gears and burns out motors.

So when a question asks “is motion (a) or (b) recommendable?”:

  1. Compute det⁡J\det J and say it is close to zero, so the configuration is nearly singular.
  2. Compute q˙\dot q for both motions.
  3. The one with sane joint speeds is feasible, the one with exploding speeds is not recommendable.

Checking for (near-)singularity first is like checking the weather before sailing: it tells you which directions are safe before you command anything.

The manipulability ellipse

The ∥q˙∥=1\lVert \dot q \rVert = 1 assumption

This confused me at first: “what if I want to rotate 2π2\pi, isn’t the magnitude bigger than 1?” The dot is the answer. q˙\dot q is a speed, not an angle. ∥q˙∥=1\lVert\dot q\rVert = 1 is a speed budget: the motors share a total budget of 1 and we look at every way to spend it. In joint space that budget is a circle. Push the circle through JJ and it comes out as an ellipse of hand speeds. A bigger budget just scales the ellipse, the shape stays the same. The shape is the point.

The derivation, in four lines

Start from the budget, substitute q˙=J−1X˙E\dot q = J^{-1}\dot X_E, and use (AB)T=BTAT(AB)^T = B^TA^T:

q˙Tq˙=1  ⇒  (J−1X˙E)T(J−1X˙E)=1  ⇒  X˙ET(J−1)TJ−1X˙E=1  ⇒  X˙ET(JJT)−1X˙E=1\dot q^T\dot q = 1 \;\Rightarrow\; (J^{-1}\dot X_E)^T(J^{-1}\dot X_E) = 1 \;\Rightarrow\; \dot X_E^T (J^{-1})^T J^{-1}\dot X_E = 1 \;\Rightarrow\; \dot X_E^T (JJ^T)^{-1}\dot X_E = 1

and with E=JJTE = JJ^T that is X˙ETE−1X˙E=1\dot X_E^T E^{-1}\dot X_E = 1, the ellipse.

Computing and reading EE

For the 2-link arm with unit links at q=[π2,π2]Tq = [\tfrac{\pi}{2}, \tfrac{\pi}{2}]^T:

J=[−10−1−1],E=JJT=[1112]J = \begin{bmatrix} -1 & 0 \\ -1 & -1 \end{bmatrix}, \qquad E = JJ^T = \begin{bmatrix} 1 & 1 \\ 1 & 2 \end{bmatrix}

To interpret EE you need its eigenvalues and eigenvectors:

For a diagonal matrix it is free: the eigenvalues are the diagonal entries and the eigenvectors are the unit vectors. E=[9009]E = \begin{bmatrix} 9 & 0 \\ 0 & 9 \end{bmatrix} gives λ1=λ2=9\lambda_1 = \lambda_2 = 9, so both semi-axes are 9=3\sqrt 9 = 3 and the “ellipse” is a circle: the robot is equally quick in every direction.

Why “any vector works” for the eigenvectors there: (E−9I)v=0(E - 9I)v = 0 becomes the zero matrix times vv, which is zero for every vv. Since anything works, you pick the cleanest, [1,0]T[1,0]^T and [0,1]T[0,1]^T.

For a non-diagonal 2×22\times2 use λ2−tr⁡(E)λ+det⁡E=0\lambda^2 - \operatorname{tr}(E)\lambda + \det E = 0, then plug each λ\lambda into (E−λI)v=0(E - \lambda I)v = 0.

Comparing configurations

The size of the ellipse is w=det⁡Ew = \sqrt{\det E}. Bigger is better (further from a singularity, where the ellipse flattens to zero area). Example: det⁡E1=0.52\det E_1 = 0.52 gives w1≈0.72w_1 \approx 0.72, and det⁡E2=0.13\det E_2 = 0.13 gives w2≈0.36w_2 \approx 0.36, so configuration 1 wins.

Statics: τ=JTFE\tau = J^T F_E

Where it comes from

At rest, the power going into the joints equals the power coming out at the hand:

τTq˙=FETX˙E=FETJq˙\tau^T\dot q = F_E^T\dot X_E = F_E^T J\dot q

The step that looked like magic to me is “dropping” q˙\dot q. Move everything to one side: (τT−FETJ) q˙=0(\tau^T - F_E^T J)\,\dot q = 0. This has to hold for every possible q˙\dot q, since the motors can spin any way they like. The only row vector that gives zero against every possible vector is the zero vector. So τT=FETJ\tau^T = F_E^T J, and transposing gives

τ=JTFE\tau = J^T F_E

Using it

With JT=[−1−10−1]J^T = \begin{bmatrix} -1 & -1 \\ 0 & -1 \end{bmatrix} and a 5 kg load, FE=[0, 49.05]TF_E = [0,\ 49.05]^T N gives τ=[−49.05, −49.05]T\tau = [-49.05,\ -49.05]^T Nm. Both joints carry the load at the same 1 m lever arm, which is exactly what intuition says.

Going backwards (torques given, which force does the hand exert?) is FE=(JT)−1τF_E = (J^T)^{-1}\tau, one more 2×22\times2 inverse.