The problem is to derive the transformation matrix of the following manipulator:
Fig.1. The manipulator with 2 revolute degrees of freedom ( link points beyond the monitor in the 3D dimension).
By using standard D-H convention we can orient axes in the following way:
Fig. 2. The manipulator with attached frames
In the initial configuration the position of the end effector on -axis is , and on the -axis is , and .
It can be seen that orientation of axis can be perpendicular to the previous and the current -axes in many various ways. However choosing it in the left or right direction would be a mistake, because the distance would be missing (please see tutorial 2). It must be chosen as a common normal, so as presented in the picture.
Let's assume that the base frame and the end effector frame must be oriented as is visualized on the picture. In this case we can find the D-H parameters as:
1 | 0 | |||
2 | 0 | 0 |
It can be seen that equations become complicated since there is and inside the matrix. In order to simplified the calculations we can substitute:
and
After doing so, the homogonous transformation matrices become:
what after multiplication gives:
It can be also seen, that:
while and position can be simplified as follows:
and can be calculated directly by looking at the triangle defined below:
By looking at the triangle the following equations can be derived:
so
and
In the presented case the value of equals .
This lead to the following equation on -coordinate:
and the result on coordinate is:
So the final result is:
.
As illustrated above in order to get this result is was necessary to solve equations with arcus function tangled in standard trigonometric functions. This might be complicated in a case a manipulator has got more than 2 DoF. In the next post I will show how one could simplify it.
]]>Let's consider the manipulator which is presented in Fig. 1 below:
Fig. 1. Manipulator with 3 revolute joints. The last joint is oriented like a driller.
After assigning the frame we can get the following relationships:
Fig. 2. Attached frames. Pay attention on axis .
It can be seen that axis must be oriented on the top-down direction according to -axis definition.
In this case if we use the strict interpretation of definition of parameters we would get the following result (this result is wrong):
Table 1. D-H parameters of a manipulator (this is wrong!!)
1 | 0 | |||
2 | 0 | 0 | ||
3 | 0 | 0 |
This is wrong, because distance is missing. The right table should look like this:
Table 2. Correct D-H parameters of a manipulator presented in Fig. 1.
1 | 0 | |||
2 | 0 | 0 | ||
3 | 0 | 0 |
In this case it was necessary to add previously missing distance .
The individual homogenous transformations matrix in this case are:
In the matrix index 2 refers to and not to .
and the final result is:
In this matrix index refers to , index refers to and index refers to .
You can use methods presented in D-H tutorial 1 in order to check the correctness of the solution.
.....................................................
Now lets see what happens if someone forget to include the initial offset of the second joint, so when someone assume, that . In order to visualize this lets calculate the matrix when , and . The result is:
It can be clearly seen, that in this case most of element are wrong. The manipulator should look like in Fig. 1 and Fig. 2 but instead the matrix shows that it is oriented in a different way. For example according to a Fig. 1 the -position should be , -position should be and . Only element from a matrix is ok. The same analysis can be done to rotation matrix - many elements are wrong.
.....................................................
Meanwhile, when we solve the equation with how it should be, then we get the following result:
Look at the Fig. 1 or 2, everything seems ok now.
Conclusion:
Always remember to include initial offset
.....................................................
There is also one strange thing to explain.
According to resulted parameters the 3rd joint of the manipulator is in the same place, what the 2nd joint. This is not consistent with a given Fig. 1. Don't worry. This is OK. Sometimes it happens- it's just the properties of D-H convention (what matter in the end is the relation between the world frame and end-effector frame).
]]>
Fig. 1. Manipulator consists of 1 revolute joint oriented perpendicular to a floor and 2 revolute joints parallel to the floor.
..................................................................................
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:
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.
Let's assumed, that column of the rotation matrix can be written as . The following relationships apply:
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).
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:
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.
]]>