Lecture 15

IIT Kanpur July 201
20 followers
Oct 23, 2023
Hello, and welcome to lecture number 15 in the course Advanced Robotics. In the last
class, we talked about the dynamic formulations, where we talked about Newton-Euler formulation
and the Lagrangian-Euler formulation of dynamics. That is basically so the forces that are required
to cause motion or the reverse of that, what when you want certain motions in the manipulator
in terms of position, velocity, acceleration, what is the corresponding joint torques that
are required. Today, we will solve a few problems and then we will proceed.
So today, we will start off with a problem in Lagrangian-Euler dynamics and then we will
do a problem in Newton-Euler. Now, as I mentioned in the last class, we will do very simple
problems only looking at 2 degree of freedom manipulators, because when you are trying
to solve this dynamic equations by hand, if it is 6 degree of freedom or 7 degree of freedom,
it becomes very, very unwieldy. It is not difficult, but then it becomes too long. So
we normally use a computer program to do the dynamics. So when we are solving by hand,
we normally look at very simple examples like 2 degree of freedom planar manipulators, which
we will do today.
Today, so we will be looking at a few problems in Newton-Euler and Lagrangian-Euler. I will
very quickly revise what we have done in the last class, so that there is continuity and
then we will move on to the problems. So we first talked about Newton-Euler, so Newton-Euler
formulation in the last class. And in Newton-Euler formulation, we said that we are using the
Newton's law as well as the Euler's formulation to compute the forces and moments which are
acting at the links of a manipulator. So if you have a manipulator here, let us say we have a
manipulator like this and we know that the velocities theta dot and theta double dot
propagate in this direction. That means from the base link, they will be moving in the forward
direction to the last link. And this velocities and accelerations will be causing inertia forces
to act at the CG of the links provided these are the CG of the links. So this is the outward
iteration, which we call the outward iterations. Now, after we find the inertia forces, which are
acting at the CG of the links, now these forces will travel backwards, which we call the inward
iterations. This is called the inward iteration. So in Newton-Euler formulation, we use the
Newton's law as well as the Euler's formulation. And then we compute the outward iteration.
Once we get the outward iteration, all the forces which are acting at the CG of the links,
then we use the inward iteration, find what are the corresponding forces which are acting
at the joints because of this inertia forces which are acting there.
So now, so what we have basically done in the last class is we derived the formulas that are
basically used for the outward iteration. That means I need the formula for computing omega,
omega, omega, i plus 1, then we need formulation for calculating omega dot, i plus 1, then I need
for vc, i plus 1, then I need for vc, i plus 1 dot, this is the velocity, this is the linear velocity,
linear acceleration of the CG of the link, this is the angular velocity and this is the
angular acceleration. So we compute this and then using Newton's law and Euler's law,
we basically find the forces acting at the CG of the links. Whereas in the case of,
so let us look at very quickly at the formula that we were having.
So this is the formula that we are going to use today also. So in the outward iteration,
that is if I have my link here, and we are basically moving from here in this direction
from 0 link to the nth link or the ith link to the i plus nth link. What we basically find is that
we find the angular velocities using this formulation, which basically says that the
angular velocity of the next link is equal to the angular velocity of the previous link
plus its own angular velocity. And then when I differentiate that, I get the angular acceleration.
So the angular acceleration is given by this formulation.
Now, in terms of the velocity, the linear velocities, so I can find the linear velocities
and then from that, taking the derivative of that, I can find the linear acceleration.
So linear acceleration is given by this. And then I need to find the inertia forces,
which are acting at the CG of the links. So that is defined as the acceleration of the
CG of the link, which is defined as vc dot i plus 1. So this basically gives us the
the acceleration, the linear acceleration of the CG of the links. Now using this,
we basically use the Newton's law, which is force is equal to mass into acceleration.
And so this is my Newton's law. Using this, I can find what are the inertia forces acting at the CG.
So once we find all the forces which are acting in the CG, then what we do is we take the free
body diagram of each link for static equilibrium, we find what is the corresponding force balance
equation. From that we can find that is in the inward loop. So for using this, we find forces
and we find moments. This is Newton's law and this is my Euler's law. So after we find the forces and
moments which are acting at the CG of the link, what we do is we take the inward iteration,
in which we find what is the force acting on the joints of the previous joints.
So this is the force acting at the CG of the link, which are the inertia forces. This is the force
acting at the next joint. So based on this and this, what is the force acting on the previous
joint? So it basically means that if I have a force acting here, then this force will have
an effect here, then this force is going to have an effect here, then here. So we start moving in
this direction using this formula for forces and this one for moments. And then finally,
we can find the moment using this equation. So this is my outward iteration and my inward
iteration. These are the inward iterations. This is the Newton-Euler formulation.
Now in the case of the Lagrangian-Euler formulation, what we see, what we do is that
the Lagrangian-Euler method, we have to compute the kinetic energy of the links.
So the kinetic energy is defined as Ki given by half mv square plus half I omega square.
Okay. And then we take the sum of the kinetic energy of all the links.
And after finding the kinetic energy, we basically find the potential energy of the links.
The potential energy is equal to mgh. So mg into PCI is the distance of the CG,
plus a u ref depending on where my 0 is, whether it is on the vertical or it is on the horizontal.
Depending on that, we will have a u ref. And then I take the sum of the potential energies.
So once we find the kinetic and potential energies, we basically make, we generate a
Lagrangian, a scalar function, we generate a Lagrangian, which is a scalar function,
which is the difference between the kinetic energy and the potential energies.
Then use it in this formula to basically get what are the joint torques acting at the joints.
Okay, d dt of dl by d theta dot minus dl by d theta is equal to tau. Now when we put the value
of l, l is equal to k minus u, what we get from here, we get this equation. And this is the
equation that we are going to use in our formulation. Okay. So let us do a few problems to
see how that we, how do we solve the dynamics and find the joint torques. Now as I said that,
this is not difficult, but it is recursive in nature. And there are a lot of terms which come
in, which means that if you are doing for a 6 degree of freedom or a 10 degree of freedom,
it becomes virtually impossible to do by hand, you will make a mistake somewhere.
So for that reason, we normally use a computer program. That is one. The second is that for,
in this problems that we will solve today, we will take a very simple example. So if you look
at textbooks also, you will find that they are very simple examples, only two links normally
are done, because otherwise it becomes very long and difficult to write. So let us take
example number one. This is using Lagrangian Euler formulation. This is the manipulator,
which is shown here. So this is a 2 DOF manipulator. It has one revolute joint and
one prismatic joint. And I want to find the joint, the torques which are acting at the joints.
So let us draw the manipulator and see. So the manipulator is, the first joint
is a revolute joint, which is shown here. The second joint is a prismatic joint.
So this one is a revolute joint, which is my theta 1. The second joint is a prismatic joint,
which is my D2. So it is an RP manipulator, 2 degrees of freedom.
So the first thing that we do is, what are the other information which is given? It is given that
the mass is acting at this point, this is the CG. So this is m1 and this is m2. So the first thing
that we need to do is to define our axis frames. So let us define our axis frames. So my z0 and
z1 are given there, x0 is here, x1 is along the link. Now the distance, so this is x1 and
this is my x, this is my z2 and this is my x2. Now in terms of distances, let me say this is my
length, this is my length from here to here, the length is l1, this is my length l1.
And D2 is a variable, let us say my D2 is here, right from here to there is my D2.
So this is my l1 and this is D2. So these are the two, D2 is a variable,
so as the link moves D2 is going to change, whereas l1 is a constant.
Now this is the manipulator, let us try to understand where it rotates. This is my revolute
joint, so it rotates about the z axis, so it can go up and down. And when joint 2 moves,
the distance D2 will change, so the link can move this way and this way, that is my D2.
But something to note here is that theta 1 is, when theta 1 is rotating,
it is a rotating axis, whereas D2 is a translating axis. But the translating axis
will also be affected by this rotation of theta 1 when the rotation happens.
Okay. So let us start off by writing our kinetic energy. So my kinetic energy of link 1
is equal to half m1 l1 square theta 1 dot square. So V is equal to omega r, so this is my
half m V square, so V is equal to omega which is here into r. So we know this formula V is
equal to omega by, this is equal to my l1, omega is theta 1 dot. So now this one plus
the inertia of the inertia tensor of the two links, so inertia tensor is half Izz,
it is rotating about z axis, so Izz1 into theta 1 dot square.
So let me write down the inertia tensor. So C1 is the inertia tensor of the first link,
which is equal to Ixx, xx1, 0, 0, 0, Iyy1, 0, 0, 0, Izz1. This is the inertia tensor for the
first link. The inertia tensor C2I2 is equal to Ixx2, 0, 0, 0, Iyy2, 0 and 0, 0, Izz2,
which is my inertia tensor of the second link. Now the rotations are taking place about z.
So the translations and the rotations are all about the z axis. So it is rotating about z axis,
so we will be considering Izz. So it is about here and here also it is about here.
And hence this Izz1 comes from there. So this is the first term that we are getting
for the link number 1 which is rotating. Now the kinetic energy of the second link
which is equal to half m2, m2 is the mass of the second link. Now this will have a component
which is d2 square theta 1 dot square because when the joint theta 1 rotates, this will have
a velocity here. So this fellow will be having a velocity because of theta 1 dot square plus
d2 dot square, that is my half mv square plus half Izz2 theta 1 dot square.
So you can see that joint 2 also, although it is a prismatic joint, it is affected by theta 1
because when theta 1 rotates, its kinetic energy will change. So as far as only theta 2 is
considered, only joint 2 is considered, then the variable is d2. So it is d2 dot square actually.
But the velocity of theta 1 also comes here and comes here also.
So please note that. So the total kinetic energy k theta theta dot is equal to k1 plus k2,
this is my total kinetic energy. Note carefully what are the variables, one variable is theta 1
and the second variable is d2. So there is a theta 1 dot and d2 dot in terms of velocity.
Now, we talk about the potential energy. Now what is the potential energy? Potential energy
is equal to U1 is equal to m1 L1 into g sin theta 1 plus m1 L1 g, which is my reference.
So this is my reference. So depending on where we are taking our horizontal, our horizontal is x0.
So this is because the we are taking x0 horizontal. And hence m1 L1 g into sin theta.
So m1 L1 sin theta is the height by which it is changing. Plus because we have taken horizontal
as the reference, then I need to add a reference here, which is m1 L1 g.
So this basically means that when the manipulator is in this configuration,
okay, if I do not take the reference, what will happen, it will mean that the potential is 0,
which is not true. Because of which we are adding another term, which is my reference m1 L1 g.
So what does it mean in terms of the robot? In terms of the robot, what it means is,
if the arm becomes horizontal, this term will start becoming 0, which means that
the torque, there is no torque required, which is not true, because the arm will immediately come
down. So to maintain it there, we are using this reference term, which is m1 L1 g.
What about u2? u2 is equal to m2 g d2 and sin theta 1 plus the variable d2 is there,
d2 is a translating variable. So the maximum of d2 is the reference that we are using here g d2
max. So it means that when the arm is extended to the extreme condition, let us say here,
okay, that is the maximum reference that we have to keep. And that is my reference here.
So the sum of u1 and u2 gives me the, is equal to u1 plus u2. So what we have done is we have
found the kinetic energy, then I found the potential energies of this tooling system,
which is a very simple system. Now, what we need to do is I need to put into the formulation,
the formulation that we just saw some time back. So this is the formulation.
So what do I need to compute? I need to compute dk by d theta dot. So the variable here is theta
dot, the variable here is theta, the variable here is theta. So I need to differentiate dk,
the potential, the kinetic energy with respect to theta dot and with respect to theta,
whereas potential energy is differentiated only with respect to theta. And then I take
the d dt of that. So this is the formula that we will be using. So what I will do here is,
I am going to first differentiate this one, then I will differentiate this one,
then I will differentiate this one. So let us do that. And so I am first going to do dk
del k by del theta dot in terms of the kinetic energy is equal to.
So if you remember the kinetic energy, let us look at the kinetic energy again. What are the
variables? Theta 1 dot is there and theta 1 dot is there. And here d2 is there, d2 dot.
Okay. So we have to differentiate first with respect to theta 1 dot. So this is what I am
doing. I am doing with respect to theta 1 dot and then, so theta 1 dot and then d2 dot.
Okay. That is what I am doing. So I am differentiating with respect to,
what do we get here? We get the terms M1 L1 square plus Izz1 plus Izz2 plus M2 d2 square,
this full thing into theta 1 dot. Okay. The next is differentiating with respect to d2.
So it is M2 d2 dot. So as I said that kinetic energy has two variables, one is theta 1 dot and
d2, d2 dot which are variables. So first we differentiate with respect to theta 1 dot and
then we differentiate with respect to d2 dot. And this is what we get. So dk by d theta and
then next I differentiate dk by d theta. Okay. Now kinetic energy, when we are looking at it,
dk by d theta, let us go back and look at dk by d theta. So in terms of this, what do we see?
We are differentiating, both of these two fellows are together. Okay. Because of which,
when you are differentiating with respect to theta 1 dot, sorry, with respect to d theta,
this is going to become a 0, whereas there is going to be a second term which is M2 d2
theta 1 dot square. So this is what we are going to get for the second term. Okay.
The first term, there is no theta. Okay. Where there is a d2, there is a combination of d2 and
theta 1. That is what is giving us the second term here. Now in terms of dU and d theta,
dU and d theta, where is dU? So dU is, so the second term I got from here. Okay. So if it is
confusing you which term is coming here, so the kinetic energy when you are differentiating with
respect to theta, there is no theta. But there is a d2 and theta 1 dot together. Okay. And that
is the term that is leading to this one here. And that is coming from here. Okay. So now let us look
at the potential energy. Now we are differentiating the potential energy with respect to theta.
So the potential energy is given by this and this. So this does not have any theta,
this does not have any theta. The reference does not have any theta. So theta comes only here and
here. So we are differentiating that with respect to theta. And what we get is dU by d theta is
equal to g into m1 l1 plus m2 l2 into cos theta 1. There is a d2 here into cos theta 1. And that
is g m2 sin theta 1. Okay. So when you look at the potential energy, the kinetic, the potential
energy term, we are differentiating with respect to theta. So let us go back and look at that
equation again. So this is my term. So m1 with respect to theta, we are getting m1 l1 g cos
theta 1. And here we are getting m2 g d2 into cos theta 1 again. Okay. So this is exactly what
I am getting. Okay. So this is what we have got, these three terms. Now I need to take,
what do I need to do? I need to find the term which is d dt of, so I need to do d dt of
dk by d theta dot. This I need to find. Okay. So I need to differentiate this one again.
So if I differentiate that again, what will happen is only theta 1 dot will become theta 1 double
dot and d2 dot will become d2 double dot. Okay. It will become acceleration. That is all. Okay.
So let me, okay. So after doing that, what we do is we write tau 1 and tau 2. So tau 1 is my,
the total torque which is acting on joint number 1. So basically I take the top, this one plus this
one plus this one and add it, the top row. Okay. So what I am going to get is m1 l1 squared
plus Izz1 plus Izz2 plus m2 d2 squared into theta 1 double dot. Okay. This fellow has come from,
where did this come from? This came from d dt of dL by d theta dot. Okay. Or dk by, sorry,
dk by d theta. So when I differentiate it with respect to time, all the theta 1 dots become
theta 1 double dots plus 2 m2 d2 theta 1 dot theta 2 dot plus m1 l1 plus m2 d2 g into cos theta 1
plus the second term becomes equal to m2 d2 double dot minus m2 d2 theta 1 dot squared
plus m2 g into sin. Now we can see that there is acceleration term. Okay. So this is my acceleration.
That is an acceleration term. There is a Coriolis term here. Okay. Then there is
a centrifugal force here and there is gravity term which is here. So there is gravity. Okay.
So we see that there is, there is acceleration term which corresponds to inertia forces.
Okay. So mass into acceleration. So this is my inertia into acceleration. Plus there is
Coriolis force theta 1 dot and d2 dot together. So we can put them together and say that this is
my, I can write my equation like this, m theta is equal to, the inertia terms I put them all
together, m1 l1 squared plus Izz1 plus Izz2 plus m2 d2 squared. This is 0. The second term is 0
and this is m2. Okay. So this is a 2 by 2 matrix. Okay. So this will be, we are going to multiply
this with theta 1 double dot and sorry, let me write it properly. Okay. So this will be multiplied
by what? This will be multiplied by theta 1 double dot and here it is d2 double dot.
That is this term. That is this term and this term. Sorry, this term and this term,
the inertia terms. Okay. Next we have V theta theta dot, which is the Coriolis and centrifugal
forces, which is 2 m2 d2 theta 1 dot and d2 dot. Okay. And here it is minus m2 d2 theta 1 dot
squared. Okay. So this is my Coriolis plus centrifugal. So this is Coriolis and this
one is centrifugal forces. Okay. So this is the second term and the third is going to become my
G theta. So which is the theta, which is the gravity term. So wherever there is a G,
so there is a G, there is a G here, there is a G here. Okay. Any more G? No. So this will become
equal to m1 L1, m1 L1 plus m2 d2 G cos theta 1. And here it is m2 G sin theta 1. Okay.
So this is the term which contains gravity. So this we call the gravity forces.
So what we have seen is that if I combine all of this, if I combine this, first of all,
we see the inertia matrix is 2 by 2. This is 2 by 1 and this is 2 by 1. Okay. In matrix form.
And on the right hand side, if I write it, then what, what would this equation look like?
So this equation would look like tau 1 or tau is equal to m into m theta into theta double dot.
Okay. Plus we get V theta, theta dot plus G. Okay. If you go back, this term is my inertia,
inertia into acceleration, which we are seeing here. Then the second term is the
Coriolis centrifugal forces, which is this. And the third is the gravity forces, which is that.
So we are seeing that the total torque, which is coming is, so we will be getting tau 1 and tau 2.
So joint 1 and joint 2 torques. So it is composed of the inertia forces,
inertia terms, Coriolis plus centrifugal terms plus the gravity terms. There could be other
terms. There could be other terms like friction could be there. Okay. Plus external forces,
J transpose F could be there. Okay. But here we are not considering these two.
So the dynamic equation appears in this form and consists of these three components,
inertia components, Coriolis centrifugal forces and gravity components. So if there is n,
if there is 6 degree of freedom manipulator, what will happen is your m will become 6 by 6.
Okay. V will become 6 by 1 and gravity will become 6 by 1. And there will be 6 torques.
So tau 1 to tau 6 for the 6 joints. Okay. Now let us very quickly look at another problem.
So this is the problem for solving using the Lagrangian Euler method.
Now let us look at, this is the Lagrangian Euler. Now let us look at Newton-Euler. Okay. Let us look
at the Newton-Euler method. Now the Newton-Euler method is a little bit longer. So Newton-Euler
method, it is a little longer because you need to do the outward, the outward iterations.
Then you have to do the inward iterations. Okay. So there is like two loops going on
and that is why it is a little longer. So here let us look at a two-link manipulator again.
Very simple case. Now you also understand why we are only saying two-link manipulator,
two-link manipulator. We are not going beyond that. Okay. So there is a 2 degree of freedom,
2 DOF, 2 degrees of freedom, 2R manipulator, planar. We are making the assumptions,
mass or rather let us say that we are making the assumption, there is no inertia here.
So there is point mass assumption, point mass at end of link. Okay. So let us say that
this is a two-link manipulator and these are, I am simplifying again. These are point masses
which are acting there, m1 and m2 at the tips of the links. So this is my theta 1, again,
z0, z1, z2, z3. This is my x naught, x1, x2 in that order. Okay. Now this is my theta 1
and this is my theta 2. Okay. Link let us say is l1 and this is my l2. Now let us say that
this is a point mass at the end of the link. Of course, the center of gravity PC1
is equal to l1 along the x1 direction and PC2 is l2 x2 direction. Okay. And the inertias,
let us say, we are considering point mass. So C1 I1 is equal to 0 and C2 I2 is also equal to 0
because we are saying point mass assumption. Okay. There are no forces acting at the end
effector. So at the end effector F3 is equal to N3 is equal to 0. So forces and moments are
not acting at the end effector. Otherwise, in the inward iteration, this will get reflected.
Okay. So this is the problem, two-link manipulator, two revolute joints
and we are making the assumption there are point masses at the end of the links
and because they are point masses, there is no inertia of the links. Okay. Now
something to note here, please note is that how do you consider gravity here?
In the Lagrangian Euler system, gravity was there because it was there in the
potential energy term. So mgh, so g was there. Whereas here, you can see there is no gravity
term because how do you include gravity? So to include gravity, we simply say that the base link
V0 is having gravitational acceleration, which is along the y-axis. Okay. So I am saying that g,
the g vector is the acceleration due to gravity. So we are saying the base link is having an
acceleration, which is the acceleration due to gravity and that propagates outwards. Okay.
So that is how we consider gravity link, the gravity effect. So base link is equal to g.
Okay. The acceleration of the base link is equal to g. Okay. So now we look at R again,
what is the R matrix? R matrix is equal to C cos minus sin, sin cos 0, 0, 1.
And the transpose of this, we need the transpose of this. So this is I to I plus 1. We need the
I plus 1 to I, because we are going outward, right? So we are going like that. So we need
the R inverse, which is equal to cos sin 0, minus sin cos 0, 0, sorry, last one is 1, 0, 0, 0.
So let us start off first, but what we need to do, we need to do the outward iterations.
So in the outward iterations, omega 1 is the, the base does not have a velocity. It is a,
so the velocity, angular velocity of the, the first link is equal to theta 1, theta 1 dot
into z, z 1 along the direction, which is equal to, okay. What about the acceleration? So from
here, if I simply differentiate it, I will get omega 1 dot is equal to theta 1 double dot along
the z 1 direction, which is equal to 0, 0, theta 1 double dot. So this is my linear velocity and
linear acceleration propagation from the 0 to the first joint. Next, I need to find the, sorry,
this was the angular, sorry, this is the outward iteration angular velocity and angular acceleration.
Next, I need to find the linear velocities. How do I find the linear velocity exactly the same way?
Linear velocities and linear accelerations, I find the linear acceleration. So cos 1, sin 1,
sin 1, cos 1, 0, 0, 1 is equal to 0, okay, which is equal to g s 1. Just follow the same
formulation that I had given some time back. So just go back, let us go back and
look at that one more time. So if you are looking at the formulations for Newton-Euler,
so Newton, sorry, Newton-Euler formulation that we are looking at is given here. So this is for
the angular velocity, angular acceleration, linear acceleration, linear acceleration of
center of gravity of the link, okay. So just use these formulas recursively.
That is how, that is what I am doing and we are going from link to link now, okay.
So this gives us my acceleration, linear acceleration. Now I need to find the
acceleration of the end that is v c 1 of the C g. Now the C g is the, is a point mass which
is acting at the end of the link. So basically what I get is L 1 theta 1 double dot 0 plus
minus L 1 theta 1 dot square 0 and 0, okay, plus I get this term which is equal to g s 1
and g c 1 0 which is equal to minus L 1 theta 1 dot square plus g into s 1.
And here it is L 1 theta 1 double dot plus g into c 1 0. So this is the linear acceleration
of the point mass, okay, which is at a distance of L 1. So this is the acceleration of the point
mass at the end effector, okay. And this is the acceleration of the frame, okay. So please note
the difference there. So now using Newton s law and Euler s formulation, we find force is mass
into, force is equal to mass into acceleration. So I simply take the acceleration and multiply
with the mass. The mass was m 1. So I take force acting at the C g is equal to minus m 1 L 1 theta
1 dot square plus m 1 g into s 1. The second one is m 1 L 1 theta 1 double dot plus m 1 g c 1 and
third term is 0. Now this is the force and what about the moment? The moment n 1 1 is equal to
0 0 0. There is no moment. So how did I get this? I simply multiplied this into m and I got this,
into m 1 and I got that, okay. So mass into acceleration is what I got,
okay. Using Newton s law, force is equal to mass into acceleration v c dot. That is how I got this.
The moment is 0. So there is no moment acting. Now this is for link 1. Now for link 2,
the outward iteration for link 2. Outward iteration for link 2, omega 2 to the angular
velocity is equal to 0 0 theta 1 dot plus theta 2 dot. This is very simple because the second
joint or the velocity of link 2 is equal to the velocity of the previous link which is this one
plus its own velocity which is this one, okay. So this is how we get it and it is very simple.
What about omega 2 2? So we differentiate that and I very simply get 0 0 theta 1 double dot
plus theta 2 double dot. So angular acceleration is very easy to get.
Now once you do that, what we need to do is to find the linear velocities of the two. So I take
the linear velocity, sorry linear acceleration, linear velocity and then linear acceleration.
So I am finding the acceleration straight and what we are doing is c 2 cos minus sin 2 cos 2
0 0 1 0 0 and this is minus l 1 theta 1 dot square plus g into s 1 and we get l 1 theta 1 dot
theta 1 double dot plus g into c 1 which is equal to, so l 1 theta 1 double dot s 2 minus l 1
theta 1 dot square c 2 plus g into s 1 2 and here we have l 1 l 1 theta 1 double dot c 2
plus l 1 theta 1 dot square s 2 plus g into c 1 2 and 0. So this is the angular,
sorry this is the linear velocity of the frame 2.
Now I need to find the linear acceleration, this is linear acceleration of frame 2. I need to find
linear acceleration of c g at the point mass which is equal to v c 2 2, this is the linear
acceleration of the point mass at the end which is equal to 0 l 2 theta 1 double dot plus theta
2 double dot 0 plus minus l 2 theta 1 dot plus theta 2 dot square 0 and 0 plus we have a third
term which is l 1 theta 1 double dot s 2 minus l 1 theta 1 dot square c 2 plus g s 1 2 and here it
is l 1 theta 1 double dot c 2 plus l 1 theta 1 dot square s 2 plus g into c 1 2 and it is 0 here.
So this consists of 3 terms. Now I found the linear acceleration of the c g which is the
point mass at the end. So multiplying that with the mass I basically get the forces which are
acting there. So force force 2 is equal to I simply take the linear the linear acceleration
of the point mass and multiply that with s 2 minus multiply that with the mass 2 l 1
theta 1 dot square c 2 plus m 2 g s 1 2 minus m 2 l 2 theta 1 dot plus theta 2 dot square.
The second term is m 2 l 2 theta 1 double dot c 2 plus m 2 l 1 theta 1 dot square s 2 plus m 2 g
c 1 2 plus m 2 l 2 theta 1 double dot plus theta 2 double dot and the third term is 0.
So this is my force 2 whatever moment 2, moment 2 is 0 again there is no moment.
So the inward iterations for link 2. So after doing this what we need to do is I have done
my outward iterations. Now I have to do my inward iterations. So basically what have we found?
We have found the forces which are acting at the c g of the links. So I need to do the inward
iteration now to find the torques, inward iterations to find torques. So f 1 and f 2
are forces which are where is f 1 and f 2 acting? f 1 and f 2 are acting at the c g points. Where
were the c g points? So f 2 is acting there and f 1 is acting there because we are considering
that their point mass, their lump mass at the end, at the end of the link. So we have found f 1,
f 2. Now we have to come backwards and see this f 1 and f 2 are causing joints or the torques.
Now they are causing torques at the joints. So what are those? So the inward iteration
for link 2 is equal to f 2 2 is equal to 2 f 2 and n 2 2 n 2 is equal to 0 0 m 2 l 1 l 2 c 2
theta 1 double dot plus m 2 l 1 l 2 sin 2 theta 1 dot square plus m 2 l 2 g c 1 2 plus m 2 l 2
square theta 1 double dot plus theta 2 double dot. So this is the torque which is acting.
So the torque which is acting on the second joint is this one, it is that term,
is the complete term. Now this is the torque along the x y and z axis. So this torque is
only about z axis because it is a planar manipulator, it is rotating about z.
Now the inward iteration for, this is for link 2. Now what about link 1? So inward for link 1,
when we do the inward iteration for link 1, what we get is f 1 1 is equal to cos 2 minus sin 2
0 0 1 0 0. This is multiplied into m 2 l 1 s 2 theta 1 double dot minus m 2 l 1
cos 2 theta 1 dot square plus m 2 g s 1 2 minus m 2 l 2 theta 1 dot plus theta 2 dot square.
And here it is m 2 l 1 c 2 theta 1 double dot plus m 2 l 1 s 2 theta 1 plus m 2 l 2
theta 1 double dot plus theta 2 double dot. This is one term plus we have m 1 l 1 theta
1 dot square plus m 1 g s 1 and we have m 1 l 1 theta 1 double dot plus m 1 g c 1 0.
This is the force acting and we have the moment now. So the moment acting will be equal to n 1,
that is a pretty long moment because there is a lot of terms in there, so 0 0.
So m 2 l 1 l 2 c 2 theta 1 double dot plus m 2 l 1 l 2 s 2 theta 1 dot square
plus m 2 l 2 g c 1 2 plus m 2 l 2 square theta 1 double dot plus theta 2 double dot
plus 0 0 m 1 l 1 square theta 1 double dot plus m 1 l 1 g into cos 1 plus 0 0.
And there is one more long term m 2 l 1 square theta 1 double dot minus m 2 l 1 l 2 sin 2,
it is theta 1 dot plus theta 2 dot square plus m 2 l 1 g s 2 s 1 2 plus m 2 l 1 l 2 cos 2
into theta 1 double dot plus theta 2 double dot plus this one I will write it here,
one more term is there plus, so the next m 1, sorry m 1 l 1, so let me write it here.
Another term is there which is plus m 1, sorry m 2 l 1 g cos 2 cos 1 2, this term plus this.
Now this is my, so this is my torque which is acting on joint number 1. Now we can put them
together and if I put them together, we have to put them together means I have to put
the inertia terms together, the corollary centrifugal terms together and then the
gravity terms together. So, if we do it that way, then what we can do is we can find the
dynamic equation in the standard form which is equal to mass theta theta double dot plus
the second term is V corollary centrifugal force plus gravity term which is C into,
gravity term is g into theta. So, I can put all of them together
and then divide into 3 parts which will correspond to the inertia forces,
the corollary centrifugal forces and the gravity forces.
So, the next thing that we should do is we should divide, we should separate it and write in terms
of, so we can do that and see what does this matrix look like. So, this matrix will look like,
so let me write down the terms and see what this matrix looks like.
So, my M term or let me write it down, let me combine it tau 1 and write,
so tau 1 is the torque which is acting, so it is M2, M2 L2 squared theta 1 double dot
plus theta 2 double dot plus M2 L1, L2 cos 2, 2 theta 1 double dot plus theta 2 double dot
plus M1 plus M2 into L1 squared theta 1 double dot minus M2 L1, L2 sin 2 theta 2 squared theta
2 dot squared minus twice M2 L1, L2 sin 2 theta 1 dot theta 2 dot plus M2 L2 g sin 1 2 plus M1
plus M2 L1 g cos 1. This is my torque 1 and torque 2 is equal to M2 L1 L2 cos 2 theta 1 double dot
plus M2 L1 L2 sin 2 theta 1 dot squared plus M2 L2 g cos 1 2 plus M2 L2 squared
theta 1 double dot plus theta 2 double dot. So, now we can break it up into in this form,
so this is the corresponding terms let us say, so this is my mass inertia matrix which will
consist of this term, there is this term, this term wherever there is the acceleration term is
there, it will make up the inertia matrix. So, this is the, these terms are all corresponding
to the inertia matrix, there is theta 2 here in the second term here and there is term here.
So, this is giving us the terms. So, now this is corresponding to the inertia term,
this will make up the inertia term into inertia into acceleration.
Next is the Coriolis centrifugal forces. So, Coriolis centrifugal forces would mean which
terms. So, this is my centrifugal force, this is Coriolis force. So, these two will make up the
this term. So, similarly here this one will make up the Coriolis centrifugal force.
Now, what about the third one, which is the gravity term? So, gravity let us say is this one,
gravity is this color. So, gravity wherever there is g, there is g here, g here,
this will make up the gravity term here, there is g here. So, based on that we can write our matrix,
the total formulation like this. So, I can make the m matrix, m theta, theta double dot,
theta 1 double dot, theta 2 double dot. So, tau 1 tau 2 is equal to, this is a 2 by 2 matrix.
So, this is m theta is 2 by 2 plus we have v theta, theta dot which is will come here,
it will become 2 by 1 and plus gravity vector which is g theta, which is again 2 by 1,
which will basically consist of the gravity terms. So, we have our inertia forces,
Coriolis plus centrifugal forces plus gravity forces. Now, as you can see that it is not very
difficult, once you understand that how the Newton Euler formulation is written, that in terms of we
have an outward iteration in which we find the angular velocity and the angular acceleration,
then we find the linear velocities and the linear accelerations of the CG, then we use
Newton s law and the Euler s formulation and get the forces in the outward iteration.
Then we come backwards and then we see what is the action, reaction of the forces on the joints.
So, this is not difficult once you understand the equations, but then you have to do it repeatedly.
And there are so many terms that there is a very high chance of making a mistake.
So, most of the textbooks you would find and most of the lecture notes, they only do 2 degree
of freedom systems and now you understand why. So, in future, if you have to do for 6 degree
of freedom system, it is a good idea to use a computer program like MATLAB for example,
MATLAB has matrix manipulation, it can be done very, very easily using MATLAB, either the
Lagrangian formulation or the Newton Euler formulation can be done very easily in MATLAB.
So, this gives you an idea of how to solve a problem using Newton Euler or Lagrangian
Euler formulation. And the dynamics basically gives us the torques which are acting at the
joints. Now, we require the torques which are acting at the joints when we talk about
energy optimization, because when a system is moving in space, then if you want to find how
much energy is being consumed, then you have to basically sum up the joint torques at every
instant. And that gives us the energy that is being consumed. So, if you want a trajectory,
which has minimum energy consumption, you have to find the torques and then see along which
trajectory the torques are minimum. And that is basically how we optimize paths or gates of
walking systems, flying systems as we will come to as we go along. So, we will stop here today.
