Alison's New App is now available on iOS and Android! Download Now

    Study Reminders
    Support

    (Refer Slide Time: 0:15) Hello, welcome back. So, we are discussing the Inverse Kinematics of Manipulators, in the last class we briefly mentioned about the method by which we can solve the inverse kinematics and we took a very simple example of a 2 degree of freedom planar manipulator to show how the equations can be solved and then we consider a 3 degree of freedom manipulator a planar manipulator as shown in the slides. And we identified the DH parameters and then we got the forward kinematics relationship. And once we have the forward relationship, we write down the equations which actually represent the matrix and the using the arm equation we will try to solve the solve for the joint variables. So, here you can see that PX was l1 c1 plus l2 c12 PY is this and then nx, ny, sx sy, so this is the way how we get the equations. So, we write down these equations and then try to solve for the joint parameters. So, we start with these two equations PX and PY and we found that the PX square plus PY square if you write you will be able to get this in terms of c12. So, we will be writing this as c2 is this c2 is PX square plus PY square minus l1 square plus l2 square divided by 2 l1 l2. So once we get c2, we do not directly get (theta), use c2 for getting the theta 2 we will try to find out s2. (Refer Slide Time: 1:51) And from s2 we will using s2 and c2 we will find theta 2 using the function atan 2. So, this is what we discussed in the last class the atan 2 gives you the value of joint angle in the correct respective quadrant. And then, so once you get theta 2, we will go for solving for theta 1, so solving for theta 1 is not that easy, so we need to do some substitution, so what we do? We assume that k1 is l1 plus l2 c2 and k2 is l2 s2, so we assume this because since we know c2 and s2 and we can say that k1 is l1 plus l2 c2 and k2 is l2 s2. And then we write PX is k1 c1 minus k2 s1 and PY is k1 s1 minus k2 c1. So, now this is in terms of theta 1, so PX and PY are expressed in terms of theta 1 here. Since k1 is known k2 is known this would be only these are all constants. Now, we cannot directly again solve this directly, we need to do one more substitution, so what we do, we will write the k1 as r cos gamma and k2 as r sin gamma, where r is k1 square plus k2 square and gamma is a tan 2 k2 k1. Again, since k1 and k2 are known, we will be able to get r and gamma. (Refer Slide Time: 3:47) So, we will write k1 is r cos gamma, k2 is r sin gamma. Now we will write this equation PX is can be written as PX by r is equal to cos gamma cos theta 1 minus sin gamma sin theta 1 and PY by r is this one and therefore cos gamma plus theta 1 can be obtained, similarly, sin gamma plus theta 1 can be obtained and since we know this, since we have this, we will be able to get gamma plus theta 1 as atan 2 of this. So, we will be writing this gamma plus theta 1 as a tan 2 PY by r PX by r and so it will be PY PX and theta 1 is a tan 2 PY PX minus a tan 2 k2 k1. So, this is the way how we get theta 1. So, now theta 1 and theta 2 we obtained, now we need to get theta 3, so to get theta 3 we will find out theta 1 plus 2 plus 3 and then find out theta 3. So, theta 1 plus 2 plus 3 can be obtained from this relationship, so ny nx can be used to get theta 1 2 3 because ny is sin theta 1 2 3 and this is cos theta 1 2 3 so there will be a tan 2 of this will be giving you theta 1 2 3. And once you get theta 1 2 3 you would be able to get theta 3 as theta 1 2 3 minus theta 1 minus theta 2. So this is the way how you can actually solve for all the join angles theta 1, theta 2 and theta 3. Now you can see that there are lot of substitutions we did to get this. So, one question will be how do we know what to be substitute and how to we actually solve it? So, this is one challenge in inverse kinematics because for each manipulators the equation will be different, there is there is no standard equation that you can see for the manipulators depending on the number of degrees of freedom depending on the configuration of the robot, your PX the relationship PX, PY, PZ extra will be completely different and the if you have to solve this we need to know how to approach the problem and then how to solve it, that is a bit complex that is why the solution inverse itself is a difficult area. To make it simple, we normally what we do is to identify some trigonometric identities and then or standard trigonometry relationship and then get the standard solution for that, so whenever we can actually convert this equations to some standard form, then we will be able to easily solve it, or there are standard solution for the such standard forms so we will try to convert these equations to some standard forms and then solve it. (Refer Slide Time: 6:01) So, we will they see what are the standard form that we can use, or what are the commonly used equations in this kind of equations and then how do we solve it. So for example, if you have a is equal to b sin theta as a form, if a is equal to b sin theta then we can write sin theta is equal to a by b and cos theta is square root of 1 minus a by b square and therefore, theta can be written as atan 2 a by b square root of 1 minus a by b square. Similarly, a is equal to b cos theta, that also we can theta is equal to atan 2 square root 1 minus a by b square a by b, so this is the way how we can actually get the solution, these are simple one so we can directly get it. Now, suppose we have another one as a is equal to b cos theta c is equal to d sin theta, so here a is b cos theta c is equal to d sin theta. So, again we can write sin theta is equal to c or d and cos theta is equal to a or b so you will be getting theta as atan 2 this format. So, these are all standard formulations and similarly next one is a sin theta plus b cos theta is equal to 0, suppose we have relationship like this a sin theta plus b cos theta is equal to 0, then we can write theta is equal to atan 2 minus ba it is atan 2 minus ba because we can actually get it as a sin theta is equal to minus b cos theta, that is why we get it as theta as atan 2 minus b a. So, another important formulation is a sin theta plus b cos theta is equal to c, a sin theta plus b cos theta is equal to c is a formulation with a format or a standard equation, then solution will be theta is equal to atan 2 a b plus atan 2 plus or minus a square plus b square minus c square comma c, that is a sin theta plus b cos theta equal to c. So, whenever you see an equation like this or whenever you are inverse problem comes up of the equation or you can actually bring down that equation into this format, then you do not really go for substitution, you what you need to do is to use this rule and then get the theta because this is a standard solution for this equation. So, what we are doing is atan 2 a, b plus a tan 2 plus or minus square root of a square plus b square minus c square comma c, so that is the solution. Now, suppose you have something like a cos theta i plus b cos theta j equal to c and a sin theta i plus b sin theta j is equal to d, then the solution is this one theta i is this and theta j is this this and the solutions come from using the substitution and then solving it since it is standard equation that is a standard solution, so we do not need to really solve it, we can just substitute this and then get the answer. So, this kind of thing will be normally coming like a cos theta 1 a cos theta 1 plus b cos theta 2 is equal to c something like that is the format here. Similarly, a sin theta 1 plus b sin theta 2 is equal to d, if this is the format, then this is the solution for theta 1 and theta 2, that is what actually it says. And you will often encounter this kind of equations in inverse problem. (Refer Slide Time: 9:56) Another one is, this is a sin theta plus b cos theta is equal to c, a sin theta plus b cos theta is equal to c, a cos theta minus b sin theta is equal to t, that is the relationship, then solution is this one, ac minus bd ad plus bc a and c are known b and d are known therefore you can directly get this as theta is equal to this. So, this is again format of a s1 plus b c1 equal to c and ac 1 plus, ac 1 minus minus b s1 is equal to d that is the format here. So, theta 1 can be obtained using this relationship theta 1 is atan 2 ac minus bd ad plus bc, so that is the way how we can solve this equation. (Refer Slide Time: 11:02) The next one is another format a cos theta i plus j theta i plus theta j plus b cos theta i is equal to c a sin theta i plus theta j plus sin theta is equal to d, that is you have a cos theta 1 plus theta 2 plus b cos theta 1, so it is a cos I will write it as 12 a cos 12 plus b cos 1 equal to c similarly, a sin 12 plus b sin 1 equal to d. So, this is a very common thing that you will be seeing in the inverse kinematics ac 12 plus bc 1 is equal to c and as 12 plus bs1 is equal to d. So if this is the format, c12 stands for c theta 1 plus theta 2 cos theta 1 plus theta 2. So, if this is the format that you are having, then the solution is this, theta j so theta 2 will be this and the cos theta j is this and sin theta j is this, therefore you will be getting this as atan 2 sin theta j cos theta sin theta j cos theta j. And then theta i is atan 2 rd minus sc rc plus sd where r is a cos theta j plus b s is equal to a sin theta j so this is the way how you will be getting the solution. So, this was the same thing what we actually we saw in the previous example also where we tried to substitute for all these values and then try to get the solution, but now if you get this kind of a formulation, then directly you can write the solution as theta i and theta j in this format, you do not need to really go substitute and then solve for it. (Refer Slide Time: 13:12) So, in the previous example actually we solved it and then got the same result what we are seeing here like PX is l1 c1 plus l2 c12 and PY is l1 s1 plus l2 s12 it is the same format that you can see. So, l1 c1 plus l2 c12 l1 s1 plus l2 s12 and then we saw that c2 is PX square plus PY square minus l1 square plus l2 square by 2 l1 l2 which is the same as this and the same way we actually solved it for solved for s2 also by substitution. So, once you have this equations in this format or if you can bring down the equations into any of these standard commonly used equations, then you can use the solution of that equation to get the to solve the problem. So this is, again you do not need to remember these equations, I mean this standard formulations and all, so you can actually take it as a reference and then use this reference and then solve for the inverse, but you need to bring this the equations in the inverse problem to any one of this format and then you will be able to solve it. (Refer Slide Time: 14:18) So, with that background let us take an example of an industrial manipulator and then see how to solve for the inverse kinematics of this manipulator. So, this is a 5 axis articulated arm Rhino XR-3 we have discussed this in one of the example in forward kinematics. Now, you want to solve this for its inverse kinematics, that is if I know this position I want to find out what should be the joint angles to make this tool point reach is this position or whatever may be the position I give this PX, PY, PZ I want to know what should be the joint angles to reach this position, that is the solution and that is the problem here to be solved. And once you have a solution for a given manipulator, that is there always no you do not need to worry about that manipulator again because every manipulator first we need to find a solution then that can be applied for any other situation. So, it is all very specific to the manipulator, so if you if you design a new manipulator, you need to see whether you can actually get inverse solution either by close form method and if you can get into a closedform, then you can solve it and then use it for all other applications. So here, this rhino RX-3 is an industrial robot 5 axis robot and the DH parameters are given here, so we can actually find it out from the method that we discussed already. So try to find out the DH parameters and then get the forward kinematics solution, so that is the first step in solving the inverse we need to have the forward kinematics solved so that we will be able to write down the relationship the arm matrix to be solved. And for that we need to get the DH parameters and then use the DH parameters to get the transformation matrix and then get the arm matrix. Once you have this relationships, so let us see how do we get this, so we can actually write it as like this, so you have PX will be getting the forward relationship like this PX is equal to c1 multiplied by a2 c2 plus a3 c23 plus a4 c234 minus d5 s234. And this will be PY equal to s1 multiplied by the same factor and PZ is d1 minus a2 s2 a3 s23 a4 s234 d5 c234 and then and next so this is PX, PY, PZ then you can see nx is this, ny is this, ax is this, ay is this, of course you can get others also from the forward relationship. It is a 5 axis robot so any arbitrary orientation is not possible, you can solve for 5 joint angles here, theta 1 to theta 5 can be solved. So, the first question is about the solubility of the manipulator, so we know that the necessary condition is that the points should be within the workspace and there we do not give any arbitrary orientation. So, in this case you cannot have arbitrary orientations because it is only 5 degree of freedom, so we can specify only two orientations and then the third one will be automatically obtained. So, the sufficiency condition for closed form solution is the next one to be checked, so if there is not sufficiency condition is not satisfied, then we will not be able to solve, this relationship will get but the sufficiency is not satisfied, then you would not be able to solve it using algebraic methods, and how do we check this the conditions sufficiency condition for closed form solution is that the 3 adjacent joined access should be parallel or 3 adjacent joined access should be intersecting at one point. So these are the two conditions, any one condition should be satisfied in order to have a closed-form solution. So, now if you look at this you can see this is the first axis z0, then you have this z1, then z2, z3, z4 and this is the z5 and these are the axis 1, 2, 3, 4, 5 axis this is the final coordinate axis. So, these are the joined axis up to this is the joint axis. Now, we know that the intersection or parallel we have to find out, so we can see this one so z1, z2 and z3 they are actually intersecting, they are parallel so all the three joined axis are parallel they are adjacent, so the adjacent joined axis are parallel and therefore we will be able to get a closed-form solution for this manipulator, so that is the first thing that you can get the closed form solution for this manipulator because it satisfy the sufficiency condition for closed form solution. And since it satisfies, we know we can actually solve this equation, these equations can be solved. And one important point you can actually see here is that since they are parallel this 1, 2, 3 are parallel, so this is basically theta 1, this is theta 1, theta 2, theta 3, theta 4, theta 5 so this is the joint angles. Now, since there is 2, 3, 4 that is the joint 2, 3 and 4 are parallel you will see some relationship like here, c234, s234 so you will be able to see this. So, whenever the axis are parallel adjacent joint axis are parallel you will be getting this is as the compound angles theta 2 plus theta 3 plus theta 4. And once you have this as 2, 3 like this then it is easy to solve. Suppose they were not parallel, so theta 4 was not, I mean this axis was not parallel, then you will be able to getting this as d5 s23 and s4, so this will be d5 s23 s4 if it is in this condition or it was in this format, then it be difficult to solve this algebraically and that is why we say that when they are parallel adjacent joined axis are parallel we will be able to solve it because they are coming as a compound angle and you will be able to solve it, otherwise this difficult to solve that is from where the sufficiency condition appears. So now, we got these equations and we know that we can write this PX is this, PY is this and then this one, now the question is how do I get theta 1 to theta 5 as a function of PX, PY, nx, ny etcetera that is the question. So, let us see how to solve it but you get to look at this equation and then try to find a method that is now standard procedure the only thing that we can do is look at these equations and then see what how we can solve it. But one thing is sure that we can solve, yes it is a it is satisfying the sufficiency condition so we are sure that it can be solved. (Refer Slide Time: 22:07) So we will take this, the first two equation, so we will see that PX is this and PY is this and now looking at this equation, we will be able to see something can be done to solve it. So, what is the thing that we can do? Now what is PX? How we can write PX c1, can we write c1 from here? C1 is PX by something s1 is this one. So, we can actually see that PX over PY so we can say PX over PY or PY over PX, so PY over PX is equal to s1 over c1. So we can see this because this factor is same for both, so if you take you divide this equation, then you will be getting this as s1 c1 which is nothing but tan theta 1. So, we can actually use this one and then get theta 1 as atan 2 PY PX, so theta 1 can be easily obtained as atan 2 PY PX. So if PY and PX are given to you, you can easily find out what should be the theta 1 for this robot to reach the this side PY and PX. Now, if you look at the manipulator if you look at this manipulator then you will see that, see this is in the x0 xz plane, so this manipulator now it is shown in xz plane. Now, if you know that if it has to come out of this plane, so if this is the z plane, then if it has to come out and then reach at y position, the first join has to move, that is by join moving this theta 1 it will be coming out of the plane and it can actually reach a y position. So, whatever is the y position given, that is decided completely by this joint angle theta 1 and that is very clear from your this relationship also, so theta 1 it is basically depending on what is your PY value and PX value you want to reach that will be decided by theta 1, so you can come out of the plane using theta 1 only, that is the PY PX. So, you got the theta 1 now. Now we have to solve for theta 2, 3, 4 and 5. (Refer Slide Time: 24:51) So, let us see how do we solve it, so look at this relationship, ax is given as minus c1 s234 ay is given as s1 s234. So, if you now c1 is known and s1 is known because theta 1 is known so we know what the what is theta 1 cos theta 1 what is sin theta 1. So, we can write it as s234 is ax minus ax c1 plus ay s1 because this ax is minus c1 s234 this ay is minus s1, so you multiply ax with c1, then it will be c1 square and this will be ay s1 will be s1 square and if you do this, s234 minus of this, you will be getting s234 and then c234 can be obtained from minus az. So, az is minus s234 c234. So, we know s234 and we know c234 and therefore we can get theta 234 as atan 2 minus ax c1 ay is 1 minus a. So, we do not need to do too much of substitution here, we can directly look at the equations and then see it can be solved, so we get theta 234 from this relationship. So, we have theta 1 now and then we have theta 234 but we do not know what is theta 2, theta 3 and theta 4 but we know the total of 2 plus 3 plus 4 is this. And again, if you look at the manipulator we can see decide the ax, ay and az that is the orientation in the plane will be decided by theta 2 plus 3 plus 4. So, the approach vector is actually decided by theta 2 plus 3 plus 4, that is ax, ay and az so we can see ax, ay, az is used to get the theta 234, of course theta 1 also besides that one because it is coming out of the plane, so theta 1 and theta 234 completely decide the approach vector for the manipulator. Now, so we have theta 1 and theta 2, 3, 4 now look at other equations, we have nx is equal to c1 c234 s5 and ny is s1 c234 c5 minus c1 s5. So in this case, we know this c1 and c234 only unknown is c5. Similarly, s1 is known, so s5 is not known, here also s1 is known c234 is known c5 is not known, here s5 is not known. Similarly, here also sx is there minus c1 s234 s5 s1 c5 sy is minus s1 c234 s5 minus c1 c5. So, these are the these are the two equation nx, ny, sx, sy. Now, if you write this as if you take nx s1 so now you multiply nx with s1 and ny with c1 and then subtract, you will get it s5 because this will be nx s1 will be c1 c234 s1 c5 and s1 square s5 and this one will be ny c1 will be s1 c234 c5 c1 minus c1 square s5 and when you subtract this two terms will actually cancel, what you are getting will be s1 square s5 c1 square s5 and when you add you will be getting only s5. So, you will be getting this is as s5 is nx s1 minus ny c1 and the same way if you substitute sx s1 so it will be getting sx s1 minus sy c1 as c5. So you will get s5 as this and c5 as this and since you know nx I mean since you know s1 you can easily find out s5 and c5 and therefore theta 5 can be atan 2 sy c5 and sy is this one nx s1 minus ny c1, so theta 5 also can be obtained from the orientation part and you know theta 5 actually decide the orientation, I mean the normal, approach vector will be, the sliding and the normal and sliding vector will be decided by this, so you will be getting it as theta 5. So, theta 5 is atan 2 s5 c5. So, we got theta 5 also, theta 1, theta 2, 3, 4 and theta 5 we obtained but still we do not have theta 2, and 3 and 4. So, we have to see how to get that one. Again we have to look at this equations and then see how can we solve this. (Refer Slide Time: 29:56) Now if you look at this part, PX part so look at this PX part, so in PX so PX is equal to c1 multiplied by something and we know now theta 1, we know theta 2, 3, 4 we know this 2, 3, 4 also. And therefore, we will be able to write PX over c1 is equal to or px or c1 plus d5 s234 minus a4 c234 is equal to a2 c2 plus a3 c23. So, we will be able to write it like this and we know this term we know and this term we know because theta 2, 3, 4 is known and therefore we will be able to write down this and c1 is also known theta 1 is also known, so this becomes a constant now, I mean this is not is a constant now and this is only what is a2 c2 plus a2 c23 we do not know. So, we can write it as a2 c2 plus a3 c23 is equal to a constant b, we will say b is equal to a2 c2 plus a3 c23. And in this one we know 234 and this 234 and therefore we will be able to write this as PZ again we will be able write this as a2 s2 plus a3 s23 is equal to another constant d, that is PZ from using the PZ relationship, we will be able to write down the these two equation using these two equation we will be able to get these two relationship and that is given here. So, we can write this as, so PX so P equation 1 gives a3 c23 plus a2 c2 is equal to this one and equation 3 gives a3 s23 plus a2 s2 is equal to this one. So, we get these two relationship and now you can see that they are actually falling in a standard form as a standard equation that we discussed earlier. So this is actually in the like it like a3 c23 plus a2 c2 c equal to a constant a3 s23 plus a2 s2 is equal to another constant. And this is a standard format that we saw in the one of the slides earlier and since this is a standard equation, we can use the standard solution for that. So, this is actually in the format of a3 a cos theta i plus j b cos theta i is equal to c format. So, this is the same format what you can see here, theta i plus j is theta 1 plus 2, that is this c23 and this is b cos theta 2. So, cos theta a cos theta 23 cos 23 b cos 2 is equal to c format, similarly this also. So and since we know this c, d and a and b, we can write down sin theta j cos theta j is this and sin theta j is this and theta j can be obtained like this. And similarly theta i theta 2 can also be obtained. So, theta 3 can be written using this method and theta 2 and theta 3 can be obtained using this relationship. So, we will be getting cos theta 3 as c square plus d square minus a3 square minus a2 square by 2 a3 a2 cos theta 3. And sin theta 3 will be 1 minus cos square theta 3, so that you will be getting sin theta 3 and cos theta 3, therefore theta 3 can be obtained as atan 2, that is the way you get the theta 3. Now, theta 2 can be obtained again from here, you can see theta 2 will be atan 2 rd minus sc rc plus sd. So, apply the same r and c because we know r, r can be calculated a cos theta or cos theta j and plus b s is a sin theta j and therefore we will be getting theta 2 as atan 2 rd minus sc rc plus sd, where r is a cos theta 3 plus a2 s is a3 sin theta 3 and therefore we get theta 2 also here. So, theta 2 we got, theta 3 we got so we got theta 1, theta 2, theta 3 and theta 5 and plus we have theta 2, 3, 4 also. So, the only thing what is remaining is theta 4 and theta 4 can be obtained, of course from theta 234 you subtract 2 and 3 you will be getting theta 4. So, that is the way how you can get theta 4, so theta 4 can be obtained so theta 4 is equal to, you can write theta 4 is theta 2, 3, 4 minus theta 2 plus theta 3 because we have solved for theta 2, theta 3 and we know theta 2, 3, 4 also and there theta 4 also can be obtained. And this way you will be able to get all the joint angles solved for this manipulator. So, that is the way how we get the inverse solution for a manipulator. Now whatever maybe the manipulator configuration whether it is 6 axis or a 5 axis or a 4 axis we will be able to solve the equations provided it may satisfy the sufficiency condition for closed form solution. If the closed form solution is not existing, there is no point in solving it you would not be able to solve it, you may have to go for a numerical solution, so that is what actually we have to do to solve any manipulator inverse problem. So, as you can see it is not a standard formulation for any particular manipulator, you have to look at the equations of the forward equations or the matrix and then see what is the best way to solve the equations. I hope you understood the principle of, I mean how we actually how we actually solve the inverse kinematics problem. (Refer Slide Time: 36:35) So, this is an home work for you, so you can consider a 4 axis SCARA robot, it is ADEPT one SCARA it is a commercial industrial robot and we need to solve for its inverse problem. So, we can so this is the configuration, so you can see there is an axis here, and axis here there is an axis here and then there is a rotational axis also here, these are the 4 axis so you have one rotation another rotation and one up and down motion and a tool throat so for joint axis. And the parameters are given, so the first step is the first step is to so draw a home position, assume a home position and then identify the DH, assign axis assign all the joint axis and the coordinate frame and then find out the DH parameters and then find out the forward relation or the arm matrix. Then, write down the equations and solve. So, when we before going for the solution, see whether you can actually get a solution or not. So, the necessity condition is that the three joint axis should be parallel or three joint axis adjacent joint axis should be parallel or the adjacent joint axis should be intersecting. So, in this case you can see that these 3 joint axis are parallel, so all the adjacent joint axis are parallel and therefore it will be always able to solve it with a closed-form solution. So, that I hope you will be able to solve it, so please try to solve this example and then if you have any difficulty, please let me know. (Refer Slide Time: 38:55) So, just giving you the DH parameters here going to make your life easy. So, these are the joint parameters, so you can see a alpha pi in this case because its direction is changed. (Refer Slide Time: 39:11) So, we discussed about the forward kinematics and inverse kinematics, what time the manipulator kinematics. We need to see, where are we applying all these things and what is the significance of this in the real industrial application? So, the inverse and forward kinematics and of course the coordinate transformation matrix are widely used in industry, though the user may not be really knowing what is happening inside but as a designer or as an engineer, we should know where actually we are applying all these things. So, to give you a very brief idea of what is all these kinematics doing in the robot or in the industry, let us take a very simple example of a robotic works cell. So, I as I mentioned in one of the classes, a robot alone cannot do any work or we need to have something around the robots as a system in order for the robot to do some meaningful work. And that work environment is called as a robotic works cell. So, a robotic works cell typically consists of a robot and then a sensor, some sensors to sense the presence of objects and then some mechanism to convey things from the robot or to bring something to the robot and take something from the robot or some kind of palate or something to place objects or something should be there around the robots in order for the robot to do some meaningful task. So, in this typical works cell, we are consisting of a robotic inspection, a robotic inspection and sorting of components. So, though it is not a purely robotic inspection per se but there is an inspection of object and the robot is used to sort the object based on whether this it is good quality or a bad quality product, so that is basically the robotic inspection and sorting work cell.