Jacobian Matrix
Table of Contents
As shown in Homogeneous Transformation Matrices, the spatial configuration of the end effector can be expressed as
$$ T = \begin{bmatrix}R^n_0& \mathbf p^n_0\\ \mathbf 0& 1\end{bmatrix} = A^1_0A^2_1\cdots A^n_{n - 1}. $$Hence, angular velocity can be obtained from the time derivative of $R^n_0$1 (see Angular Velocity), giving
$$ \begin{aligned} \omega^n_0 &= \omega^1_0 + R^1_0\omega^2_1 + R^2_0\omega^3_2 + \cdots R^{n - 1}_0 \omega^n_{n-1}\\ &= \mathbf k \frac{d \theta_1}{d t} + R^1_0 \mathbf k \frac{d\theta_2}{dt} + R^2_0\mathbf k \frac{d\theta_3}{d t} + \cdots R^{n - 1}_0 \mathbf k \frac{d\theta_n}{dt} \\ &= \begin{bmatrix}\mathbf \rho_1k,& \rho_2R^1_0\mathbf k,& \rho_3R^2_0\mathbf k,& \cdots,& \rho_nR^{n - 1}_0\mathbf k \end{bmatrix}\dot{\mathbf q} \end{aligned} $$where $\dot {\mathbf q} = \begin{bmatrix}\frac{d\theta_1}{dt},& \frac{d\theta_2}{dt},& \frac{d\theta_3}{dt},& \cdots,& \frac{d\theta_n}{dt}\end{bmatrix}^T$. $\rho_i = 1$ if the $i$th joint is revolute, otherwise $\rho_i = 0$.
In the following, linear velocity is derived from the time derivative of $\mathbf p^n_0$1, and the Jacobian matrix is constructed from the angular and linear velocities.
Linear velocity
Using the chain rule, the end effector’s linear velocity can be expressed as
$$ \begin{aligned} \dot {\mathbf p}^n_0 &= \sum^n_{i = 1} \frac{\partial {\mathbf p}^n_0}{\partial q_i}\dot q_i \\ &= \begin{bmatrix}\frac{\partial \mathbf p^n_0}{\partial q_1},& \frac{\partial \mathbf p^n_0}{\partial q_2},& \frac{\partial \mathbf p^n_0}{\partial q_3},& \cdots,&\frac{\partial \mathbf p^n_0}{\partial q_n}\end{bmatrix}\dot{\mathbf q} \end{aligned} $$where $\dot {\mathbf q}$ depends on the joint types. We therefore start from the general expression
$$\mathbf p^n_0 = R^i_0\mathbf p^n_i + R^{i-1}_0 {\mathbf p}^i_{i-1} + {\mathbf p}^{i - 1}_0$$with motion produced by prismatic or revolute joints, derived from
$$ \begin{aligned} T &= A^{i - 1}_0A^{i}_{i - 1}A^n_{i} \\ &= \begin{bmatrix}R^{i-1}_0& \mathbf p^{i - 1}_0 \\ \mathbf 0& 1\end{bmatrix} \begin{bmatrix}R^{i}_{i - 1}& \mathbf p^{i}_{i - 1} \\ \mathbf 0& 1\end{bmatrix} \begin{bmatrix}R^{n}_{i}& \mathbf p^{n}_{i} \\ \mathbf 0& 1\end{bmatrix} \\ &= \begin{bmatrix}R^{i}_0& R^{i-1}_0\mathbf p^i_{i-1} + \mathbf p^{i - 1}_0 \\ \mathbf 0& 1\end{bmatrix}\begin{bmatrix}R^{n}_{i}& \mathbf p^{n}_{i} \\ \mathbf 0& 1\end{bmatrix} \\ &= \begin{bmatrix}R^n_0& R^i_0\mathbf p^n_i + R^{i-1}_0\mathbf p^i_{i-1} + \mathbf p^{i - 1}_0 \\ \mathbf 0& 1\end{bmatrix}. \end{aligned} $$First, consider the $i$th joint to be prismatic. The rotation matrix and position vector of the $(i-1)$th frame are:
$$ \begin{aligned} &R^i_{i - 1} = \begin{bmatrix} 1& 0& 0\\ 0& 1& 0 \\ 0& 0& 1 \end{bmatrix}, \\ & \mathbf p^i_{i - 1} = \begin{bmatrix}a_i \\0\\ d_i\end{bmatrix}. \end{aligned} $$HINT:
According to the definition of homogeneous transformation matrix, $A^i_{i -1}$ is
$$ \begin{aligned} A^{i}_{i - 1} &= Rot(z, 0)Trans(0, 0,d_i)Trans(a_i, 0, 0)Rot(x, 0) \\ &= \begin{bmatrix}1& 0& 0& 0\\ 0& 1& 0& 0 \\ 0& 0& 1& 0\\ 0& 0& 0& 1\end{bmatrix} \begin{bmatrix}1& 0& 0& 0 \\ 0& 1& 0& 0\\ 0& 0& 1& d_i\\ 0& 0& 0& 1\end{bmatrix} \begin{bmatrix}1& 0& 0& a_i \\ 0& 1& 0& 0\\ 0& 0& 1& 0\\ 0& 0& 0& 1\end{bmatrix} \begin{bmatrix}1& 0& 0& 0\\ 0& 1& 0& 0 \\ 0& 0& 1& 0\\ 0& 0& 0& 1\end{bmatrix} \\ &= \begin{bmatrix} 1& 0& 0& a_i \\0& 1& 0& 0 \\ 0& 0& 1& d_i \\ 0& 0& 0& 1 \end{bmatrix} = \begin{bmatrix}R^i_{i - 1}& \mathbf p^i_{i - 1} \\ \mathbf 0& 1\end{bmatrix}. \end{aligned} $$
Let $q_i = d_i$. The partial derivative of $\mathbf p^n_0$ can then be written as
$$ \begin{aligned} \frac{\partial \mathbf p^n_0}{\partial q_i} &= \frac{\partial R^i_0\mathbf p^n_i}{\partial q_i} + \frac{\partial R^{i - 1}_0\mathbf p^i_{i - 1}}{\partial q_i} + \frac{\partial \mathbf p^{i - 1}_0}{\partial q_i} \\ &= R^{i - 1}_0 \frac{\partial \mathbf p^i_{i - 1}}{\partial q_i} \\ &= R^{i - 1}_0 \begin{bmatrix}0 \\ 0 \\ \dot q_i\end{bmatrix} \\ &= R^{i - 1}_0 \mathbf k \dot q_i \end{aligned} $$where the partial derivatives of $R^i_0\mathbf p^n_i$ and $\mathbf p^{i - 1}_0$ vanish because these quantities are constant and not affected by $q_i$.
Next, consider the $i$th joint to be revolute, which yields
$$ \begin{aligned} &R^i_{i - 1} = \begin{bmatrix} \cos\theta_i& -\sin\theta_i& 0\\ \sin\theta_i& \cos\theta_i& 0 \\ 0& 0& 1 \end{bmatrix}, \\ &\mathbf p^i_{i - 1} = \begin{bmatrix}a_i \cos \theta_i \\ a_i \sin \theta_i \\ 0\end{bmatrix}. \end{aligned} $$HINT:
$A^i_{i - 1}$ is
$$ \begin{aligned} A^{i}_{i - 1} &= Rot(z, \theta_i)Trans(0, 0, 0)Trans(a_i, 0, 0)Rot(x, 0) \\ &= \begin{bmatrix}\cos \theta_i& -\sin\theta_i& 0& 0\\ \sin \theta_i& \cos \theta_i& 0& 0 \\ 0& 0& 1& 0\\ 0& 0& 0& 1\end{bmatrix} \begin{bmatrix}1& 0& 0& 0 \\ 0& 1& 0& 0\\ 0& 0& 1& 0\\ 0& 0& 0& 1\end{bmatrix} \begin{bmatrix}1& 0& 0& a_i \\ 0& 1& 0& 0\\ 0& 0& 1& 0\\ 0& 0& 0& 1\end{bmatrix} \begin{bmatrix}1& 0& 0& 0\\ 0& 1& 0& 0 \\ 0& 0& 1& 0\\ 0& 0& 0& 1\end{bmatrix} \\ &= \begin{bmatrix} \cos\theta_i& -\sin\theta_i& 0& a_i\cos\theta_i \\ \sin\theta_i& \cos\theta_i& 0& a_i\sin\theta_i \\ 0& 0& 1& 0 \\ 0& 0& 0& 1 \end{bmatrix}. \end{aligned} $$
Thus, setting $q_i = \theta_i$ leads to:
$$ \begin{aligned} \frac{\partial \mathbf p^n_0}{\partial q_i} &= \frac{\partial R^i_0\mathbf p^n_i}{\partial q_i} + \frac{\partial R^{i - 1}_0\mathbf p^i_{i - 1}}{\partial q_i} + \frac{\partial \mathbf p^{i - 1}_0}{\partial q_i} \\ &= \frac{\partial R^i_0\mathbf p^n_i}{\partial q_i} + \frac{\partial R^{i - 1}_0\mathbf p^i_{i - 1}}{\partial q_i}. \end{aligned} $$Using the definition of angular velocity for the $i$th link, the first term becomes
$$ \frac{\partial R^i_0\mathbf p^n_i}{\partial q_i} = S(R^{i - 1}_0 \dot q_i \mathbf k)R^i_0 \mathbf p^n_i. $$The second term is
$$ \begin{aligned} \frac{\partial R^{i - 1}_0 \mathbf p^i_{i - 1}}{\partial q_i} &= R^{i - 1}_0 \frac{\partial }{\partial q_i}\begin{bmatrix}a_i\cos\theta_i \\ a_i\sin \theta_i \\ 0 \end{bmatrix}\\ &= R^{i - 1}_0\begin{bmatrix}-a_i\sin\theta_i \\ a_i\cos \theta_i \\ 0 \end{bmatrix} \dot q_i \\ &= R^{i - 1}_0 \dot q_i (\mathbf k \times \mathbf p^i_{i -1})\\ &= R^{i - 1}_0 (\dot q_i \mathbf k \times \mathbf p^i_{i -1}) \\ &= R^{i - 1}_0 S(\dot q_i \mathbf k)\mathbf p^i_{i - 1} \\ &= S(R^{i - 1}_0\dot q_i \mathbf k)R^{i - 1}_0 \mathbf p^i_{i - 1}. \end{aligned} $$HINTs:
$$ \begin{aligned} \mathbf k \times \mathbf p^i_{i - 1} &= \begin{bmatrix}0 \\ 0\\ 1\end{bmatrix} \times \begin{bmatrix}a_i \cos \theta_i \\ a_i \sin \theta_i \\ 0\end{bmatrix} \\ &= \begin{bmatrix}0 * 0 - 1 * a_i\sin\theta_i \\ 1 * a_i \cos\theta_i - 0 * 0 \\ 0 * a_i \sin \theta_i - 0 * a_i \cos\theta_i \end{bmatrix} \\ &= \begin{bmatrix}-a_i \sin \theta_i \\ a_i \cos\theta_i \\ 0\end{bmatrix}. \end{aligned} $$
- $[-a_i \sin \theta_i,\ a_i \cos\theta_i,\ 0]^T$ is the result of the cross product.
According to the property of skew symmetric matrix, $S(\mathbf a)\mathbf p = \mathbf a \times \mathbf p, \forall \mathbf p = [p_x, p_y, p_z]$ where $\times$ means the cross product, we have $\dot q_i \mathbf k \times \mathbf p^i_{i - 1} = S(\dot q_i \mathbf k) \mathbf p^i_{i - 1}$.
By using the property of skew symmetric matrix again, that is $RS(\mathbf a)R^T\mathbf b = S(R\mathbf a)\mathbf b$, we have
$$ \begin{aligned}R^{i - 1}_0 S(\dot q_i \mathbf k)\mathbf p^i_{i - 1} &= R^{i - 1}_0 S(\dot q_i \mathbf k) {R^{i - 1}_0}^TR^{i - 1}_0\mathbf p^i_{i - 1} \\ &= S(R^{i - 1}_0\dot q_i \mathbf k)R^{i - 1}_0 \mathbf p^i_{i - 1}. \end{aligned}$$
Combining the two terms gives
$$ \begin{aligned} \frac{\partial \mathbf p^n_0}{\partial q_i} &= \frac{\partial R^i_0\mathbf p^n_i}{\partial q_i} + \frac{\partial R^{i - 1}_0\mathbf p^i_{i - 1}}{\partial q_i} \\ &= S(R^{i - 1}_0 \dot q_i \mathbf k) R^i_0 \mathbf p^n_i + S(R^{i - 1}_0\dot q_i \mathbf k)R^{i - 1}_0 \mathbf p^i_{i - 1} \\ &= S(R^{i - 1}_0\dot q_i \mathbf k) (R^i_0 \mathbf p^n_i + R^{i - 1}_0 \mathbf p^i_{i - 1}) \\ &= \dot q_i R^{i - 1}_0 \mathbf k \times (\mathbf p^n_0 - \mathbf p^{i - 1}_0) \end{aligned} $$based on the skew-symmetric property $S(\mathbf a)\mathbf p = \mathbf a \times \mathbf p$.
In summary, the linear velocity is given by
$$ \begin{aligned} \dot {\mathbf p}^n_0 &= \begin{bmatrix}\frac{\partial \mathbf p^n_0}{\partial q_1},& \frac{\partial \mathbf p^n_0}{\partial q_2},& \frac{\partial \mathbf p^n_0}{\partial q_3},& \cdots,&\frac{\partial \mathbf p^n_0}{\partial q_n}\end{bmatrix}\dot{\mathbf q}, \\ \frac{\partial \mathbf p^n_0}{\partial q_i}&= \begin{cases} R^{i - 1}_0\mathbf k \times (\mathbf p^n_0 - \mathbf p^{i - 1}_0)& \text{revolute joint,} \\ R^{i - 1}_0\mathbf k& \text{prismatic}. \end{cases} \end{aligned} $$Jacobian Matrix
The Jacobian matrix maps joint velocities to the end effector’s velocities and is denoted by $J$. From the angular and linear velocity expressions, the relationship between the two spaces becomes
$$ \begin{aligned} \begin{bmatrix} \mathbf v^n_0 \\ \mathbf \omega^n_0 \end{bmatrix} &= \begin{bmatrix} J_{\mathbf v} \\ J_{\mathbf \omega} \end{bmatrix} \dot {\mathbf q}, \\ J_{\mathbf v} &= \begin{bmatrix}\frac{\partial \mathbf p^n_0}{\partial q_1},& \frac{\partial \mathbf p^n_0}{\partial q_2},& \frac{\partial \mathbf p^n_0}{\partial q_3},& \cdots,&\frac{\partial \mathbf p^n_0}{\partial q_n}\end{bmatrix}, \\ J_{\omega} &= \begin{bmatrix}\rho_1\mathbf k,& \rho_2R^1_0\mathbf k,& \rho_3R^2_0\mathbf k,& \cdots,& \rho_nR^{n - 1}_0\mathbf k \end{bmatrix}. \end{aligned} $$For a revolute $i$th joint,
$$ \begin{aligned} J_{\mathbf v_i} &= R^{i - 1}_0\mathbf k \times (\mathbf p^n_0 - \mathbf p^{i - 1}_0), \\ J_{\omega_i} &= R^{i - 1}_0\mathbf k. \end{aligned} $$For a prismatic $i$th joint,
$$ \begin{aligned} J_{\mathbf v_i} &= R^{i - 1}_0\mathbf k, \\ J_{\omega_i} &= 0. \end{aligned} $$In principle, given a desired change in end‑effector position and orientation one could compute a corresponding change in joint configuration by inverting $J$, i.e. $J^{-1}[\Delta \mathbf v^n_0, \Delta \omega^n_0]^T$. However, in practice this inversion is often difficult for various reasons.