Beruflich Dokumente
Kultur Dokumente
ME537 Project I
Control of a Pendulum on a Cart
Kadir Cumali
30 November, 2015
Introduction
The pendulum on a moving cart is a classic problem of the control theory since it is
an illustrative example of linear and nonlinear systems analysis and design. It can be
used to understand some concepts such as stability, controllability, and observability. In
this report, some nonlinear system analyses and control techniques are investigated for
this particular system. The intention is to obtain nonlinear control solutions in order to
regulate the pendulum to the upright position and the cart at its desired position.
The report is organized as follows. 1. Dynamics and linearization, 2. Controllability
of the system, 3. Control of the system 4. Results
1 Dynamics and Linearization
In this section, the dynamic equations of the pendulum on a cart system is described
two equations, where mc is the mass of the cart, m is the pendulum mass, L is distance
from cart to pendulum mass, g is the gravitational acceleration constant, and Td is small
perturbations. The variables x and are the cart displacement and the pendulum angle,
respectively.
(Td + mgLsin()(mc + m) mcos()(F + mLsin()2 )
=
mL2 (mc + m mcos2 ())
x =
Now to put these equations into state form, we make the following substitution in
order to linearize around = 0.
z1 =
z2 =
z3 = x
z4 = x
We can write the final state space equations for the system given as,
z2
(T + mgLsin()(m + m) mcos()(F + mLsin()2 )
z1
d
c
2
2
z
d
d
d
2
mL (mc + m mcos ())
=
=
z=
dt
dt z3 dt x
z
4
1 0 0 0
y = C[z] or y =
z=
x
0 0 1 0
x
x
These equations give a complete state space representation of the nonlinear inverted
pendulum. Linearizing at upward position, the system has,
0
0
1
0
0
mc L
+ mc L F
=
=
mc
z =
x
x
0
0 0 1 x 0
mg
1
F mg
x
0 0 0 x
mc
mc
mc
0
0
1 0 0
(m + m)g
1
c
0 0 0
m L
and B =
c
mc
A=
0
0 0 1
1
mg
0 0 0
mc
mc
2 Controllability of the System
The system defined can be controlled so that pendulum on the cart remain vertical
on the top of the cart, that is = 0. The system is: (1) controllable by the input, and
(2) the state z can be measured directly. The linearized control system around (0, 0)
R4 xR is z = Az + BF with, we have equations by taking mc = 4, m = 2, and L = 2.
= 14.715(t) 0.125F (t)
(t)
= 4.905(t) + 0.25F (t)
z(t)
We can easily check that if this linearized control system satisfies the Kalman rank
condition. Let parameter r = (mc , m, L, g) R4 , then the controllability matrix Qc (r)
is:
(mc + m)g
1
0
0
mc L
M 2L
1
(mc + m)g
0
2
M L
Qc (r) = [B AB A2 B A3 B] = mc L
1
mg
0
2
mc
mc L
1
mg
0
0
mc
m2c L
Since determinant of controllability matrix, |Qc (r)|, is 0.1468, Qc (r) has full rank, the
system is completely controllable. Thus, if the angle departs from equilibrium by a
small amount, a control always exists which will drive it back to the zero. This justifies
the assumption that = 0.
3 Control of the System
We normally investigate a feedback control scheme in order to minimize the destabilizing
effects of disturbance forces. The close - loop system is formed by feeding back the state
variables through a real constant matrix K;
u(t) = Kx(t)
The closed loop system is thus described by,
x = (A BK)x(t)
The design objective in this case is to find the gain matrix K such that the close - loop
system is stable.
if we
2. For the gain matrix, K, we will find the input from the equation F = K
assume that desired angle and angular velocity are 0. Afterwards, is calculated.
and = 0 + dt
are computed in small dt time. We have new
3. Equations = 0 + dt,
and values.
For different Td values, the algoritm is executed.
Figure 3: Change of state variables, input: force, and output: acceleration of cart
Initial values are taken x0 = 2 cm, x0 = 5 cm, 0 = 0.01, 0 = 0.03. The initial
angle value of pendulum is taken 0.01. After 2 seconds, there exists a small perturbation
and angle of pendulum increases. Though, as we expect, it will come into the equilibrium
point, which is 0.
4 Results
The intention of this project is to familiarize with modelling nonlinear systems performing
linearization, designing and evaluating different control laws based on pole placement or
LQR, and finally verifying our design. The pendulum on a cart is used for this control
system design. However, to control a pendulum on a cart is a diffucult problem. The
design specifications are:
(a) The pendulum is balanced at its vertical position;
(b) The cart is asymptotically moved back to the origin and remains there.