Robotic Mechanics and Modeling/Kinematics

Introduction to Kinematics for Robotic Mechanics and Modeling (Portion from Link)


Kinematics is the science and math of describing the configuration, position, velocity, and acceleration of an object or a machine. We ignore the dynamics or changes in velocity/acceleration due to inertia of the machine. We also ignore internal or external forces that may be acting on the machine.

Robot kinematics applies geometry to the study of the movement of multi-degree of freedom kinematic chains that form the structure of robotic systems. The emphasis on geometry means that the links of the robot are modeled as rigid bodies and its joints are assumed to provide pure rotation or translation.

Robot kinematics studies the relationship between the dimensions and connectivity of kinematic chains and the position, velocity and acceleration of each of the links in the robotic system, in order to plan and control movement and to compute actuator forces and torques.

Position in 1-D
In 1-D, we can imagine the position of a particle along a line given as $$x_i$$, and this position is not subject to rotation but can only move along the line (translate) to a new position $$x_f$$.

Velocity in 1-D
In 1-D, we can describe the change in position $$\boldsymbol{x}$$ (a translation) over time $$t$$ as a velocity $$\boldsymbol{v}$$ (a vector with speed and direction) without accounting for rotation and angular velocity:

$$\boldsymbol{v}=\operatorname{d}\!\boldsymbol{x}/\operatorname{d}\!t$$

A familiar expression for describing position motion from $$x_i$$ to $$x_f$$ as a function of time with constant speed $$v_c$$ is:

$$x_f=x_i+v_c t$$

Acceleration in 1-D
In 1-D, we can describe the change in velocity $$\boldsymbol{v}$$ (a translation) over time $$t$$ as an acceleration $$\boldsymbol{a}$$ (a vector with speed and direction) without accounting for rotation, angular velocity, or acceleration:

$$\boldsymbol{a}=\operatorname{d}\!\boldsymbol{v}/\operatorname{d}\!t$$

Motion from $$x_i$$ to $$x_f$$ as a function of time with constant speed $$v_c$$ and constant acceleration $$a_c$$ is:

$$x_f=x_i+v_c t+\frac{1}{2}a_c t^2$$

Example for 1-D Motion in IPython (JupyterLab)
An example of how to setup a symbolic expression $x_f=x_i+v_c t+\frac{1}{2}a_c t^2$ in IPython.

If $$x_i=0$$, $$v_c=1\, \mathrm{m/s}$$, and $$a_c=1\, \mathrm{m/s^2}$$, what is $$x_f$$ after 1 second?

The answer is 1.5 $$ \mathrm{m} $$.

Additional Examples of 1-D Kinematics
/Additional Examples of 1-D Kinematics/

== Kinematics of a particle trajectory in a non-rotating frame of reference (Copied and edited from Kinematics ) ==

Representation of Vectors and Paths
Particle kinematics is the study of the trajectory of particles. The position of a particle is defined as the coordinate vector from the origin of a coordinate frame to the particle. In the most general case, a three-dimensional coordinate system is used to define the position of a particle. However, if the particle is constrained to move within a plane, a two-dimensional coordinate system is sufficient. All observations in physics are incomplete without being described with respect to a reference frame.

The position vector of a particle is a vector drawn from the origin of the reference frame to the particle. It expresses both the distance of the point from the origin and its direction from the origin. In three dimensions, the position of point P can be expressed as


 * $$\mathbf{P} =  = x_P\hat{\imath} + y_P\hat{\jmath} + z_P\hat{k},$$

where $$x_P$$, $$y_P$$, and $$z_P$$ are the Cartesian coordinates and $$ \hat{\imath}$$, $$\hat{\jmath}$$ and $$\hat{k}$$ are the unit vectors along the $$x$$, $$y$$, and $$z$$ coordinate axes, respectively. The magnitude of the position vector $$\left|\mathbf{P}\right|$$ gives the distance between the point $$\mathbf{P}$$ and the origin.


 * $$|\mathbf{P}| = \sqrt{x_P^{\ 2} + y_P^{\ 2} + z_P^{\ 2}}.$$

The direction cosines of the position vector provide a quantitative measure of direction. It is important to note that the position vector of a particle isn't unique. The position vector of a given particle is different relative to different frames of reference.

The trajectory of a particle is a vector function of time, $$\mathbf{P}(t)$$, which defines the curve traced by the moving particle, given by


 * $$ \mathbf{P}(t) = x_P(t)\hat{\imath} + y_P(t)\hat{\jmath} +z_P(t) \hat{k}, $$

where the coordinates xP, yP, and zP are each functions of time.

An Example for Representing a Position Vector in IPython
An example of how to define a "vector" $$\mathbf{P}=<1,2,3>$$ as an array in IPython.

An example of how to calculate the magnitude of vector $$\mathbf{P}$$.

An example of how to plot the vector $$\mathbf{P}$$.



An Example of Representing a 2D Path in IPython
Let's represent a trajectory with vector path $$ \mathbf{P}(t) = x_P(t)\hat{\imath} + y_P(t)\hat{\jmath} $$, where $$ x_P(t)=t $$ and $$ y_P(t)=e^{-t}\cos(2\pi t) $$. Then, we can use the following code to represent this path of this trajectory.



Additional Examples for Vectors
/Additional Examples for Vectors/

Velocity and speed
The velocity of a particle is a vector quantity that describes the magnitude as well as direction of motion of the particle. More mathematically, the rate of change of the position vector of a point, with respect to time is the velocity of the point. Consider the ratio formed by dividing the difference of two positions of a particle by the time interval. This ratio is called the average velocity over that time interval and is defined as Velocity=displacement/time taken


 * $$ \overline{\mathbf{V}} = \frac {\Delta \mathbf{P}}{\Delta t} \ ,$$

where ΔP is the change in the position vector over the time interval Δt.

In the limit as the time interval Δt becomes smaller and smaller, the average velocity becomes the time derivative of the position vector,


 * $$ \mathbf{V} = \lim_{\Delta t\rightarrow0}\frac{\Delta\mathbf{P}}{\Delta t} = \frac {d \mathbf{P}}{d t}=\dot{\mathbf{P}} = \dot{x}_p\hat{\imath}+\dot{y}_P\hat{\jmath}+\dot{z}_P\hat{k}.$$

Thus, velocity is the time rate of change of position of a point, and the dot denotes the derivative of those functions x, y, and z with respect to time. Furthermore, the velocity is tangent to the trajectory of the particle at every position the particle occupies along its path. Note that in a non-rotating frame of reference, the derivatives of the coordinate directions are not considered as their directions and magnitudes are constants.

The speed of an object is the magnitude |V| of its velocity. It is a scalar quantity:


 * $$ |\mathbf{V}| = |\dot{\mathbf{P}} | = \frac {d s}{d t},$$

where s is the arc-length measured along the trajectory of the particle. This arc-length traveled by a particle over time is a non-decreasing quantity. Hence, ds/dt is non-negative, which implies that speed is also non-negative.

Acceleration
The velocity vector can change in magnitude and in direction or both at once. Hence, the acceleration accounts for both the rate of change of the magnitude of the velocity vector and the rate of change of direction of that vector. The same reasoning used with respect to the position of a particle to define velocity, can be applied to the velocity to define acceleration. The acceleration of a particle is the vector defined by the rate of change of the velocity vector. The average acceleration of a particle over a time interval is defined as the ratio.


 * $$ \overline{\mathbf{A}} = \frac {\Delta \mathbf{V}}{\Delta t} \ ,$$

where ΔV is the difference in the velocity vector and Δt is the time interval.

The acceleration of the particle is the limit of the average acceleration as the time interval approaches zero, which is the time derivative,


 * $$ \mathbf{A} = \lim_{\Delta t \rightarrow 0} \frac{\Delta \mathbf{V}}{\Delta t} = \frac {d \mathbf{V}}{d t} = \dot{\mathbf{V}} = \dot{v}_x\hat{\imath}+\dot{v}_y\hat{\jmath}+\dot{v}_z\hat{k} $$

or


 * $$ \mathbf{A} = \ddot{\mathbf{P}} = \ddot{x}_p\hat{\imath}+\ddot{y}_P\hat{\jmath}+\ddot{z}_P\hat{k} $$

Thus, acceleration is the first derivative of the velocity vector and the second derivative of the position vector of that particle. Note that in a non-rotating frame of reference, the derivatives of the coordinate directions are not considered as their directions and magnitudes are constants.

The magnitude of the acceleration of an object is the magnitude |A| of its acceleration vector. It is a scalar quantity:


 * $$ |\mathbf{A}| = |\dot{\mathbf{V}} | = \frac {d v}{d t},$$

Additional Examples for Velocity and Acceleration
/Additional Examples for Velocity and Acceleration/

Relative position vector
A relative position vector is a vector that defines the position of one point relative to another. It is the difference in position of the two points. The position of one point A relative to another point B is simply the difference between their positions

$$\mathbf{P}_{A/B} = \mathbf{P}_{A} - \mathbf{P}_{B} $$

which is the difference between the components of their position vectors.

If point A has position components $$\mathbf{P}_{A} = < X_{A}, Y_{A}, Z_{A}> $$

If point B has position components $$\mathbf{P}_{B} = < X_{B}, Y_{B}, Z_{B}> $$

then the position of point A relative to point B is the difference between their components: $$\mathbf{P}_{A/B} = \mathbf{P}_{A} - \mathbf{P}_{B} = < X_{A} - X_{B}, Y_{A} - Y_{B}, Z_{A} - Z_{B} > $$

Relative velocity
The velocity of one point relative to another is simply the difference between their velocities

$$\mathbf{V}_{A/B} = \mathbf{V}_{A} - \mathbf{V}_{B} $$

which is the difference between the components of their velocities.

If point A has velocity components $$\mathbf{V}_{A} = < V_{A_{x}}, V_{A_{y}}, V_{A_{z}} > $$

and point B has velocity components $$\mathbf{V}_{B} = < V_{B_{x}}, V_{B_{y}}, V_{B_{z}} > $$

then the velocity of point A relative to point B is the difference between their components: $$\mathbf{V}_{A/B} = \mathbf{V}_{A} - \mathbf{V}_{B} =  $$

Alternatively, this same result could be obtained by computing the time derivative of the relative position vector RB/A.

In the case where the velocity is close to the speed of light c (generally within 95%), another scheme of relative velocity called rapidity, that depends on the ratio of V to c, is used in special relativity.

Relative acceleration
The acceleration of one point C relative to another point B is simply the difference between their accelerations.

$$\mathbf{A}_{C/B} = \mathbf{A}_{C} - \mathbf{A}_{B} $$

which is the difference between the components of their accelerations.

If point C has acceleration components $$\mathbf{A}_{C} =  $$

and point B has acceleration components $$\mathbf{A}_{B} = < A_{B_{x}}, A_{B_{y}}, A_{B_{z}} > $$

then the acceleration of point C relative to point B is the difference between their components: $$\mathbf{A}_{C/B} = \mathbf{A}_{C} - \mathbf{A}_{B} = < A_{C_{x}} - A_{B_{x}}, A_{C_{y}} - A_{B_{y}} , A_{C_{z}} - A_{B_{z}}   > $$

Alternatively, this same result could be obtained by computing the second time derivative of the relative position vector PB/A.

== Rotation Matrix (Copied and edited from Rotation Matrix ) == One of the key tools used to help in the representation of robotic pose, configuration, and orientation is the rotation matrix. In linear algebra, a rotation matrix is a matrix that is used to perform a rotation in Euclidean space. For example, using the convention below, the matrix


 * $$R =

\begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \\ \end{bmatrix} $$

rotates points in the $xy$-plane counterclockwise through an angle $θ$ with respect to the $x$ axis about the origin of a two-dimensional Cartesian coordinate system. To perform the rotation on a plane point with standard coordinates $v$ = (x,y), it should be written as column vector, and multiplied by the matrix R:



R\textbf{v} \ = \ \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix} \cdot \begin{bmatrix} x \\ y \end{bmatrix} \ = \ \begin{bmatrix} x\cos\theta-y\sin\theta \\ x\sin\theta+y\cos\theta \end{bmatrix}. $$

The examples in this article apply to active rotations of vectors counterclockwise in a right-handed coordinate system (y counterclockwise from x) by pre-multiplication (R on the left). If any one of these is changed (such as rotating axes instead of vectors, a passive transformation), then the inverse of the example matrix should be used, which coincides with its transpose.

Since matrix multiplication has no effect on the zero vector (the coordinates of the origin), rotation matrices describe rotations about the origin. Rotation matrices provide an algebraic description of such rotations, and are used extensively for computations in geometry, physics, and computer graphics. In some literature, the term rotation is generalized to include improper rotations, characterized by orthogonal matrices with determinant −1 (instead of +1). These combine proper rotations with reflections (which invert orientation). In other cases, where reflections are not being considered, the label proper may be dropped. The latter convention is followed in this article.

Rotation matrices are square matrices, with real entries. More specifically, they can be characterized as orthogonal matrices with determinant 1; that is, a square matrix $R$ is a rotation matrix if and only if $R^{T} = R^{−1}$ and $det R = 1$. The set of all orthogonal matrices of size $n$ with determinant +1 forms a group known as the special orthogonal group $SO(n)$, one example of which is the rotation group SO(3). The set of all orthogonal matrices of size $n$ with determinant +1 or −1 forms the (general) orthogonal group $O(n)$.

Rotations in Two Dimensions
In two dimensions, the standard rotation matrix has the following form,


 * $$R(\theta) = \begin{bmatrix}

\cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \\ \end{bmatrix}$$.

This rotates column vectors by means of the following matrix multiplication,



\begin{bmatrix} x' \\ y' \\ \end{bmatrix} = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \\ \end{bmatrix}\begin{bmatrix} x \\ y \\ \end{bmatrix}$$.

For example, if the vector $$ \mathbf{\hat{x}} = \begin{bmatrix} 1 \\   0 \\  \end{bmatrix} $$ is rotated by an angle $$\theta$$, its new coordinates are $$ \begin{bmatrix} \cos\theta \\ \sin\theta \\ \end{bmatrix} $$

and if the vector $$ \mathbf{\hat{y}} = \begin{bmatrix} 0 \\   1 \\  \end{bmatrix} $$ is rotated by an angle $$\theta$$, its new coordinates are $$ \begin{bmatrix} -\sin\theta \\ \cos\theta \\ \end{bmatrix} $$

More generally, the new coordinates $(x′, y′)$ of the point $(x, y)$ after rotation are


 * $$\begin{align}

x' &= x \cos\theta - y \sin\theta\, \\ y' &= x \sin\theta + y \cos\theta\, \end{align}$$.

The direction of vector rotation is counterclockwise if $θ$ is positive (e.g. 90°), and clockwise if $x$ is negative (e.g. −90°). Thus the clockwise rotation matrix is found as



R(-\theta) = \begin{bmatrix} \cos\theta & \sin\theta \\ -\sin\theta & \cos\theta \\ \end{bmatrix}\, $$.

The two-dimensional case is the only non-trivial (i.e. not one-dimensional) case where the rotation matrices group is commutative, so that it does not matter in which order multiple rotations are performed. An alternative convention uses rotating axes, and the above matrices also represent a rotation of the axes clockwise through an angle $θ$.

An Example of Rotating a Vector in Two Dimensions with IPython
We will create a 2D rotation matrix to provide a rotation of $$45^o$$ to the vector $$<1,0>$$ at the origin.



Basic rotations
A basic rotation (also called elemental rotation) is a rotation about one of the axes of a coordinate system. The following three basic rotation matrices rotate vectors by an angle $θ$ about the $θ$-, $θ$-, or $x$-axis, in three dimensions, using the right-hand rule—which codifies their alternating signs. (The same matrices can also represent a clockwise rotation of the axes. )



\begin{alignat}{1} R_x(\theta) &= \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \theta & -\sin \theta \\[3pt] 0 & \sin \theta &  \cos \theta \\[3pt] \end{bmatrix} \\[6pt] R_y(\theta) &= \begin{bmatrix} \cos \theta & 0 & \sin \theta \\[3pt] 0 & 1 & 0 \\[3pt] -\sin \theta & 0 & \cos \theta \\ \end{bmatrix} \\[6pt] R_z(\theta) &= \begin{bmatrix} \cos \theta & -\sin \theta & 0 \\[3pt] \sin \theta &  \cos \theta & 0\\[3pt] 0 & 0 & 1\\ \end{bmatrix} \end{alignat} $$

For column vectors, each of these basic vector rotations appears counterclockwise when the axis about which they occur points toward the observer, the coordinate system is right-handed, and the angle $y$ is positive. $sin θ$, for instance, would rotate toward the $R_{z}$-axis a vector aligned with the $y$-axis, as can easily be checked by operating with $x$ on the vector $R_{z}$:


 * $$ R_z(90^\circ) \begin{bmatrix} 1 \\ 0 \\ 0 \\ \end{bmatrix} =

\begin{bmatrix} \cos 90^\circ & -\sin 90^\circ & 0 \\ \sin 90^\circ &  \quad\cos 90^\circ & 0\\ 0 & 0 & 1\\ \end{bmatrix} \begin{bmatrix} 1 \\ 0 \\ 0 \\ \end{bmatrix} = \begin{bmatrix} 0 & -1 & 0 \\ 1 & 0 & 0\\ 0 & 0 & 1\\ \end{bmatrix} \begin{bmatrix} 1 \\ 0 \\ 0 \\ \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \\ 0 \\ \end{bmatrix} $$

This is similar to the rotation produced by the above-mentioned two-dimensional rotation matrix. See below for alternative conventions which may apparently or actually invert the sense of the rotation produced by these matrices.

General rotations
Other rotation matrices can be obtained from these three using matrix multiplication. For example, the product


 * $$R = R_z(\alpha) \, R_y(\beta) \, R_x(\gamma)$$

represents a fixed-body rotation whose yaw, pitch, and roll angles are $z$, $θ$ and $R_{x}$, respectively. More formally, it is an intrinsic rotation whose Tait–Bryan angles/Euler angles are $θ$, $α$, $β$, about axes $γ$, $α$, $β$, respectively. Similarly, the product


 * $$R = R_z(\gamma) \, R_y(\beta) \, R_x(\alpha)$$

represents an extrinsic spaced-fixed rotation whose rotation angles are $γ$, $z$, $y$, about axes $x$, $α$, $β$.

These matrices produce the desired effect only if they are used to premultiply column vectors, and (since in general matrix multiplication is not commutative) only if they are applied in the specified order (see Ambiguities for more details).

An Example of a Single Rotation of a Vector in Three Dimensions
Create a 3D rotation matrix to provide a rotation of $$45^o$$ about the Z-axis to the vector $$<1,0,0>$$ at the origin.



An Example of Successive XYZ Space-fixed Rotations of a Vector in Three Dimensions
Successive XYZ space-fixed rotations of vector $$<1,0,0>$$ at the origin of $$90^o$$ about X, then about Y, and then about Z.





An Example of Successive ZYX Body-fixed, Euler Rotations of a Vector in Three Dimensions
Successive ZYX space-fixed rotations of vector $$<1,0,0>$$ at the origin of $$90^o$$ about Z, then about Y', and then about X''. The final axes are given by x,y,z.



Additional Examples for Rotations
/Additional Examples for Rotations/

Properties
For any $γ$-dimensional rotation matrix $x$ acting on $(1,0,0)$,


 * $$ R^\mathrm{T} = R^{-1}$$ (The rotation is an orthogonal matrix)

It follows that:


 * $$ \det R = \pm 1$$

A rotation is termed proper if det R = 1, and improper (or a roto-reflection) if det R = –1.

Mathematical Examples

 * The 2 × 2 rotation matrix
 * $$ Q = \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix} $$
 * corresponds to a 90° planar rotation clockwise about the origin.


 * The transpose of the 2 × 2 matrix
 * $$ M = \begin{bmatrix} 0.936 & 0.352 \\ 0.352 & -0.936 \end{bmatrix} $$
 * is its inverse, but since its determinant is −1, this is not a proper rotation matrix; it is a reflection across the line $ℝ^{n}$.


 * The 3 × 3 rotation matrix
 * $$ Q = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \frac{\sqrt{3}}{2} & \frac12 \\ 0 & -\frac12 & \frac{\sqrt{3}}{2} \end{bmatrix} $$
 * corresponds to a −30° rotation around the $y$-axis in three-dimensional space.


 * The 3 × 3 rotation matrix
 * $$ Q = \begin{bmatrix} 0.36 & 0.48 & -0.8 \\ -0.8 & 0.60 & 0 \\ 0.48 & 0.64 & 0.60 \end{bmatrix} $$
 * corresponds to a rotation of approximately −74° around the axis (−$z$,$n$,$R$) in three-dimensional space.


 * The 3 × 3 permutation matrix
 * $$ P = \begin{bmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{bmatrix} $$
 * is a rotation matrix, as is the matrix of any even permutation, and rotates through 120° about the axis $11y = 2x$.


 * The 3 × 3 matrix
 * $$ M = \begin{bmatrix} 3 & -4 & 1 \\ 5 & 3 & -7 \\ -9 & 2 & 6 \end{bmatrix} $$
 * has determinant +1, but is not orthogonal (its transpose is not its inverse), so it is not a rotation matrix.


 * The 4 × 3 matrix
 * $$ M = \begin{bmatrix} 0.5 & -0.1 & 0.7 \\ 0.1 & 0.5 & -0.5 \\ -0.7 & 0.5 & 0.5 \\ -0.5 & -0.7 & -0.1 \end{bmatrix} $$
 * is not square, and so cannot be a rotation matrix; yet $x = y = z$ yields a 3 × 3 identity matrix (the columns are orthonormal).


 * The 4 × 4 matrix
 * $$ Q = -I = \begin{bmatrix} -1 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 \\ 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & -1 \end{bmatrix} $$
 * describes an isoclinic rotation in four dimensions, a rotation through equal angles (180°) through two orthogonal planes.


 * The 5 × 5 rotation matrix
 * $$ Q = \begin{bmatrix} 0 & -1 & 0 & 0 & 0 \\ 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & -1 & 0 & 0 \\ 0 & 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & 0 & 1 \end{bmatrix} $$
 * rotates vectors in the plane of the first two coordinate axes 90°, rotates vectors in the plane of the next two axes 180°, and leaves the last coordinate axis unmoved.

Geometry
In Euclidean geometry, a rotation is an example of an isometry, a transformation that moves points without changing the distances between them. Rotations are distinguished from other isometries by two additional properties: they leave (at least) one point fixed, and they leave "handedness" unchanged. By contrast, a translation moves every point, a reflection exchanges left- and right-handed ordering, and a glide reflection does both.

A rotation that does not leave handedness unchanged is an improper rotation or a rotoinversion.

If a fixed point is taken as the origin of a Cartesian coordinate system, then every point can be given coordinates as a displacement from the origin. Thus one may work with the vector space of displacements instead of the points themselves. Now suppose $M^{T}M$ are the coordinates of the vector $(p_{1},…,p_{n})$ from the origin $x$ to point $1⁄3$. Choose an orthonormal basis for our coordinates; then the squared distance to $2⁄3$, by Pythagoras, is


 * $$ d^2(O,P) = \| \mathbf{p} \|^2 = \sum_{r=1}^n p_r^2 $$

which can be computed using the matrix multiplication


 * $$ \| \mathbf{p} \|^2 = \begin{bmatrix}p_1 \cdots p_n\end{bmatrix} \begin{bmatrix}p_1 \\ \vdots \\ p_n \end{bmatrix} = \mathbf{p}^\mathrm{T} \mathbf{p} . $$

A geometric rotation transforms lines to lines, and preserves ratios of distances between points. From these properties it can be shown that a rotation is a linear transformation of the vectors, and thus can be written in matrix form, $p$. The fact that a rotation preserves, not just ratios, but distances themselves, is stated as


 * $$ \mathbf{p}^\mathrm{T} \mathbf{p} = (Q \mathbf{p})^\mathrm{T} (Q \mathbf{p}), $$

or


 * $$\begin{align}

\mathbf{p}^\mathrm{T} I \mathbf{p}&{}= \left(\mathbf{p}^\mathrm{T} Q^\mathrm{T}\right) (Q \mathbf{p}) \\ &{}= \mathbf{p}^\mathrm{T} \left(Q^\mathrm{T} Q\right) \mathbf{p}. \end{align}$$

Because this equation holds for all vectors, $Qp$, one concludes that every rotation matrix, $p$, satisfies the orthogonality condition,


 * $$ Q^\mathrm{T} Q = I . $$

Rotations preserve handedness because they cannot change the ordering of the axes, which implies the special matrix condition,


 * $$ \det Q = +1 . $$

Equally important, it can be shown that any matrix satisfying these two conditions acts as a rotation.

Multiplication
The inverse of a rotation matrix is its transpose, which is also a rotation matrix:


 * $$\begin{align} \left(Q^\mathrm{T}\right)^\mathrm{T} \left(Q^\mathrm{T}\right) &= Q Q^\mathrm{T} = I\\ \det Q^\mathrm{T} &= \det Q = +1. \end{align}$$

The product of two rotation matrices is a rotation matrix:


 * $$\begin{align}

\left(Q_1 Q_2\right)^\mathrm{T} \left(Q_1 Q_2\right) &= Q_2^\mathrm{T} \left(Q_1^\mathrm{T} Q_1\right) Q_2 = I \\ \det \left(Q_1 Q_2\right) &= \left(\det Q_1\right) \left(\det Q_2\right) = +1. \end{align}$$

For $Q$, multiplication of $n > 2$ rotation matrices is generally not commutative.


 * $$\begin{align}

Q_1 &= \begin{bmatrix}0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1\end{bmatrix} & Q_2 &= \begin{bmatrix}0 & 0 & 1 \\ 0 & 1 & 0 \\ -1 & 0 & 0\end{bmatrix} \\ Q_1 Q_2 &= \begin{bmatrix}0 & -1 & 0 \\ 0 & 0 & 1 \\ -1 & 0 & 0\end{bmatrix} & Q_2 Q_1 &= \begin{bmatrix}0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0\end{bmatrix}. \end{align}$$

Noting that any identity matrix is a rotation matrix, and that matrix multiplication is associative, we may summarize all these properties by saying that the $n × n$ rotation matrices form a group, which for $n × n$ is non-abelian, called a special orthogonal group, and denoted by $n > 2$, $SO(n)$, $SO(n,R)$, or $SO_{n}$, the group of $SO_{n}(R)$ rotation matrices is isomorphic to the group of rotations in an $n × n$-dimensional space. This means that multiplication of rotation matrices corresponds to composition of rotations, applied in left-to-right order of their corresponding matrices.

==Robotic Position and Orientation (Copied and edited from Wikibooks )==

In general, a rigid body in three-dimensional space has six degrees of freedom: three rotational and three translational.

A conventional way to describe the position and orientation of a rigid body is to attach a frame to it. After defining a reference coordinate system, the position and orientation of the rigid body are fully described by the position of the frame's origin and the orientation of its axes, relative to the reference frame.

Rotation Matrix
A rotation matrix describes the relative orientation of two such frames. The columns of this 3 &#215; 3 matrix consist of the unit vectors along the axes of one frame, relative to the other, reference frame. Thus, the relative orientation of a frame $$\{b\}$$ with respect to a reference frame $$\{a\}$$ is given by the rotation matrix $$^{b}_{a} R \,$$:

^{b}_{a} R = \begin{bmatrix} _{a}x^{b} & _{a}y^{b} & _{a}z^{b} \end{bmatrix} = \begin{bmatrix} x^{b} \cdot x^{a} & y^{b} \cdot x^{a} & z^{b} \cdot x^{a} \\ x^{b} \cdot y^{a} & y^{b} \cdot y^{a} & z^{b} \cdot y^{a} \\ x^{b} \cdot z^{a} & y^{b} \cdot z^{a} & z^{b} \cdot z^{a} \end{bmatrix} $$

Rotation matrices can be interpreted in two ways:
 * 1) As the representation of the rotation of the first frame into the second (active interpretation).
 * 2) As the representation of the mutual orientation between two coordinate systems (passive interpretation).

The coordinates, relative to the reference frame $$\{a\}$$, of a point $$p$$, of which the coordinates are known with respect to a frame $$\{b\}$$ with the same origin, can then be calculated as follows: $$_{a} p = \, ^{b}_{a} R \, _{b} p$$.

Graphical Representation of Point in Rotated Frame about Origin
If we have $$_a p=<0.5,0.5,0.5>$$ in reference frame $$\{a\}$$. What is $$_b p$$ in frame $$\{b\}$$ after Euler sequence ZYX by $$45^o$$ about each axis?

Additional Examples for Rotations and Coordinates
/Additional Examples for Rotations and Coordinates/

Properties
Some of the properties of the rotation matrix that may be of practical value, are:
 * 1) The column vectors of $$^{b}_{a} R \,$$ are normal to each other.
 * 2) The length of the column vectors of $$^{b}_{a} R \,$$ equals 1.
 * 3) A rotation matrix is a non-minimal description of a rigid body's orientation. That is, it uses nine numbers to represent an orientation instead of just three. (The two above properties correspond to six relations between the nine matrix elements. Hence, only three of them are independent.) Non-minimal representations often have some numerical advantages, though, as they do not exhibit coordinate singularities.
 * 4) Since $$^{b}_{a} R \,$$ is orthonormal, $$^{a}_{b} R = \, ^{b}_{a} R^{-1} = \, ^{b}_{a} R^{T}$$.

Elementary Rotations about Frame Axes
The expressions for elementary rotations about frame axes can easily be derived. From the figure on the right, it can be seen that the rotation of a frame by an angle $$\gamma$$ about the z-axis, is described by:

R_{z}(\gamma) = \begin{bmatrix} \cos(\gamma) & -\sin(\gamma) & 0 \\ \sin(\gamma) & \cos(\gamma) & 0 \\ 0 & 0 & 1 \end{bmatrix} $$

Similarly, it can be shown that the rotation of a frame by an angle $$\alpha$$ about the x-axis, is given by:

R_{x}(\alpha) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos(\alpha) & -\sin(\alpha) \\ 0 & \sin(\alpha) & \cos(\alpha) \end{bmatrix} $$

Derived in exactly the same manner, the rotation of a frame by an angle $$\beta$$ about the y-axis, is described by:

R_{y}(\beta) = \begin{bmatrix} \cos(\beta) & 0 & \sin(\beta) \\ 0 & 1 & 0 \\ -\sin(\beta) & 0 & \cos(\beta) \end{bmatrix} $$

Compound Rotations
Compound rotations are found by multiplication of the different elementary rotation matrices.

The matrix corresponding to a set of rotations about moving axes can be found by postmultiplying the rotation matrices, thus multiplying them in the same order in which the rotations take place. The rotation matrix formed by a rotation by an angle $$\alpha$$ about the z-axis followed by a rotation by an angle $$-\beta$$ about the moved y-axis, is then given by:
 * $$R(zy, \alpha, -\beta) = R(z, \alpha) R(y, -\beta)$$

The composition of rotations about fixed axes, on the other hand, is found by premultiplying the different elementary rotation matrices.

Inverse Rotations
The inverse of a single rotation about a frame axis is a rotation by the negative of the rotation angle about the same axis:
 * $$R^{-1}(z, \alpha) = R(z, -\alpha)$$

The inverse of a compound rotation follows from the inverse of the matrix product:
 * $$R^{-1}(zy, \alpha, -\beta) = R^{-1}(y, -\beta) R^{-1}(z, \alpha)$$

Euler Angles
Contrary to the rotation matrix, Euler angles are a minimal representation (a set of just three numbers, that is) of relative orientation. This set of three angles describes a sequence of rotations about the axes of a moving reference frame. There are, however, many (12, to be exact) sets that describe the same orientation: different combinations of axes (e.g. ZXZ, ZYZ, and so on) lead to different Euler angles. Euler angles are often used for the description of the orientation of the wrist-like end-effectors of many serial manipulator robots.

Note: Identical axes should not be in consecutive places (e.g. ZZX). Also, the range of the Euler angles should be limited in order to avoid different angles for the same orientation. E.g.: for the case of ZYZ Euler angles, the first rotation about the z-axis should be within $$[-\pi, \pi]$$. The second rotation, about the moved y-axis, has a range of $$[-\pi/2, \pi/2]$$. The last rotation, about the moved z-axis, has a range of $$[-\pi, \pi]$$.

Forward Mapping
Forward mapping, or finding the orientation of the end-effector with respect to the base frame, follows from the composition of rotations about moving axes. For a rotation by an angle $$\alpha$$ about the z-axis, followed by a rotation by an angle $$\beta$$ about the moved x-axis, and a final rotation by an angle $$\gamma$$ about the moved z-axis, the resulting rotation matrix is:


 * $$^{ee}_{bs}R \, = R(zxz, \alpha,\beta,\gamma) = R(z, \alpha) R(x, \beta) R(z, \gamma)$$

After writing out:

R(zxz, \alpha,\beta,\gamma) = \begin{bmatrix} c_\gamma c_\alpha - s_\gamma c_\beta s_\alpha & -s_\gamma c_\alpha - c_\gamma c_\beta s_\alpha & s_\beta s_\alpha \\ c_\gamma s_\alpha + s_\gamma c_\beta c_\alpha & -s_\gamma s_\alpha + c_\gamma c_\beta c_\alpha & -s_\beta c_\alpha \\ s_\gamma s_\beta & c_\gamma s_\beta & c_\beta \end{bmatrix} $$

Note: Notice the shorthand notation: $$s_\alpha$$ stands for $$\sin \alpha$$, $$c_\alpha$$ stands for $$\cos \alpha$$, and so on.

Inverse Mapping
In order to drive the end-effector, the inverse problem must be solved: given a certain orientation matrix, which are the Euler angles that accomplish this orientation?

For the above case, the Euler angles $$\alpha$$, $$\beta$$ and $$\gamma$$ are found by inspection of the rotation matrix:
 * $$\alpha = \textrm{atan2}(R_{13}, -R_{23})$$
 * $$\beta = \textrm{atan2}(-R_{23} c_\alpha + R_{13} s_\alpha, R_{33})$$
 * $$\gamma = \textrm{atan2}(R_{31}, R_{32})$$

Coordinate Singularities
In the above example, a coordinate singularity exists for $$\beta = 0$$. The above equations are badly numerically conditioned for small values of $$\beta$$: the first and last equaton become undefined. This corresponds with an alignment of the first and last axes of the end-effector. The occurrence of a coordinate singularity involves the loss of a degree of freedom: in the case of the above example, small rotations about the y-axis require impossibly large rotations about the x- and z-axes.

No minimal representation of orientation can globally describe all orientations without coordinate singularities occurring.

Roll-Pitch-Yaw Angles
The orientation of a rigid body can equally well be described by three consecutive rotations about fixed axes. This leads to a notation with Roll-Pitch-Yaw (RPY) angles.

Forward Mapping
The forward mapping of RPY angles to a rotation matrix similar to that of Euler angles. Since the frame now rotates about fixed axes instead of moving axes, the order in which the different rotation matrices are multiplied is inversed:
 * $$R(RPY, r, p, y) = R(z, y) R(y, p) R(x, r)$$

After writing out:

R(RPY, r, p, y) = \begin{bmatrix} c_y c_p & c_y s_p s_r - s_y c_r & c_y s_p c_r + s_y s_r \\ s_y c_p & s_y s_p s_r + c_y c_r & s_y s_p c_r - c_y s_r \\ -s_p & c_p s_r & c_p c_r \end{bmatrix} $$

Inverse Mapping
The inverse relationships are found from inspection of the rotation matrix above:
 * $$r = \textrm{atan2}(R_{32}, R_{33})$$
 * $$y = \textrm{atan2}(R_{21}, R_{11})$$
 * $$p = \textrm{atan2}(-R_{31}, c_{y} R_{11} + s_{y} R_{21})$$

Note: The above equations are badly numerically conditioned for values of $$p$$ near $$\pi/2$$ and $$-\pi/2$$.

Unit Quaternions
Unit quaternions (quaternions of which the absolute value equals 1) are another representation of orientation. They can be seen as a compromise between the advantages and disadvantages of rotation matrices and Euler angle sets.

Homogeneous Transform
The notations above describe only relative orientation. The coordinates of a point $$ _a p $$ with $$ _b p$$ relative to a frame $$\{b\}$$, rotated and translated with respect to a reference frame $$\{a\}$$, are given by:


 * $$_{a} p = \, ^{b}_{a} R \, _{b} p + _{a} p ^{a,b}$$

This can be compacted into the form of a homogeneous transformation matrix or pose (matrix). It is defined as follows:
 * $$^{b}_{a}T = \begin{bmatrix} ^{b}_{a} R & _{a} p^{a,b} \\ 0_{1 \times 3} & 1 \end{bmatrix}$$

This matrix represents the position and orientation of a frame $$\{b\}$$ whose origin, relative to a reference frame $$\{a\}$$, is described by $$_{a} p^{a,b}$$, and whose orientation, relative to the same reference frame $$\{a\}$$, is described by the rotation matrix $$^{b}_{a}R \,$$.

$$^{b}_{a}T \,$$ is, thus, the representation of a frame in three-dimensional space. If the coordinates of a point $$p$$ are known with respect to a frame $$\{b\}$$, then its coordinates, relative to $$\{a\}$$ are found by:

\begin{bmatrix} _{a} p \\ 1 \end{bmatrix} = \, ^{b}_{a} T \begin{bmatrix} _{b} p \\ 1 \end{bmatrix} $$

This is the same as writing:
 * $$_{a} p = \, ^{b}_{a} R \, _{b} p + _{a} p ^{a,b}$$

Note that the above vectors are extended with a fourth coordinate equal to one: they're made homogeneous.

As was the case with rotation matrices, homogeneous transformation matrices can be interpreted in an active ("displacement"), and a passive ("pose") manner. It is also a non-minimal representation of a pose, that does not suffer from coordinate singularities.

Compound Poses
If the pose of a frame $$\{c\}$$ is known, relative to $$\{b\}$$, whose pose is known with respect to a third frame $$\{a\}$$, the resulting pose $$^{c}_{a}T \,$$ is found as follows:


 * $$^{c}_{a}T = \, ^{b}_{a}T \, ^{c}_{b}T$$

Graphical Representation of Compound Poses
If we know the transformation $$^b _a T$$ from frame $$\{b\}$$ relative to reference frame $$\{a\}$$ and the transformation $$^c _b T$$ from frame $$\{c\}$$ to $$\{b\}$$, we can describe the transformation from $$^c _a T$$ from frame $$\{c\}$$ to reference frame $$\{a\}$$.

$$ ^c_a T= \,^b _a T\, ^c _b T $$



Additional Examples of Homogeneous Transforms
/Additional Examples of Homogeneous Transforms/

Finite Displacement Twist
A pose matrix is a non-minimal way of describing a pose. A frequently used minimal alternative is the finite displacement twist:

t = \begin{bmatrix} \alpha \\ \beta \\ \gamma \\ x \\ y \\ z \end{bmatrix} $$

Here, $$\alpha$$, $$\beta$$ and $$\gamma$$ are a valid set (any) of Euler angles, while $$x$$, $$y$$ and $$z$$ are the coordinates of a reference point on the rigid body. == Forward Kinematics (Copied and Edited from Link and Link ) ==

Forward kinematics refers to the use of the kinematic equations of a robot to compute the position of the end effector from specified values for the joint parameters.

The kinematics equations of the robot are used in robotics, computer games, and animation. The reverse process that computes the joint parameters that achieve a specified position of the end effector is known as inverse kinematics.



Forward Position Kinematics
The forward position kinematics problem is: given the different joint angles, what is the position of the end-effector? With the previous sections in mind, the answer is: construct the different transformation matrices and combine them in the right way, the result being $$^{ee}_{bs}T \,$$, where $$\{bs\}$$ is the base frame of the robot manipulator.

Solution
Suppose the mutual orientation matrices between adjacent links are known. (As the fixed parameters of each link are known, and the joint angles are a given to the problem, these can be calculated. One possible way to do this would be to make use of the Denavit-Hartenberg convention.) The transformation that relates the last and first frames in a serial manipulator arm, and thus, the solution to the forward kinematics problem, is then represented by the compound homogeneous transformation matrix. The axes are moving, thus, the compound homogeneous transformation matrix is found by multiplying the individual transformation matrices:
 * $$^{ee}_{bs}T = \, ^{N}_{0}T = \, ^{1}_{0}T \, ^{2}_{1}T \ldots \, ^{N-1}_{N-2}T \,^{N}_{N-1}T$$

The Planar Three-Link Manipulator


The equations below use 3 &times; 3 pose matrices (homogeneous transformations), as this is just a 2-dimensional case (cf. the figure on the right).

The pose of the first link, relative to the reference frame, is given by (recall the elementary rotation about the z-axis from the previous section):

T_1(\theta_1) = \begin{bmatrix} \cos(\theta_1) & -\sin(\theta_1) & 0 \\ \sin(\theta_1) & \cos(\theta_1) & 0 \\ 0 & 0 & 1 \end{bmatrix} $$

The pose of the second link, relative to the first link, is given by:

T_2(\theta_2) = \begin{bmatrix} \cos(\theta_2) & -\sin(\theta_2) & l_1 \\ \sin(\theta_2) & \cos(\theta_2) & 0 \\ 0 & 0 & 1 \end{bmatrix} $$

This corresponds to a rotation by an angle $$\theta_2$$ and a translation by a distance $$l_1$$, where $$l_1$$ is the length of the first link.

The pose of the third link, relative to the second link, is given by:

T_3(\theta_3) = \begin{bmatrix} \cos(\theta_3) & -\sin(\theta_3) & l_2 \\ \sin(\theta_3) & \cos(\theta_3) & 0 \\ 0 & 0 & 1 \end{bmatrix} $$

The pose of the end effector, relative to the third link, is given by:

T_4 = \begin{bmatrix} 1 & 0 & l_3 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} $$

The solution to the forward kinematics problem is then:
 * $$^{ee}_{bs}T = \, ^4_0T(\theta_1, \theta_2, \theta_3) =

\begin{bmatrix} c_{123} & -s_{123} & l_1 c_1 + l_2 c_{12} + l_3 c_{123} \\ s_{123} & c_{123} & l_1 s_1 + l_2 s_{12} + l_3 s_{123} \\ 0 & 0 & 1 \end{bmatrix} $$

Hence:

\begin{bmatrix} x \\ y \\ 1 \end{bmatrix} = T \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} $$

The resulting kinematic equations are:

\begin{array}{l} x = l_1 \cos \theta_1 + l_2 \cos(\theta_1 + \theta_2) + l_3 \cos(\theta_1 + \theta_2 + \theta_3) \\ y = l_1 \sin \theta_1 + l_2 \sin(\theta_1 + \theta_2) + l_3 \sin(\theta_1 + \theta_2 + \theta_3) \end{array} $$

Two Configurations for the Same Resulting Location of the End Effector


We can demonstrate how to have the same position of an end effector with two different configurations of the planar serial manipulator.

Kinematic Equations for a Serial Manipulating Robotic Arm
The kinematic equations for the series chain of a robot are obtained using a rigid transformation [Z] to characterize the relative movement allowed at each joint and separate rigid transformation [X] to define the dimensions of each link. The result is a sequence of rigid transformations alternating joint and link transformations from the base of the chain to its end link, which is equated to the specified position for the end link,
 * $$[T] = [Z_1][X_1][Z_2][X_2]\ldots[X_{n-1}][Z_n][X_n],\!$$

where [T] is the transformation locating the end-link. These equations are called the kinematics equations of the serial chain.

==Denavit-Hartenberg Notation (Copied from Link and Link )== In 1955, Jacques Denavit and Richard Hartenberg introduced a convention for the definition of the joint matrices [Z] and link matrices [X] to standardize the coordinate frame for spatial linkages. This convention positions the joint frame so that it consists of a screw displacement along the Z-axis
 * $$ [Z_i] = \operatorname{Trans}_{Z_{i}}(d_i) \operatorname{Rot}_{Z_{i}}(\theta_i),$$

and it positions the link frame so it consists of a screw displacement along the X-axis,
 * $$ [X_i]=\operatorname{Trans}_{X_i}(a_{i,i+1})\operatorname{Rot}_{X_i}(\alpha_{i,i+1}).$$

Using this notation, each transformation-link goes along a serial chain robot, and  can be described by the coordinate transformation,
 * $$^{i}_{i-1}T = [Z_i][X_i] =

\operatorname{Trans}_{Z_{i}}(d_i) \operatorname{Rot}_{Z_{i}}(\theta_i) \operatorname{Trans}_{X_i}(a_{i,i+1}) \operatorname{Rot}_{X_i}(\alpha_{i,i+1}),$$ where θi, di, αi,i+1 and ai,i+1 are known as the Denavit-Hartenberg parameters.

Kinematics equations revisited
The kinematics equations of a serial chain of n links, with joint parameters θi are given by
 * $$[T] = ^{n}_{0}T = \prod_{i=1}^{n} {^i _{i - 1}T(\theta_i)},$$

where $$^{i}_{i - 1}T(\theta_i)$$ is the transformation matrix from the frame of link $$i$$ to link $$ i-1$$. In robotics, these are conventionally described by Denavit–Hartenberg parameters.

Denavit-Hartenberg matrix
The matrices associated with these operations are:
 * $$\operatorname{Trans}_{Z_{i}}(d_i)

= \begin{bmatrix} 1 & 0 & 0 & 0 \\   0 & 1 & 0 & 0 \\    0 & 0 & 1 & d_i \\ 0 & 0 & 0 & 1 \end{bmatrix}, \quad \operatorname{Rot}_{Z_{i}}(\theta_i) = \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}. $$ Similarly,
 * $$\operatorname{Trans}_{X_i}(a_{i,i+1})

= \begin{bmatrix} 1 & 0 & 0 & a_{i,i+1} \\ 0 & 1 & 0 & 0 \\   0 & 0 & 1 & 0 \\    0 & 0 & 0 & 1  \end{bmatrix},\quad \operatorname{Rot}_{X_i}(\alpha_{i,i+1}) = \begin{bmatrix} 1 & 0 & 0 & 0 \\   0 & \cos\alpha_{i,i+1} & -\sin\alpha_{i,i+1} & 0 \\ 0 & \sin\alpha_{i,i+1} & \cos\alpha_{i,i+1} & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}. $$

The use of the Denavit-Hartenberg convention yields the link transformation matrix, [ii-1T] as
 * $$ {^i} _{i-1} T

= \begin{bmatrix} \cos\theta_i & -\sin\theta_i \cos\alpha_{i,i+1} & \sin\theta_i \sin\alpha_{i,i+1} & a_{i,i+1} \cos\theta_i \\ \sin\theta_i & \cos\theta_i \cos\alpha_{i,i+1} & -\cos\theta_i \sin\alpha_{i,i+1} & a_{i,i+1} \sin\theta_i \\ 0 & \sin\alpha_{i,i+1} & \cos\alpha_{i,i+1} & d_i \\ 0 & 0 & 0 & 1 \end{bmatrix}, $$ known as the Denavit-Hartenberg matrix.

Denavit-Hartenberg Notation Re-visited
In mechanical engineering, the Denavit–Hartenberg parameters (also called DH parameters) are the four parameters associated with a particular convention for attaching reference frames to the links of a spatial kinematic chain, or robot manipulator.

Jacques Denavit and Richard Hartenberg introduced this convention in 1955 in order to standardize the coordinate frames for spatial linkages.

Richard Paul demonstrated its value for the kinematic analysis of robotic systems in 1981. While many conventions for attaching reference frames have been developed, the Denavit–Hartenberg convention remains a popular approach.

Denavit–Hartenberg Convention and Transformations
A commonly used convention for selecting frames of reference in robotics applications is the Denavit and Hartenberg (D–H) convention which was introduced by Jacques Denavit and Richard S. Hartenberg. In this convention, coordinate frames are attached to the joints between two links such that one transformation is associated with the joint, [Z], and the second is associated with the link [X]. The coordinate transformations along a serial robot consisting of n links form the kinematics equations of the robot,
 * $$[T] = [Z_1][X_1][Z_2][X_2]\ldots[X_{n-1}][Z_n][X_n],\!$$

where [T] is the transformation locating the end-link.

In order to determine the coordinate transformations [Z] and [X], the joints connecting the links are modeled as either hinged or sliding joints, each of which have a unique line S in space that forms the joint axis and define the relative movement of the two links. A typical serial robot is characterized by a sequence of six lines Si, i = 1,...,6, one for each joint in the robot. For each sequence of lines Si and Si+1, there is a common normal line Ai,i+1. The system of six joint axes Si and five common normal lines Ai,i+1 form the kinematic skeleton of the typical six degree of freedom serial robot. Denavit and Hartenberg introduced the convention that Z coordinate axes are assigned to the joint axes Si and X coordinate axes are assigned to the common normals Ai,i+1.

This convention allows the definition of the movement of links around a common joint axis Si by the screw displacement,
 * $$ [Z_i]=\begin{bmatrix}\cos\theta_i & -\sin\theta_i & 0 & 0 \\ \sin\theta_i & \cos\theta_i & 0 & 0 \\ 0 & 0 & 1 & d_i \\ 0 & 0 & 0 & 1\end{bmatrix},$$

where θi is the rotation around and di is the slide along the Z axis—either of the parameters can be constants depending on the structure of the robot. Under this convention the dimensions of each link in the serial chain are defined by the screw displacement around the common normal Ai,i+1 from the joint Si to Si+1, which is given by
 * $$ [X_i]=\begin{bmatrix} 1 & 0 & 0 & a_{i,i+1} \\ 0 & \cos\alpha_{i,i+1} & -\sin\alpha_{i,i+1} & 0 \\ 0& \sin\alpha_{i,i+1} & \cos\alpha_{i,i+1} & 0 \\ 0 & 0 & 0 & 1\end{bmatrix},$$

where αi,i+1 and ri,i+1 define the physical dimensions of the link in terms of the angle measured around and distance measured along the X axis.

In summary, the reference frames are laid out as follows:
 * 1) the $$z$$-axis is in the direction of the joint axis
 * 2) the $$x$$-axis is parallel to the common normal: $$x_n = z_n \times z_{n-1} $$ (or away from zn-1) If there is no unique common normal (parallel $$z$$ axes), then $$d$$ (below) is a free parameter.  The direction of $$x_n$$ is from $$z_{n - 1}$$ to $$z_n$$, as shown in the video below.
 * 3) the $$y$$-axis follows from the $$x$$- and $$z$$-axis by choosing it to be a right-handed coordinate system.

Four parameters


The following four transformation parameters are known as D–H parameters:.


 * $$d\,$$: offset along previous $$z$$ to the common normal
 * $$\theta\,$$: angle about previous $$z$$, from old $$x$$ to new $$x$$
 * $$a\,$$: length of the common normal (do not confuse with $$\alpha$$). Assuming a revolute joint, this is the radius about previous $$z$$.
 * $$\alpha\,$$: angle about common normal, from old $$z$$ axis to new $$z$$ axis

A visualization of D–H parameterization is available: YouTube

There is some choice in frame layout as to whether the previous $$x$$ axis or the next $$x$$ points along the common normal. The latter system allows branching chains more efficiently, as multiple frames can all point away from their common ancestor, but in the alternative layout the ancestor can only point toward one successor. Thus the commonly used notation places each down-chain $$x$$ axis collinear with the common normal, yielding the transformation calculations shown below.

We can note constraints on the relationships between the axes:


 * the $$x_n$$-axis is perpendicular to both the $$z_{n - 1}$$ and $$z_n$$ axes
 * the $$x_n$$-axis intersects both $$z_{n - 1}$$ and $$z_n$$ axes
 * the origin of joint $$n$$ is at the intersection of $$x_n$$ and $$z_n$$
 * $$y_n$$ completes a right-handed reference frame based on $$x_n$$ and $$z_n$$

Denavit–Hartenberg matrix
It is common to separate a screw displacement into the product of a pure translation along a line and a pure rotation about the line, so that


 * $$ [Z_i] = \operatorname{Trans}_{Z_{i}}(d_i) \operatorname{Rot}_{Z_{i}}(\theta_i),$$

and
 * $$ [X_i]=\operatorname{Trans}_{X_i}(a_{i,i+1})\operatorname{Rot}_{X_i}(\alpha_{i,i+1}).$$

Using this notation, each link can be described by a coordinate transformation from the concurrent coordinate system to the previous coordinate system.


 * $${^n}_{n - 1}T

= \operatorname{Trans}_{z_{n - 1}}(d_n) \cdot \operatorname{Rot}_{z_{n - 1}}(\theta_n) \cdot \operatorname{Trans}_{x_n}(r_n) \cdot \operatorname{Rot}_{x_n}(\alpha_n)$$

Note that this is the product of two screw displacements, The matrices associated with these operations are:


 * $$\operatorname{Trans}_{z_{n - 1}}(d_n)

= \left[ \begin{array}{ccc|c} 1 & 0 & 0 & 0 \\   0 & 1 & 0 & 0 \\    0 & 0 & 1 & d_n \\ \hline 0 & 0 & 0 & 1 \end{array} \right] $$


 * $$\operatorname{Rot}_{z_{n - 1}}(\theta_n)

= \left[ \begin{array}{ccc|c} \cos\theta_n & -\sin\theta_n & 0 & 0 \\ \sin\theta_n & \cos\theta_n & 0 & 0 \\ 0 & 0 & 1 & 0 \\   \hline 0 & 0 & 0 & 1 \end{array} \right] $$


 * $$\operatorname{Trans}_{x_n}(a_n)

= \left[ \begin{array}{ccc|c} 1 & 0 & 0 & a_n \\ 0 & 1 & 0 & 0 \\   0 & 0 & 1 & 0 \\    \hline 0 & 0 & 0 & 1 \end{array} \right] $$


 * $$\operatorname{Rot}_{x_n}(\alpha_n)

= \left[ \begin{array}{ccc|c} 1 & 0 & 0 & 0 \\   0 & \cos\alpha_n & -\sin\alpha_n & 0 \\ 0 & \sin\alpha_n & \cos\alpha_n & 0 \\ \hline 0 & 0 & 0 & 1 \end{array} \right] $$

This gives:


 * $$\operatorname{^n}_{n - 1}T

= \left[ \begin{array}{ccc|c} \cos\theta_n & -\sin\theta_n \cos\alpha_n & \sin\theta_n \sin\alpha_n & a_n \cos\theta_n \\ \sin\theta_n & \cos\theta_n \cos\alpha_n & -\cos\theta_n \sin\alpha_n & a_n \sin\theta_n \\ 0 & \sin\alpha_n & \cos\alpha_n & d_n \\ \hline 0 & 0 & 0 & 1 \end{array} \right]

=

\left[ \begin{array}{ccc|c} & &  &  \\     & R &  & T \\ & & &  \\    \hline 0 & 0 & 0 & 1 \end{array} \right] $$

where R is the 3×3 submatrix describing rotation and  T is the 3×1 submatrix describing translation.

In some books, the order of transformation for a pair of consecutive rotation and translation (such as $$ d_n$$and $$\theta_n $$) is replaced. However, because matrix multiplication order for such pair does not matter, the result is the same. For example: $$\operatorname{Trans}_{z_{n - 1}}(d_n) \cdot \operatorname{Rot}_{z_{n - 1}}(\theta_n) = \operatorname{Rot}_{z_{n - 1}}(\theta_n) \cdot \operatorname{Trans}_{z_{n - 1}}(d_n) $$.

Use of Denavit and Hartenberg matrices
The Denavit and Hartenberg notation gives a standard methodology to write the kinematic equations of a manipulator. This is especially useful for serial manipulators where a matrix is used to represent the pose (position and orientation) of one body with respect to another.

The position of body $$n$$ with respect to $$n-1$$ may be represented by a position matrix indicated with the symbol $$ T $$ or $$ M $$
 * $$  \operatorname{^n}_{n - 1}T = M_{n-1,n} $$

This matrix is also used to transform a point from frame $$n$$ to $$n-1$$


 * $$  M_{n-1,n} =  \left[ \begin{array}{ccc|c} R_{xx} & R_{xy} & R_{xz} & T_x \\ R_{yx} & R_{yy} & R_{yz} & T_y \\ R_{zx} & R_{zy} & R_{zz} & T_z \\

\hline 0 & 0 & 0 & 1 \end{array}\right] $$ Where the upper left $$3\times 3$$ submatrix of $$M$$ represents the relative orientation of the two bodies, and the upper right $$3\times 1$$ represents their relative position or more specifically the body position in frame n − 1 represented with element of frame n.

The position of body $$k$$ with respect to body $$i$$ can be obtained as the product of the matrices representing the pose of $$j$$ with respect of $$i$$ and that of $$k$$ with respect of $$j$$


 * $$ M_{i,k}= M_{i,j} M_{j,k} $$

An important property of Denavit and Hartenberg matrices is that the inverse is
 * $$  M^{-1} =

\left[ \begin{array}{ccc|c} & &  &  \\     & R^T &  & -R^T T \\ & & &  \\    \hline 0 & 0 & 0 & 1 \end{array} \right] $$ where $$ R^T $$ is both the transpose and the inverse of the orthogonal matrix $$ R $$, i.e. $$ R^{-1}_{ij}=R^T_{ij} = R_{ji} $$.

Example of Planar, Three-link Manipulator with D-H Parameters


D-H Parameters for planar manipulator with three links

Link 1: $$d_1=0$$, $$\theta_1=\theta_{1}$$, $$a_1=l_1$$, and $$\alpha_1=0$$

Link 2: $$d_2=0$$, $$\theta_2=\theta_{2}$$, $$a_2=l_2$$, and $$\alpha_2=0$$

Link 3: $$d_3=0$$, $$\theta_3=\theta_{3}$$, $$a_3=l_3$$, and $$\alpha_3=0$$

Animated Example of the Top-Down Perspective of a Three-link Manipulator with D-H Parameters


D-H Parameters for serial manipulator with three links

Link 1: $$d_1=0.1$$, $$\theta_1=\theta_{1}$$, $$a_1=l_1$$, and $$\alpha_1=0$$

Link 2: $$d_2=0.1$$, $$\theta_2=\theta_{2}$$, $$a_2=l_2$$, and $$\alpha_2=0$$

Link 3: $$d_3=0.1$$, $$\theta_3=\theta_{3}$$, $$a_3=l_3$$, and $$\alpha_3=0$$

We vary $$\theta_1$$ from 0 to 45 degrees over 10 frames while the other joint angles remain constant with $$\theta_2=0$$ and $$\theta_3=45^o$$.

3D Example of a Three-link Manipulator with D-H Parameters
D-H Parameters for serial manipulator with three links

Link 1: $$d_1=0.1$$, $$\theta_1=45^o$$, $$a_1=l_1$$, and $$\alpha_1=0$$

Link 2: $$d_2=0.1$$, $$\theta_2=45^o$$, $$a_2=l_2$$, and $$\alpha_2=0$$

Link 3: $$d_3=0.1$$, $$\theta_3=45^o$$, $$a_3=l_3$$, and $$\alpha_3=0$$

We use D-H notation, but we have to perform "extra" calculations to determine the locations of Joint 1 on Link 1 (J1L1), Joint 2 on Link 2 (J2L2), and Joint 3 on Link 3 (J3L3). One way to envision their locations (Joint $$i$$ on Link $$i$$) relative to the Joint $$i+1$$ on link $$i$$ is to remember them as being offset by $$a_i$$. Thus, we can find the location of Joint 1 on Link 1 in the global reference frame with the following D-H transformation:

$$ _1 p_1=^2 _1 T \begin{bmatrix} -a_1 \\ 0 \\   0 \\    1  \end{bmatrix} $$

3D Example of an Animated, Three-link Manipulator with D-H Parameters
D-H Parameters for a serial manipulator with three links

Link 1: $$d_1=0.1$$, $$\theta_1=\theta_{1}$$, $$a_1=l_1$$, and $$\alpha_1=0$$

Link 2: $$d_2=0.1$$, $$\theta_2=\theta_{2}$$, $$a_2=l_2$$, and $$\alpha_2=0$$

Link 3: $$d_3=0.1$$, $$\theta_3=\theta_{3}$$, $$a_3=l_3$$, and $$\alpha_3=0$$

We vary $$\theta_1$$, $$\theta_2$$, and $$\theta_3$$ from 0 to 45 degrees over 10 frames.

Addtional Examples for Denavit-Hartenberg Parameters
/Additional Examples for Denavit-Hartenberg Parameters/

Modified DH parameters
Some books such as Introduction to Robotics: Mechanics and Control (3rd Edition) use modified DH parameters. The difference between the classic DH parameters and the modified DH parameters are the locations of the coordinates system attachment to the links and the order of the performed transformations. Compared with the classic DH parameters, the coordinates of frame $$O_{i-1}$$ is put on axis i − 1, not the axis i in classic DH convention. The coordinates of $$O_{i}$$ is put on the axis i, not the axis i + 1 in classic DH convention.

Another difference is that according to the modified convention, the transform matrix is given by the following order of operations:



{^n}_{n - 1}T = \operatorname{Rot}_{x_{n-1}}(\alpha_{n-1}) \cdot \operatorname{Trans}_{x_{n-1}}(a_{n-1}) \cdot \operatorname{Rot}_{z_{n}}(\theta_n) \cdot \operatorname{Trans}_{z_{n}}(d_n) $$

Thus, the matrix of the modified DH parameters becomes


 * $$\operatorname{^n}_{n - 1}T

= \left[ \begin{array}{ccc|c} \cos\theta_n & -\sin\theta_n & 0 & a_{n-1} \\ \sin\theta_n \cos\alpha_{n-1} & \cos\theta_n \cos\alpha_{n-1} & -\sin\alpha_{n-1} & -d_n \sin\alpha_{n-1} \\ \sin\theta_n\sin\alpha_{n-1} & \cos\theta_n \sin\alpha_{n-1} & \cos\alpha_{n-1} & d_n \cos\alpha_{n-1} \\ \hline 0 & 0 & 0 & 1 \end{array} \right] $$

Note that some books (e.g.: ) use $$a_n$$ and $$\alpha_n$$ to indicate the length and twist of link n − 1 rather than link n. As a consequence, $${}^{n - 1}T_n$$ is formed only with parameters using the same subscript.

In some books, the order of transformation for a pair of consecutive rotation and translation (such as $$ d_n$$and $$\theta_n $$) is replaced. However, because matrix multiplication order for such pair does not matter, the result is the same. For example: $$\operatorname{Trans}_{z_{n}}(d_n) \cdot \operatorname{Rot}_{z_{n}}(\theta_n) = \operatorname{Rot}_{z_{n}}(\theta_n) \cdot \operatorname{Trans}_{z_{n}}(d_n) $$.

Surveys of DH conventions and its differences have been published.

Velocity and Acceleration in Kinematics
Further matrices can be defined to represent velocity and acceleration of bodies. The velocity of body $$i$$ with respect to body $$j$$ can be represented in frame $$k$$ by the matrix
 * $$ W_{i,j(k)}=\left[ \begin{array}{ccc|c} 0 & -\omega_z & \omega_y & v_x \\ \omega_z & 0 & -\omega_x & v_y \\ -\omega_y & \omega_x & 0 & v_z \\

\hline 0 & 0 & 0 & 0 \end{array}\right]$$ where $$ \omega $$ is the angular velocity of body $$ j $$ with respect to body $$ i $$ and all the components are expressed in frame $$ k $$; $$ v $$ is the velocity of one point of body $$ j $$ with respect to body $$ i $$ (the pole). The pole is the point of $$ j $$ passing through the origin of frame $$i$$.

The acceleration matrix can be defined as the sum of the time derivative of the velocity plus the velocity squared
 * $$ H_{i,j(k)}=\dot{W}_{i,j(k)}+W_{i,j(k)}^2 $$

The velocity and the acceleration in frame $$ i $$ of a point of body $$ j $$ can be evaluated as
 * $$\dot{P} = W_{i,j} P $$
 * $$\ddot{P} = H_{i,j} P $$

It is also possible to prove that


 * $$\dot{M}_{i,j} = W_{i,j(i)} M_{i,j} $$


 * $$\ddot{M}_{i,j} = H_{i,j(i)} M_{i,j} $$

Velocity and acceleration matrices add up according to the following rules


 * $$ W_{i,k}= W_{i,j} + W_{j,k} $$


 * $$ H_{i,k}= H_{i,j} + H_{j,k} + 2W_{i,j} W_{j,k}$$

in other words the absolute velocity is the sum of the parent velocity plus the relative velocity; for the acceleration the Coriolis' term is also present.

The components of velocity and acceleration matrices are expressed in an arbitrary frame $$k$$ and transform from one frame to another by the following rule


 * $$ W_{(h)}=M_{h,k} W_{(k)} M_{k,h} $$
 * $$ H_{(h)}=M_{h,k} H_{(k)} M_{k,h} $$

== Jacobian Matrix (Portions Copied from Link, Link, and Link) ==

The time derivative of the kinematics equations yields the Jacobian of the robot, which relates the joint rates to the linear and angular velocity of the end-effector. The principle of virtual work shows that the Jacobian also provides a relationship between joint torques and the resultant force and torque applied by the end-effector. Singular configurations of the robot are identified by studying its Jacobian.

Velocity kinematics
The robot Jacobian results in a set of linear equations that relate the joint rates to the six-vector formed from the angular and linear velocity of the end-effector, known as a twist. Specifying the joint rates yields the end-effector twist directly.

Twists
A popular, and minimal way to represent the time derivative of a pose is a twist. A twist consists of two 3 &#215; 1 vectors: $$\omega$$ and $$v$$, where $$\omega$$ is the angular velocity of the moving rigid body (manipulator link), and $$v$$ is the linear velocity of the point on the moving rigid body that instantaneously coincides with the origin of the reference frame.

$$t = \begin{bmatrix} \begin{array}{c} \omega \\ v \end{array} \end{bmatrix}$$

Propagation of Velocity
Rotational velocities that are written with respect to the same frame can simply be added. Hence:

_{i + 1} \omega_{i + 1} = \, ^i _{i + 1} R \, _i \omega_i + \begin{bmatrix} 0 \\ 0 \\ \dot{\theta}_{i + 1} \end{bmatrix} $$

The linear velocity of the origin of a link is that of the origin of the preceding link plus a rotational component:

_{i + 1} v_{i + 1} = \, ^i _{i + 1} R \left( _i v_i + _i \omega_i \times \, _i P_{i + 1} \right) $$

Note: In the above equations the resulting velocities are expressed relative to the frame of the current link. $$_i P_{i + 1}$$ is the vector pointing from the origin of frame $${i}$$ to that of frame $${i + 1}$$.

Example: The Two-Link Planar Manipulator
The link transformations that come with this manipulator can be easily derived graphically from looking at the figure on the right:

^1 _0 T = \begin{bmatrix} c_1 & -s_1 & 0 & 0 \\ s_1 & c_1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{bmatrix} $$



^2 _1 T = \begin{bmatrix} c_2 & -s_2 & 0 & l_1 \\ s_2 & c_2 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{bmatrix} $$



^3 _2 T = \begin{bmatrix} 1 & 0 & 0 & l_2 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{bmatrix} $$

Here, $$l_1$$ and $$l_2$$ are the lengths link 1 and 2, respectively.

Note: Notice again the use of $$s_i$$ and $$c_i$$ as shorthand notations for $$sin(\theta_i)$$ and $$cos(\theta_i)$$, respectively.

Hence, from the above equations:

_2 \omega_2 = \begin{bmatrix} 0 \\ 0 \\ \dot{\theta_1} + \dot{\theta_2} \end{bmatrix} $$ and:

_3 \omega_3 = _2 \omega_2 $$

Also:

_2 v_2 = \begin{bmatrix} c_2 & s_2 & 0 \\ -s_2 & c_2 & 0 \\ 0 & 0 & 1 \end{bmatrix} \left[ \begin{bmatrix} 0 \\ 0 \\ \dot{\theta_1} \end{bmatrix} \times \begin{bmatrix} l_1 \\ 0 \\ 0 \end{bmatrix} \right] = \begin{bmatrix} l_1 s_2 \dot{\theta_1} \\ l_1 c_2 \dot{\theta_1} \\ 0 \end{bmatrix} $$ and:

_3 v_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \left[ \begin{bmatrix} l_1 s_2 \dot{\theta_1} \\ l_1 c_2 \dot{\theta_1} \\ 0 \end{bmatrix} + \begin{bmatrix} 0 \\ 0 \\ \dot{\theta_1} + \dot{\theta_2} \end{bmatrix} \times \begin{bmatrix} l_2 \\ 0 \\ 0 \end{bmatrix} \right] = \begin{bmatrix} l_1 s_2 \dot{\theta_1} \\ l_1 c_2 \dot{\theta_1} + l_2 ( \dot{\theta_1} + \dot{\theta_2} ) \\ 0 \end{bmatrix} $$

With respect to the base frame, the end-effector velocity becomes:

_0 v_3 = \, _0 ^3 R \, _3 v_3 = \, _0 ^1 R \, _1 ^2 R \, _2 ^3 R \, _3 v_3 = \begin{bmatrix} -l_1 s_1 \dot{\theta_1} - l_2 s_{12} (\dot{\theta_1} + \dot{\theta_2}) \\ l_1 c_1 \dot{\theta_1} + l_2 c_{12} (\dot{\theta_1} + \dot{\theta_2}) \\ 0 \end{bmatrix} $$

Jacobian
Suppose $$m$$ kinematic (end-effector) equations. Each is a function of $$n$$ degrees of freedom:

\begin{array}{ccc} x_1 & = & x_1(\theta_1, \ldots, \theta_n) \\ \vdots & & \vdots \\ x_m & = & x_m(\theta_1, \ldots, \theta_n) \\ \end{array} $$

Note that in the case of a non-redundant manipulator, $$m = n$$.

The time derivate of the above equations is found as follows:

\begin{array}{ccc} \dfrac{dx_1}{dt} & = & \dfrac{\partial x_1}{\partial \theta_1} \dfrac{d \theta_1}{dt} + \cdots + \dfrac{\partial x_1}{\partial \theta_n} \dfrac{d \theta_n}{dt} \\ \vdots & & \vdots \\ \dfrac{dx_m}{dt} & = & \dfrac{\partial x_m}{\partial \theta_1} \dfrac{d \theta_1}{dt} + \cdots + \dfrac{\partial x_m}{\partial \theta_n} \dfrac{d \theta_n}{dt} \end{array} $$

This can be written in vector form:

v = J \frac{d \theta}{dt} $$

The matrix $$J$$ is called the Jacobian, the matrix of which the elements are the partial derivatives of the kinematics equations. The relationship between the end-effector velocity and the (known) joint velocities is thus fully described by the Jacobian. The end-effector velocity is a linear function of the joint velocities.

$$J = \begin{bmatrix} \frac{\partial x_1}{\partial \theta_1} & \cdots & \frac{\partial x_1}{\partial \theta_n} \\ \vdots & \ddots & \vdots \\ \frac{\partial x_m}{\partial \theta_1} & \cdots & \frac{\partial x_m}{\partial \theta_n} \end{bmatrix} $$

Example: The Two-Link Planar Manipulator
This example presents a slightly other way of solving the above problem. The position kinematics equations of this manipulator can be easily derived using the technique presented in the Serial Manipulator Position Kinematics section, or graphically from looking at the figure above:

\begin{array}{l} x = l_1 \cos(\theta_1) + l_2 \cos(\theta_1 + \theta_2) \\ y = l_1 \sin(\theta_1) + l_2 \sin(\theta_1 + \theta_2) \end{array} $$

Here, the Jacobian is:
 * $$J =

\begin{bmatrix} -l_1 \sin(\theta_1) - l_2 \sin(\theta_1 + \theta_2) & -l_2 \sin(\theta_1 + \theta_2) \\ l_1 \cos(\theta_1) + l_2 \cos(\theta_1 + \theta_2) & l_2 \cos(\theta_1 + \theta_2) \\ \end{bmatrix} $$

Hence, the end-effector velocity is:

\begin{array}{ccc} \dfrac{dx}{dt} & = & \left[ -l_1 \sin(\theta_1) - l_2 \sin(\theta_1 + \theta_2) \right] \dfrac{d \theta_1}{dt} - l_2 \sin(\theta_1 + \theta_2) \dfrac{d \theta_2}{dt} \\ \dfrac{dy}{dt} & = & \left[ l_1 \cos(\theta_1) + l_2 \cos(\theta_1 + \theta_2) \right] \dfrac{d \theta_1}{dt} + l_2 \cos(\theta_1 + \theta_2) \dfrac{d \theta_2}{dt} \\ \end{array} $$

Note that the end-effector's angular velocity is, of course, the sum of the joint velocities. Another possibility that yields exactly the same result would be to explicitly include the equation for angular velocity and then calculate the Jacobian accordingly. This result is, as could already be expected, the same as the one in the above example, where the link transformation matrices were used to achieve the result.

Additional Examples for Jacobian Matrices in Robotics
/Additional Examples for Jacobian Matrices for Robotics/

== Quaternions for Rotation (forthcoming, but see this link ) ==