Observer-Based Control
Observer-Based Control
ME537 Project II
Observer - Based Control of Pendulum and Cart
Kadir Cumali
21 December, 2015
1. Introduction
The balancing of a pendulum by moving a cart along a horizontal track is a classic
problem in the area of control. The pendulum system inherently has one unstable
equilibrium point. This point corresponds to a state in which the pendulum points
downwards and, thus, requires a control force to maintain this position. The objective
of the system is to balance the pendulum by applying a force to the cart that the
pendulum is attached to. Therefore, this project will focus on swinging the pendulum up
to the unstable equilibrium position (vertically upright), and maintaining this state. An
observer-based controller is designed in order to swing the pendulum to an upright and
to maintain at that position.
(1)
(2)
Now we put these equations into state space 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 2
d
mL
(m
c + m mcos ())
z=
=
=
dt
dt z3 dt x
z4
h
i
y = C[z] or y = = 0 1 0 0
x
x
These equations give a complete state space representation of the nonlinear inverted
pendulum. Linearizing at upward position, = 0, 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
h
i
0 0 0
m L
m
c
A=
, B = 0 , and C = 0 1 0 0
0
0 0 1
1
mg
0 0 0
mc
mc
3. Observability of the System
The system is said to be completely observable if the all state variables in x(t) can be
observed from the measurement of the output y(t), and the input u(t). Assuming that
15
A=
0
1
0
0
0
z = Az + Bu
y = Cz
0 0
h
i
0 0
and C = 0 1 0 0
0 1
0 0
2
C
0
1 0
CA 15 0 0
Qn =
CA2 = 0 15 0
3
CA
225 0 0
Rank(Qn ) is 2, and therefore, the system is not completely observable. That means
0 1
z= 0 1
and A =
y=
15 0
"
# "
#
C
0 1
Q2 =
=
CA
15 0
Rank(Q2 ) is 4, and therefore, this system defined is observable. It points out that if we
observe (t)
as an output, we can determine angle of pendulum, . Because of the fact
that the system is observable, it is always possible to find an observer gain L to set the
eigenvalues of the error dynamics at arbitrary values.
4. Designing an Observer-based Controlller
Since one of the state variable, , is not available, we should design a state observer
for the system that has A and C matrices.
Figure 2: Observer
The intention is to simulate the closed loop system for different initial conditions
closed to equilibrium and small perturbations denoted by Td, which are given in the
problem. The controller is applied to the nonlinear equations defined in the dynamics
and linearization. In order to analyze how to change angle of pendulum, angular velocity,
acceleration, and force during the time, we can follow the basic steps explained below.
" #
The initial value of z and zobs , is given as [0; 0], [0; 1], respectively. The pendulum is
balanced at its vertical position. The experiment is done when t is between 2 t < 2.4
Td = 2, and 8 t < 8.3 Td = 3. If we increase the perturbation to Td = 10 within
2 t < 2.4, we will observe how the angle of pendulum changes.
Figure 4: Td = 2 and Td = 10 within 2 t < 2.4 for the same initial condition
In figure 4, when the perturbation is increased, the angle of pendulum rises and the time
of being stable takes more time for the same initial conditions. The input force applied
is varied, the pendulum quickly balances itself with almost zero vibration in its steady
state.
Figure 5: Td = 3 and Td = 13 within 8 t < 8.3 for the same initial condition
The overall design requirements are satisfied and the system has a relatively good performance.