Forward kinematics example

The RRRP (three revolute joints, followed by a prismatic joint) arm, also commonly referred to as the SCARA arm, is used as an example in the video below to determine the forward kinematics, using both options for the product of exponentials (PoE) formulas shown in previous videos.

In the video above, the instructor quickly shows an example for how to derive the forward kinematics of an RRRP robot arm, as shown in the figure below.

../../_images/RRRP.png

RRRP robot arm.

If we want to use the product of exponentials formula in the space frame, we need \(M\), and the joint screw axes expressed in the space frame \(\CoorSys{s}\). These were already derived in the video:

\[\begin{split}M = \begin{bmatrix} 0 & -1 & 0 & 19 \\ -1 & 0 & 0 & 0 \\ 0 & 0 & -1 & -3 \\ 0 & 0 & 0 & 1 \\ \end{bmatrix}\end{split}\]
\[\begin{split}\begin{align*} \Screw_1 &= \begin{bmatrix} 0 & 0 & 1 & 0 & 0 & 0 \end{bmatrix} \Transposed, & \Screw_{\omega,1} &= \begin{bmatrix} 0 & 0 & 1 \end{bmatrix}\Transposed, & \Screw_{v,1} &= \begin{bmatrix} 0 & 0 & 0 \end{bmatrix}\Transposed \\ \Screw_2 &= \begin{bmatrix} 0 & 0 & 1 & 0 & -10 & 0 \end{bmatrix} \Transposed, & \Screw_{\omega,2} &= \begin{bmatrix} 0 & 0 & 1 \end{bmatrix}\Transposed, & \Screw_{v,2} &= \begin{bmatrix} 0 & -10 & 0 \end{bmatrix}\Transposed \\ \Screw_3 &= \begin{bmatrix} 0 & 0 & 1 & 0 & -19 & 0 \end{bmatrix} \Transposed, & \Screw_{\omega,3} &= \begin{bmatrix} 0 & 0 & 1 \end{bmatrix}\Transposed, & \Screw_{v,3} &= \begin{bmatrix} 0 & -19 & 0 \end{bmatrix}\Transposed \\ \Screw_4 &= \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 1 \end{bmatrix} \Transposed, & \Screw_{\omega,4} &= \begin{bmatrix} 0 & 0 & 0 \end{bmatrix}\Transposed, & \Screw_{v,4} &= \begin{bmatrix} 0 & 0 & 1 \end{bmatrix}\Transposed \\ \end{align*}\end{split}\]

Note that the notation of the screw axes is only transposed to make it more readable. They are still treated as column arrays.

Now to apply the product of exponentials formula, we need the scary-looking formula from the lesson about exponential coordinates of rigid-body motion, but we will go through it step-by-step.

\[\begin{split}\exp(\TildeSkew{\Screw}\theta) = \begin{cases} \begin{bmatrix} \exp(\TildeSkew{\Screw}_{\omega}\theta) & (I\theta + \TildeSkew{\Screw}_{\omega}(1 - \cos\theta) + \TildeSkew{\Screw}_{\omega}^2(\theta -\sin\theta)) \Screw_{v} \\ 0 & 1 \end{bmatrix}, & \Norm{\Screw_{\omega}} = 1 \\ \begin{bmatrix} I & \Screw_v \theta \\ 0 & 1 \end{bmatrix}, & \Screw_{\omega} = 0,\; \Norm{\Screw_v} = 1 \end{cases}\end{split}\]

This equation must be found for all joints, and for every joint \(i\), the screw axis \(\Screw\) will be substituted with the joint’s screw axis \(\Screw_i\), and \(\theta\) will be substituted with the joint’s generalized coordinate: \(\GeneralizedCoordinate_i\). The full product of exponentials formula in the space frame for an \(n\)-joint manipulator then becomes:

\[\FromTo{b}{s}{\HomogeneousTransformationMatrix}(\Configuration) = \exp(\TildeSkew{\Screw}_1 \GeneralizedCoordinate_1)\exp(\TildeSkew{\Screw}_2 \GeneralizedCoordinate_2) \cdots \exp(\TildeSkew{\Screw}_n \GeneralizedCoordinate_n)M\]

We start with \(\Screw_1\). We can see that \(\Norm{\Screw_{\omega,1}}=1\), and additionally that \(\Screw_{v,1}=0\). The exponential therefore is given by the first case in the equation above. The top left element of the matrix on the right is the exponential coordinate representation of rotation. From the lesson on exponential coordinates of rotation we know that:

\[\exp(\TildeSkew{\UnitLength{\omega}}\theta) = I_3 + \TildeSkew{\UnitLength{\omega}}\sin\theta + \TildeSkew{\UnitLength{\omega}}^2\left(1-\cos\theta\right)\]

In this equation we can substitute the unit angular velocity \(\TildeSkew{\UnitLength{\omega}}\) by the angular velocity part of the joint screw axis (\(\Screw_\omega\)), and the travelled ‘distance’ or ‘angle’ \(\theta\) with the generalized coordinate of the joint: \(\GeneralizedCoordinate_i\).

\[\exp(\TildeSkew{\Screw}_{\omega,i} \GeneralizedCoordinate_i) = I_3 + \TildeSkew{\Screw}_{\omega,i}\sin \GeneralizedCoordinate_i + \TildeSkew{\Screw}_{\omega,i}^2\left(1-\cos \GeneralizedCoordinate_i\right)\]

Substituting gives:

\[\begin{split}\begin{align*} \exp(\TildeSkew{\Screw}_{\omega,1} \GeneralizedCoordinate_1) &= \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} + \begin{bmatrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix} \sin\GeneralizedCoordinate_1 + \begin{bmatrix} -1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 0 \end{bmatrix} (1 - \cos\GeneralizedCoordinate_1) \\ &= \begin{bmatrix} \cos\GeneralizedCoordinate_1 & -\sin\GeneralizedCoordinate_1 & 0 \\ \sin\GeneralizedCoordinate_1 & \cos\GeneralizedCoordinate_1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \end{align*}\end{split}\]

Then on to the top-right element of the exponential coordinates representation of rigid-body motion. Again we substitute the proper matrix and vector for \(\Screw_v\) and \(\TildeSkew{\Screw}_{\omega}\), and the generalized coordinate for \(\theta\). We can immediately see that \(\Screw_v=0\), effectively setting the entire term to zero.

For the first joint, the exponential representation therefore is:

\[\begin{split}\exp(\TildeSkew{\Screw}_1 \GeneralizedCoordinate_1) = \begin{bmatrix} \cos\GeneralizedCoordinate_1 & -\sin\GeneralizedCoordinate_1 & 0 & 0 \\ \sin\GeneralizedCoordinate_1 & \cos\GeneralizedCoordinate_1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}\end{split}\]

The second joint has the same angular velocity part of the joint screw axis, therefore the top-left part of the exponential representation will also be the same. The linear velocity part, however, is non-zero. Therefore we need to calculate the top-right part, let’s call it \(B\). We can substitute the proper values for \(\Screw_v\), \(\TildeSkew{\Screw}_{\omega}\), and \(\theta\) again:

\[\begin{split}\begin{align*} B &= \left( I\GeneralizedCoordinate_2 + \TildeSkew{\Screw}_{\omega,2}(1 - \cos\GeneralizedCoordinate_2) + \TildeSkew{\Screw}_{\omega,2}^2 (\GeneralizedCoordinate_2 - \sin\GeneralizedCoordinate_2) \right)\Screw_{v,2} \\ &= \left( \begin{bmatrix} \GeneralizedCoordinate_2 & 0 & 0 \\ 0 & \GeneralizedCoordinate_2 & 0 \\ 0 & 0 & \GeneralizedCoordinate_2 \\ \end{bmatrix} + \begin{bmatrix} 0 & -1+\cos\GeneralizedCoordinate_2 & 0 \\ 1 - \cos\GeneralizedCoordinate_2 & 0 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix} + \begin{bmatrix} -\GeneralizedCoordinate_2 + \sin\GeneralizedCoordinate_2 & 0 & 0 \\ 0 & -\GeneralizedCoordinate_2 + \sin\GeneralizedCoordinate_2 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix} \right) \begin{bmatrix} 0 \\ -10 \\ 0 \end{bmatrix} \\ &= \begin{bmatrix} \sin\GeneralizedCoordinate_2 & \cos\GeneralizedCoordinate_2 - 1 & 0 \\ 1 - \cos\GeneralizedCoordinate_2 & \sin\GeneralizedCoordinate_2 & 0 \\ 0 & 0 & \GeneralizedCoordinate_2 \end{bmatrix} \begin{bmatrix} 0 \\ -10 \\ 0 \end{bmatrix} \\ &= \begin{bmatrix} 10 - 10\cos\GeneralizedCoordinate_2 \\ -10\sin\GeneralizedCoordinate_2 \\ 0 \end{bmatrix} \end{align*}\end{split}\]

For the second joint, the exponential representation therefore is:

\[\begin{split}\exp(\TildeSkew{\Screw}_2 \GeneralizedCoordinate_2) = \begin{bmatrix} \cos\GeneralizedCoordinate_2 & -\sin\GeneralizedCoordinate_2 & 0 & 10 - 10\cos\GeneralizedCoordinate_2 \\ \sin\GeneralizedCoordinate_2 & \cos\GeneralizedCoordinate_2 & 0 & -10\sin\GeneralizedCoordinate_2\\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}\end{split}\]

Similarly we can determine the third joint:

\[\begin{split}\exp(\TildeSkew{\Screw}_3 \GeneralizedCoordinate_3) = \begin{bmatrix} \cos\GeneralizedCoordinate_3 & -\sin\GeneralizedCoordinate_3 & 0 & 19 - 19\cos\GeneralizedCoordinate_3 \\ \sin\GeneralizedCoordinate_3 & \cos\GeneralizedCoordinate_3 & 0 & -19\sin\GeneralizedCoordinate_3\\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}\end{split}\]

The final joint is slightly different. We can use the less complex case, because for the last joint \(\Screw_{\omega,4}=0\) because it is a prismatic joint. It is clear to see that the transformation of joint 4 is:

\[\begin{split}\exp(\TildeSkew{\Screw}_4 \GeneralizedCoordinate_4) = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & \GeneralizedCoordinate_4 \\ 0 & 0 & 0 & 1 \\ \end{bmatrix}\end{split}\]

Finally to find the forward kinematics, expressed in the \(\CoorSys{s}\) frame, we concatenate the found link transformations and \(M\):

\[\begin{split}\begin{align*} \FromTo{b}{s}{\HomogeneousTransformationMatrix}(\Configuration) &= \exp(\TildeSkew{\Screw}_1 \GeneralizedCoordinate_1) \exp(\TildeSkew{\Screw}_2 \GeneralizedCoordinate_2) \exp(\TildeSkew{\Screw}_3 \GeneralizedCoordinate_3) \exp(\TildeSkew{\Screw}_4 \GeneralizedCoordinate_4) M \\ &= \begin{bmatrix} \ShortCos{123} & -\ShortSin{123} & 0 & 10\ShortCos{1} - 9\ShortCos{12} - 19\ShortCos{123} \\ \ShortSin{123} & \ShortCos{123} & 0 & 10\ShortSin{1} - 9\ShortSin{12} - 19\ShortSin{123} \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 0 & -1 & 0 & 19 \\ -1 & 0 & 0 & 0 \\ 0 & 0 & -1 & -3 \\ 0 & 0 & 0 & 1 \end{bmatrix} \\ &= \begin{bmatrix} \ShortSin{123} & -\ShortCos{123} & 0 & 9\ShortCos{12} + 10\ShortCos{1} \\ -\ShortCos{123} & -\ShortSin{123} & 0 & 9\ShortSin{12} + 10\ShortSin{1} \\ 0 & 0 & -1 & \GeneralizedCoordinate_4 - 3 \\ 0 & 0 & 0 & 1 \\ \end{bmatrix} \end{align*}\end{split}\]

Where we use the common shorthands \(\ShortSin{123}=\sin(\GeneralizedCoordinate_1 + \GeneralizedCoordinate_2 + \GeneralizedCoordinate_3)\) and \(\ShortCos{123}=\cos(\GeneralizedCoordinate_1 + \GeneralizedCoordinate_2 + \GeneralizedCoordinate_3)\).