 I will be speaking about robot kinematic analysis to you today ok. So, kinematic analysis as you know is basically a study of motion with it without regard to the forces which cause it. You all studied hopefully kinematics. So, there are two problems that are encountered in robotics. The first one is robot forward kinematics and that is if you are given a robot mechanism whatever the configuration is joints, links and you know everything about the geometry of it. Then if you are given all the joint positions that means the joint angles for each of the revolute axis and if you had prismatic axis then what is the offset distance. If those are known then we want to find out where the wrist of the robot is. So, that is called the forward kinematic problem. Similarly, many times you need to know how to what the robot should be doing given that you want to reach a endpoint or the wrist point or the tool point and there it is the inverse kinematic problem. You are given the space location and the orientation in which your wrist should be and then you want to know what should be the joint angles and that is it is a harder problem and in fact, there are no the inverse kinematic problem is a harder problem and there are in general there are no solutions if you had arbitrary robot or there could be multiple solutions, but for most robots which are developed for the industry the configurations are selected such that the inverse kinematic problem can be sought in the closed form. Then apart from kinematic analysis you have of course, the static analysis where you would like to know the forces on each joint if the wrist forces are given forces and movements I mean and also the dynamic analysis where the robot is executing some motion and there are acceleration decelerations in the robot. So, basically when we deal with robotics we are dealing with spatial which means three dimensional kinematics because we need to reach any place in three dimensions and also the fact that we want to be able to reach with any orientation. So, that makes the problem much harder because planar problems have motion in parallel planes only. So, that is a whole of whole lot of simpler problem a planar problem is a much simpler problem in terms of maths because all the rotational axis of the links are perpendicular to the plane of motion of the links which means that if you have any rotations you can have you can consider them in any order for example, whereas in the spatial kinematic case you need to have the maintain the order of rotation. I will illustrate that if you look at this diagram here let us look at this frame here this is the universal frame and there are two rotations we desire one about the y axis and one about the x axis. If you look at that I start from here I have one sequence in which I do the y rotation first and you will see that from going from here to here I have performed 90 degrees of rotation about the y axis and a flat piece which was aligned like this earlier now looks like this and then I execute the x rotation about the x axis by 90 degrees and I end up with a position of the object like this. If I did the other sequence that means I did the x rotation first then from this initial same position I come to this position after doing 90 degrees of x rotation and then when I do rotation about the y axis I end up with a different orientation of the object. Therefore, this is the problem that one has to keep in mind this is the problem that corresponds to basically matrix multiplication not being commutative. In the plane we had excuse me in the plane we are talking about rotations about the z axis alone and therefore, if I have let us say two rotations minus 15 degrees and 45 degrees it does not matter which sequence I carry them out I start out with a object like this when I do 45 degrees rotation which means if you look at the direction of the rotation it is about positive z axis I rotate that means counter clockwise in this case and I get 45 degrees rotation from the original position which comes brings me here and then minus 15 degrees rotation under some of the rotation and if I did the other way round first doing minus 15 degrees then followed by 45 degrees positive then I end up in the same position that is only because of fact that all the axis of rotation are all aligned in the z direction. As I already mentioned we need 6 degrees of freedom for a general robot to be able to reach a point in any orientation and basically in most of robots we use simple joints like revolute joints and prismatic joints. So, we come to the problem of how do we describe position and orientation we all know that if you want a point in space then we can describe it by a position the coordinates of the point with respect to some coordinate system or equivalently we can have a vector which has three components representing the same three. When it comes to orientation now we talk about orientation obviously of a rigid body whereas, we talk of position of a point. So, if you want to talk about position of a rigid body we have to identify a point first on the rigid body and then say I am going to mean this is the point of interest to me. Orientation on the other hand pertains to the rigid body itself now I can describe the orientation of the rigid body by choosing a point on it describing its position and then choosing some other points and telling something about the positions of those then I should be able to identify the orientation of that particular object. I can also do it by having three angles described with the three angles describing rotation about some axis they could be fixed axis they could be the axis which are obtained after rotation of a coordinate frame and those kind of angles can also suffice. So, you have two descriptions two type of descriptions roll pitch yaw description or Euler angle description of orientation. We would not deal too much with this we would not have time to deal with it, but basically roll pitch and yaw description is with respect to fixed reference frames. When the reference frame remains fixed with the respect to the object no not with respect to the object with respect to the universal frame then when we describe rotations about different axis then we have the roll pitch y r p y description and if we describe the rotations about rotated frame of reference then you get the Euler angle representation. What we will be concentrating more on is the third type which is the rotation matrix. Just a notation note on notation we are going to use small letters for scalars capital letters for matrices and coordinate frames and we are going to have a whole lot of pre fixes which means pre superscript and pre subscript leading superscript and leading subscript leading superscript will refer to the reference coordinate frame with respect to which the motion is being described and leading subscript will refer to the frame of interest that we are talking about what are we talking about motion of what orientation of what etcetera. Now, the trailing superscript is only going to be used for matrix operations like transposition and inverse of a matrix and the trailing subscript is a descriptor. So, what are again it is it is similar to the leading subscript, but can describe more you can have you can identify a particular point etcetera. Hat quantities above the letter will mean that it is a unit vector which means it is it is the magnitude of the vector is unity. So, if you look at the examples here this a that is leading superscript p b origin b org. So, b org is the point we are talking about p will refer typically to a position type of just a point at the origin of say coordinate system b, but we are looking at the position in coordinate system a. So, the leading superscript is very important essential. Similarly, if you look at the second example here I have a b a actually b should have been just directly below it, but there was some problem in putting it like that, but what it means is with respect to a I am looking at the rotation matrix r of a coordinate system b and I am looking at the inverse of that matrix. So, that there is a minus 1 coming as a trailing superscript. Keeping that in mind now looking at translation and rotation or position and orientation simple problem is you know given a point you have the 3 components r 1 r 2 r 3 which are the projections of this end point on the x axis y axis and z axis. Now, if you want to talk about orientation what we will do is on a object the objects orientation that we are trying to talk about we will fix a coordinate frame to that. Then we can talk about the orientation of the coordinate frame in the original coordinate frame and that will tell us about the orientation or rotation of this coordinate frame with respect to the other one and the way we can do this is simply by looking at the 3 axis here x b hat y b hat and z b hat are the coordinates coordinate system whose orientation I am trying to determine in the original coordinate system which is well let us say coordinate system a which is x a hat y a hat and z a hat and the same 3 green lines I have shown in the original way. Then you can see that each of these 3 unit vectors have projections on the x y and z plane. So, the components of each of these unit vectors can be known. So, we basically have orientation of 3 points now 3 vectors. So, we can describe the orientation of a object by having 3 position vectors. So, we can write this as a rotation matrix consisting of 3 vectors rotation matrix a b r which means I am looking at the orientation of b orientation of b with respect to a and it consists of 3 unit vectors x b with respect to a hat y b with respect to a hat and z b with respect to a hat 3 unit vectors having components as described in this picture here. Of course, I know that orientation can be described in by 3 angles 3 numbers now I have here 9 numbers. So, there is lot of redundancies here they are not independent there are unit vectors for example. So, therefore, the sum of the squares of the components are 1. So, there are equations like this and there are the fact that these axis are perpendicular to each other. So, these 3 unit vectors are not just any 3 unit vectors, but they are perpendicular to each other therefore, the dot products of these are 0. So, you have 3 relationships which are talking about the magnitude of these 3 vectors and 3 relationships which are talking about the orthogonality of these vectors. So, this rotation matrix then can describe the orientation for me is everyone convinced about that it may not be the most succinct way of writing it that is agreed, but it is convenient way yes. It is being used for the orientation, but this is only one of the axis right a object you are saying the object is a cubical object in which this is the vector. Yeah, but it is not uniquely defining that object because you take the hypotenuse that orientation being known you can rotate the object about that itself and their vector will not change right. So, it is not sufficient ok. So, now when we want to describe often times we are going to talk about these frames attached to rigid bodies or robot links essentially because we want to describe the robot motion therefore, we need the position of the origin of the coordinate frame and its orientation. So, we can do that by a frame we call that a frame both positions and orientations can be represented by a set of 4 vectors. So, we construct a frame which is shown here that frame B is a rotation matrix which describes its orientation with respect to some coordinate system of reference which is A and A vector which gives the position of the origin of this B with respect to again A. So, this is a this way we can have a position and orientation of the object in space and we call this entity A frame or what we can do is unfortunately this matrix is not appearing correctly is basically it is a matrix in which you have a rotation matrix which is a 3 by 3 matrix and you have the position vector A P B origin and then you have a unit here and you have 3 zeros here. So, this is basically the frame description as a 4 by 4 matrix ok. So, now we are going to actually talk about frames and we are going to talk about transformation and they basically represented by a 4 by 4 matrix of the type that I just now showed you it can have different interpretations. Interpretations are that you are describing a frame with respect to another that we saw. So, we have this description here of frame B as I described or we are talking about a transformation of a vector described in frame B as it would appear in frame A. So, look at this you have the green coordinate system here B and there is a vector P which is described in this by this vector shown here. Now, this vector if you wanted to describe it in frame A or this position P wanted to describe in frame A then we will have to apply this transformation which is the same transformation by the way it is not a different transformation we are talking about the same transformation which is the transformation describing the rotation matrix of this coordinate system with respect to A and the location of its origin in the way that I described to you. So, this transformation will if you multiply a position vector known in coordinate system B with this transformation matrix you will get a vector which is going to be the vector of point P as described in coordinate system A. Now, of course, I should make a note here and you should otherwise you will catch me on that is that this is a 4 by 4 matrix. So, I have to now multiply A 4 by 1 vector to it. So, of course, I have my P x P y P z and then I am going to add A 1 at the as a fourth element of the vector to make it consistent with the operations that I will be doing. It is interpreted as a scaling type of a quantity, but we will leave it as one we are not going to we are not dealing with graphics where we use that or other 0 elements in the last row which have some interpretation, but we do not have to worry about that now. So, this is coming back to this interpretation that given a vector in a coordinate system how it appears in another coordinate system is a very important task which we will be doing in robotics when we try to do motion analysis. One thing has to be remembered is that all operations when we want to do operations they must be referring to the same frame. So, therefore, if I wanted to write the position of point P in frame A then it is actually not simply addition of these two, but you see I take B P multiplied by the rotation matrix. So, now that gives me the orientation of this vector in frame A, but to that I have to add the displacement which was there for the frame B. So, but that is already known in frame A. So, this type of thing what you can think about this quantity here that the leading subscript B is canceling of the tray leading subscript of the next quantity because both are P that means it is known in A this is a quantity which can be added to this quantity. We cannot take some component in one coordinate system and some other component in another coordinate system and add them with will be meaningless. So, this is something that takes is taken care of in the transformation matrix that we are talking about. The third interpretation of this is that it translates a given vector by some it translates and rotates by some given amount. So, here is a example of that type of thing if you look at this first 3 by 3 part of the matrix of the upper left hand side it is basically you can see it is a rotation of 30 degrees about the z axis. So, does everyone know how the rotation matrix looks like? Just to make sure that everyone knows that if I talk about rotation matrix which is representing yes sorry. So, rotation of about z axis by 30 degrees this is going to be a 3 by 3 matrix which is going to have cosine of 30 degrees minus sin of 30 degrees cosine of 30 degrees 0 0 1 0 0 1. This is a rotation matrix which is describing a rotation about z axis that is why we have a 1 here and it is by 30 degrees. So, you have these elements which can be immediately known. If it is a rotation about x axis then this element the first element will become 1 and you will have non-zero items there, but notice that these are all unit vectors if you look at the columns because sin square 30 plus cos square 30 is unity. So, that is essential because rotation matrix is only 3 vectors which are unit vectors. So, this interpretation is that you take a vector say this one AP1 is shown in green and then I am applying a translation of some quantity 10 and 2 in the x and y direction and I am applying a rotation of 30 degrees and then what happens to this vector is that this becomes a red vector and this is what you will get if you multiply this vector by this matrix. So, it represents a translation operation and translation and rotation operation or the previous interpretation was given a point in one coordinate frame how it will appear in another coordinate frame or simply the description of the coordinate frame. So, with these same transformation matrix 4 by 4 is having a number of ways you can interpret it and these are very convenient. So, now if I have more than one such transformations. So, if I had 3 reference frames here. So, I have x y z here of C frame I have x y x y z of B frame and this is my A frame then I can write A vector in C frame this is the point that I am talking about. So, this is the C p vector here now that that will appear as B p vector the green vector here and that can be obtained simply by multiplying it with the transformation matrix between B and C. Similarly, you can cascade it and you can go down and then you will find that by substituting for B p here in terms of what is known in the first line here I can write this compound transformation matrix A C as a product of A B T and B C T. So, they stack up nicely they can multiply 4 by 4 matrices and this is when you multiply it out again the difference word different version of the software seems to be doing this these L L are supposed to be just 3 horizontal dots and M M are vertical 3 dots. So, it is just basically separating I will not keep writing it because it will take too much time. So, just imagine that this is a sub matrix defining the sub matrix like this into 4 sub matrices one is the rotation matrix 3 by 3 this is a vector 3 by 1 vector this is a 1 by 3 vector of zeros and this is a scalar quantity 1 here. So, keeping that in mind we will proceed with this thing rather than redrawing it on the paper. So, when I multiply it out these two then the left hand side in the product is a 3 by 3 matrix sub matrix which is a product of the two rotation matrices. And here we have the last column the last column is not 0 last column is a 3 by 1 vector which is represented by that A P B origin this is this is a vector quantity. So, now this vector quantity here you will be the multiplication of this row versus this column right. So, this will give me A B rotation matrix multiplied to B P C or plus 1 times this. So, it is simply you know I am writing some matrices, but you are multiplying it just like that you with row versus column multiplication. So, you can write the expression for a compound transformation which is again a 4 by 4 matrix. If you want to find an inverse of a transform which means we know B in A, but actually we wanted to know A in B right. So, it is simply if you want to have that then B with respect to B meet the coordinate system A has a transformation T which is nothing, but the inverse of the transformation of B with respect to A. And we can find the inverse by simply finding the inverse of a 4 by 4 matrix, but it is not required because actually it can be written in a much more compact way. Once again think about this matrix as 4 sub matrices, this is nothing, but the transpose of the rotation matrix. Now, this is a property which you would have studied in maths that if you have a matrix having unit vectors which are orthogonal then the inverse is nothing, but the transpose. So, this is nothing, but the inverse of the rotation matrix in the first sub matrix, but it is actually computed simply by taking the transpose. So, you have to do no calculations you just have to move the elements around. This is 0 0 0 this is 1 and this is this can be this is basically B P A origin meaning the origin of matrix A with respect to the coordinate system B. And that can be computed in a simple way also by taking the product of the transposed rotation matrix and the given vector which we have with a minus sign, there is a minus sign which is kind of hidden. So, this can be again you can derive this and we will not get into derivations of that. So, the whole idea is that these transforms are if we have a number of transforms describing one frame with respect to another frame then you can write if you have a loop you can go from one transform to another transform in two different ways then you can write the equation in terms of the transforms. So, what I mean to say is look at this diagram here you have frame A, frame B, frame C in red, frame D in orange, frame E in purple. Now, the way the arrows are I hope you can see the arrows that this means that frame B is known in frame A because the arrow is pointing towards B that means this is the vector A, P, B origin. Similarly, this green here is the vector B, P, C origin. So, you got that very good. So, now we can write let us say we want to write transformation A, C, T which is nothing but the product of A, B, T this transformation and B, C, T this transformation, but I can also get to it by the other route which is going towards D. So, A, D, T, D, E, T and E, C, T. So, geometrically it is much clearer. So, I can write now I have got two expressions for that transformation and I equate that so I have a equation. Now, if I want to find out some unknown quantity something that is desired say we wanted to know C, E, T. Now, I have E, C, T here. So, I can pre multiply this quantity by the inverse of this product here on both sides. So, that is what I do. So, I take the this product here of the first two quantities here to matrices here and take the inverse of that and pre multiply it to this that then I will get E, C, T. Now, when you take the inverse you can write the inverse of individual matrices in that product, but the order gets changed this you have to remember. So, it becomes D, E, T inverse which is this quantity here times A, D, T inverse times these two quantities A, B, T and B, C, T. So, now if these are all known then this can be computed of course, we wanted the other way round we wanted C, E, T. So, therefore, we have to take the inverse of the whole quantity and then therefore, again the order gets changed of the four matrices. So, you get this expression here. Now, here it was nice because my arrow was pointing in the right direction to get to that. In this diagram it is not very clear, but this arrow is pointing this way, but this arrow is pointing this way. Similarly, this arrow is pointing this way, but this matrix D is known from frame E and frame E is also defining C. So, now it is all there is no neat way, but there is no problem because we know the inverse will do the job for us. So, if I want to write again A, C, T then it is A, B, A, B, T which is describing this coordinate system and then because the arrow is the wrong way round I have to take the inverse of the next one. So, it becomes C, B is known, but I take the inverse of that so it becomes B, C, T essentially right. So, like that I write another equation in terms of wherever the arrow is in the wrong direction I take the inverse of the transform and then I get another equation and then again I can solve for the quantity of interest to me. Now, why am I talking about this is because it represents the problem under consideration for us. Look at a typical situation, you have a robot here, its base is described by A transform or a frame B then you have the wrist, the position of the wrist if that is known then you may have holding a tool. So, there is a tool frame which is known with respect to the wrist because you have attached to the wrist, it may be a gripper, it may be some kind of a grinding tool or it could be deburring tool or whatever it is it is known with respect to the wrist. Similarly, where you fix a robot with respect to that the station workstation coordinate is known and you have in the workstation you have the part where the job has to be done may be deburring has to be done and this. So, this is the goal frame. So, this is the station frame, goal frame, base frame of the robot, wrist frame of the robot and tool frame. These are standard names used for in robotics. So, now I want to know B, I know where the goal point is from the base point and I know it in two ways. I know it if I go through the robot which means from base to wrist, wrist to tool and tool to goal and similarly I can get to the goal by base to station, station to goal and I equate the two and I can find, I can solve for what my, how my tool has to move, what is the transformation necessary, how it should, how much it should be displaced and how much it should be rotated. That is what I want to know so that I can do the job. So, therefore, I want to know TG and this can be obtained by doing similar manipulations that we have talked about already. So, this will give us. Now of course, the question is we have said that these are all known. Of course, between station and the base it is known because it is fixed. Robot is fixed somewhere, station is fixed somewhere. Part is coming to a known location because of some conveyor or some feeding device or something the part is known location and known orientation or whatever. Tool and wrist are known by some fixed kind of a relationship also. Every relationship that is not fixed is between the wrist and the base which is the whole purpose of the robot that we want to be able to take the wrist at different positions and orientations with respect to the base. So, the question in front of us is how do we know BWT that is the transform between the base and the wrist. This is the forward kinematic problem that we are talking about. So, we need to now develop a tool for doing this. The tool we are going to develop is will be based on the geometry of the arrangement that we have in the robot from link to link. So, now let us look at some kind of a general link. So, I have link i minus 1 which is shown in the light blue color and link i which is shown in the pink color. Now, let I have shown only the revolute joints here, but analysis is actually quite valid for prismatic joints also. Only thing is the direction of motion of the prismatic joint the axis of the prismatic joint is taken as a z axis. So, but do not worry about that let us first try to understand how it is what we are doing for the revolute joints. So, for these two revolute joints on link i minus 1, 1 is the axis i minus 1 and 1 is the axis i. The axis i is common to link i minus 1 and link i. So, any two consecutive links there is a axis that is defined which is defining the joint. Similarly, the previous a link is nothing but having two joints. Now, a link can have more than two joints we know that, but what in robotics we will do is we will break apart the joint and we will say it is not one joint then it is two joints coincident in one. So, our purpose it is sufficient to say that each link has two joints and each joint is connecting two links. So, in general these two axis i minus 1 and i are not parallel because we are not talking about planar robots anymore we are talking about general robots. So, they are not going to be parallel they are going to be some two lines in space they do not have to intersect either. However, between any two lines whatever their orientation is one can define a common normal which is normal to both of these lines. So, that is the line of interest to us. So, we draw that line between which is the line which is perpendicular to both of these axis. Now, this we will take as the z axis the joint axis and this line which is joining the two consecutive z axis which is common having a common normal is going to be defining the x axis for us. So, this distance from the two axis on this line is a characteristic of the link. So, we call that the link length. If the two axis were parallel of course, it is the geometrical distance between the two. So, there is no problem between the two joints right, but when it is not when you have a twist in the link then this is the way we are going to define the link length. Similarly, we define a twist the twist I am going to define as a rotation about this line this line which is the normal to both of these axis and if I take this axis i minus 1 and take it parallel and connect it here then the rotation from i minus 1 to i about this x axis is going to give me the twist in the link. So, link twist is defined by a angle alpha and link length is defined by a variable call variable or constant it is constant here of course, it is a yes please the alpha. So, we already have a line which is uniquely defined for any two skew lines which is the line which is normal to both that is going to be our x axis point going from i minus 1 link to i link. So, the direction of x axis would be along this direction. Now, I am just taking this z axis of the i minus 1 axis and parallely taking it to the point where it is intersecting here. So, I am saying the angle which this translated line is making with with to this axis because both are perpendicular to this line right that is the definition we said that that is the line joining both to these axis perpendicularly. So, therefore, I can uniquely know this rotation required to go from i minus 1 axis to ith axis about that x axis. So, that rotation again is unique and it can be it will define the twist in the link. So, we got two things now physical link we have a length and we have a twist, but we have to deal with a few more parameters here. . This is the only twist only twist because of the way we defined it any arbitrary link of any shape, any geometry anything you will you will be able to say one length and one . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . distance between the two along the z i axis again uniquely determined. And the rotation of the next x axis with respect to the previous axis about the same z axis. So, you have the z axis and I translate this down here then this rotation here from going from i minus 1 x i minus 1 to x i which is this line here. So, that is the joint angle. So, you have two things here you have the joint angle theta which for you know planar thing it is very easy to see it is simply the rotation about the axis which is same here it is not difficult to see here either. So, it is angle between x i and x i minus 1 about z z i axis. Then you have the joint offset D which is the distance along the z axis going from i minus 1 to so x i minus 1 to x i. So, now for a revolute joint what happens is that theta becomes a joint variable this is the variable which we control in the robot. And for prismatic joint this offset becomes the variable. So, that is the that is how much we are translating that particular joint. So, in summary I have listed down all the definitions this should have been alpha here the second quantity. So, it is a i is the distance from z i to z i plus 1 measured along x i alpha is the twist angle which is the angle between z i and z i plus 1 measured along the x i axis. Offset joint offset is the distance from x i minus 1 to x i measured along the z i axis and theta i is the angle between x i minus 1 and x i measured about z i. This is not the only way to define these parameters, but this is one way to define the parameters. So, I have taken the notation which the convention that Craig uses in his book on robotics. Now, so we talked about coordinate frames we have already actually talked about that. So, we have established we have to establish the coordinate frames at the intersection of the z axis and the common normal. So, which is so this is the ith coordinate frame. So, z i sorry i minus 1 this is i minus 1 axis. So, z i minus 1 axis x i minus 1 axis and y i minus 1 means to chosen. So, that you get a right hand coordinate system. So, as you go from x to y it must the screw must move in the z direction. So, that gives you the complete coordinate system and similarly for the next axis we have z i axis x i and y i all unit vectors shown here. Now, you can have a situation where the previous z axis and the next z axis they intersect. We talked about the general case where they are two skewed line and they do not intersect they are not parallel right. So, if they intersect then you have a bit of a problem because the common normal is a not a line, but a point. So, therefore, you have a choice of choosing the x direction right. You will choose a x direction which is perpendicular to both of these which is perpendicular to the plane defined by the two intersecting z axis right. You can have a situation where one z axis is like this another one is passing through it. So, all you have to do is to choose a x direction which is perpendicular to both either this way or that way. So, you have a choice two choices are there going this way or that way. So, this is a ambiguity or you know you will have to choose one of the two. Now, the convention is we have to adopt a convention for the first and the last link because there some of the things are free. So, what is done is for the base frame which is the first frame or zeroth frame we call it zeroth frame or base frame we make it. So, that we make the two frames coincidental 0 and frame 1 when the joint variable is 0. So, if it is a rotary revolute joint then for 0 degree rotation you make the two coordinate systems the same. Similarly, for the last frame you choose you try to make your x n minus 1 and x n coincidental for 0 joint variable this is always possible to do. So, this way we get one set of coordinate systems fixed to each of the links and they are defined by 4 parameters link length, link twist, joint rotation and joint offset. So, if we prescribe these then we have defined the geometry of the robot and then we will be able to use this to do our forward kinematic calculation and analysis. So, let us look at some examples to consolidate this heavy material ok. So, let us look at a simple example of a planar 3 degree of freedom robot arm. So, here we I have not shown the z axis at all they are all perpendicular to the plane the zeroth frame here first frame aligned to the. So, how would we would have chosen we would have chosen according to the same convention here because all the z axis are parallel. So, this line joining this 2 has to be the x axis this is the common normal going from the first frame to the second frame in that direction. So, z axis is out of the thing. So, obviously, y axis has to be perpendicular to this like this right. You come to this joint once again same reasoning you will get all these axis fixed to the links and if you look at the parameters alpha i minus 1, A i minus 1, D i n and theta i for i is equal to 1 2 3 then there is no twist in the links no displacement between the zeroth frame and the first frame. So, that is 0 and there is no offset between the joints and only the theta 1 variable will come here as a joint variable between x 0 and x 1 let us say about z 0 or z 1 here. So, like that if you do then only things that will come is the link lengths which are going to come as the parameter A i's. So, A 2, A 1 and A 2 link length 3 is not coming to picture at all here in the parameters because we are going up to the wrist. So, what this length is is not making any difference. So, this is easy to see now let us see something a little more complicated. So, we have here a simple robot in which the first axis of rotation is vertical axis and the second axis of rotation is horizontal axis and then you have some link and some more axis etcetera. But let us focus only on the first two because here what I have tried to do is to illustrate the ambiguity which is there the all different ways you can choose your coordinate system. So, having chosen your x 0, y 0, z 0 x 1, y 1, z 1 is coincidental with that, but there are two ways we can choose that we can choose the x axis about this or that. So, there are the two cases which are there and then in this case your z 1 axis is here and z 2 axis is here because this is a rotary joint about a horizontal line. So, this z 2 axis passes through z 1 axis. So, you have a case where the two z axis are intersecting and therefore, the x axis had to be perpendicular to that. So, there are two perpendicular directions x 1 in that direction or x 1 in this direction. Similarly, if you go to the next coordinate frame then you have the possibility of choosing the x in two directions again. You have two parallel z axis. So, x 2 is to be chosen in this direction, but you have the choice of choosing the z either in this direction or this direction. x 2 is fixed as x 2 has to go from previous link to the next link, but z there is no clear cut thing it depends on your preference what you consider as positive angle and what you consider as a negative angle. So, in each case one can find out these parameters. Do you have a question? Yeah x 1 has to go in the direct it has to be along the common normal. The common normal between z 1 and z 2 can be either way because it is intersecting. So, it is perpendicular to the plane which is defined by z 1 and z 2. So, here it is you know there is a ambiguity there is two directions you can choose, but it does not matter you can choose one and then you can stick to that and everything will be fine. Because once you fix a coordinate system to the rigid body then where whatever rotation it does the coordinate frame rotates with it and your interpretation of what you are getting as a result you have to be then you have to apply your convention and know what you have actually chosen. Here is another example where you have a prismatic joint. So, you have one rotary joint here about a vertical axis then you have a sleeve here in which this whole body is moving in and out and then you have also a revolute joint which is rotating about horizontal axis. So, here if you fix a coordinate frames. So, you will have to the 0 and 1 frame would be here your translatory axis has to be z axis here and here the z axis is a rotation axis. So, if I enlarge these coordinate frames here then sorry the first one is the revolute joint here joint one which has the vertical axis z axis has to be vertical this is the one that I was talking about which is for the prismatic joint which has to have z 2 horizontal and z 3 has to be horizontal also because that is the axis of rotation of the third joint. So, for choosing x axis in this direction because again there is a ambiguity z 1 and z 2 are intersecting and therefore, x 1 has to be perpendicular to that plane defined by z 1 and z 2 and it is been chosen like this. Having chosen that after that you have to choose z x 2 in this direction and you can find out the joint parameters here link the link joint parameters which define the whole geometry. Once you have gotten this after that it is all maths. So, shall we look at any of these or these are just basically the way I have defined them you have to interpret that look at that carefully, but you should go through the exercise if you want to understand it. So, now look at something more realistic you have the Puma industrial robot 6 degrees of freedom, articulate type meaning all revolute axis and electric actuation it has some weight capacity and some accuracy etcetera, but it is a realistic robot. So, if you look at that now the schematic of the robot is shown here the first axis is about the vertical axis the second is about a horizontal axis which is that the whole thing rotates like this and then the next one is the arm moves about a horizontal axis and then you have a elbow. So, another axis which is horizontal here. So, z 2 is coincidental with you know and look located at the same point, but not oriented in the same way because z 1 has to point up whereas, z 2 has to point horizontally, but it is located in the same place here. It was not essentially it could have been located here for example, but the manufacturers have used this and so that is most people are using that it has some advantages. So, going next joint you have z 3 axis like this and x 3 has to be pointing away going from z 2 to z 3. Now, the next 3 joints are all located at one point because that wrist has 3 rotations and therefore, they are shown by 3 separate coordinate systems, but they are supposed to be located at the same point therefore, but so there the various parameters for this can be defined according to the definitions and one can see that between 0 and 1 the base frame and the first joint it is simply the theta 1 rotation theta 2 should have been there. So, this is a mistake in here this should have been theta 2 and so on so forth. So, various offsets are defined and these offsets get reflected in the parameters. So, now having known these parameters how do we get the transformation because transformation is what we want once we have transformations then I can find out the transformation between the base and the wrist that is what I need. This is we are doing all this so that we will be able to compute that transformation. So, for that we need to know how from one link to the next link what is the transformation and that transformation can be defined in terms of the 4 parameters that we have one variable and 3 parameters. So, how do we do that now let us understand that. So, we have the 2 links here and my red coordinate system here is x i, y i, z i and the blue coordinate system here is x i minus 1, y i minus 1, z i minus 1. So, this is what we had talked about earlier. So, these are the same 2 coordinate systems defined in the same way located in the same way. Now, what I do is I define a whole lot of intermediate coordinate systems to understand how the transformation will be. So, look at the coordinate system P which is shown in green. It is oriented the same way as i it is only displaced by the offset amount. The joint offset amount it is displaced by. So, now it is now located here, but oriented the same way as the ith frame. Similarly, now I go to next is q frame. Now, q frame is shown in yellowish color or orange color and it is located at the same point the origin is at the same point z axis is in the same direction, but it is rotated about the z i axis or z q axis by the theta i amount. So, now, if you look at the x p axis which was the axis of the i p also sorry x i also and x q they are rotated. So, that this x q is now become aligned with the x axis here. Now, between q and r which is shown in light blue color it is simply a translation. You take this whole coordinate frame and you now translate it by this amount to bring it here. So, you have x q and r sorry. So, this is x r y r and z r and between x r y r and z r and x i minus 1 y i minus 1 z i minus 1 there is only a rotation of the twist of the link. So, now, what we have done is we have defined these intermediate p q r frames. So, that between any of these two there is only one change of one rotation or one translation. Now, those rotations and translations of one axis I know how to write it down I have written it down for you like for x axis, y axis, z axis and these are rotations about z axis and x axis and translations about some axis. So, translation is simply the last column the three elements on the top that is the translation and rotation is the rotation matrix. So, for each of these I can find the transformations and therefore, I can write this given any vector in frame i if I want to know how it will look in frame i minus 1 then I have to multiply it by these transformations i minus 1 r transformation r q transformation q p transformation p i transformation and each of these transformations is simple because they have as I said only one change either some angle rotation or and in fact, it is precisely this between there is a z about z you have a translation by amount the offset joint offset you have a rotation about the z axis by theta i you have a translation about the x i axis by a minus a i minus 1 which is this distance here and you have a rotation about the x axis by the link twist angle. If you do these then you are actually going to get the entire transformation and which when you multiply it out comes out to be what is shown here the convention here is that c theta i is cosine of theta i and s theta i is sin of theta i. So, this here this term here for example, is cosine theta i times cosine alpha i minus 1. So, all these quantities are known except of course, one quantity which is the joint angle which is known from at each time or at this instant of time this is the joint angle. So, at any instant of time we know all these things we can compute this in numerically and get a 4 by 4 matrix which is set of numbers known to me. So, then what we can do is knowing all the link parameters. So, for the Puma robot for example, all the link parameters are known and all these transformation matrix can be computed. So, for example, look at the first one first joint you have all these quantities parameters are 0 only theta 1 is there and since theta 1 is there which is a rotation about the z axis. Therefore, I have a transformation matrix which is simply a rotation matrix of this type. Similarly, if you look at the second one you have alpha i minus 1 which is non 0 and theta 2. So, if I go back then I have to substitute for the all those parameters here and I will get a transformation matrix which will look like this. Now, it is not a pure rotation about y axis because there is a twist coming in here. Therefore, it is not coinciding with what I would have expected for just a rotation about x axis or y axis. So, it is something more, but you can see that all these columns are unit vectors which must be so in the rotation matrix and there is no translation here. The moment I will have some kind of offsets here then these numbers also come in here in the last column which is representing translations and offsets. So, this is now you have understood that given any robot geometry the way the link is the way the joints are we can compute these 4 parameters by looking you know without getting confused, but it can be done you can master it is not difficult. And then once we know these 4 parameters we can find out the transformation matrix between every joint. And all I can do is I have all these going from 1 to 2, 1 to 0 to 1, 1 to 2 and 5 to 6. If I want to know what my gripper have a vector let us say there is a tool the tool frame which is defined by let us say a vector there. How that is oriented in the third joint? If I want to know that then I have to multiply these 3 matrices together and I will get a description of that vector in the coordinate frame of the third joint or if I want to know how it looks in the world frame I have to go down to the zeroth frame and I multiply all these 6 axes and I get the compound transformation matrix which will describe the tool in the base frame. So, this is what basically is forward kinematic analysis. It is difficult when you try to do the problems there is lot of computations I am not saying it is easy, but at least you have a handle on it you understand how it is done then you can sit down and spend enough time and you can for any robot actually you can do it. So, let us look at the inverse problem. As I said the inverse problem is given you have the wrist position and orientation is given you want to know what the joint should be. So, I am taking a very simple example here because we would not have time to do and there is no need to subject you to that right now is basically. So, in this planar problem you have all z axes are coming out of the plane and you have 3 joint variables all the fluid joints theta 1, theta 2, theta 3 and the link parameters are what we had found out earlier are listed here. So, what we do is we can find the compound transformation from the base to the wrist. I can do that by multiplying that and then. So, I multiply the 3 transformation matrices which I will get from corresponding to the 3 rows of this right. So, 0, 1, t, 1, 2, t, 2, 3, t which will be gotten from there by using the general formula for defining the link transformation. So, multiplying them all together I get a matrix like this which is showing the cosine of theta 1 plus theta 2 plus theta 3, sine of theta 2 you know. So, this part actually you should be able to you should have guessed it because what is the orientation of the wrist is nothing but theta 1 plus theta 2 plus theta 3 whichever way it is that is how the wrist is going to be oriented there is no other way the wrist can be oriented. So, that is what our fortunately our matrix multiplication is also showing the same. So, you can always have a check like this and see. Now, the location of the thing is also is not very difficult to see in this particular case one could have derived it from the geometry very easily using trigonometry, but this can be done by transformation matrices. The way we have to do the problem is that we are given the wrist position and orientation. So, what we are given is what we specified is this matrix here x, y location of the wrist point and some orientation of the wrist phi. So, from that I can find the rotation matrix and the rotation matrix is cosine phi minus sine phi sine phi cosine phi and 1. So, this part is the rotation matrix about the z axis by phi amount and this is the translation amount which is the position of the wrist with respect to the base frame. If this is specified what I can do is I can compare various quantities here and here and write equations algebraic equations or trigonometric equations here. So, for example, I can say that cosine of theta 1 plus theta 2 plus theta 3 cosine of phi and sine of theta 1 plus theta 2 plus theta 3 is sine of phi I can determine from that that phi is nothing but theta 1 plus theta 2 plus theta 3 or I can look at these two quantities x and y, x equals to l 1 cosine theta 1 plus l 2 cosine theta 1 plus theta 2 and y is equal to l 1 sine 1 plus l 2 sine theta 1 theta theta 1 plus theta 2. So, I have two equations now and I have two unknowns theta 1 and theta 2 and I can solve for it no, but in these equations there are only two unknowns theta 1 and theta 2 right and I have two knowns x and y is specified for me the link parameters are known to me l 1 and l 2. So, therefore, it is a question of solving them. What one will have to do in this case is that you have to take the square of each of the equations add them together you will basically get the cosine formula right and then one will have to juggle around and you will get the solution to all the angles theta 1 theta 2 from here and then knowing the sum of the three as phi we can find out theta 3. Now, in general this is what we will have to do you have for any robot the end wrist position and orientation are being given to you. So, you will be able to find the product of that the six transformation matrix and equate it to the desired position and orientation matrix that you are desiring the frame that you are desiring and you will compare these things and you will try to solve these transcendental equations which will be coming basically trigonometric functions are there and one will have to find ways there are once you start doing it you get to know what the techniques you should be using. But in general you can only have numerical solution you can have analytical solution only when there are three no I should not say only when you are guaranteed that you have a analytical solution if three axis in the robot pass through a single point. Now, this is why if you go back to the Puma robot the last three axis were at the same point they were intersecting axis. So, if the last three axis are always passing through a point then there is a way to given by Piper it was somebody Piper who solved the general case when three intersecting axis are there how to get the inverse solution in a closed form. If three axis are not intersecting then they may be or may not be. So, in all commercially available robots usually the last three axis are intersecting and this allows you to solve. So, what we do is we solve for the position and then we can solve for the last three axis using Euler angle expressions. So, as a general way if you look at Puma for example, then you this is what you will know you want some orientation which means you know some rotation matrix given here and you have the wrist position. So, these are known and this is equal to a matrix which has got these expressions this R 1 1 is this which is now in this it is been further compacted this is cosine of theta 1 cosine of theta 2 plus theta 3 is written as C 2 3 the cosine of theta 4 times cosine of theta 5 times cotinus theta 6 minus sin of theta 4 sin of theta 6 etcetera. So, they are long complex expressions, but there are some simpler expressions also. So, you will you will correspondingly you will from the given element that you know the numerical value for you will compare it with say these two and then adding subtracting you may be able to get rid of some terms taking ratios you may be able to get rid of the some terms or in the case of Puma the way it works is that there is a technique you can adopt which is that given this overall transformation for the robot from base to wrist this is consisting of product of 6 transformations each is a function of one of the angles. So, if I take this overall transformation and multiplied by the inverse of the first matrix then on the right hand side I will get 1 6 which is a product of these 5 terms here on the left hand side I have this known matrix which is the what I want and this is the unknown theta 1 here right. Now, as it happens if you actually multiply out matrix 1, 2, 3, 2, 3, 4, 5, 6 then you will get some expression there and it happens so that the element 2, 4 which is turns out to be d 3 only. So, d 3 is known if d 3 is known I can equate the unknown expression here which happens to be sin of theta 1 times p x given quantity plus cosine of theta 1 times p y. So, I have been able to write the equation by simply looking at the elements which elements to compare because there are so many elements in fact there is a redundancy of elements. So, I if I equate that then I have only unknown is theta 1 here and then so you are isolating each of these variables because each of these transformation matrix is only depending on 1 and this a product is known because that is a desired position and orientation and by pre-multiplying by the inverse of one of these you are separating that variable out of the other variables. If I had simply multiplied out they will all be clumps of mixtures of various variables, but I have isolated it by pre-multiplying it on the left hand side and multiplying it to the desired orientation you know transform and isolated that and manage to solve it. So, like that one can do and one can find the solution it comes out to be very complex solution, but it is doable. So, that is all I think I should talk about wanted to give you a flavor of what the problems look like in kinematics and inverse kinematics. Actual solutions you know the approaches are there and then one will have to do the hard work for actually doing any of these. Well, bond graph is a way of modeling right. So, it could be any way of modeling it does not have to be bond graphs. The package they the Cosmo package or whatever that is developed at IIT Kharagpur it is I think they must have found some way of using it, but because inverse kinematics problem in general is generally is not solvable in a closed form only numerically it can be solved in general. Forward kinematics yeah it is possible no, no I am not saying that it is not possible to do it is very possible to do it in that because you have to define all these transformer fields and gyrator fields and the zeros and one junctions and all that it is not very very straightforward for rigid body dynamics. For lump parameter systems you know of spring mass dash pod that that scheme is very good especially when you have electrical system mechanical systems rotational systems other systems all combined you know in a multi domain type of situation bond graphs are very useful and bond graphs help you in modeling in some way because they have the concept of causality and there are various checks and balances whether you are doing it right or wrong it helps you to do that, but it is not necessary. If it is simpler to you then by all means you should you know look at that I have not really looked at that particular solution. So, I cannot comment on that. No it is the same thing now teach path meaning you already know the joint angles this depends on the task in many places you can do teach teaching is not that simple if you have lots and lots of points for example, pallet application and all that if pallet has 100 parts in it you have to go to each part and you have to teach it it is not very good then you would like to know say ok x direction offset is so much y direction offset is so much pallet corner is here all 100 points can be generated yeah that is right. So, there you would like to use inverse kinematics and nowadays I mean yes 20 years ago when 30 years ago when these things were you know just being demonstrated the first robots were being demonstrated that time computation power and today's computation power there is a vast difference. So, computation is not as much of a issue as it used to be it is still a issue because you want to do in real time you want to do as fast as possible so that your robot is fast, but it is not as much of an issue.