Forward Kinematics Of A Robot Arm

\bf {Task \ and \ Configuration}

Configuration space – the space in which the joint coordinates of the robot are described. Robot configuration is described by a vector of generalised joint coordinates, denoted:

q=\{ q_j, j \in [1...N]\} \in C

C \subset \R^N

Where N is the number of joints in the robot and configuration space C is the set of all possible joint configurations.

The generalised joint coordinates can be either angles (revolute joint) or lengths (prismatic joint).

The dimension of the configuration space is given by the number of joints in the robot.

The task space defines the space of all possible end-effector poses. The task space is the space for all possible end-effector poses and the task space number defines the degrees of freedom of the robot.

 \xi_E \in \tau

The dimension of the task space is the number of degrees of freedom of the robot or the number of elements which define the pose of the end-effector. This can be a maximum 6 (degrees of freedom), (x, y, z,\theta_r,\theta_p, \theta_y).

In robotics, a robot with a configuration space dimension far larger than the task space is known as a redundant robot. This is a robot capable of achieving any end-effector position and orientation within its workspace.

\bf Kinematics

\bf definition: kinematics is a branch of mathematics that studies the motion (position and velocity) of a body, or system of bodies.

In Robotics there are two types of kinematics problems to consider:

-Forward kinematics;

-Inverse kinematics.

The forward kinematics of a system, e.g. a robot arm, give us the pose and coordinate of the robot end-effector given a set of joint angles.

Consider a simple single joint robot arm.

Figure 1: Single Link Manipulator

Take E to be the pose of the end-effector which is has a translational and rotation component such that: E = R(q_1) T_x (a_1)

In the 2D case, for an angle q_1 and link length a_1, the pose of the end effector would be expressed:

E = \left ( \begin{matrix} cosq_1& -sinq_1&0 \\ sinq_1& cosq_1 & 0 \\ 0&0&1 \end{matrix} \right ) \left ( \begin{matrix} 1&0&a_1 \\ 0&1&0 \\ 0&0&1 \end{matrix} \right ) = \left ( \begin{matrix} cosq_1& -singq_1&a_1cosq_1 \\ sinq_1& cosq_1 & a_1sinq_1 \\ 0&0&1 \end{matrix} \right )

From this we can see that the coordinates of the end-effector are represented by the last column of the matrix: E(x,y) = (a_1cosq_1,\ a_1sinq_1)

The command in the Matlab robotics library to model the forward kinematics of the single planar system is:

trchain2('R(q_1) Tx(a_1)', q)

where q is the angle of rotation, in this case q1.

Tip: To visualize a representation of a robot arm, we can import the model of a planar 1-joint robot using the command 'mdl\_planar1' from the Robotics Toolbox, and input the joint angles using the command ‘p1.teach‘.

Figure 2: 1-planar robot model in Matlab

This way of representing the forward kinematics of the robot arm translates identically to a 2 or 3 link robot arm, where we can express the end-effector pose as the sum of the rotations and translations of each link of the robot:

E= R(q_1) Tx(a_1) R(q_2) Tx(a_2)

E = \left ( \begin{matrix} cosq_1& -sinq_1&0 \\ sinq_1& cosq_1 & 0 \\ 0&0&1 \end{matrix} \right ) \left ( \begin{matrix} 1&0&a_1 \\ 0&1&0 \\ 0&0&1 \end{matrix} \right ) \times \left ( \begin{matrix} cosq_2& -sinq_2&0 \\ sinq_2& cosq_2 & 0 \\ 0&0&1 \end{matrix} \right ) \left ( \begin{matrix} 1&0&a_2 \\ 0&1&0 \\ 0&0&1 \end{matrix} \right )

In Matlab this would be written using the ‘trchain2()’ command as follows:

>>trchain2('R(q_1)\ Tx(a_1)\ R(q_2)\ Tx(a_2)', [q_1 \ q_2]);

Once again the translational component of the homogeneous matrix represents the x and y coordinate of the end-effector which is defined by the third column of the 3×3 matrix of the pose. In the case of the simple two link robot arm:

\left (\begin{matrix} x \\ y \end{matrix} \right) =\left (\begin{matrix} a_2 cos(q_1+q_2) + a_1 cosq_1 \\ a_2 sin(q_1+q_2) + a_1 sinq_1 \end{matrix} \right)

We know that for a two planar robot such as the one shown in the figure above there are always two joint angle configuration that will position the end -effector at any given coordinate within the workspace.

\bf {3-joint \ planar \ robot \ arm}

With a 3 joint robot arm, the end effector of the robot can reach any position within its workspace and achieve any orientation for that given position.

Take the simple 3-link robot arm shown below.

Figure 3: Diagram representing a 3-link manipulator

we can describe the pose of the robots arms end-effector as a chain of homogeneous transformation matrices which belong to the Euclidean special group of 3 dimensions.

A very commonly used industrial robot which which uses both revolute and prismatic joints is the Scara robot, shown below.

Image result for Scara robot
Figure 4: Model of a Scara Robot
and translation. For example, when computing the motion of the prismatic joint in Matlab, using the trchain command, it is important that the correct axis of translation is defined. In the previous examples we only covered 2-DOF arms which had only revolute joints rotating on the z axis, therefore, we only input translations in the x axis T_x(a_1) and did not need to specify the axis of the rotation matrices. However, in the case of the Scar robot arm, the end effector is attached to a prismatic joint and the robot end effector can move in 3 dimensions. As such the End effector pose would be expressed:

E = Rz(q_1)Tx(a_1)Ry(q_2)Tz(a_2)Ry(q_3) Tz(a_3)Ry(q_4)Tz(a_4)

\bf {Denavit \ and \ Hartenberg}

The Denavit and Hartenberg system was developed as a general theory to describe and articulated sequence of joints, where each joint is defined by four parameters.

link 0 is used to describe the base of the robot itself. The following links will then be numbered 1, 2…n from the base to the end-effector.

The principle of the DH (Denavit and Hartenberg) method is that a coordinate frame is assigned to the end of each link (at the joint or end-effector) and describe the pose of said link frame with respect to that of the previous link frame.

As usual, the relative pose from one link frame to the next is represented by a homogeneous transformation matrix of the form:

^{i-1}\zeta_i \sim A = Rz(\theta_i)Tz(d_i)Tx(a_i)Ry(\alpha_4)

Figure 5: Denavit & Hartenberg Principles (researchgate.net)

It is important when modelling robots arms with 6-DOF and above to specify the axis of rotation

As we can see from the expression above, the transform from link frame i-1 to link frame i comprises two rotations and two translations: a rotation and translation about the z-axis, followed by a translation then rotation about the x-axis.

From this we can describe the relationship between the two frames in terms of just 4 parameters, in this case (\theta_i, d_i, a_i and \alpha_i)

Pose has a translational component and rotational component (euler angles or roll-pitch-yaw). Therefore, a transformation in 3D would have 6 parameters.

Using the Denavit Hartenberg notation, imposes certain constraints on the position of the link frames:

  • The x axis of frame i intersects the z-axis of i-1;

  • The x-axis of frame i is perpendicular to the z axis of i-1.

These constraints allow us to describe the change in relative pose using only 4 parameters.

For a robot arm we can simply stack groups of these link transforms (each defined by 4 parameters) to compute the end-effector pose relative to the robot base, link 0.

Normally only one or two terms of the link transforms are variable or changing, and the other parameters are typically constants as they are simply a function of the mechanical design of the robot.

Take, for example a 3 link manipulator shown in Figure 4. In this case, only the rotation about the z-axis theta is changing, while the the remain three terms remain constant for each link.

This will obviously vary based on the design of the robot, for example for a prismatic joint the translation along the z-axis d_i becomes the variable parameter.

\bf {Matlab}

The Denavit and Hartenberg notation can quite easily be computed in Matlab, using the Robotics toolbox.

By declaring a a simple 4xn matrix to define the four parameters of the N number of links. A 4×2 matrix will define a 2 link robot arm, where each row represents a link.

We can then use the Toolbox function SerialLink(DH) to create a serial link object of a robot arm. An example of this is displayed in the Figure below.

Figure 6: DH notation of 2-link robot in Matlab

Leave a comment