EGME 511 (Advanced Mechanical Vibration) Final Project Stabilization of an inverted pendulum on moving cart using feedback control
by Nasser Abbasi
\clearpage
Given the following
system

Need
to find control law
to stabilize the inverted pendulum. First we need to obtain the equations of
motions.
Let the Lagrangian coordinates be
and
as shown. Let
be the Lagrangian. Let
be the kinetic energy of the system and let
be the potential energy.
Hence
and
Where
is the linear velocity of the blob
relative to the inertial system.

Hence,
since
,
we
obtain
Hence
becomes
And since the blob is losing potential energy as it move downwards, we obtain
as (assuming zero potential energy is the ground
level)
Therefore the Lagrangian
is
To obtain the equation of motions, we need to evaluate
for each Lagrangian coordinate
and
is the generalized force for that coordinate. Hence for
we obtain
Hence EQM for
is
Now we need to obtain
for the coordinate
.
Apply a virtual displacement
and determine the work done by

Hence
the work done by
is making virtual displacement
is zero, since
is not in the line of force along this displacement. Therefore, the EQM for
is from (1)
above
Now we find EQM for coordinate

Hence EQM for
is
Now we need to find
for
.
Apply virtual displacement in the
direction, and find work done by

But
,
hence we see that
,
therefore, the
EQM becomes
Assume
Now, solve for
and
from (4) and (5). From the second equation above, eq (5) we
find
Substitute the above into eq (4) we
obtain
Now, using result for
found in (6), substitute into (5) we
obtain
Hence, to
and
and they are the following
Now convert to state space. Let
,
hence

Writing the above in the form
we
obtain
To determine the stability of the above system (it is a linear system now,
since we have already linearized it), we first find the equilibrium point.
This is found by setting
,
and this results in
,
i.e.
and
.
Notice that the value of
is not important for the equilibrium point. Now we need to determine if this
point is stable or not.
Hence
Since
are all positive, we see that one root will be in the RHS of the complex
plane. Therefore the open loop system is
To stabilize it, we need to supply a control law
to force the roots of the new
matrix to be all in the LHS of the complex plane.
Let
Hence (7) becomes
Therefore
Hence
We
now
need to determine
and
.
Assume we require that the closed loop poles be located at
Hence, the characteristic polynomial is
Compare (8) and (9) we obtain the following
or
Hence
Therefore, given
we can now find
which will generate force
which will keep the poles of the closed loop system in the LHS of the complex
plane, and keep the inverted pendulum stable. For example, for
,
we obtain
We will now generate the solution
for some initial conditions and plot these solutions against time. In the
first case, we assume
is zero. Hence we will observe that the system is unstable, i.e.
will grow away from the marginally stable position which is
and will not return back. Next, we will introduce
as determined in the previous section, and observe the new solution to see
that it remains near or at the
position.
First, we need to decide on some initial conditions. These must be such that
close to zero and for
we can use
.
Hence, let
To determine
,
which is the solution of the system, we first must solve equation (7) and (8)
for the above IC.
The solution to (7) is given by solution to
which is
Where
and
Taking Laplace transform of (10) we obtain
Hence
Therefore, the solution to
is
Therefore, the solution to
which is
is given by
Let
,
we plot the above solution for
up to
seconds

Now, we plot the solution to (8), which is the state space equation with the stabilizing control law derived above,which is the following
where
Where the above values determined to cause the closed loop poles to be located
at
Hence
To make the computation easier, we now substitute numerical values for all the
above parameters
,
which are
,
and we obtain
and
Hence
Using
and solving for
we obtain
Using CAS system to matrix inverse the above and obtain the inverse Laplace
transform, and pick the
solution and plot it, we observe that now the system becomes stable as
expected.

We observe from the above plots and the plots shown in the computation section
below, that with the control law derived to force the poles of the closed loop
to be stable, the inverted pendulum has been stabilized and the final angle
that the inverted pendulum makes with the vertical does go to zero. From the
position
plot, we see that the cart move to the right away from the
position, then it return back to
position, while in the same time, the pendulum has swung back and forth about
the
position before it finally settles down the at the stable position. This shows
the using pole placement will result in an effective control law which
stabilized the system. We have assumed small angle approximation here, and the
initial angle used was small.