Posts by Askic

    MOM

    just to see that you advices were not given in vain, here is the code I used to calculate FW kinematics (KUKA 360-2 from the RoboDK library):

    And the result is:

    Code
    T06_dh =
    [-0.287491, 0.0466039,  0.956649, 2311.23]
    [ 0.279567,  0.959402, 0.0372771, 369.424]
    [-0.916074,  0.278164, -0.288849,  1622.2]
    [        0,         0,         0,     1.0]

    This is the same result that can be obtained from RoboDK with the following input angles:

    Code
    Ad = [-10, -60, 90, -30, -15, 10];

    The RoboDK output is given in the picture shown here.


    I think I got it now, thanks for the help. I really appreciate it.

    Hello,

    This time I used UR5 as an example, defined DH parameters and everything work as expected. The results were the same as shown in RoboDK simulation software.


    I have noticed a mismatched between positive direction of A1, A4 and A6 for KUKA robot in the RoboDk software, which triggered the original question in the post #1.

    In the attached picture this is clearly visible. There are directions of z axis for A1 and A2. Changing both joint angles for some positive shows that A2 is moving according to the right hand rule around Z2, while A1 is doing the opposite.


    My question is based only on what I saw in RoboDK, and it is confirmed here in the attached picture.

    MOM, In the post # 9 you placed a picture from the other closed thread. I didn't mention anywhere how I defined z axis here. RoboDK defined axis for the joints.


    P.S. I'm not able to upload picture as attachment, that is why I post a link here

    Thank you MOM for the explanation. I'm learning robotics mostly based on textbooks and examples I can find on the Internet.

    I have made my own calculation of forward kinematics and checked the results in RoboDK software. That is where I have discovered this "mismatch".

    I have done calculations on UR5 and on KUKA 360-2. On UR5 everything as aligned to my expectations and I found out that all joints use mathematical positive direction of an angle around axis of rotation (z axis). But the results for the same logic were not OK when I tried on KUKA robot.

    For example, for UR5, my calculation is given in the attachment.

    I'm not sure if there is a way to obtain actual dimensions of the robot that is stored internally in the model in RoboDK software, so I used dimensions I could find on the drawings elsewhere. This caused small differences in the position values, but not significant.


    The .pdf generated script is attached. Since I don't have actual robots and don't have access to it, this is right now the only way to learn to calculate myself, use simulation software and ask for explanations and clarifications here.

    Well, I thought that because with revolute joints axis Z are considered as rotation axis.

    For example if I turn on joint frames (like shown in the attachment), each joint rotate around its Z axis, so this axis is rotation axis. I thought (obviously) wrong that there must be a consistent rule, what is considered as positive angle of rotation (just like in mathematics, positive rotation is considered counter clockwise direction).


    Thank you for the clarification.

    Okay, thank you. I noticed this by playing with different joint frames, that this "right hand rule" for joint angles is not consistent. By right hand rule I meant right hand screw rule.

    What I mean by this is to define right hand oriented coordinate frame for each joint, and then apply right hand screw rule considering joint angle as an angle around its z axis.

    I used option "show frame" for each joint and then observed how joint rotates changing one joint angle (theta) at a time.

    Hello,

    experimenting with trial version of RoboDK software, I found out that KUKA robots in this simulation software don't follow right hand rule for determining positive angle rotation.

    I have checked this with UR and ABB robots and for these robots angle rotations follow right hand rule.


    I have attached picture for clearer view of this. Is this true in reality that for example rotation about z axis of joint A1 for 30° follow left had rule with KUKA robots?


    Thank you.

    Ok, thank you very much for your time and help.


    I don't think and don't claim that you're wrong. I just went step by step setting up the DH table according to the DH instructions.

    The difference in calculations was only because of what was considered as variable value in th2 and th3. Because, the way I approached, in the DH tables these values had constant part (offset). For example, var2 = var1+90° is still a variable, but if var1 belongs to a range [-30°, +30°], then var2 will have a different range [60°, 120°] . That is why there was a difference.


    Your posts were very helpful to me.
    We can consider this thread closed.

    I do not like taking my picture, cut the correct information off and put wrong information on

    I'm afraid this is a misunderstanding, the screenshot I made from your picture is initial configuration with all joint angles assumed to be zero in my calculations. I just attached a picture trying to explain why there is a difference in the calculations mentioned above. So the information is not wrong. The picture corresponds to the DH table I posted together in the same thread.


    Just want to point out once again, that my DH parameters table is derived based on the initial configuration that is shown in the attached picture assuming that theta variables are zero.

    So, when you calculate forward kinematics for [0 -60, 90, 0,0,0], I need to calculate for [0, +30,0,0,0,0].


    I didn't put wrong information, I did put information that correspond to the DH table I placed in the same post.

    I hope it is Ok with you now?

    Hello MOM,

    I have checked everything again and I'm pretty confident that I didn't make a mistake. The cause of the difference is actual theta offset i.e. what is considered a variable. For example, when setting up coordinate systems, I have considered that zero positions of all angles corresponds to the same configuration that you considered as: [0, -90, 90, 0, 0, 0].

    So when you calculate transformation matrix for [0,-60,90,0,0,0], I need to calculate for [0, +30, 0, 0, 0, 0], because comparing to mine assumed zero configuration, only th2 is changed for +30° because Z axis of joint 2 is oriented "into the screen from us".


    So the following code:


    will produce the following output:

    Code
    [       -0.5, -5.30288e-17,    0.866025,      2261.32]
    [5.30288e-17,          1.0, 9.18485e-17, -1.06281e-13]
    [  -0.866025,  9.18485e-17,        -0.5,       1465.7]
    [          0,            0,           0,          1.0]

    Do you want to start a different thread for every kuka robot?

    No, but I thought it would be more appropriate to start a new thread, because it is specific to this robot and it is a different question from the other main topic.


    No, I don't have a KUKA robot, so I cannot test to learn for myself. That is why I asked this question. I was wondering if all angles are set to zero, whether the robot would be in the position like shown in the datasheet.

    OK,

    I have made a mistake in calculation for th = [0 -pi/3 pi/2 0 0 0]; and I corrected that, but the results are indeed different.

    Here is my Matlab code, it should be very easy to translate to Python:

    And this is my result for T06:

    Code
    [       -0.5, -5.30288e-17,    0.866025,       485.49]
    [5.30288e-17,          1.0, 9.18485e-17, -7.71447e-14]
    [  -0.866025,  9.18485e-17,        -0.5,      989.869]
    [          0,            0,           0,          1.0]

    But why there is a difference in X,Y and Z coordinates.


    I know exactly why there is a difference.

    First of all, in my case for all zero angles, the result is:

    Code
    [       -0.5, -5.30288e-17,    0.866025,       485.49]
    [5.30288e-17,          1.0, 9.18485e-17, -7.71447e-14]
    [  -0.866025,  9.18485e-17,        -0.5,      989.869]
    [          0,            0,           0,          1.0]

    which is the same result as in your case for A2 = -90° and A3 = 90°.

    So, there is an offset in my case, so If I want to move robot in the same position like in your case, then I need to calculate FW kinematics for the following input: th = [0 pi/6 0 0 0 0];

    In that case, the Matlab code I used above will give the same result as in your case for th= [0 -60 90 0 0 0].


    It is because of the definition of zero. In my case for all zero angles robot looked exactly like your position for [0 -90 90 0 0 0]


    P.S. Can you please share your Python matlplotlib code, I'd like to learn how this is plotted in Python.

    Hello KUKA experts,

    I have started another thread here with calculating forward kinematics and I used KUKA KR 500-2 robot as an example.

    During the discussion, I started to wonder what position of the robot corresponds to all joint variable angles set to zero.

    For example, please a look at the extract from the datasheet given in the attachment. Axis A1 and axis A3 have mutual angle of 90°.

    When the robot is given exactly like in the datasheet, does it mean that position in which is drawn corresponds to all zero angles?


    For example, if all angle A2 is 30° and all other are zeros, does it mean that actual angle between z axis of A1 (first joint - its z axis corresponds to the base z axis) and the axis that goes through the flange is 120°?


    This is important to me, so I can calculate forward kinematics correctly.


    Thank you!

    Okay, if I choose to have the base coordinate frame K{0} with the z axis points up, then the D_H parameters are:

    Code
    % D_H parameters:
    a1 = 500;   alpha1 = -pi/2;   d1 = 1045; th1 = 0;
    a2 = 1300;  alpha2 = 0;       d2 = 0;     th2 = deg2rad(0.0)-pi/2;
    a3 = 55;    alpha3 = -pi/2;   d3 = 0;     th3 = deg2rad(0.0)+pi;
    a4 = 0;     alpha4 = pi/2;    d4 = -1025; th4 = deg2rad(0.0);
    a5 = 0;     alpha5 = -pi/2;   d5 = 0;     th5 = deg2rad(0.0);
    a6 = 0;     alpha6 = pi;      d6 = -290;  th6 = deg2rad(0.0);

    This would produce the following homogeneous transformation matrices:

    As you can see the final result is the same. There are differences in the intermediate results, but they are there because of the way I defined intermediate coordinate frames. You can see this as well as DH parameters table in the attachment.


    Which software do you use for making this plots and calculating matrices. Is it RTSX Ninja for SCILAB?


    Since we have the same T06 matrix, which is 4x4, now for joint angles: th = [ 0.0, -60.0, 90.0, 0.0, 0.0, 0.0], the result would be:

    Code
    ans =
     
    [       -0.5, -5.30288e-17,    0.866025,       485.49]
    [5.30288e-17,          1.0, 9.18485e-17, -7.71447e-14]
    [  -0.866025,  9.18485e-17,        -0.5,      989.869]
    [          0,            0,           0,          1.0]


    How this could be converted to the command in KUKA with A,B and C?

    Code
    DECL E6POS K0P1={X 485.0,Y 0.0,Z  989.9,A ??,B ??,C ??,S 18,T 34,E1 0.0,E2 0.0,E3 0.0,E4 0.0,E5 0.0,E6 0.0}

    Hello Mom,

    I assumed that all angles are zero when robot is in configuration like shown in the attached picture (this is how it is shown in the datasheet as well).

    Can you please, in your software set {0} in such way that z points downward and then recalculate. I'm pretty sure my result is correct and the main difference is the inital (or maybe home) configuration of the robot. I just assumed and calculated everything as if the robot is in the shown position when all angles are zero. Because base z axis points downward, that is why I had for Z coordinate: -2290.0.

    Thank you all for the replies, especially MOM.

    Regarding your observation about K{0}, normally I would also expect to choose Z0 axis to points upwards, but in general this coordinate frame can be fixed as initial condition. That is why first translation along the z axis is (d1) is negative.

    But in order to follow your example and notation I will use Z0 to point upwards. But can you please tell me from where you have a1 = 350 mm and d1 = 675 mm.


    But if we assume that first coordinate frame is already given like shown in the picture, then we have for the first transformation: translation along -z0 by 1045 mm, rotation around z0 by angle theta1, then translation along x1 by 500 mm, and then rotation around x1 by 90 deg. This way K{0} will match K{1}, so DH parameters are: a1 = 500 mm, alpha1 = pi/2, d1 = -1045mm, th1 = joint_angle (A1).


    Now the problem I see here is matching K{1} with K{2}. The normal between z1 and z2 axis has a distance 1300 mm along x2, so the a2 = 1300mm. Now in order to match K{1} with K{2}, it is needed th1 - rotation around z1 by pi/2, so the DH parameters in the second row should be:

    a2 = 1300, alpha2 = 0, d2 = 0; th2 = joing_angle(A2) - pi/2.


    Now, to match {K2} with {K3}, first there should be rotation about z2 for 180° (pi) plus additional joint_angle(A3) translatin along x3 by 55 mm and then rotation around x3 for -pi/2, so DH for the third row would be:

    a3 = 55, alpha3 = -pi/2, d3 = 0, th3 = joint_angle(A3) + pi.


    As you can see here there is a deviation in this logic to the complete DH table presented in the picture, but I have double checked everything and the DH table and final T06 transformation matrix is given in the attachment

    All this time I'm refereeing to the coordinate frames shown in the attached picture in the first post.


    So for the angles [0,30,-45,35,25,10] , the result transformation matrix is:

    Code
    [-0.23857,  0.10868,  0.96503,  2434.2]
    [ 0.65418, -0.71644,   0.2424,  70.297]
    [ 0.71773,  0.68913, 0.099823, -2354.0]
    [       0,        0,        0,     1.0]

    So my originally intended question was how to make correlation with the move instruction in KUKA robot programming language.

    Here I have 4x4 transformation matrix. X,Y and Z coordinates of the flange (in comparison to the fixed reference coordinate system K{0}) are: 2434.2, 70.3 and -2354.0 mm. So, how I can now connect A,B and C angles for rotation to the 3x3 submatrix inside this T06 matrix?


    I hope you understand what is my question here.


    I need to add more to this.

    If all angles are zeros, (as MOM said, to make my life easier) then T06 is

    Code
    [6.1232e-17, -6.1232e-17,         1.0,     1815.0]
    [6.1232e-17,        -1.0, -6.1232e-17, 4.2863e-15]
    [       1.0,  6.1232e-17, -6.1232e-17,    -2290.0]
    [         0,           0,           0,        1.0]

    In that case, If I look at the initial picture with K{0} and K{6}, then it looks to me that I can match {0} and {6} in the following way:

    1. Translate along z by (1045+1300-55) mm, then translate along x by (500+1025+290) mm

    2. Rotate about z axis for 180° (A = 180°), then rotate around new y for -90° (B = -90)


    If I do this in Matlab:

    Code
    v = [0 0 -(1045+1300-55)];
    T1 = trvec2tform(v);
    v = [500+1025+290 0 0];
    T2 = trvec2tform(v);
    T3r = rotz(180);
    T3 = rotm2tform(T3r);
    T4r = roty(-90);
    T4 = rotm2tform(T4r);
    
    Tres = T1*T2*T3*T4

    The result is:

    Code
    Tres =
    
               0           0           1        1815
               0          -1           0           0
               1           0           0       -2290
               0           0           0           1

    So in this case, there is a match in calculation.

    rotz(A=180)*roty(B=-90) would produce 3x3 submatrix.

    No it is not a homework. It is more like professional curiosity. I have used original (standard) DH notation according to this resource here: https://en.wikipedia.org/wiki/…0%93Hartenberg_parameters

    I know for revolute joints, angle theta is a variable and for prismatic joints displacement d is variable. parameters a and alpha are constants and they depend on geometry of the robot.

    I also know that KUKA uses consecutive rotations A is rotation about Z, B is rotation about new Y, C is rotation about new X. So total rotation should be: Rz(A)*R_new_y(B)*R_new_x(C)


    DH convention uses rotations about z and x (previous and new) and translation in the z and x directions. Y axes are only chosen to complete right hand coordinate systems, so there are no displacements in the y directions.


    So If I understood correctly, I will be able to obtain 3x3 submatrix by multiplying (to the right) rotation matrices that are created by series of consecutive rotations of coordinate frames starting from the base until it matches last coordinate frame placed on the flange.

    I'll try to make a little example and compare results obtained by DH parameters and the result that should be obtained by simply rotation and translation of coordinate frames starting from the base to the last 6th coordinate frame associated to the last joint.

    Hello guys,

    I have already read a couple of threads on this forum regarding the calculation of forward (direct) kinematics using DH parameters on real examples of KUKA robots.

    Most theory books use DH parameters extensively for calculating forward kinematics. I have found an example of DH parameters for KUKA KR500 robot. The datasheet is given here


    The table with DH parameters together with joint coordinate frames is given in the attachment.


    The direct kinematics is calculated as matrices multiplications (one for each joint) and the result matrix 4x4 matrix, let say denoted M. The last column of this transformation matrix is always in form: X,Y,Z,1. This means that element m41 is the X coordinate of the last coordinate frame in reference to the base coordinate frame, m42 is Y coordinate etc.

    Submatrix 3x3 with elements m11, m12, m13, m21,m22,m23,m31,m32,m33) is a rotation part of the transformation matrix M.

    So my question is the following:

    How to make a connection from the result of direct kinematics and actual position and orientation in KUKA robot language, which is given by X,Y,Z, A,B,C?


    It should be: m41 = X, m42 = Y, m43 = Z, and I wonder how to correlate A, B, C with 9 elements of a 3x3 rotation submatrix of matrix M?


    I hope you understand my question.


    Thank you very much!

    I fully understand now, thank you. When I now look at this, it is obvious, but still, it wasn't before.

    What added to the confusion is the fact that when searching for the definition of this point where error message is generated, I found this:

    DECL E6POS XP005={X 4221.21,Y -139.86,Z 3991.02,A -4.106,B 1.03,C 168.043,S 2,T 43,E1 -1400,E2 0,E3 0,E4 0,E5 0,E6 0}


    So, no H02 nor H2b, but binary values recalculated to decimal, b0010 1011 = d43. Like I said it should have been obvious.

    Anyway, thank you for your explanations and time.

    and your program is doing just that by using PTP motion and specifying turn value (in your case 'H2b'). that tells robot which way each axis must turn.

    'H2B' = 'B101011' so A1,A2,A4 and A6 must go in the negative direction while A3 and A5 go in the positive...

    Thank you for the reply. Can you please tell me how I can see which axis will move in negative direction by observing H2B?

    For example you wrote: 'H2B' = 'B 1 0 1 0 1 1' , but obviously this doesn't correspond to A1 A2 A3 A4 A5 A6, because there is correlation: 1 = A1, 0 = A2, 1 = A3, 0 = A4, 1 = A5, 1 = A6

    So , how can I know from this that A1, A2, A4 and A6 will go in negative direction? What is the logic here to determine that?


    Thank you once again for your support.

Advertising from our partners