 Some topics in robotics which are related to getting some work done by the robot ok. So, I would describe the nature of the tasks you want to perform using these robots. You have already been given introduction to various types of sensors, various types of actuators that are commonly used in these robots which drive these joints ok. And you have also been given some lectures on how to control these actuators to achieve desired motion. So, in today's talk first part of today morning's lecture I would be talking about what is the type of desired motion we want to achieve ok. So, you have to place these things together in your mind, you have already been taught if you desire a certain motion how to control an actuator to get that. So, you have microcontrollers, you have some sensors fitted on the actuators. So, you can take feedback and then do some control action to achieve the desired motion. Now, what is this desired motion, how do I decide this is the way the joint should move that is what we are going to discuss in today morning ok. So, our task is really what is called trajectory planning. So, depending on the type of tasks you want to perform I have given some examples in my lecture notes I think the lecture notes is with you already. You may have a certain type of tasks where you say that just say pick and place. So, I am saying that I just pick up this water bottle from here and then place it somewhere else ok. So, this is what is called a typical pick and place assembly task. Here from one workbench I am picking up an object and keeping it somewhere else. Only the path I am following is not so important. So, these are what are called point to point tasks ok. That is why you would see in my talk also the schedule it is given as PTP tasks, point to point tasks. But suppose on the other hand you are using a robot to do say a painting job or a welding job. So, two pieces are there and two pipes are there and then you want to do welding. So, there you have a particular profile of the weld you want to generate and whatever is a robot that is driving this welding gun must make sure that the welding gun follows exact profile that you want. It cannot miss any points in between. It has to follow the particular profile that you wanted to move. So, that is what is called the continuous path kind of motions. So, you have you know both typically both types of tasks one are pick and place kind of assembly tasks, one is what is called a continuous path motion ok. So, these are the type of tasks typically broad classification that you can think of you may want a robot end factor to perform. And the way you would as a user look at a robot the task you would like to specify in world coordinates what we call as world coordinates in the sense supposing you look at this room this is your machine shop or something like that. So, this is my world and I might define a set of coordinate frames x, y, z axis or or theta z axis and so on and so forth some coordinate frame with reference to that I can define that there is a machine shop here there is a machine shop here at some locations and the robot end factor must pick some object from here and keep it here. So, my task specification usually takes place in world coordinates with with reference to some x, y, z coordinates I keep fixed for this whole machine shop. So, you must understand the problem domain before I get into the details because once we get into the details it may look like lot of maths. But you must understand the problem physics where we are operating then we get into some of the details. So, as a user you are worried about getting the end effector to do certain types of tasks which is point to point or it may be continuous path either point to point or continuous path is typically specified in world coordinates because that is what you are convenient you know the coordinate frame that you are attaching to a particular machine shop floor with reference to that you can specify that so many meters here so many you know meters above the ground this position is there you have to lift it you have to orient it like this and so on and so forth. But on the other hand you are achieving this motion by controlling individual robot actuators joint actuators. So, at each at the shoulder at the elbow at the wrist as Prof Ramandar might have mentioned to you about robot anatomy class yesterday at various joints you have various actuators. So, you have to achieve this world positions by driving the motors which are going to be worried about joints coordinate frames within this coordinate frame this joint is to be driven like this. So, you have to link up these two coordinate frames the task of a trajectory planner is to link up a user defined world coordinate frame jobs into the individual joints how they have to be driven link up the coordinates and then find out how to reach these positions and so on. So, that is really what we are going to discuss for the next one and a half hour or so if you have any doubts in between feel free to stop me and ask me. Now, I come from the mechanical engineering department I am Sehshu I have multiple interests some of you know me for the book I have written on finite elements I have mentioned to me that NITS or they are using that so I have multiple interests I use computational tools also interested in robotics because lot of computational tools find applications in kinematics dynamics trajectory planning control and so on and so forth. So, let us go over this and see how we look at therefore a task as I was mentioning in the world coordinates it is prescribed in terms of say I have taken because you probably have not done too much of kinematics by now in this short course. So, we are talking in terms of about 40 hours of theory course on robotics typically mechatronics is another 40 hours you know in IIT. So, we are trying to compress it into you know about 10 hours of theory classes for your course purpose. So, I have taken simple examples of planar motion so that you will be able to immediately understand based on simple trigonometry the relations that we are talking about. So, in a two dimensional example that I have taken here supposing you think in terms of two links and then the end effector at the end of the links has to do some tasks simple mechanism I have taken into account so you just do not have a wrist also there it is very very simple. So, I have just a shoulder joint and an elbow joint and I want it to do some work. So, these two joints have two degrees of freedom so that is what I call as theta 1 and theta 2. So, there is a motor sitting here driving this joint there is a motor sitting here driving this joint. So, I have two degrees of freedom theta 1 and theta 2 I need to drive in a manner that I have to achieve the end effector position wherever I want and this is specified in terms of the global x y frame x y coordinates of the end effector point b. So, now how do I relate it this is a typical planar 2R manipulator two revolute joint. So, this is very very simple example but it illustrates the points that we are talking about. So, I am sure you must have done this type of things before it is a simple L1 in L2 are the link lengths. So, x b y b that is in world coordinates are related to the joint coordinates theta 1 and theta 2 of each individual motor sitting here and being driven. So, x 1 and y 1 are x c b y b is L1 cos theta 1 plus L2 cos theta 2 and L1 sin theta 1 plus L2 sin theta 2 gives you y b. So, I hope there is no problem in understanding this simple trigonometric thing L1 L2 L1 L2 are being given to you. So, for any given position now the interesting point that I want you to observe is that given any joint positions theta 1 and theta 2 it is fairly easy of course link lengths are already known to you. So, it is fairly easy to find out x b y b where my end effector will be it is very easy to find out but the problem as a trajectory planning person is the reverse. Typical problems of trajectory planning you are given x b y b you are of course given the link lengths L1 and L2 you have to find out the required theta 1 and theta 2 to achieve with this link lengths to achieve x b y b. So, given these left hand side things you are trying to find out theta 1 and theta 2 two equations and two unknowns but the problem is that these are sin and cos functions. So, it is like non-linear algebraic equations yes. You could do that yes I think in the previous picture it is shown as this is theta 2 it is actually should have been with respect to the x axis and thank you for that yeah. If you think in terms of a motor sitting on the first link driving the second link or motor sitting and the frame and driving the second link the difference is that thanks for pointing it out I forgot to mention that. So, given theta 1 and theta 2 to find x b y b is fairly straightforward but in trajectory planning problems you are typically told where the end effector should go and then you are to find out how to drive the joints. So, theta 1 and theta 2 to be found out. So, given x b y b this becomes non-linear algebraic equations that is trigonometric equations to be solved. So, multiple solutions will be there and so on and so forth right sometimes you may not have solution all those problems will be there that is what we will try to look at. Now, what it means is that for each position that you want in the world coordinates the end effector should reach I can find out corresponding positions that the joints should take theta 1 and theta 2 corresponding to this position, corresponding to next position, next position, next position. For each position of the end effector I can have a table these are the joint angles that I need to go through ok. So, that comes from inverse kinematics ok. So, assuming that you have solved this inverse kinematics for your robot ok. So, you can achieve something similarly by differentiating these kinematic relations in relations in terms of the velocities and the accelerations because typically you also have a time sense to these motions. You may say that if it is an assembly operation you want this particular task to be achieved in a certain time ok. So, that means you are automatically talking in terms of certain positions to be reached with certain velocities to be achieved ok. So, therefore, we differentiate these things and then you will get this type of relationships. So, this is x dot y dot in the end effector coordinates world coordinate frame the velocities that you want to get for the end effector and these are theta 1 dot and theta 2 dot wherever you see the sign end symbol you please treat it as a dot ok. So, you will have theta 1 dot theta 2 dot related through the derivatives relations ok. Given theta 1 and theta 2 again at a given position of the joints it is fairly easy to find out given theta 1 theta 2 theta 1 dot theta 2 dot. But here you are trying to find out given x dot that is velocities of the end effector in the global world coordinate frame you are trying to find out what is its joint velocity is I need to drive it ok. Now, broadly you have got an idea of what is the trajectory planning problem, but at the same time some more aspects that we need to look at are there are likely to be constraints ok. In the sense that when I am driving a point an end effector from one position to another position with certain velocity ok I need to go through certain accelerations therefore, but now I have some motor sitting there actuators are there. So, they have certain torque speed characteristics certain maximum accelerations that they can supply to this system with some finite inertia. So, you will have some constraint on what is the maximum acceleration or what is the maximum torque that I can supply as an actuator sitting here ok. So, you cannot get any arbitrary profile that you want with respect to time you have some constraint in general. You also have a constraint arising out of dynamics of the manipulator. What I mean by dynamics is that it could be simple rigid body dynamics because whatever we have discussed so far is kinematics. I tell that this is the geometry relation and if I drive this actuator if I position this then the kinematics dictates the rest of the motion. But because of the finite mass and inertia of the links the joint torque supplied do not automatically translate to these kinematic positions that is one problem we will have dynamics rigid body dynamics comes into picture. The other dynamics effects that comes into picture is the compliances joint joints may have some finite stiffness links also may have some finite stiffness ok. So, what happens is that when I say that you move from this position to this position with some finite velocity and acceleration it accelerates and decelerates so inertia forces are set up. So, when I go here to here it does not only go from here to here but as it reaches it does vibrations and then settles down ok. So, because of the inherent stiffnesses compliances and the of the links and the joints. So, therefore I need to take into account so otherwise it would start welding in a zigzag manner when I ask it to follow a particular path ok. So, these are constraints I have to take into account dynamics and then compliances. So, you may also specify some constraints on how the smoothness of the motion is. You may have some problems which we will come to towards the end these Cartesian path constraints I would talk about towards the end briefly. You may have some constraints coming from the world coordinates because for example if I want to go from this position here to this position here in between there is an obstacle here. So, I cannot simply go like this ok. So, there are constraints in that sense ok. So, all these things have to be taken into account. So, we are in a position now to kind of formally state what is the broad trajectory planning problem ok. So, we may say that you are trying to move from an initial position to a final position via some intermediate points I will talk about that in a minute now. Within specified duration of time as I mentioned you may say that go from position A to position B within say 5 milliseconds or 50 milliseconds depending on your kind of operations. Subject to constraints ok. Now, what is this via some intermediate points which we have not talked about right now. When you look at the particular constraints I have mentioned supposing I am saying that this particular object is to be picked up from here and placed right on this chair. So, I cannot directly take it like this. So, I might actually say how do I tell it to the robot. So, I can actually say that you start from here I know that these are the constant obstacles. So, I may tell the robot that you start from here you go via this point you go like this and then clip it here you know. So, I am actually specifying some via points. These are points which need not necessarily be passed through important point to keep in mind is that these via points are such that you may or you may not really pass through those points, but you have to pass close through those points with some finite velocity. So, depending on how you specify these via points these intermediate points are extremely useful because as we go along we would probably try and highlight that and see that when you specify these via points and require that the robot should pass through them with some velocity and so on so it becomes tricky. So, you could use the via points conveniently to do the trajectory planning. So, we will go through these various steps. So, now when I am specifying that from initial position I need to go to a final position for the end factor through the kinematics I have transferred that problem into motion planning for each joint because I know that x is l 1 cos theta 1 plus l 2 cos theta 2 and so on. So, I can relate the x y specifications to theta 1 theta 2 specifications. So, from now onwards really speaking I am going to talk about only how to get individual joint to motions theta 1 theta 2 and so on and so forth. This is really what I have mentioned here. We are talking in terms of joint space trajectory planning. So, within the joint space so for a given actuator here sitting how it should drive the shoulder joint and elbow actuator here how it should drive the elbow joint theta versus time that is what I am really talking about. So, let us consider one such joint I have taken a single revolved joint the degree of freedom is angular rotation with respect to time. Say from an initial position I to a final position j I am right now not talking about any via points to begin with to simplify the problem I am not talking about any via points. So, let us say that I want to move from position I to position j at that position I may specify the position the velocity and the acceleration in general. So, it is possible that I reach a position j with some position at that position with some velocity and with some acceleration some of these things you may not specify. Please understand when we are talking in terms of specify who specify is this the user has to specify. Keep this in mind. So, when we are designing a robot putting it in operation say you may give some provisions, but ultimately the user has to specify all these things. So, you ask too much information to be specified by the user he may not really know how to specify that. So, keep this point also in mind. So, in general he can specify position velocity acceleration position velocity acceleration at the initial point and at the final point. So, I have put here as theta versus time initial position is this final position is this and then in a particular time duration. So, one of the common things that is done is to use a cubic curve fit to go from an initial position to a final position. So, you are starting from an initial position at time t equal to 0 in the final time t ij. The reason why I have used t ij is that the time taken to go from an initial position i to a final position j. So, therefore, it is given the symbol t ij very intuitive to remember and use it and the general time is time tau. So, I specify that theta of tau is c0 plus c1 tau plus c2 tau square c3 tau cube. If you use cubic curve fit the idea is that this gives you a cubic curve passing through this initial position and final position with some velocity at the initial position and then final position. And then you will know the particular joint that you are trying to drive. This is the motion I need to get at every time step. Now, I have a clearly defined equation which tells me from this position to this position how I should drive it. So, that is the reason why we are doing a cubic curve fit. So, initial position to final position in a time t ij. Suppose you think in terms of initial position and velocity, final position and velocity are specified. These could be 0 you are starting probably from rest that is fine. So, at an individual joint you might actually initially start from rest or from some finite velocity to a final position either at rest or at some finite velocity. So, 0 or non-zero values are perfectly possible. So, I am going to use these four conditions 1, 2, 3, 4. Four conditions are there. These four conditions I am going to use to determine c0, c1, c2, c3. So, when I substitute tau is equal to 0, this should expression should become theta i, tau is equal to t ij it should become theta j. I should have reached the final position when the time is t ij, I should have reached the final position and when tau is 0 the initial velocity should be theta dot is equal to theta dot i and when I reach the final time t ij the velocity should be. So, four conditions are there I can determine the four coefficients c0, c1, c2, c3. So, it is a fairly simple strategy. It is the simple curve fitting strategy that you will help you to plan the joint motion. I have just done through the maths. They can be solved c0, c1, c2, c3 can be solved in terms of the initial position velocity, final position and velocity and then you can plan the trajectory. I know how to actually now drive the individual motor. We are assuming that all the joints now theta I have taken the example of only one single revolved joint but we are assuming that all the joints that are there the shoulder joint, elbow joint, wrist and whatever joints you have all of them will start and end at the same time. So, that is what really we are assuming we could plan it other ways also but I am just taking a very simple case of coordinated motion. Every fellow joint starts at the same time and ends at the same time. So, we have taken one such joint and we know now how to plan this joint. So, once you know that this is the motion I want to achieve. So, please see this. So, once I know that this is the motion I want to achieve I have determined c0, c1, c2, c3 coefficients. So, I know the motion I want to achieve. I start supplying the necessary inputs to the motor. The motor rotates. I have a sensor which you have already been taught. Maybe you have an encoder or whatever type of sensors you may have. You may also have a taco, you may monitor the position as well as angular position as well as the velocity. You can come back and check with this desired motion whether or not you are getting this desired motion. Whatever is the difference, you can use your microcontrollers to find out the difference and then you have an appropriate control law. Maybe a simple PID law. Maybe a simple proportional integral derivative control. Maybe an advanced control strategy does not matter. Whatever appropriate control law you have from the sensor input that you are currently having, this is the desired motion that I want to have. The difference between these two in terms of positions, velocities are minimized. So, you are able to get as close to the desired motion as possible. This is the overall strategy that we follow for achieving a coordinated motion of a robot from any position to any position. If you have large number of points also, only computations increase conceptually this is all that we are doing nothing more than that. So, this is the scheme of things. Various lecturers are coming, Professor Seshik Anshunan came and taught you microcontrollers. Probably, Professor Prasanna Gandhi came and talked to you about sensors and actuators. Yesterday, Professor Amanal talked to you about robot anatomy. Now, I am talking about trajectory planning. But the subject is all integrated in this manner. So, you desire whatever the tasks you want the robot end effector to perform. From the world coordinates, you convert it into the joint coordinates. From the joint coordinates, you do some strategy like a cubic curve fit or any other strategy. I will talk about other strategies also. You do that. So, convert it into a desired motion for a joint. Once you have the desired motion, you have what is called the set point for your controller design, what you have to achieve. Then you have the actuator, you have the sensor which keeps telling you what is the current position, vis-a-vis the desired position and velocity and then you try to minimize the error between these two. So, that is how every instant of time the whole planning goes. Now, supposing you have n points in between. So, from an initial position to a final position, but a via point is also specified. Then what you could think of, I would not spend too much time on that. What you could think of doing is that you have this position here, you have final position is this. But in between you may say that from here I should go to this, I should go to this, then I should go here. So, whatever we have just now discussed, you can apply to each set of two points. Between these two, I can fit a cubic polynomial curve and then decide what the joint motion should be. Then I have done this and then I go from here to here, I go from here to here and so on and so forth. Any number of points that are there, it is no problem at all to conceptually do this. I think the necessary maths for this I have already given in the lecture notes, it is just repeated application of whatever we have discussed for a single joint. So, between from here to here I do it and then I do it from here to here and so on. Only thing I have to keep track of is the fact that when I am going from here to here, whatever position and velocity I have achieved at this instant of time here, whether I come from this side or I take off here, there should be a smooth handshake. I should not have a discontinuity in these variables. So, that is all that I have to keep track of and again conceptually, intuitively that is very, very straightforward that requirement that is you are coming from some position and then you take off smoothly. So, you are having continuity of position, velocity, acceleration, whatever derivatives you can specify, you can achieve. It is good if you can achieve them, but if you do not achieve them, it would mean that you are going to have slightly jerky motion. If there is a discontinuity, it means that you are going to have jerky motion. Most many of you must have learnt driving and then initially when you are learning driving, then you would know how to operate the clutch, how to operate the accelerator, you would not know how to do this then it keeps on going like this. So, that is the jerky motion because you are not able to coordinate the release of the clutch slowly and then pressing of the actuator. That is all you have to do. You have to release the clutch and you have to press the accelerator, but that coordination till you get the car would have experienced lots of jerks. What would happen is that, let us go back here. So, when you are looking at n points, so the user if you are following our strategy right now, so please see this cubic strategy that I have just now mentioned. We are talking in terms of position and velocities, theta dots being mentioned specified by the user. Now, if he has to do it from this position to the end position, say some three points. So, the initial position and then three intermediate points and then the final position. So, total always it is n plus 2. If there are n intermediate positions, initial position and final position are always there, n plus 2 positions the poor fellow has to specify position and velocity. Only then you can work out the strategy. So, you are really asking him to specify too much of information to be given by the user. So, keep this point in mind. The second disadvantage I mean or drawback I want you to keep in mind whenever in robot motions and so on planning you specify you require that the user specify something you must keep in mind that you are driving real physical joints. The user really does not see all this. User just sees that this should be picked up from here and kept somewhere there while you are driving these individual joints. So, the position that he gives the velocity that he gives the accelerations that he gives may not be kinematically consistent. You are driving a set of links connected together through a particular set of revolved joints, prismatic joints, cam pairs, all kinds of things. You know the kinematics. He does not necessarily know that. So therefore, when you ask him to specify 100 different things then it is possible that because there is a window I mean you must have seen lots of computer interfaces. It asks for this address that name this mobile number that you know landline all kinds of numbers it asks all kinds of data it asks because it is asking otherwise it does not proceed further he might give some number. You may not be able to with your joint actuators with these prismatic joints, revolved joints, cam pairs that you have. You may not be able to achieve at this position in velocity you may not be able to achieve this acceleration then you are stuck you cannot proceed. You have asked the way you have defined your user interface and the control scheme and so on no trajectory planning. You have asked the user to specify all this but you have not provided him any way in which he can do this conveniently kinematic consistency he cannot check he does not understand robotics the way you understand. So you have to be careful when you ask the user to specify lots of data. So this is a disadvantage of our present strategy it is very very simple given any position velocity any position velocity I just fit a smooth cubic curve. Cubic curve has C0, C1, C2, C3, 4 coefficients to be determined and I am asking for 4 conditions initial position velocity final position velocity. So my job is done but it does not work out like that we are talking in terms of a large number of via points. So let us see how it goes. So I have just now mentioned about this. So user to give large number of data point data specifications which may not be kinematically consistent user interface may become a mess. So I am talking about this particular example. Now you may come back because of the constraints I have mentioned kinematic consistency and so on and so forth. So you may say that let the user specify the initial position velocity, final position velocity. He may specify the via points position but he may say that you choose your convenient velocity you know I do not really bother. See the particular example I am giving supposing I am taking it from here I cannot directly go here because there is an obstacle the user knows that. So he is telling you to go via this point. He does not really care what is the velocity with which you are going around this because he has given you the total time available to you that is about say I mean you know 100 milliseconds or whatever it is he has given you that. He does not really worry about the velocity with which you go through a specific point. He may tell you that you go through this point so that you will you know avoid all his obstacles or whatever things and then you will go to the final position. So your velocity you may choose he gives you that freedom to choose that becomes then more convenient for you as a trajectory planner that you can choose a velocity that ensures smooth motion without any problems. So velocity to be chosen that is what I have written here velocity to be chosen by the system meaning by your computer program it can choose that trajectory planning program it can choose that let us see how it goes. So I am talking in terms of three points specified i, j, k that means initial position final position say and an intermediate point j via point I have taken one simple point to illustrate the basic idea. So you can have many more of these and in each case I am specifying that from i to j you have a certain time tij from j to k you have certain time tjk. So the user specifies you go from this position to this position via through this point here and here you may do it in about 25 milliseconds here to here you may do it in about 75 milliseconds. So he specifies the total time available to you and the initial position velocity final position velocity and the intermediate position. He does not care really what is the velocity achieved through that point. So that is another way of looking at this problem. So I will just show you how that can be solved. So I look at now two cubic curves segments. So I look at one cubic curve from i to j and then another cubic curve from j to k. So from i to j I specify one cubic curve smooth cubic curve and then j to k I specify another cubic curve. Let me see how I can fit that. So each of them will have c0, c1, c2, c3, some b0, b1, b2, b3. Time goes from 0 to tij here and here I have tjk. So this may be say 25 milliseconds, this may be say 75 milliseconds or he may give you 50 milliseconds, 50 milliseconds whatever. Within that you have the initial position, initial velocity and at time tij you should reach this position. At the end of this time you should reach this position. Similarly at time t equal to 0 here in this part of the segment you are at that position and finally at the end of this time 75 milliseconds or whatever you must have reached the final position with some velocity. But now please see that because you have used two cubic curves you have to determine to completely specify the trajectory for your calculator. So you have to specify 1, 2, 3, 4 each. That means 8 constraints equations I will need. The problem has become a little more tedious the moment you brought in one extra point. Let us see how it goes. So I have only how many equations here? 3, 4, 5, 6. So that means I can determine only 6 coefficients. How do I get two other fellows? Then only I will be able to solve this problem. Two other equations how will I get? I am going to say that when it goes through j it has to have smooth continuity. That is exactly what I am going to say now. So at j, continue to velocity and acceleration. Theta dot I request you to read this as dot for now. So theta dot is theta dot whether you are coming from this side or taking off from this side. So theta dot is same. Theta double dot is also same that is accelerations are same. So two additional conditions are there. Based on that you can then this is yours. You are requiring because I am driving physical joints with physical actuators, bearings and links and so on and so forth you want to achieve smooth motion. That is you are requiring therefore that velocities and accelerations should be continuous and you can work through the maths. You are not changing the velocity it is same. No, no. Acceleration does not have to be 0. If I am passing through a point, I may be actually having some acceleration. The rate of change of velocity is acceleration. So velocity at that point is some 10 meters per second. I approach it from a 10 meter per second. So when I am approaching it, it is 10 meter per second. So next instant of time it can become 11 meters per second. I am not disputing that. So acceleration does not have to be necessarily 0. It could be 0 but does not have to be 0. So I just would avoid the maths. It is already there in your notes. You can work through that. It is a simple cubic curve strategy. So between i and j, I get 3 equations. Between j and k, I get 3 more equations and velocity continuity at j gives me one equation. Velocity, acceleration, day continuity at j gives me one more equation. 8 equations in 8 coefficients C0, C1, C2, C3, B0, B1, B2, B3. So they can all be solved. If I were to ask you to sit down and solve it, you will run away from this course. It can all be done. You have a computer, you know, macro processor which can actually do these computations in real time. All those facilities are available now. Technology has advanced to an extent where you can all, you have to only understand conceptually how the whole thing scheme works and then write it into your program and then the calculations are done internally. So all these, yes. No, you are using a cubic curve therefore you are looking for 4 equations. That is the way I would put it. I have just introduced one strategy. I will talk about other similar strategies also. It is that way. You are looking for 4 equations because you have to determine C0, C1, C2, C3. I would be happy if there are less coefficients here, less equations perfectly fine. Can I say that cubic curve will have more the capability of the different curves compared to the C1 curve? Yes. We have some advantages but at the same time very, very popular schemes do not necessarily use cubic curves. You have a simple trapezoidal velocity profile you might take. It is very, very easy to do. You may have more advanced strategies that we would just now discuss both trapezoidal and advanced curves I will talk about. But cubic I have just taken as a simple example for you to immediately latch on to that. Okay. Yeah. The system itself automatically updates that post sort of thing that comes in the case of a robot to specify that initial post and final post because at what post it should start and it what post it should end so that all via points also should be having that and that right. I did not get your doubt. What is that system automatically will compute at the via points that head angle as well. Yes it can. I have just right now looking at I am actually looking at one joint because as I said depending on the type of robot configuration you have you can relate through kinematics, direct kinematics and inverse kinematics you can relate to the end position to all the joints positions. Okay. So I am right now looking at any one joint. I have taken the example of a simple 2R manipulator to illustrate that point that these two are related so you can always do the calculations in your joint space. And I am assuming that all of the joints are going together therefore I can take a look at one joint to understand the problem first. Then I can build it back to the total system. Yes. Okay. So if you look at now in general if I have an initial position to a final position via end points. Okay. It was case of IJK so IK initial position final position and one intermediate point but supposing I have several intermediate positions specified then between any two points I am going to fit a cubic polynomial that means I am actually going to ask for lot of trouble. So okay n plus 1 cubic segments to be fit and then correspondingly each cubic segment will have 4 coefficients to be determined. So I have to determine 4 into n plus 1 coefficients to be able to tell each motor that look here this is the trajectory you need to follow. And then the control will take care that it actually drives it in such a way that it will follow that trajectory. But 4 into n plus 1 coefficients can be determined when you have 4 into n plus 1 equations you have to solve those supposing you have 5 via points between an initial position and a final position. So 5 plus 1 is 6, 6 into 4, 24 coefficients to be determined and 24 equations to be solved. Okay. So this that is the nature of the problem that we are talking about. I have just shown here how all of them you know in this slide I have just tried to capture that do not worry about the equations they will all come okay. Because at each point you are going to impose the condition that the position is that and velocity acceleration must be continuous smoothness of motion. So therefore you can really write down I mean in conceptually not you are actually not going to sit down and write it but you can conceptually think of all the equations that you require are available there. So it is a solvable problem okay. That is what I have said all the just to reassure you on you know on a Thursday morning that yes you need so many equations but all those equations are there for you. You can sit down and write them and the coefficients can be found the strategy we have just now discussed can be implemented there is no problem with that. Now I have just when once we have understood how the cubic works I wanted to wait till when to bring it to this stage why is cubic so important it is just that it is a lowest degree polynomial that ensures velocity and acceleration continuity. Because I have taken cubic okay I am able to take velocity and acceleration at the intermediate point and ensure that it is smooth. Of course as I said it is easy to work with okay but we can also use lower and higher polynomials there is no problem at all I would actually illustrate how the lower polynomial is used how the higher polynomials are also used okay then we will work out one or two examples. Let us see how it goes okay yeah of course this is an extreme case where I am saying that I move from position i to j with some position velocity and acceleration specified by the user. Therefore six conditions are there at the initial position velocity acceleration final position velocity acceleration then you can fit a 50 degree polynomial and then work with that okay. But let us look at also a common strategy that is implemented you know which is not necessarily cubic okay let us look at how it this problem goes so I am looking at a particular robot end effector as a gripper this has some mechanism with probably cams linkages whatever whatever it has some mechanism which is driving this and this is the object I need to pick okay and keep it somewhere else okay typically what is done is that you look at an initial position where you come you these are things that we automatically do it as children I mean we have learnt this task but if you look at any toddler then you would probably appreciate what I am just now going to describe and look at it robot program from that point of view. So if I have to pick up this particular water bottle I have to set myself at an initial position close to this okay just think that I am a very small child you know toddler okay the way a toddler would walk and come to that so I have to come near that set myself somewhere there then I have to grab that and the way I am grabbing it I should not press it into the surface because this is after all it could be a you know an operation where you are handling say in a silicon valley I mean you are fabricating lots of chips and electronics and so on and so forth so you are just trying to pick this and put it there so when I am approaching this I should not approach it with a velocity that digs into that surface so I have to keep take care of that I have to position myself at an initial position I have to gradually grab it I have to take it out the way I take it out the velocity should again not be having any component that digs inside the object you know surface where it is so I have to plan all these things you are almost teaching it like a toddler okay that is what I have written here so and again when you come into the final position when I am taking it and finally keeping it I should keep it in such a way that it is delicately positioned there it is delicately positioned there so I have a final approach position and then final landing position so these are things which we when we do jobs we automatically intuitively a skilled laborer does these things intuitively okay but we have to bring that into our program okay mathematically we need to capture that we have to convert it into a particular desired motion for the actuator thereafter the controller can take over once you are able to specify it as a desired motion okay that is why I have said here initial position approaching that then takeoff position then you have reached the final position you are setting down it there is one position just before putting it down and then you actually final position you put it somewhere okay so it looks rather you know silly to talk about this like this but you have to tell all these things into the program then only the robot gripper will be actually able to achieve the task that you are asking it to do okay you have to put all this into its head in a way that the actuators understand the controller can understand so for an individual joint so what we are talking about is that you are going from an initial position to final position alright but you are actually going through a initial position then takeoff position you take off from here actually and then final set down position just before the position where you are putting it down so you go here the set down position and then the final position okay so this is your total strategy of motion with respect to time for a given joint okay so therefore common strategy that is followed for this kind of motion that you would see in many industrial robots would be that in this portion initial position this is what is called a 4 3 4 trajectory that means this is a polynomial with fourth degree polynomial quartic polynomial this is a cubic polynomial and again I use a fourth degree polynomial okay so that means I actually talk in terms of I to L so this is I to sorry these positions are shifted a little this is I initial position and then takeoff position and then the set down position and final position so initially you talk in terms of fourth degree polynomial then a cubic polynomial and again a fourth degree polynomial but basic idea of cubic polynomial if you have understood a cubic polynomial that will help you to do the quartic polynomial also very easily all that you are taking that given a certain time that is available to you given certain position specification velocity specification velocity direction as well as magnitude you may specify that the velocity should be directed only tangential to the surface and no velocity that goes digs into that component of velocity should be 0 that it does not dig into the surface all those things you can specify okay so correspondingly as is said that there are coefficients that you can solve if you want this should be 4 sorry so fourth degree polynomial will mean that there are 5 coefficients to be solved similarly 4 coefficients to be found for a cubic and so on and so forth so you have to correspondingly write down the equations solve them in terms of the specified variables by the user and then you will be able to do this so for I have just illustrated here how all the 4 3 4 strategy 4 3 4 strategy therefore you have 5 coefficients 4 coefficients 5 coefficients so 14 coefficients and you can generate 14 equations to solve for this this is the common strategy that is employed in industrial pick-and-place kind of robots assembly robots looking at strategies other than cubic I have illustrated one strategy which is a higher degree polynomial 4 3 4 you may even have other strategies also but just to complete the story I want to give another strategy which is lower degree polynomial than cubic so you can use that also okay simple trapezoidal velocity profile this is what is this strategy telling and please observe here that it is theta dot I am plotting here with respect to time okay trapezoidal velocity profile so what I am saying is that if you want to go from here to here simply follow a uniform acceleration phase velocity keeps on increasing here for some small time and then velocity remains constant once you have reached some velocity okay from say initially 0 at rest you are initially at rest here you are moving from here to here okay so from 0 you reach a certain velocity say 10 meter per second 1 meter per second whatever it is you have reached that velocity you maintain that velocity now for some time and then when you are approaching that that is what you do okay when you go in Bombay traffic from one traffic signal to another traffic signal you are almost at rest at one traffic signal you start off you increase the velocity to 60 kilometers per hour or 40 kilometers per hour 60 I think is too high nowadays for Bombay roads so 40 kilometers per hour probably you can reach there and then maintain that study before you see that there is another red signal that is coming okay so you now start decelerating to rest at that point but in between you maintain 40-50 kilometers per hour or whatever so that at least you will get some little bit mileage from your fuel okay so that is what is a very very simple intuitive strategy here okay it does not require your cubic polynomials and 434 strategy and so on and so forth okay this is commonly employed again okay there are some problems with these things we will look at that okay supposing you look at this strategy now so velocity increases gradually and velocity increases gradually meaning uniform acceleration then in this position from A to B velocity is constant that means acceleration is zero then you are going from B to C acceleration is negative you are decelerating down to zero speed okay but uniform deceleration look at this how it will be acceleration is uniform some constant value and then it goes to zero it remains zero for some time between A and B then it goes to negative deceleration some uniform deceleration and then it again comes up and so on and so forth. So what you are really looking at is some jerks like this it is a very simple motion to program to implement very simple strategy to understand and implement but you are likely to have jerky motion okay that is the reason why if you go back to cubic you can maintain that smooth accelerations also okay so of course you have some advantage here that it is simple motion there you have advantage that you can get the accelerations smoothly okay so you have to trade off the way you look at it. So you are essentially talking in terms of a parabolic profile in displacement time displacement ways you are talking in terms of parabolic motion and then a linear motion because uniform you know velocity is uniform so it is linearly increasing displacement for that joint okay it just goes from one position to another position linearly velocities at the same velocity it goes okay so again a parabolic segment. So it is a fairly simple strategy to program conceive of implement and so on and so forth okay so keep this in mind all these things are used but basically you need to understand whenever you are looking at broadly I keep going back to that same thing that you have a workspace world coordinates x, y, z fixed with respect to the world you as a user think in terms of the end effector where it has to go from one position with some orientation maybe also required so that means another joint another actuator so that needs to be specified. So you are looking at that and then you are talking about a final position maybe through certain set of points and so on so you convert it into individual joints and for each individual joint you have to use one of these strategies to convert it into a desired motion once you convert it into a desired motion then your control strategy microcontrollers hardware implementation everything will take over okay that is right that is right. So that is where I was to begin with I was saying that you have some constraints okay that is your masses and inertia of the links that you are moving them with some finite size actuators so the actuator can only exert this much of torque okay so you would say that at no point of time your strategy should demand a higher torque than this okay so you may want anything but you must make sure that you do not demand from this actuator this is all the actuator I have this is the maximum torque I can achieve you cannot ask for more than this that automatically translates to a certain acceleration specification because of the masses and mass moments of inertia of the links okay so those aspects have to be taken into account that is serious that is there yes that we try to minimize by using other than this trapezoidal profile if you are using the 434 strategy or a cubic polynomial and so on you can make sure that you know jerks are minimized to a large extent yes correct absolutely you could do that but as I was saying in the beginning the way the task is specified is in actually world coordinates of positions and times see the user of the robot who is doing a particular welding operation or a pick and place operation does not really know how to specify this must be your accelerations or this is the tolerable jerk he cannot specify those things he specifies to you that this is the motion I want to get from this position to this position and the time I can allow for this operation is so much so you are working backwards from there so you can work with you first of all you converted into joint emotions then you are dealing with displacement variables but you can certainly do it with accelerations also sure absolutely there is no problem at all but finally you have to come back to the displacement variables because that joint actually drives it through those displacements yes you could do that okay so I have worked through the maths of the trapezoidal velocity profile looks this way another important point I want you to grasp I am trying to take you through an exposure to the general problem of you know trajectory planning rather than trying to equip you with the various details of maths that goes with this that maths is there in the notes that I have given to you those of you who are interested can sit down and work through the maths it is also available in most of the books I have taken it from the books only another important point that you may want to see which I have illustrated here is that supposing I am going from some position initial position to another final position in a given time through certain points here via points a b and c and so on if I am trying to fit through this you know trapezoidal velocity profile that I have talked about where it is linear motion and then parabolic blends and so on and so forth you may notice that when it is if you see this thing here I think I have shown that okay there is basically a parabolic fit and then the linear motion most of the motion is linear because uniform velocity and then a parabolic fit again here okay so now when I look at that kind of a strategy when I am trying to get a smooth motion I may not be really able to reach a via point because I am going through a linear displacement here and another linear displacement here unless I actually come to when you talk in terms of theta versus time and a linear displacement so the slope of that is actually the velocity so unless I come to rest at this point I will not be able to actually pass through a via point okay earlier we did not have this limitation this is another thing that comes out it is not just uniform accelerations therefore jerky motion but it is also important to realize that you may not actually pass through a via point you may pass close to it but you will not pass through that because then you are going like this then you have to come okay so unless you come to rest there you cannot do that okay so these are things you have to keep in mind some advantages some disadvantages okay so I will just take one example problem and show how the calculations go through okay initial the example that I have taken is from a 2R planar manipulator so you have two links I have just for simplicity taken each link to be a 1 meter length theta 1 and theta 2 are the joints so I have a here and then a b is the end effector initial position of the end effector is shown okay and then the final position is this so the final position I have specified and initial position I have specified and I am telling that I want to go from this initial position to final position in about one second let us say okay let us see how the calculations go through okay so first step I have tried to give it as first step is to convert the initial position specifications final position specifications of the end effector in global world coordinates into joint coordinates so I have done that here so theta 1 to find initial to final theta 2 initial to final and then x b y b r cos theta 1 1 meter 1 meter link length l 1 l 2 so that is taken as to be 1 unit so cos theta 1 cos of theta 1 plus theta 2 my dear friend who has pointed it out to me so when I was working out the example I noticed that so cos of theta 1 plus theta 2 because the motor is sitting here and driving this joint with respect to this joint so it is okay so theta 1 plus theta 2 and then you can find out the initial angle and then the final angle for each joint to be achieved okay so 30 degrees to 150 degrees for the first joint 30 degrees to minus 30 degrees for the next second joint okay but the time available to me to do this is one second okay let us say that initially they are all at rest and finally they are all at rest for simplicity if it is not rest also you can solve the same equations I have just taken it to be like that so then what you are saying is next step you achieve this from 0 to 1 second theta 1 and theta 2 as functions of time that is what is the next step you do one first step is through inverse kinematics which professor said is going to describe in greater detail direct and inverse kinematics for more complex examples since you have not done that yet I have taken a simple 2R manipulator where you know cos theta 1 cos theta 2 and so on okay so you choose that inverse kinematics so you have got theta 1 and theta 2 now you convert them into the cubic profiles within this time for about a one second here okay so theta 1 and theta 2 so I have done that so then I get this trajectory time is 0 to 1 second and these two joints have to be driven in this manner okay step 3 is now you estimate your xb and yb that you actually get so that is what I have tried to do let us see how it works out so this is trajectory for the first fellow and then the second link okay theta 1 and theta 2 actually will go through like this theta 1 goes from 30 degrees to 150 degrees smoothly and this goes from 30 degrees to minus 30 degrees smoothly like this as a cubic curve fit so this is your desired motion that you need to get from the actuator now you specify this to your microprocessor microcontroller that is driving the actuator and the sensor encoder position sensor is there typically so you are measuring the actual theta 1 desired is this I can say that theta 2 desired is this theta 1 actual and theta 2 actual that you are able to achieve will be slightly different and then you try to minimize the error between these two positions I have now taken that from this initial position to a final position but there is an intermediate position here I have specified okay which you have to pass through so between these two points you have to pass through this position I have said so now I have just said this is at this position same height as this okay but at x is equal to 0 and this is say 0.5 seconds this is 0.5 seconds for simplicity okay what should be the intermediate position details so one cubic I have fit for each joint so that is intermediate initial position to the via point via point to the final point position so I have fit that and then one cubic for each position therefore four coefficients each and half a second half a second time frame that is available to me okay so keep this in mind that is the example that we are now considering so I find that at the via point theta 1 has to be about 43 degrees okay this is theta 2 unfortunately so you work through the maths again I initial position to the via point theta 1 and initial via point to the final position another remaining half second you should do that so theta 1 is this theta 1 final segment so I will get now two profiles for theta 1 and similarly I can do it for theta 2 so this is your trajectory so I am starting from here this is my initial position this is my final position but I have to reach the intermediate position therefore I have this intermediate via point position so I go through from an initial position of the end effector to a final position via a point B here okay so I have mentioned here that it is initially when I did not have any via points only initial position final position is specified I start theta 1 to initial to final but when I am specifying that I have to have a via point I have to pass through that then it is this okay similarly for theta 2 when I did not have any via points then it will look like this it is a cubic curve again but when I have via points then I have to go up and then come down to minus that initial position final position remain the same but in between I have to change see you would see here that I have to bend quite a bit to come to this position when the initial link is here first link is here second link has to go like this okay so that is why you would see the spike here it would go up and then actually come down to minus 30 degrees so just based on the cubic curve strategies we will be able to achieve these targeted motions okay you could use the trapezoidal velocity profile you could use higher degree polynomials or you could do other strategies as well okay. The one final comment before I wind up which is that we have so far talked about specifying the trajectory planning problem in joint space not really you might have asked me for example if I have to move from here to here let me just you know do trajectory planning in that sense in the world coordinates only because now after all nowadays you are talking in terms of you know some cameras being there you are doing image processing you are able to figure out where the end effectories so why not I do directly the motion problem in world coordinates yes it is possible to do that but you need to find out at each instant of time where your end effectories in world coordinates so x, y, z fixed there you need to be able to figure that out that means you should have a vision system or something like that which will tell you where your end effectories at each instant of time okay but then you convert it into joint space motions finally you have to execute it through joint motions. Some points I just wanted to keep in mind that when you are looking at this type of thing I am not sure if many of you are aware but we do not really have time to go through too much of kinematics but if you have to understand what the concept of reachable workspace okay not all the points that appear in a world frame are reachable by your mechanism okay within your total workspace also some positions you may not be able to reach so you have to take out those things then only you will get actually a total envelope of workspace then actually you remove all these spaces that you cannot reach then you would get a reachable workspace for this you just illustrate that I have given here so supposing we have just a single link and then the end effector joined like this so when the end effector whenever you look at this link OA and B folds back onto that that is the circle that I have shown here so any point within the circle cannot be reached you cannot of course reach any point outside the circle because everything is stretched out now beyond that you cannot reach but when I fold it back I cannot reach anything more less than this also see I cannot with my tip I cannot touch with my fingertip I cannot touch any point beyond this okay. So there is a notion of a reachable workspace that you have to be careful about when you do these pranks so with that I come to the end of my talk I hope you have enjoyed the session you have got an idea of how robot motion planning takes place of course there are lots more issues involved in this you are talking in terms of this here I am talking mainly primarily concentrated about you know assembly kind of robots doing some particular tasks or you know industrial robots but if you are talking in terms of autonomous vehicles which have to go on their own you know then it is a different kind of things that you have they have to sense the obstacles that are there okay and so on and so forth so they have to do this planning automatically in real time they have to have a map of where they are I mean you it does not know that there are steps here it is an unknown environment for that. So it has to have a map it has to figure out what is the environment in which it is operating where are the obstacles fixed obstacles moving obstacles vehicles may be coming and going okay all those things will be there okay whereas when you talk in terms of AGVs now going over a shop floor okay other people are also moving other vehicles are moving this AGV should keep track of what are fixed obstacles what are moving obstacles and then decide how it should go okay and so on. So it is a complex problem but we have got hopefully some idea of an appreciation of what the problem is and how it is specified what we intuitively do some of these things we intuitively cross the road but if you sit down and try to track it down mathematically and program it into a machine as an intelligence that it can cross the road in front of an AIT power by Alishankaracharya mark that would be great okay.