# Modified DH Parameters for Puma 560 - Wrong Results

In continuation of my question on modified parameter for Puma 560 posted here Modified DH Parameters for Puma 560. Further I used a available dimension for Puma 560 here (FYI: the figure shows dimension in inches, but all following dimensions in DH parameters for length are converted to mm), [ and trial version of RoboDK simulator to check my result. I assigned the frame as show in the figure from first link, the last link is placed to the flange in the figure below with z6 pointing downward while keeping x6 in same direction as x5.

So the DH parameter looked liked, double alpha = { 0, -90, 0, -90, 90, -90 }; double a = { 0, 0, 431.80, 0, 0, 0 }; double d = { 0, 0, 139.7, 433.07, 0, 55.88 };

I started with joint angles (theta) double theta = { 0, 0, 0, 0, 0, 0 };

My calculations give me same position as Puma 560 simulator except z values are negatives. Correct position for joint angles of zeroes is x = 431.800, y = 139.700, z = 489.580. I get x = 431.800, y = 139.700, z = -489.580.

But if I put double d = { 0, 0, 139.7, -433.07, 0, -55.88 }; then I get the correct value, x = 431.800, y = 139.700, z = 489.580.

I tested with other joint angles, for which I am getting correct values with negative -433.07 and -55.88 in above. So, they must be negatives.

My question is, why I have to take negative values for d to get correct result? Does this is because the value in this case should be assigned as per base frame (all value above base frame is assigned positive and all below should be assigned negative irrespective of convention.)

Base frame is located at same position as frame 1 (refer to the top most link) I used the same procedure as described in "Introduction to Robotics" by J.J. Craig.

EDIT: below is the codes I am using for the computation. Alpha and theta is converted to radians.

    ////// Craig Matrix - Modified DH Parameters Convention
mat = cos(theta);
mat = -1 * sin(theta);
mat = 0;
mat = a;

mat = sin(theta) * cos(alpha);
mat = cos(theta) * cos(alpha);
mat = -1 * sin(alpha);
mat = -1 * sin(alpha) * d;

mat = sin(theta) * sin(alpha);
mat = cos(theta) * sin(alpha);
mat = cos(alpha);
mat = cos(alpha) * d;

mat = 0;
mat = 0;
mat = 0;
mat = 1;


Above codes will give a 4 x 4 DH transformation matrix for each frame as per Modified DH conventions (Refer to Modified DH parameters on Wikipedia or J.J. Craig book, the matrix is defined there.)

Now, we multiply all matrices as per, starting with matrix for frame 6 on the right hand side and multiplying it with preceding joint from left hand side. Repeating the same sequence as noted above. This should give as the location of origin of frame 6 with respect to the base frame of the robot.

• Can you post the code you're using to calculate the complete transform? Mar 18, 2017 at 13:49
• @Chuck: Added the codes and way I am doing computation. Mar 18, 2017 at 15:26
• I did a similar simulation using SolidWorks: youtube.com/watch?v=crJXUlzJ918 Feb 19, 2018 at 20:08

I think the problem is with your simulator. You said,

Base frame is located at same position as frame 1 (refer to the top most link)

And, from the previous question you asked, there is the following picture where I have highlighted the first frame: So here you can see how the global frame is oriented. Now, compare the global/world frame to the end effector location: You've got the coordinates clearly labeled now on these drawings and you can, at a glance, see what the end effector's position is:

You move along the positive x axis 17 inches, you move along the positive y axis 5.5 inches, and you move along the NEGATIVE z axis (17.05 + 2.2) inches. So, per your drawing, the output you're calculating is correct; it should be +17,+5.5,-19.25 inches, or +431.8,+139.7,-488.95 mm.

My suggestion to you would be to find the discrpancy in your simulator. It looks like there's an offset somewhere on your z-axis measurement. I would say that maybe the base frame there is considered the base of the robot, but that doesn't make sense per the x/y coordinates. Your x/y values are pretty close to equal, which means the end effector should be located close to a (+/-) 45 degree line from the origin.

• Thanks for explanation! I've check the DH parameters for this robot on internet to cross check, and it seems that others are talking d3 and d4 positive. I started with the assumption that one can set DH parameters from any position of robot but this example is forcing me to believe that there is really a zero reference position to determine get DH parameters for each robot. Perhaps RoboDK simulator, that I'm using, has also set DH parameter with arm up and thus taking positive for d3 and d4. We need to find someone who can confirm that we can use any robot position to set DH parameter or not. Mar 20, 2017 at 23:21
• If we have a particular or zero reference position, where we have to set DH parameters then perhaps my approach is wrong. Mar 20, 2017 at 23:37
• @NitinKumar - I would contact the people at RoboDk about this model in particular (and maybe refer them back to your question here) and see if they could verify it's programmed correctly. As I've drawn it in my answer, you can clearly see that the z-value must be negative if the first frame is coincident with the world frame. This reinforces/verifies the modified DH parameter selection that was made in your previous question (d3 and d4 are positive) because those values produce the same transform. Mar 21, 2017 at 12:04
• I would be willing to bet that the discrepancy is, as you hint, due to a difference in how the default (zero angle) configuration is assumed to be laid out. If I were you, I would contact RoboDk and Puma both to try to get feedback on how RoboDk has the robot arm configured (default arrangement) and how Puma has manufactured the robot (default joint angles). Mar 21, 2017 at 12:08