Denavit-Hartenberg convention - tutorial 1
Denavit-Hartenberg convention is a technique which allows to derive parameters and variables of a kinematic chain of a manipulator. These parameter and variables can be after that used to get kinematic and dynamic models of a manipulator. Using the D-H convention can simplify the whole process. The notation will be explained on a sample manipulator which is illustrated in Fig. 1.
Fig. 1. Manipulator consists of 1 revolute joint oriented perpendicular to a floor and 2 revolute joints parallel to the floor.
- It can be assumed that the length of links, which are not given, equal 0.
- It can be also assumed that given distances are in fact distances between rotational/translational axis of joints.
..................................................................................
1st STEP - ATTACHING THE COORDINATES FRAMES
The first step is to attach Cartesian coordinate systems to individual joints. Variables and parameters of a manipulator will be designated based on these frames. We will use frames to transform systematically among them using matrix transformations in order to get the final model later.
In this example right-sided Cartesian coordinate frames are used:
Z-axes must have direction compatible with joints rotation axes (in case of revolute joints) or moving axes (in case of prismatic joints). |
X-axes lie on common normal to the previous z-axis and actual z-axis. The x-axis is oriented towards joints with higher numbers (from a base to a gripper). |
Common normal generally means that the axis is perpendicular to the previous and current axis.
It is no need to draw y-axis, since its direction is known when we already have x- and z-axes.
Other important part of convention:
- The x-axis of the 1st coordinate system can be chosen arbitrarily.
- The coordinate system of an end effector also can be chosen arbitrarily and usually is selected based on a gripper geometry.
- The assignment of coordinate systems start from 0, so the final index which is assigned to an end effector equals the number of joints (in case there are no passive joints).
After assigning the frames, the manipulator looks like in Fig. 2. You can also assign , and in another direction.
Fig. 2 The manipulator with assigned frames
..................................................................................
2nd STEP - PARAMETERS AND VARIABLES
In the D-H convention there are 3 parameter and 1 variable, or 4 parameters (if there is no active motor in a joint for which parameters belong to).
alpha () - is the angle which is measured about the actual x-axis from the previous z-axis to an actual z-axis with a right-hand threaded screw notation (the angle is positive when the rotation is compatible with clock motion). |
Assigning parameters for the 1st joint is done by treating the coordinate system number 1 as actual coordinate system and the coordinate with index 0 as the previous coordinate frame. By looking at our example, we can derived the first alpha angle after extending axis until it crosses the axis. After that when we project is on the plane, we get the following relationship:
Fig. 3 Axes projected on the plane in order to get angle
It is important to look at the axis in the direction of increasing the numbers, otherwise you get result for a left-sided Cartesian coordinate frame. Generally we cannot mixed left- and right-frames, since they are characterized with different matrices.
We can see that the angle between oz and is (rotate axis to cover axis).
a - is a distance for the first joint which is measured along current axis from the previous z-axis to current z-axis. If we draw this coordinate frame we can get something like this: |
by looking at the from above we get:
From both figures we see, that the distance between is 0.
Looking at designation methods of alpha and a can be seen how important it is to properly assign all axes.
d is a distance which is measured along previous z-axis from previous x-axis to current x-axis (for the 1st joint it is measured along 0z axis from to ). |
when we extend in mind the axis in this way to intersect ox and axis we will get the following view (xz plane):
The same result we also get by looking from yz plane point of view:
So the distance equals .
theta () is an angle which is measured about previous z-axis from previous x-axis to current x-axis, according to right-hand threaded screw (positive angle is in clock-rotation direction). |
When we project previous and current x-axis on we can see that the angle is zero. This is an initial angle.
However this angle can change, because the axis is assigned to let's say some motor's shaft. This is why we treat it as a variable.
Remember to always mark the initial angle too, if it is different from 0 (you will see in some other tutorial why).
....................
In the next step we change the index of a frame (now current coordinate system is a system marked with index 2, and the previous one - the coordinate system marked with index 1) and we repeat the whole procedure once again.
After doing it for the whole robot, we get the following result:
.............
1 | 0 | |||
2 | 0 | 0 | ||
3 | 0 | 0 |
The variables are marked with a star.
..................................................................................
3rd STEP - HOMOGONOUS TRANSFORMATION MATRIX
The homogonous transformation matrix can be designated from the following equation:
The matrix tell us what is the relation in the sense of rotation and translation between the base of the robot (index 0) and its end effector (index 3).
The individual matrices can be designated immediately by using the general D-H formula:
where , , and .
after substituting parameters and variables from the table we get:
We can see that the matrix for the 2nd and 3rd joint has the same form. It should be like this, because they are situated in the same way.
After multiplying these matrices we get:
where
..................................................................................
4th STEP - THE ANALYSIS OF THE RESULT
It is also necessary to check if the result is correct, since action which comes after that (kinematic and dynamic modeling, simulation, control, programming) is very time consuming. So we must be sure, that we are working on the good model.
- The first thing is that the matrix should have the block structure.
Our matrix from the example has the block structure, so this is ok. - The rotation matrix (part of the matrix 1:3,1:3) should have properties of a rotation matrix. These properties are generally defined below:
Let's assumed, that column of the rotation matrix can be written as . The following relationships apply:
- is normalized, so the squares of elements in any row or column must equal .
- is orthogonal, so the dot product between any column must equal 0
- The vector product of rotation matrix: , and .
- Another thing is to look at the rotation matrix and see if everything is ok. For example since the 2nd and 3rd joints are situated in the same way, there is a sum of angles in the matrix.
Also the 3rd column is quite simple to quick analysis. The relation between and is . Look at Fig. 2 - this is OK. Similar situation also applies between and , and the relation between and is (so the angle is always and we cannot change it in this manipulator).
- We can easily calculate how the matrix looks like in certain configurations, for example after substituting angles for , and we get:
The translation vector tells us what is the position of the end effector frame in relation to world frame. This configuration is presented in Fig. below. We can see that and so everything matches values from a matrix.
The analysis of matrix rotation elements, for example:
- x-axis of a base frame and x-axis of an effector are oriented in the same direction. This is why we have on position (1,1) of rotational matrix;
- and are opposite to each other this is why in position (3,2) we can find ;
- The and are perpendicular to each other, this is why we have on position (1,3).
After doing above presented analysis we can assume, that the result is correct. Eventually you can also make a simulation study, which will be presented in some of other tutorials.