Lec21 PDF
Lec21 PDF
Lec21 PDF
Lecture - 21
Trajectory Planning
Now, I am going to start with a new topic that is topic 3, that is, Trajectory Planning.
Now, before I start, let me tell you that this particular trajectory planning is not the same
with the robot motion planning. The purpose of trajectory planning is to ensure the
smooth variation in the robotic joint. On the other hand, the purpose of robot motion
planning is to make that particular robot intelligent.
Now, here, I am just going to concentrate on the principle of the trajectory planning only,
like how to make that particular trajectory planning, so that that the operation or the
variation in a particular robotic joint becomes smooth. Now, before I proceed further, let
me tell you the reason behind going for this particular trajectory planning. Now, till now,
we have discussed the robot kinematics. The purpose of kinematics is to study the
motion of the different robotic joints without considering the reason behind that
particular motion, that is, the force or the torque.
Supposing that we have got a linear joint, so we will have to find out the force; if we
have got the rotary joint, we will have to find out the torque. Now, supposing that I have
got rotary joint, now in that particular rotary joint, so I will have to find out the joint
torque and in a particular cycle time, the variation of joint torque has to be gradual and
there should not be any such abrupt change in the value of that particular torque.
Now, if you see the expression of joint torque, which I am going to derive after some
time, you will see that this particular joint torque has got a few components like the
inertia component, Coriolis and centrifugal component, gravity terms, friction terms and,
so on. And, if you see the expression, we have got the terms like joint angle, that is
nothing but the angular displacement, angular velocity, angular acceleration. Now, as I
told that we will have to ensure the smooth variation of this particular joint torque with
time; that means, the joint angle should vary in a very smooth way with time and to
ensure that, the first time derivative of this angular displacement, that is angular velocity,
and the second order derivative, that is angular acceleration are to be continuous.
Now, to ensure that actually, we will have to study the trajectory planning before you
start with the dynamics. And, that is why actually, we should study this trajectory
planning before the robot dynamics.
Now, supposing that we have got a serial manipulator like 2 degrees of freedom serial
manipulator. So, let me concentrate, so this is nothing but your link_1. So, this is the
link_1, L_1 and the link_2, the length is L_2. Now, here the aim is as follows: this is the
starting point of this particular end-effector; the end-effector starting from here will
reach this particular, the final point, that is, the goal point through a number of
intermediate points like 1, 2, 3 and so on.
Now, the purpose of this particular trajectory planning is to determine the time history of
position, velocity and acceleration of end-effector, while moving from the initial position
S to the final position G through a number of intermediate points or the via points. Now,
let us see, how to ensure the smooth variation.
(Refer Slide Time: 04:46)
So, corresponding to this particular point S, in Cartesian coordinate system, we have got
X_S, Y_S, this particular coordinate, and corresponding to this the first intermediate
point, we have got X_1, Y_1.
Similarly, second intermediate point X_2, Y_2, third one X_3, Y_3 and the final one that
is X_G, Y_G. Now, we have already discussed inverse kinematics. Now, supposing that
in Cartesian coordinate system, we know the position of this end-effector and if we know
the position of the end effector, we can solve the inverse kinematics and we can find out
two sets of θ values like your θ1 , θ 2 , the left hand solution and we have got the θ1 , θ 2 ,
right hand solution.
Now, here, out of these left and right hand solutions, let me consider any one, supposing
that I am concentrating on the left hand solution. So, corresponding to these X_S, Y_S, I
will be getting θ1S , θ 2S . Similarly, corresponding to X_1, Y_1 in Cartesian, in joint space
scheme, I will be getting θ11 , θ 21 . Corresponding to X_2, Y_2, I will be getting θ12 , θ 22 ,
then corresponding to X_3, Y_3, I will be getting X_1 sorry, θ13 , θ 23 . Then
Now, as I know that at each of the robotic joints, we have got, the motor, the dc motor
and this particular angular displacement will have to generate with the help of that
particular the motor. Now, that is why, for the controlling of the motor, there is no way
out but we will have to go for the joint space scheme. Now, if I want to ensure the
smooth variation of theta during a particular cycle time, so what I will have to do is, I
will have to feed a smooth curve passing through your θ1S , θ11 , θ12 , θ13 , θ1G . Similarly, I will
have to actually find out another smooth curve for the variation, the smooth variation of
θ 2 . This is what, we mean by the trajectory planning. So, in trajectory planning actually
what we do is, we try to fit a smooth curve for this particular joint variable. Now, if it is a
rotary joint, then of course, it will be the joint angle.
So, here let us see how to fit a smooth curve, so that I can ensure the smooth variation of
θ1 and θ 2 , separately. So, this is actually the thing, which I am going to discuss in
details.
Now, if you see the trajectory planning, the trajectory planning can be done either in
Cartesian coordinate system or in joint space scheme. Now, as the motor is controlled in
joint space scheme, and if I want to follow the trajectory planning in Cartesian
coordinate system, we will have to carry out the inverse kinematics and we have seen,
how much complex this particular inverse kinematics is and it is a bit difficult to solve
this inverse kinematics problem, online. And, that is why, the trajectory planning in
Cartesian scheme is not so much important but we will have to concentrate more on
trajectory planning in joint space scheme because the motor is controlled in the joint
space.
(Refer Slide Time: 08:51)
Now, let us see how to make this particular planning for the variation of joint angle in
joint space scheme. Now, as I told, the purpose of this trajectory planning in joint space
scheme is to fit a smooth curve passing through θ1S , θ11 , θ12 , θ13 , θ1G and to ensure actually,
the first order derivative and the second order derivative must be continuous; that means,
the first order derivative that is the angular velocity. So, we will have to find out this
particular θ and this θ is the actually the angular acceleration and they are to be
continuous.
Now, here, actually what we do is we try to find out like how to fit different types of
trajectory function. For example, say, we are going to concentrate on the cubic
polynomial, then comes the fifth order polynomial and the linear trajectory function. Let
us see, how to fit the cubic polynomial first, then I will move to the fifth order
polynomial and we will also see how to fit one linear trajectory to ensure the smooth
variation of the joint angle.
(Refer Slide Time: 10:14)
So, let me concentrate on the polynomial trajectory function, first. Now, case 1; this is a
very typical problem, where this is the variation of theta, that is, the joint angle with
time. Now, what you do is, we will have to find out a smooth curve of theta as a function
of time. So, theta should be a function of time and we will have to find out a smooth
curve. Now, here, the conditions are as follows: at time t equals to t_i equals to 0; that
means, initially, theta equals to θi . So, θ is equal to θi and θ that is actually the angular
velocity is kept equal to 0. So, here, there is some typographical error. So, truly speaking,
it should be θ is equal to 0.
So, angular velocity here will be equal to 0, that is a time t equals to t_i, your theta^dot
that is the angular velocity is kept equal to 0. Similarly, at time t equals to t_f, t_f
indicates the finishing time, theta is nothing but θ f . So, this is actually the θ f and the
angular velocity, that will be θ and that is equal to 0. So, here once again, the θ is equal
to 0.
So, let me repeat at time t equals to t_i initially, theta equals to θi , angular displacement
and θ , that is the angular velocity that is equal to 0; a time t equals to t_f, theta equals to
θ f , the angular displacement and velocity, that is θ is equals to 0. So, there are four
known conditions. So, for these four known conditions actually, I can fit one cubic
polynomial in the form of this. So, let us consider the cubic polynomial like this.
(Refer Slide Time: 12:51)
Now, this particular cubic polynomial θ (t ) is nothing but C0 + C1t + C2t 2 + C3t 3 . Here,
C0 , C1 , C2 , C3 are the coefficients. Now, we have got four known conditions and those
four known conditions will have to be utilized just to find out the expressions or the
values for these coefficients: C0 , C1 , C2 , C3 .
Now here, actually, what we do is, we differentiate θ (t ) with respect to time that is, we
dθ
try to find out actually what is θ . Now, this particular θ is nothing but your . So, this
dt
is θ (t ) . So, if you find out the derivative. So, this here, this contribution will be 0. So,
velocity and truly speaking, so this is also a function of time, so, θ(t ) .
So, here, we can find out this angular displacement and angular velocity and now, I am
just going to put all four conditions, which I discussed a little bit early. So, what I am
going to do is, I am just going to put these four conditions in these two equations.
(Refer Slide Time: 14:03)
Now, if I just put those conditions, so we will be getting this particular the equations; for
example, the first equation will be C0 = θi , then the second equation is C1 = 0 , then
θ f that
C0 + C1t f + C2t 2f + C3t 3f = will be equation (3). Then, comes your
C1 + 2C2t f + 3C3t 2f =
0 . So, this is equation (4).
So, there are four equations and there are four unknowns and out of these four
unknowns, two have already determined, that is C_0 and C_1. Now, if I substitute the
values of C_0 and C_1 here, similarly, the value of C_1 here. So, I will be getting one
equation in terms of C_2, C_3, I will be getting another equation in terms of C_2, C_3.
So, there are two equations and there are two unknowns C_2 and C_3 and those things
can be very easily solved.
(Refer Slide Time: 15:18)
And, if I solve it, then I will be getting actually the final expression and this particular
3(θ f − θi ) 2 2(θ f − θi ) 3
final expression is nothing but θ (t ) =
θi + t − t . So, this particular
t 2f t 3f
Now, if I just plot it, for example, now we can plot theta as a function of time and I can
plot this particular curve and this is up to t cube. So, this will be a some sort of cubic
polynomial and very easily, I can find out the suitable plot. Now, here, approximately, I
am just putting the plot but that may not be the correct one; for example, at time t equals
to 0. So, these will be θi and there is a possibility that it will be something like this. So,
this type of plot will be getting. So, this is the approximate plot for this particular the
function. Now, this could be your θi , the starting is θi at time t equals to 0, theta is
nothing but θi .
So, I can find out approximately this type of the smooth curve further, the θi . So, this is
the way actually, I can use cubic polynomial to find out what should be the trajectory
function.
(Refer Slide Time: 16:49)
The expression for theta as a function of time, so that the variation of theta becomes
smooth. Now, I am just going to concentrate on case 2. Now here, actually what I do is,
this is slightly different from case 1. So, in case 1, at time t equals to t_i, the velocity was
equal to 0 but here it will be non-zero.
So, at time t equals to t_i, that is, t_i equals to 0, so if I just plot it here, this is time and
this is theta. So, at time t equals to t_i equals to 0, theta is equal to θi and here, there is
typographical error. So, this particular θ , that is the angular velocity, is nothing but θi , it
equals to θ f . So, I have got θ f here and once again there is typographical error; so, this
particular θ , that is the angular velocity that will be equal to θf . So, this is non zero. So,
here the angular velocity will be θf . So, using these four conditions, so once again, we
can go for some sort of cubic polynomial. So, there are four known conditions. So, I can
fit one cubic polynomial.
(Refer Slide Time: 18:52)
So, let us try to fit one cubic polynomial. Now, if I just try to fit the cubic polynomial, so
this is nothing but the expression for the cubic polynomial. θ (t ) = C0 + C1t + C2t 2 + C3t 3 .
Once again, there are four coefficient C_0, C_1, C_2 and C_3 and we will have to find
out the values for this C_0, C_1, C_2 and C_3.
Now, by following the same method, actually what you can do is, there are four
conditions and we can put the conditions on the equation and we can try to find out like,
what should be the equations.
θ f , that
C0 + C1t f + C2t 2f + C3t 3f = is your equation (3); then comes your
θf .
C1 + 2C2t f + 3C3t 2f =
So, this is your equation (4). Now, there are four equations and there are four unknowns.
So, these four equations can be solved just to find out the values of the four coefficients.
Now, if we just solve those equations.
So, we will be getting the terms like this, the coefficients like this. For example, C0 = θi ,
then C1 = θi . So, I am sorry for this type of graphical error, then
3(θ f − θi ) 2 1
=
C2 2
− θi − θ f . Now, if I just a write down, let me write down once again;
t f tf tf
3(θ f − θi ) 2 1
=
C2 2
− θi − θ f . So, this is the final expression for C_2.
t f tf tf
2(θ f − θi ) 1
Now, similarly, the =
C3 3
+ (θi + θ f ) . Now, if I write down once again. So,
t f t 2f
2(θ f − θi ) 1
this =
C3 3
+ (θi + θ f ) . So, this is the expression, which will be getting for
t f t 2f
C_3.
Now, I will request all of you just to carry out this particular derivation and check
whether you are getting the same expression or not. So, this is how to find out the cubic
polynomial.
Now, I am just going for case 3. Now, the case 3 is more complicated. More complicated
in the sense, like we have got more known conditions.
Now, once again the problem is as follows: say, I will have to fit one smooth curve for
this particular theta. So, theta as a function of time, so at time t equals to t_i that is the
initial condition and at time t equals to t_f it ends. So, at time t equals to t_i, I have got
the initial displacement as θi . Then, comes the initial velocity that is nothing but θi and
initial acceleration that is nothing but θi ; that means, this will be your, this will be θ is
equals to θi . Then comes, this will be θ that is the angular acceleration is nothing but θi .
Similarly, at time t equals to t_f, so we have got some other conditions like theta equals
to θ f . So, at time t equals to t_f, theta equals to θ f . Then, comes your theta^dot, θ is
nothing but θf . Then comes your θ is nothing but θf that is the angular acceleration.
So, if I just make the correction, so this particular thing theta^dot will become equal to
θf and your θ is nothing but is your θf , ok?
So, at time t equals to t_i, we have got three conditions like angular displacement,
velocity and angular acceleration. At time t equals to t_f, we have got three conditions
like your theta equals to θ f , angular velocity is θf and angular acceleration is θf . So,
there are six conditions. So, we can fit actually the fifth order polynomial like
θ (t ) =C0 + C1t + C2t 2 + C3t 3 + C4t 4 + C5t 5 .
Now, here actually, what I can do is, so we can put these conditions and just to find out
all such coefficients.
(Refer Slide Time: 26:28)
So, there are six coefficients and there are six known conditions. So, I will be getting
actually the equations. Now here, so theta (t) we have seen, now if I find out the
derivative, the first order derivative, so this is nothing but the first order derivative
C1 + 2C2t + 3C3t 2 + 4C4t 3 + 5C5t 4 , then θ(t ) = 2C2 + 6C3t + 12C4t 2 + 20C5t 3 .
θ(t ) =
Now here, if I just put all such conditions, I will be getting the equations like this and I
will be getting these six equations; for example, say C0 = θi . So, this is equation (1).
1
C1 = θi is equation (2) and C2 = θi is equation (3). Similarly, I will be getting equation
2
(4) here, then comes equation (5) here and equation (6) here. Now, out of these 6
unknowns, 3 we have already got like C_0, C_1 and C_2. Now, if I put in this particular
equation like C_0, C_1 and C_2, similarly if I put C_1 and C_2 here, so I will be getting
another equation in terms of C_3, C_4, C_5 and here also, I will be getting C_3, C_4,
C_5.
Now, the same thing you do here, you put this expression of C_2. So, you will be getting
another equation in terms of C_3, C_4 and C_5. So, there are three unknowns C_3, C_4
and C_5 and there will be three derived equations. So, there are three unknowns and
three equations. So, those can be solved and if you solve it then finally, we will be
getting the expression like this.
1
So, your C0 = θi , C1 = θi , C2 = θi , then comes your C_3 will be getting this particular
2
big expression involving your θ f , θi , θf , θi , θi , θf , ok? So, I will be getting this big
expression for C_3. Similarly, I will be getting another big expression for C_4 and
another big expression for C_5.
So, this is the way actually we can utilize the known condition just to find out the smooth
variation of this particular theta, that is theta as a function of time and this is actually the
purpose of trajectory planning.
Thank you.