LESSON

# Denavit-Hartenberg notation

#### Share

#### Transcript

If you pick up any of the standard textbooks about robotics, you will find reference to Denavit and Hartenberg notation. This is named after Jacques Denavit and Richard Hartenberg who in 1955 wrote an article and later, a book which proposed a very, very general way of describing serial link mechanisms and most of the robots that we've looked at are serial link manipulators. So, the Denavit and Hartenberg notation is particularly applicable for this class of mechanism.

Now in most of the standard textbooks. People start off with introducing this particular notation. Personally, I find the notation somewhat complex and not particularly intuitive. So, what I've done in this particular lecture is left it until the end. A key aspect of Denavit-Hartenberg notation is that each joint in the robot is described simply by 4 parameters. So, let's start off with a very simple serial link manipulative that 2 joint robot that we've seen a number of times before. Each joint is attached via a link to the previous joint. So here, we can see joint 1 which is connected to link 1 which is connected to joint 2 which is connected to link 2. Their links are rigid but the joints can move. They can be either rotational as an example shown here or they can be prismatic or sliding joints that we've talked about before.

Every joint connects to links and every link connects to joints except for the first and last link. The first link is the base of the robot which does not move refer to that as link 0 and the last link is the in-defector or is attached to the in-defector of the robot. If a robot has got n-joints then, it must have n plus 1 links, that's including the 0th link or the base. Fundamental to the Denavit-Hartenberg notation is we attach a coordinate frame to the far end of every link of the robot. So here, we can see link J shown in blue and we attach the coordinate frame J to the far end of link J that is the end of the link that's closest to the robots tool. Then, we describe the pose of that link frame with respect to the link frame of the previous joint. So, this is a relative pose and this is a concept we should be familiar with now. This is a relative pose from coordinate frame J-1 to coordinate frame J.

In the Denavit-Hartenberg notation, the link transform is represented by a homogeneous transformation matrix which is typically denoted by the letter A and it comprises a number of elementary transformations. It comprises a rotation around the Z axis. A translation along the Z axis. A translation along the X axis and a rotation around the X axis. It's very concise. It allows us to describe the relationship between the 2 link coordinate frames by simply 4 parameters, theta, D, A and alpha. Let's see how that works in practice. So here, we have in red link J-1 and the coordinate frame attached to link J-1. First thing that we're going to do is to rotate that coordinate frame around its Z axis by an amount theta J and we rotate the axis. The next thing we're going to do is to translate that coordinate frame along the Z axis by an amount D and then, we're going to translate it along the X axis by an amount J and finally, we're going to rotate it around the X axis by an angle alpha and now, it looks like this.

So, we have moved from the frame J-1 to the frame J by applying 4 elementary transformations, 2 translations and 2 rotations. You're probably asking is how can we do this using only 4 parameters because a pose has got 2 components. It's got a translational component which we described by 3 numbers and it has a rotation which we described by 3 numbers. For example, roll, pitch, yaw angles or Euler angles. How do we do it with just 4 numbers? Well, the reason this works is that the Denavit-Hartenberg notation requires some constraints on where we place the coordinate frames. The first constraint is that the X axis of frame J intersects the Z axis of frame J-1. The second constraint is that the X axis of frame J is perpendicular to the Z axis of frame J-1. Although, there are only 6 degrees of freedom in a relative pose. The fact that we've introduced 2 constraints means that we can describe this using only 4 parameters. There's an interesting and often confusing consequence of this and that means that the link frames are not necessarily on the link itself and this is something that quite often confuses people when they're starting off and learning about Denavit-Hartenberg notation.

The axis of a rotational joint has to be aligned with the Z axis of that joints coordinate frame. The Denavit-Hartenberg notation requires that the axis of joint J is parallel to the Z axis of a coordinate frame but it's not the coordinate frame attached to link J. The axis of joint J is aligned with the Z axis of the previous coordinate frame, that's coordinate frame J-1 and again, this is a confusing aspect for people who is starting out learning about this notation. For the case of a prismatic or sliding joint, the motion must be along the Z axis. So, for rotational joint, rotate around the Z axis of the previous frame for a prismatic joint, we translate along the Z axis of the previous frame.

The relative pose from the frame of 1 link to the next is described by 4 elementary transformations. For an n-link robot, we can stack groups of these elementary transformations and each group contains 4 parameters which described the relationship between 1 link frame and the next. If the robot has got all revolute joints then, the joint angles correspond to the theta values shown here. So, these are the joint variables. They change as the robot moves. All the other parameters, the D's, the A's and the alpha's are all constant. They're a function of the mechanical design of the particular robot. Let's consider a robot that has got a prismatic joint. Its second joint is prismatic. Since the first joint is revolute, we substitute Q1 in here. For the second joint which is prismatic, we substitute Q2 in here. For a joint like this, theta 2 is a constant just like A2 and alpha 2. They are the function of the mechanical design of this particular robot.

The great advantage of the Denavit-Hartenberg notation is that it allows us to very concisely describe a robot. So, for the 2 link robot, it can be described simply by a table like this. We have 1 column for each of the Denavit-Hartenberg parameters and we have one row for each joint of the robot. The joint variables Q1 and Q2 lie in the theta column because they are revolute joints. The D values are all 0. There are no translations along the Z axis because this robot exists in a plain and the 2 link lengths appear in the A column and the alpha values are all equal to 0. So, this very compact table completely describes what we call the kinematics of the robot. The robotics toolbox is very well set-up to deal with Denavit-Hartenberg notation.

I'm going to create a Denavit-Hartenberg matrix and each row in this matrix represents a single link. It's just like the table we looked at a moment ago. Now, I'm going to enter the numbers corresponding to the columns of that table; theta, D, A and alpha for the first joint and theta, D, A and alpha for the second joint and finish that matrix offset, I have a simple 2 by 4 matrix which contains a Denavit-Hartenberg parameters for a 2 joint robot.

While I can create a robot object, I'm going to put it into the workspace variable R and I use the toolbox function serial link and I parse in the Denavit-Hartenberg parameter matrix and the result is a serial link object created in my workspace and the serial link object represents a robot arm. We can see here that it's displayed the Denavit-Hartenberg parameters in table form. There are some additional parameters around the bottom which we will introduce shortly.

Once I have this object then, I can perform some simple functions on it I can plot the robot with the configuration where the joint angles are perhaps 0.2 radiance and 0.3 radiance and this is what it looks like and I can also create a teach pendant.

So, here is the teach pendant, brings up the sliders that we've seen before allows me to move the joints of this robot arm.

The robot object also has a forward kinematic method. So, I can apply that to the robot object. It's the fkine method and if I parse in for instance, the joint angles 0.2 and 0.3, it will return for me a homogeneous transformation representing the pose of the in-defector of that robot.

We can see here the X coordinate and the Y coordinate and this matrix over here represents the orientation of the in-defector of this robot. For a more complex robot like the Puma 560, it can be described by a table like this. Once again, the table has got 4 columns but in this case, it's got 6 rows because there are 6 joints, because this robot is all revolute, we find all the joint verbals in the theta column. In the D column and the A column, we find a number of numbers which correspond to physical lengths on the Puma robot.

The length of the upper arm, the length of the lower arm, some horizontal offsets and so on and the alpha column, we find a number of rotations which either pi on 2 or negative pi on 2 and they say something about the orientation of 1 joints rotational axis and the next joints rotational axis.

Where MATLAB and robotics toolbox really come into their own is when we're dealing with complex robots, those with 6 joints or more. I can import a model of the classical Puma 560 robot and it's created a verbal in the workspace called P560 and I can have a look at that and here, we see a table which contains the Denavit-Hartenberg parameters that described that particular robot.

Now, I can plot that robot for a particular joint angle configuration. Now, I'm going to use the variable QZ which was defined by the function in the Puma 560. We can see that over here in the workspace. It's a vector with 6 elements all equal to 0 and here, we see the robot in the configuration where all its joint angles are equal to 0. Another configuration that was defined is this one QR which was referred to the robot's ready pose and this is with the arm pointing straight up into the air.

I can also bring up a teach pendant on this particular robot. Here, we see it. Now, I have got 6 sliders, 1 for each of its joints. I can rotate it above the waist. I can move the shoulder down. I can lift the elbow up. I'll move the elbow down, move it down a bit more and I can rotate it around the waist so we can see what's going on.

We can see the in-defector coordinate frame there and if I adjust the wrist joint angles, we can see the orientation of the in-defector changing. The object has got a forward kinematic method. So, if I asked for the forward kinematics for a set of joint angles, perhaps the joint angles equal 0.1, 0.2, 0.3. I'm just making up some numbers here. This is the homogeneous transformation which represents the pose of the in-defector of this 6 axis Puma 560 robot.

So, to use a very general mathematical notation, we can say that the pose of an n-joint robot which I'm going to write as PSI N is a function and the function is K and K stands for kinematics, a term that we will define concisely shortly and it's a function of the joint configuration, that's the vector of the N joint variables.

They might be angles or they might be links in the case of a sliding joint. A vector of joint angles, a vector of link offsets, a vector of link lengths and a vector of what are called link twists and a vector of joint types.

Sigma is a vector that contains elements which are either R or P and they indicate whether the joint is revolute or prismatic. In the case of a revolute joint, we substitute the corresponding element of theta from the corresponding element of Q and for prismatic joint, we substitute the corresponding element of D from the corresponding element of Q. All the other elements of D, theta, A and alpha are constant.

#### Code

We learn a method for succinctly describing the structure of a serial-link manipulator in terms of its Denavit-Hartenberg parameters, a widely used notation in robotics.

### Skill level

Undergraduate mathematics

This content assumes high school level mathematics and requires an understanding of undergraduate-level mathematics; for example, linear algebra - matrices, vectors, complex numbers, vector calculus and MATLAB programming.

### Rate this lesson

## Check your understanding

## Discussion

## Leave a comment

Please Sign In to leave a comment.

This video helped me understand the foundation of DH parameters, but the following link was instrumental in helping me visualize DH parameters in a 3d space. I figured I would attach it here for anyone else who was interested.

https://youtu.be/rA9tm0gTln8

It is a great video. Although it doesn’t explicitly say so, this is showing

standard Denavit-Hartenbergparameters. The parameterris more commonly denoted bya, as it is in this lesson.If the previous way of writing the forward kinematics is easier and more intuitive( like we did with the 4 dof educational robot in lesson 6 of this lecture), why would we use the DH notation if it is more complex? why is it popular?

Great question and one I have pondered a lot. DH notation was picked up early by the robotics community from the mechanism theory community, and it was computationally efficient which was important back in the day. Since then it’s just been passed from book to book, professor to student, without much thought. More modern robotics programming environments are using a description called URDF which can describe arbitrary mechanisms (eg. humanoids) essentially as a chain of transformations. URDF is described in XML format which IMHO makes it rather more complex than it needs to be. DH notation is very compact, just a simple table. There isn’t really an agreed upon alternative notation for a chain of transforms, the notation I use in the book is the best that I could come up with, easily read by humans and computers, but it hasn’t set the world on fire (yet).

Congratulations! This is the best video I’ve ever watched about DH parameters. Simple, clear and carefully made. Would you also have some material about converting a DH table to a URDF format?

Thanks. I haven’t anything on that exact topic, but URDF is a capability that is slowly being added to RTB. A first part of that project was to understand URDF, I couldn’t really find a good clear tutorial on this, so I wrote a tutorial and some example MATLAB code for parsing.

So, I am a bit confused by a statement on the video. In the video around about 5:06, it is stated that the axis of a rotational joint has to be aligned with the Z axis of that Joint’s coordinate frame. But then again, shortly after that it says that the axis of a coordinate frame will NOT be aligned with Z axis of its coordinate frame, but of the previous one (i.e. z-1). These two statements appears to be contradictory.

Is the first statement not correct? Am I interpreting things wrong here? Thanks!