Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
102 views

Observer-Based Control

This document describes the design of an observer-based controller for balancing an inverted pendulum attached to a moving cart. It presents the nonlinear dynamics and linearization of the pendulum-cart system. The system is observable when using the angular velocity as the output but not when using position outputs alone. An observer is designed using pole placement to estimate the full state. Simulation results show the controller can balance the pendulum for different initial conditions and perturbations, requiring a larger input force when perturbations are increased.

Uploaded by

Kadir Cumali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Observer-Based Control

This document describes the design of an observer-based controller for balancing an inverted pendulum attached to a moving cart. It presents the nonlinear dynamics and linearization of the pendulum-cart system. The system is observable when using the angular velocity as the output but not when using position outputs alone. An observer is designed using pole placement to estimate the full state. Simulation results show the controller can balance the pendulum for different initial conditions and perturbations, requiring a larger input force when perturbations are increased.

Uploaded by

Kadir Cumali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Bogazici University

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.

Figure 1: Cart and pendulum system


The report is organized as follows. 2. Dynamics and linearization, 3. Observability
of the system, 4. Designing an observer-based controller 5. Results
2. Dynamics and Linearization
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 =

(F + mLsin()2 )L cos()(Td + mgLsin())


(mc + m mcos2 ())L

(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

(F + mLsin()2 )L cos()(Td + mgLsin())


z4
x
(mc + m mcos2 ())L

y is a column vector of the output variable. Let us take only output y = .


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

F + (mc + m)g (mc + m)g


1
0 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

the only output variable to be measured is y = (t),


the angular velocity of pendulum,
then the linearized equations governing the systems are;

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

The observability matrix,


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

while we measure the angular velocity of pendulum, (t),


over an arbitrary time interval,
we can not determine x and x from the output. However, if we take the output as,
" #
" #
"
#
h
i

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.

" #

i) Lets define a state variable z, which is shown z =


. We have initial conditions for

the state z and observer zobs .


ii) State feedback gain K and observer gain L are obtained from the poles we desire.
K = place(A, B, poles)
L = place(A0 , C 0 , poles)0
iii) By the state gain K, we will find the input from the equation u = Kzobs if we assume
that desired angle and angular velocity are 0.
iv) zobs represents estimated state, zobs = Azobs + Bu LC(z zobs ).
5. Results
The intention of this project is to familiarize with modelling cart and pendulum system
performing linearization, designing and evaluating output feedback control based on pole
placement, and finally verifying our design.

Figure 3: Observer based Control

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.

You might also like