DH parameters solution for forward kinematics - Robotics Stack Exchange most recent 30 from robotics.stackexchange.com 2022-01-25T22:26:18Z https://robotics.stackexchange.com/feeds/question/13930 https://creativecommons.org/licenses/by-sa/4.0/rdf https://robotics.stackexchange.com/q/13930 4 DH parameters solution for forward kinematics Robotics nerd https://robotics.stackexchange.com/users/17554 2017-07-30T06:17:00Z 2017-08-03T21:35:42Z <p>I am stuck at a problem of solving DH parameters for a simple test mechanism. I know that the given mechanism is a structure but just for pure academic purposes assume that it's a real system. I only want to know the correct way to solve a system with DH parameters, when there is only one active joint and more than one passive joints that depend totally on the command of the actuated joint.</p> <p>-- Joints (All joints are Revolute): J1 (Actuated by some motor) J2 (Passive) J3 (Passive)</p> <p>-- Links: L1,L2 (Rigid Links) The link 1 and link 2 are not directly connected at joint J2 but there is a small link that connects link L1 with joint J2. It is not visible in top view but it allows the system to work in real life. But please just ignore it for this example!</p> <p>-- The images are the top view with the z axis for each joint coming out of the paper.</p> <p>-- Assuming clockwise rotation as positive for this problem.</p> <p><img src="https://preview.ibb.co/jyfjfQ/IMG_20170730_075747.jpg" alt="Page#1"> ![Page#1] I realize that the transformations below are wrong and not done by following the DH convention. I should have but instead I followed the standard method. But once I apply DH coordinate axis, I should use the DH method. But this still does not change the real question in the last picture. Thank you <img src="https://preview.ibb.co/dZRCZk/IMG_20170730_080135.jpg" alt="Page#2"> ![Page#2]</p> <p>@Chuck:</p> <p>Problem: J1 is the only active joint in the system. j2 and J3 are passive joints. I want to find the kinematic equations of the system(basically, I want to find the Joint angle of J3(Pitch) as a function of Joint angle of J1). I have shown the DH coordinate axis in the first picture. I can only measure J1 angle with an encoder but J2 and J3 are passive, so I have to find their relation with J1 to get their value for the transformation matrix. Since the choice of first joints x axis is arbitrary in DH method, I chose x0 axis parallel to link L2 and then found theta2 as a function of theta1. I want to know, is this the correct way to find the passive joints angle as a function of an active joint?</p> <p>If my solution of joint paramter Theta2 = 180 - Theta1 is not correct, then how would you find the joint parameter Theta2 as a function of Theta1, since you can not measure Theta2(for it is passive), you can only find Theta2 mathematically and its very important to find Theta2 to get the transformation matrix from J3 coordinate system to J1 coordinate system(The goal)... </p> <p>I expect the system to move like this when the Joint 1 motor is actuated in clockwise direction <img src="https://i.imgur.com/wbe0g2F.jpg" alt="Page#3"> ![Page#3]</p> <p><strong>EDIT</strong></p> <p>Hey chuck, As the following sketch shows, the motor housing is fixed on the box, it rotates with the same angle as the box about joint J4. The blue dot in the previous image is the motor axis of rotation which I called J1 because it links the motor shaft with the link L12. </p> <p>If the motor shaft is rotated anti-clockwise by an angle Pfi, it makes the whole box move with it but not with the same angle. I have to find the box rotation about joint J4 as a result of this rotation of motor shaft about J1 by Phi..</p> <p>As you explained, I can solve the 4 bar mechanism but how can this motors angle of rotation be related to the 4 bar mechasim's four angles Theta12,Theta23,Theta34 and Theta41 ?</p> <p><img src="https://i.imgur.com/6OzCjmK.jpg" alt="Page#4"> ![Page#4]</p> <p>After anti clockwise rotation..</p> <p><img src="https://i.imgur.com/cRMNB7W.jpg" alt="Page#5"> ![Page#5]</p> https://robotics.stackexchange.com/questions/13930/-/13946#13946 3 Answer by Chuck for DH parameters solution for forward kinematics Chuck https://robotics.stackexchange.com/users/9720 2017-08-01T02:36:37Z 2017-08-01T14:35:19Z <p>Ah ha! From my comment earlier - </p> <blockquote> <p>If it's kinematics, then none of the joints are a function of any of the other joints. The only exception is if you had a kinematic loop, like a four bar mechanism, or a rocker, or a crank.</p> </blockquote> <p>What you have is a <a href="https://en.wikipedia.org/wiki/Four-bar_linkage#Design_of_four_bar_mechanisms" rel="nofollow noreferrer">four bar mechanism</a>, and it has probably been giving you trouble because:</p> <ol> <li>It's just a hard problem to begin with, and</li> <li>You haven't been drawing the complete diagram for your analysis. </li> </ol> <p>There are four links (or "bars") and they form a kinematic loop. Two are obvious, one is a little less obvious, and the last one is disguised. Your links are:</p> <ol> <li>The link from J1 to J2,</li> <li>The link from J2 to J3,</li> </ol> <p>those you already have and have been giving for the problem statement, BUT you also have:</p> <ol start="3"> <li>The wall, which acts as a link between J3 and J4, and</li> <li>The box itself, which acts as a link between J4 and J1.</li> </ol> <p>You can see that the links go J1 -> J2 -> J3 -> J4 -> J1, and so they form the loop.</p> <p>I'm on mobile for the rest of the night, so it'll be tomorrow before I can give a fuller answer (at the earliest), but you should look up the "Freudenstein equation" as a starting point for the solution. Springer has a decent paper on it, but you have to pay for it, of course. </p> <p>The gist is to label all of your angles, theta 1 through 4, and then to work your way top to bottom using and terms like <code>L1 sin(theta1) + ... + L4 sin(theta4) = 0</code> and similarly with cosine from left to right. The key concept here is that you're forming a closed LOOP, so you <strong>must</strong> end where you started when you add together all the vertical (or horizontal) components of each link. </p> <p>The biggest pain there is to be really consistent with your notation, but that's true of all engineering, isn't it? You may find that the vertical component of a link might involve a cosine term, and vice versa, depending on how you defined the datums (data) and positive conventions, etc.</p> <p>I'll draw a picture later, but hopefully that's enough to get you started. </p> <h2>:EDIT:</h2> <p>Okay, some drawings to go with the answer. </p> <p>First, re-draw the problem with all the links. </p> <p><a href="https://i.stack.imgur.com/OaRZz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OaRZz.jpg" alt="Step 1"></a></p> <p>Then, <strong>be consistent</strong> with notation. In my method of solving, I assume +y is up and +x is to the right. Then I use the right hand rule that the angle should be positive in a counter-clockwise direction (right hand rotation about +z axis, which points "up out of the page.")</p> <p><a href="https://i.stack.imgur.com/n593R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n593R.png" alt="Step 2"></a></p> <p>With the picture above, you can make a couple equations. First, combine all of the vertical components of the linkages:</p> <p>$$L_{12}\sin{\theta_{12}} + L_{23}\sin{\theta_{23}} + L_{34}\sin{\theta_{34}} + L_{41}\sin{\theta_{41}} = 0 \\$$</p> <p>Then, do the same for the horizontal components: </p> <p>$$L_{12}\cos{\theta_{12}} + L_{23}\cos{\theta_{23}} + L_{34}\cos{\theta_{34}} + L_{41}\cos{\theta_{41}} = 0 \\$$</p> <p>So, two equations and two unknowns - you need at least one more. For that, look at the interior angles. To do that, try to "rephrase" the interior angles in terms of the angles as already defined.</p> <p>First, use the alternate interior angles: </p> <p><a href="https://i.stack.imgur.com/C216L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C216L.png" alt="Step 3"></a></p> <p>Then, "clip" the other angles in preparation for using THEIR alternate interior angles:</p> <p><a href="https://i.stack.imgur.com/4zZsC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4zZsC.png" alt="Step 4"></a></p> <p>Now you have a good setup to getting the interior angles:</p> <p><a href="https://i.stack.imgur.com/Eglh9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Eglh9.png" alt="Step 5"></a></p> <p><a href="https://i.stack.imgur.com/uJotL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uJotL.png" alt="Step 6"></a></p> <p>And now, finally, you get the formulas for the interior angles:</p> <p>$$\begin{array}{ccc} \theta_{{J_1}_{\mbox{interior}}} &amp; = &amp; \theta_{12} - \left(\theta_{41} - \pi \right) \\ \theta_{{J_2}_{\mbox{interior}}} &amp; = &amp; \left(\theta_{23} - \pi \right) - \theta_{12} \\ \theta_{{J_3}_{\mbox{interior}}} &amp; = &amp; \left(\theta_{23} - \pi \right) - \theta_{34}\\ \theta_{{J_4}_{\mbox{interior}}} &amp; = &amp; \left(\theta_{41} - \pi \right) - \theta_{34}\\ \end{array}$$</p> <p>The last step now is to recognize that the sum of interior angles, $\theta_{J_1} ... \theta_{J_4}$ is 360 degrees, or $2\pi$:</p> <p>$$\theta_{J_1} + \theta_{J_2} + \theta_{J_3} + \theta_{J_4} = 2\pi \\$$</p> <p>This now gives you three equations and four unknowns, which means you can now express any one of the angles $\theta_{J_2} .. \theta_{J_4}$ in terms of the actuated joint $\theta_{J_1}$. </p> <p><strong>NOTE THAT</strong> my expression for $\theta_{J_1}$, or $\theta_{41}$, is <em>not</em> the same as your $\theta_1$ and is not necessarily the same as the DH representation for the joint either. You'll have to re-express the joint angles (again), but hopefully I've outlined the process for you.</p> <p>Final note - you might not be able to get a "clean" solution to this set of equations because they are nonlinear (thanks, trig -.-). You are likely to need a numeric solver to get the answer for the joint angles. </p>