In this section, we’ll learn how to find the Denavit-Hartenberg Parameter table for robotic arms. This method is a **shortcut for finding homogeneous transformation matrices **and is commonly seen in documentation for industrial robots as well as in the research literature. The real-world example we’ll consider in this tutorial is a SCARA robotic arm, like the one below.

Remember that homogeneous transformation matrices enable you to express the position and orientation of the end effector frame (e.g. robotics gripper, hand, vacuum suction cup, etc.) in terms of the base frame.

To calculate the homogeneous transformation matrix from the base frame to the end effector frame, the only values you need to have are the length of each link and the angle of each servo motor.

Table of Contents

# The Three Steps

Here are the three steps for finding the Denavit-Hartenbeg parameter table and the homogeneous transformation matrices for a robotic manipulator:

**1. Draw the kinematic diagram according to the four Denavit-Hartenberg rules.**

**2. Create the Denavit-Hartenberg parameter table.**

- Number of Rows = Number of Frames – 1
- Number of Columns = 4: Two columns for rotation and two columns for displacement

**3. Find the homogeneous transformation matrices (I’ll cover how to do this step in my next post).**

# Definition of the Parameters

The Denavit-Hartenberg parameter tables consist of four variables:

- The two variables used for rotation are
**θ**and**α**. - The two variables used for displacement are
**r**and**d**.

Here is the D-H parameter table template for a robotic arm with four reference frames:

Let’s take a look at what these parameters mean by looking at two different frames. The n-1 frame is the frame before the n frame. We assume that both frames are connected by a link.

For example, if the n-1 frame is frame 2, the n frame is frame 3.

**θ is the angle from x _{n-1} to x_{n} around z_{n-1}.**

**α is the angle from z _{n-1} to z_{n} around x_{n}.**

**r (sometimes you’ll see the letter ‘a’ instead of ‘r’) is the distance between the origin of the n-1 frame and the origin of the n frame along the x _{n} direction.**

**d is the distance from x _{n-1} to x_{n} along the z_{n-1} direction.**

# Example 1 – Two Degree of Freedom Robotic Arm

Let’s take a look at an example so that we can walk through the process of creating and filling in Denavit-Hartenberg parameter tables.

## Draw the Kinematic Diagram According to the Denavit-Hartenberg Rules

We’ll start by drawing the kinematic diagram of a two degree of freedom robotic arm.

## Create the Denavit-Hartenberg Parameter Table

Now, we need to find the Denavit-Hartenberg parameters. We have three coordinate frames here, so we need to have two rows in our D-H table (i.e. number of rows = number of frames – 1).

### Find θ

For the Joint 1 (Servo 0) row, we are going to focus on the relationship between frame 0 and frame 1. **θ is the angle from x _{0} to x_{1} around z_{0}.**

If you look at the diagram, x_{0} and x_{1} both point in the same direction. The axes are therefore aligned. When the robot is in motion, θ_{1} will change (which will cause frame 1 to move relative to frame 0). The angle from x_{0} to x_{1} around z_{0} will be θ_{1}, so let’s put that in our table.

Now, let’s look at the Joint 2 (Servo 1) row. We take a look at the rotation between frame 1 and frame 2. **θ is the angle from x _{1} to x_{2} around z_{1}.**

If you look at the diagram, x_{1} and x_{2} both point in the same direction. The axes are therefore aligned. When the robot is in motion, θ_{2} will change (which will cause frame 2 to move). The angle from x_{1} to x_{2} around z_{1} will be θ_{2}, so let’s put that in the second row of our table.

### Find α

Let’s start with the Joint 1 (Servo 0) row of the table.

**α is the angle from z _{0} to z_{1} around x_{1}.**

In the diagram above, you can see that this angle is 90 degrees, so we put 90 in the table.

Let’s go to the Joint 2 row of the table.

α is the angle from z_{1} to z_{2} around x_{2}. You can see that no matter what happens to θ_{2}, the angle from z_{1} to z_{2} will be 0 (since both axes point in the same direction). We put 0 degrees into the table.

### Find r

Let’s start with the Joint 1 row of the table.

r is the distance between the origin of frame 0 and the origin of frame 1 along the x_{1} direction. You can see in the diagram that this distance is 0.

Now let’s look at the Joint 2 row. r is the distance between the origin of frame 1 and the origin of frame 2 along the x_{2} direction. You can see in the diagram that this distance is a_{2}.

### Find d

Now let’s find d. We’ll start on the first row of the table as usual.

**d is the distance from x _{0} to x_{1} along the z_{0} direction. You can see that this distance is a_{1}.**

Now let’s take a look at frame 1 to frame 2. d is the distance from x_{1} to x_{2} along the z_{1} direction. You can see that this distance is 0.

# Example 2 – SCARA Robot

Let’s get some more practice filling in D-H parameter tables by looking at the SCARA robot.

## Draw the Kinematic Diagram According to the Denavit-Hartenberg Rules

Here is the kinematic diagram using the D-H convention.

## Create the Denavit-Hartenberg Parameter Table

Now, we need to find the Denavit-Hartenberg parameters. We have four coordinate frames here, so we need to have three rows in our D-H table.

### Find θ

For the Servo 0 row, we are going to focus on the relationship between frame 0 and frame 1. **θ is the angle from x _{0} to x_{1} around z_{0}.**

If you look at the diagram, x_{0} and x_{1} both point in the same direction. The axes are therefore aligned. When the robot is in motion, θ_{1} will change (which will cause frame 1 to move). The angle from x_{0} to x_{1} around z_{0} will be θ_{1}, so let’s put that in our table.

Now, let’s look at the Servo 1 row. We take a look at the rotation between frame 1 and frame 2. **θ is the angle from x _{1} to x_{2} around z_{1}.**

If you look at the diagram, x_{1} and x_{2} both point in the same direction. The axes are therefore aligned. When the robot is in motion, θ_{2} will change (which will cause frame 2 to move). The angle from x_{1} to x_{2} around z_{1} will be θ_{2}, so let’s put that in the second row of our table.

Now, let’s look at the Servo 2 row. We take a look at the rotation between frame 2 and frame 3. **θ is the angle from x _{2} to x_{3} around z_{2}.**

If you look at the diagram, x_{2} and x_{3} both point in the same direction. The axes are therefore aligned. When the robot is in motion, there is only linear motion along z_{2}. The angle from x_{2} to x_{3} around z_{2} will remain 0, so let’s put that in the third row of our table.

### Find α

Let’s start with the Servo 0 row of the table.

**α is the angle from z**_{0}** to z**_{1}** around x**_{1}**.**

In the diagram above, you can see that this angle is 0 degrees, so we put 0 in the table.

Let’s go to the Servo 1 row of the table.

α is the angle from z_{1} to z_{2} around x_{2}. In the diagram above, you can see that this angle is 180 degrees, so we put 180 in the table.

Let’s go to the Servo 2 row of the table.

α is the angle from z_{2} to z_{3} around x_{3}. In the diagram above, you can see that this angle is 0 degrees, so we put 0 in the table.

### Find r

Let’s start with the Servo 0 row of the table.

r is the distance between the origin of frame 0 and the origin of frame 1 along the x_{1} direction. You can see in the diagram that this distance is a_{2}.

Now let’s look at the Servo 1 row. r is the distance between the origin of frame 1 and the origin of frame 2 along the x_{2} direction. You can see in the diagram that this distance is a_{4}.

Now let’s look at the Servo 2 row. r is the distance between the origin of frame 2 and the origin of frame 3 along the x_{3} direction. You can see in the diagram that this distance is 0.

### Find d

Now let’s find d. We’ll start on the first row of the table as usual.

**d is the distance from x _{0} to x_{1} along the z_{0} direction. You can see that this distance is a_{1}.**

Now let’s take a look at frame 1 to frame 2. d is the distance from x_{1} to x_{2} along the z_{1} direction. You can see that this distance is a_{3}.

Now let’s take a look at frame 2 to frame 3. d is the distance from x_{2} to x_{3} along the z_{2} direction. You can see that this distance is a_{5 }+ d_{3}.

# References

Credit to Professor Angela Sodemann for teaching me this stuff. She is an excellent teacher (She runs a course on RoboGrok.com). On her YouTube channel, she provides some of the clearest explanations on robotics fundamentals you’ll ever hear.