Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

Modeling and Control of Inverted Pendulum

Abdul Qayyum Khan

Institute of Automatic Control and Complex Systems, Faculty of Engineering,


University of Duisburg-Essen, Bismarck Straße 81, Duisburg 47057, , Germany
March 10, 2017
Contents

Abstract v

1 Modeling and Control of an Inverted Pendulum 1


1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Nonlinear Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1 Energy Equations . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2 Equations of Motion . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.3 Modeling of Friction . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 State Space Model and Transfer Function of the System . . . . . . . . 7
1.3.1 Nonlinear State Space Model . . . . . . . . . . . . . . . . . . 8
1.3.2 Linearized State Space Model . . . . . . . . . . . . . . . . . . 10
1.3.3 Transfer Function of the System . . . . . . . . . . . . . . . . . 13
1.4 Coprime Factorization Techniques . . . . . . . . . . . . . . . . . . . . 14
1.5 Representation of Process model with model Uncertainties . . . . . . 16
1.6 Modeling of Faults and Disturbances . . . . . . . . . . . . . . . . . . 19
1.7 Observer Based Controller Design . . . . . . . . . . . . . . . . . . . . 21
1.7.1 Observer Based State Feedback Controller for Continuous Time System 22

i
2 Conclusion and Future Work 29

Bibliography 30

ii
List of Figures

1.1 Schematic of the Inverted Pendulum . . . . . . . . . . . . . . . . . . 3

iii
List of Tables

1.1 Definition and Numerical Values of the system parameters. . . . . . . 24


1.2 Distribution of maximum sing value for θ = ±10◦ . . . . . . . . . . . 25
1.3 Distribution of maximum sing value for θ = ±6◦ . . . . . . . . . . . . 26
1.4 Distribution of maximum sing value for θ = ±5◦ . . . . . . . . . . . . 27
1.5 Distribution of maximum sing value for θ = ±3◦ . . . . . . . . . . . . 28

iv
Abstract

This report focuses on the modeling as well as model based fault diagnosis of a well
known cart Pole System also known as Inverted Pendulum. The system is highly
Nonlinear in nature. The model is derived using Euler Lagrangian formulation. The
system has one actuator and three degrees of freedom i.e. input to the DC motors is
the input to the system while the position and velocity (r, ṙ)of the cart and the an-
gular displacement θ of the Pole (lever bar). The Linearized continuous time model
as well as the linearized discrete model can also be found in this report. The lin-
earization is performed using Taylor series approximation. The modeling of Friction
, uncertainties as well as faults in the system can also be found in the report. Fault
detection and diagnosis techniques such as fault detection filter (FDF), Diagnostic
observer (DO), Parity space based fault detection schemes, perfect unknow input
decoupling using unknow input observer,unknown input fault detection filter, un-
known input parity space observer, optimal design using unified approach, threshold
computation, fault isolation and identification.

v
Chapter 1

Modeling and Control of an

Inverted Pendulum

1.1 Introduction
Cart pole system also called Inverted Pendulum System is very famous system used
to demonstrate various control algorithms in control engineering labs. Modeling and
Control of Inverted Pendulum has been attacked by many researchers.See [1],[2] [3]
to list a few. The system is used as a bench mark in Institute of Automatic Con-
trol and Complex System(AKS) for various experiment in Fault detection, Isolation
and Tolerant Control.It is highly nonlinear in nature.In addition to the nonlinear
dynamics, other nonlinearities i.e. static friction and dry friction(Coulomb friction)
are also present in the system. These features makes the system more complex.The
nonlinear model of the system is presented in this report. Euler-Lagrangian based

1
approach is used for the deriving the nonlinear model.The system is then linearized
using Taylor’s series approximation. Moreover modeling for uncertainties, faults are
also presented in the last section.
This system consists of a cart which can move horizontally along a metal guiding
bar as show in figure 1. An aluminum rod with a cylindrical weight is fixed to the
cart by an axis.The cart is connected by a transmission belt to a drive wheel. The
wheel is driven by a current controlled direct current motor which delivers a torque
proportional to the acting control voltage us such that the cart is accelerated. this
is shown in figure (1.1) The system is three degree of freedom having the following
outputs.

• The position of the cart(r) is measured by means of circular coil potentiometer


which is fixed to the driving shaft of the motor.

• The velocity of the cart (ṙ) by means of the taco-generator which is also fixed
to the motor.

• The angle of the pendulum (θ) rod by means of a layer potentiometer which is
fixed to the pivot of the pendulum

There are two types of uncertainties and errors present in the system.

• the modeling errors. No matter how much care is taken in driving the mathe-
matical model of the system, still there is a possibility of model-plant-mismatch
(MPM)

• the potentiometer always having errors in rounding the digits

2
y
7 P(x(R),y(R)
r(t)

9
4 8
2

Ø
6
1 x
l ge
i put
vota
u=n

3 5

y
P(x(R),y(R))

R
R cos

x
R sin

Figure 1.1: Schematic of the Inverted Pendulum

3
1.2 Nonlinear Modeling
In this section we present the nonlinear model of the Inverted Pendulum. Euler
Lagrangian based approach has been used to model the system. The idea using
Euler Lagrangian is taken from [4],[5] and the references there in. Let us consider a
point P (R) : (x(R), y(R)) parameterized by the distance R from the point of rotation
on the lever bar as in figure 1. The coordinates of the point are given as follows

x (R) = R sin (θ)


(1.1)
y (R) = R cos (θ)
since the pendulum is mounted on the cart which is moving in horizontal direction.
so the point x(R) can be defined as x(R) = r + R sin(θ) where r is the displacement
of the cart.
x (R) = r + R sin (θ)

The velocity in horizontal as well as in the vertical direction for the lever bar is

vx (R) = ṙ + R cos (θ) θ̇


(1.2)
vy (R) = −R sin (θ) θ̇
The over all velocity of the point P (R) is given by

v 2 (R) = vx2 (R) + vy2 (R)

= r2 + R2 θ˙2 + 2rθR cos(θ) (1.3)

1.2.1 Energy Equations

The Kinetic and Potential Energy of a system are derived from

K1 = 12 v 2 (R)dm(R)
R

R
l (1.4)
V = g y(R)dm(R)

4
where K is the Kinetic Energy,V is the Potential Energy and g is the acceleration
due to gravity. Inserting the respective values from (3) and (4) in (5) and we get the
expression for kinetic and potential energies of the lever bar.
1
Z
K1 = (θ2 + R2 θ˙2 + 2rθR cos(θ))dm(R)
2
l
1
= (m2 r2 + JL θ˙2 + m2 lc2 r2 + m2 lc rθ cos θ) (1.5)
2

Z
V = g (R cos θ)dm(R)

= m2 lc g cos θ (1.6)

R R
where dm (R) = m2 , Rdm (R) = m2 lc and according to the parallel axis theorem
we can define R2 dm(R) = JL + m2 lc2 .m2 is the mass of the lever bar and lc is the
R

centre of gravity of the lever bar. Similarly the KE for the cart is given by
1
Kc = m1 r2 (1.7)
2
The KE of the system including cart and the pendulum is

K = Kl + Kc
1 1
= (m2 r2 + JL θ̇2 + m2 lc2 r2 ) + m2 lc ṙθ̇ cos θ + m1 θ2
2 2
1 2 1 2 2
= (m1 + m2 )r + (Jl + m2 lc )θ̇ + m2 lc ṙθ̇ cos θ
2 2
(1.8)

and the potential energy is

V = Vl + Vc

= m2 lc g sin θ (1.9)

5
1.2.2 Equations of Motion

We will use Euler-Lagrange equations of motion to drive equation of motion in x = r


and θ direction. The Lagrangian can be defined as

L=K −V (1.10)

the equation of motion based on Lagrangian formulation can be given as


d ∂L ∂L
− = Fr
dt ∂ ṙ ∂r
d ∂L ∂L
− = Fθ (1.11)
dt ∂ θ̇ ∂θ
Inserting (1.8)and (1.9) in (1.10) and (1.10)in (1.11), we have the following dynamical
equation for the cart pole system.

(m1 + m2 )r̈ + m2 lc θ̈ cos θ − m2 lc sin θq22 = F

m2 lc cos θr̈ + (Jl + m2 lc2 )θ̈ − m2 lc gsin θ = 0 (1.12)

The model presented in equation (1.12) is a nominal model of the cart pole system.
It can be expressed in more compact form as
   
r̈ ṙ
D(r, θ)   + C(r, θ, ṙ, θ̇)   + G(r, θ) = τ (1.13)
θ̈ θ

where

   
m1 + m2 m2 lc cos θ 0 m2 lc sin θθ̇
D(r, θ) =  , C(r, θ, ṙ, θ̇) =  
m2 lc cos θ Jl + m2 lc2 0 0
 
0
G(r, θ) =   (1.14)
m2 lc g sin θ

Here D is called Inertia matrix, C is Coriolis Matrix and G is gravity matrix.

6
1.2.3 Modeling of Friction

It is worth noting that there exist some sort of errors in the system as discussed in
section [1.1]. Friction is one of the most unwanted terms in the system. One should
always aim to minimize or even to eliminate it.There are two types of frictions may
exits in the system. These are Coulomb Friction and static friction. These can be
defined as
Fc = −|Fc |.sign(r)

and the static friction can be defined as



 −µF f or r = 0
n
FHR =
 0 f or r 6= 0

Similarly the friction occurred during the rotation of the lever bar at the pivot
point can also be modeled as
∂θ
θf r = C
∂t
If we denote the overall friction force by Ff r = Kr ∂r
∂t
= Kr ṙ and θf r = C θ̇. These
factors can be inserted (1.12) The system with the friction is give as

(m1 + m2 )r̈ + (m2 lc cos θ)θ̈ − m2 lc θ̇2 sin θ + Kr ṙ = F

(m2 lc cos θ)r̈ + (Jl + m2 lc2 )θ̈ − m2 lc gsin θ + C θ̇ = 0 (1.15)

1.3 State Space Model and Transfer Function of

the System
In this section we present the state space model of the system in the nonlinear and
linear form. Then we present the transfer function of the system.

7
1.3.1 Nonlinear State Space Model

The system in (1.15) can be written in state space form as follows

dr dθ
= ṙ, = θ̇
dt dt

   
dṙ 2
dt
F + m2 lc θ sin θ − Kr ṙ
   
 = D−1  (1.16)
   
 
   
dθ̇
dt
m2 lc gsin θ + C θ̇

Let us consider the following manipulation of the state vector,

x = col(x1 , x2 , x3 , x4 ) = col(r, θ, ṙ, θ̇)

and the input signal is u = F .


After doing the above manipulation we can get the following nonlinear state space
representation of the system

x˙1 = x3

x˙2 = x4
J(u − Kr x3 + αx24 sin x2 ) − α cos x2 (αg sin x2 − Cx4 )
x˙3 =
|D|
−αg cos x4 (u − Kr x3 + αx24 sin x2 ) − M (αg sin x2 − Cx4 )
x˙4 = (1.17)
|D|

Where α = m22 lc2 ,M = m1 + m2 and J = Jl + m2 lc2 .|D| = M J − α2 cos2 x2 . The


system in (1.17) can also be written in the following formate

8
x˙1 = x3

x˙2 = x4

x˙3 = β(x2 ) a32 sin x2 cos x2 + a33 x3 + a34 x4 cos x2 + a35 x24 sin x2 + b3 u


x˙4 = β(x2 ) a42 sin x2 + a43 x3 cos x2 + a44 x4 x4 + a45 x24 cos x2 sin x2 + b4 u cos x2


(1.18)

The more compact representation of is given as follows

ẋ = f (x) + g(x)u, y = h(x) (1.19)

Here
 
x3
 
x4
 
 
f (x) =  
 β(x2 ) (a32 sin x2 cos x2 + a33 x3 + a34 x4 cos x2 + a35 x24 sin x2 )
 

 
β(x2 ) (a42 sin x2 + a43 x3 cos x2 + a44 x4 − a45 x24 cos x2 sin x2 )

 
0  
  1 0 0 0
0
   
 
g(x) =  , h(x) =  0 1 0 0 
 
b3
   
 
  0 0 1 0
b4 cos x4

9
Where

1 1 N2
β(x2 ) = = = (1 − 2
sin x2 )−1 ,
|D| M J − alpha2 cos2 x2 N01
N2 θ
a32 = − 2 g = −α2 g, a33 = − 2 Fr = −JFr , (1.20)
N01 N01
2
N θC
a34 = 2 C = Cα, a35 = − 2 g = Jα,
N01 N01
θ MN
u3 = − 2 = Ja42 = 2 g = M gα,
N01 N01
Fr N MC
a43 = − 2 = −Fr α, a44 = − 2 = −M C,
N01 N01
2
N N
a45 = 2 = −α2 u4 = − 2 = −α
N01 N01

1.3.2 Linearized State Space Model

The system can be linearized using taylor series expansion around the equilibrium
point. The system has infinity equilibrium points. θ = 0, 2nπ is unstable equilibrium
point while θ = (2n − 1)π is stable equilibrium points. where n is an integer.
∂f ∂f
Computing ∂x
and ∂u
and evolving the terms at x0 = (1, 0, 0, 0), we have.


∂f

∂x =A
(1,0,0,0)

and
∂f

∂u =B
(1,0,0,0)

The linearized model can then be obtained as

ẋ = Āx + B̄u (1.21)

y = C̄x (1.22)

10
where
   
0 0 1 0 0
   
 0 0 0 1 0
   
  
A= , B =  ,
 0 −0.8809 −1.9148 0.0056  0.3088 
   

   
0 21.4745 3.8498 −0.1362 0.6209
 
1 0 0 0
 
C= 0 1 0 0 
 
 
0 0 1 0

The linearized Continuous time system with the matrices A, B, C, D mentioned


above is give as

ẋ(t) = Ax(t) + Bu(t) (1.23)

y(t) = Cx(t) + Du(t) (1.24)

As we know that the system is equipped with three sensors, which measures the posi-
tion of the cart, the velocity of the cart and the angle of the pendulum. The angular
velocity of the pendulum is observed by the state observer. Since all the sensors are
measuring the above mentioned quantities in terms of the voltages. It is necessary
to normalize the system with respect to electrical quantities. The normalization can
be done using the transformation give below.

xn = N x, u = K f us , yn = N y (1.25)

using some simple algebraic manipulation, we can get the following

An = N AN − 1, Bn = N BKf (1.26)

11
where  
n 0 0 0
 11 
 0 n22 0 0
 

N = 
 0 0 n33 0
 

 
0 0 0 n33
The elements n11 to n33 are identical to the factors relating the electrical to me-
chanical quantities.Since the the angular velocity n44 can not be measured directly,
it is possible to assign some arbitrary value to n44 . This value can be exceeded the
maximum voltage of the D/A converter. Let us choose the value n44 = n22 . The
values of the parameters used in the above equations can be found in table (1.1).
The normalized model of the system can then be given as follows

x˙n (t) = An xn (t) + Bn us (t) (1.27)

where
   
0 0 −1.95 0 0
   
 0 0 0 1.0 0
   
  
An =  , Bn =  
 0 −0.12864 −1.9148 −0.0082  −6.1343 
   

   
0 21.4745 26.31 −0.1362 84.303

For the analysis in the latter chapter the normalized model of the system will be
used. Similarly the discrete model of the system can be obtained using the zero
order hold method of discretization with a sampling rate T = 0.03

x(k + 1) = Ad x(k) + Bd u(k) (1.28)

y(k) = Cd x(k) + Dd u(k) (1.29)

12
   
1 0.0001125 −0.05685 8.174e − 006 0.005288
   
 0 1.01 0.01162 0.03003  0.03723 
   

Ad =  , Bd =  
 0 −0.00384 0.9441 −0.0002962  −0.1792 
   

   
0 0.6434 0.768 1.005 2.461

The linear mathematical model is valid for the following condition.

• A limitation of the control force F . The linearity of the servo amplifier is


guaranteed on for a control force satisfying |F | ≤ 20N

• A limitation of the guiding bar. it is |r| ≤ 0.5m

• A limitation of the angle θ, |θ| ≤ 10◦

1.3.3 Transfer Function of the System

Since the system has three outputs and one input,we can get three transfer functions.
i.e Transfer function from input voltage to Position of the cart Gpc u . Transfer function
from input voltage to velocity of the cart Gvc u and Transfer function from input
voltage to Position of the lever bar.Gpp u These can be defined as follows

1.776 × 10−015 s3 − 0.6022s2 − 0.09194s + 12.78


Gpc u (s) =
s4 + 2.051s3 − 21s2 − 37.74s
2
−0.6022s − 0.09194s + 12.78
= 4 (1.30)
s + 2.051s3 − 21s2 − 37.74s

3.997 × 10−015 s3 − 0.6203s2 + 6.937s


Gpp u (s) =
s4 + 2.051s3 − 21s2 − 37.74s
−0.6203s2 + 6.937s
= 4 (1.31)
s + 2.051s3 − 21s2 − 37.74s

13
0.3088s3 + 0.04715s2 − 6.551s
Gvc u (s) = (1.32)
s4 + 2.051s3 − 21s2 − 37.74s
The overall system transfer function can be written as can

y(s) = G(s)u(s) (1.33)

where G(s) = col(Gpc u (s), Gpp u (s), Gvc u (s) and y = col(y1 (s), y2 (s), y3 (s)).

1.4 Coprime Factorization Techniques


The Coprime factorization of system gives the two stable transfer functions which
are coprime. These techniques are extensively used for the parameterization of the
controllers in robust control theory and parameterization of residual generators in
robust fault detection and isolation theory. We can define the coprime factorization
as follows.

Definition 1.4.1. Two transfer matrices Mˆ(s), Nˆ(s) in ℜH∞ are called left coprime

over ℜH∞ if there exist two transfer matrices X̂(s) and Ŷ (s) in ℜH∞ such that
 
  X̂(s)
 
M̂ (s) N̂ (s)  =I (1.34)
 
ˆ
Y (s)

Similarly, two transfer matrices M (s), N (s) in ℜH∞ are called right coprime over

ℜH∞ if there exist two transfer matrices X(s) and Y (s) in ℜH∞ such that
 
  M (s)
 
X(s) Y (s)  =I (1.35)
 
N (s)

14
Let G(s) be a proper real-rational transfer matrix. The so-called left coprime
factorization (LCF) of G(p) is a factorization of G(p) into two stable and coprime
matrices which will play a key role in designing residual generators. The following
lemma (1.4.1) can be used in order to determine the left and right coprime factor-
ization.

Lemma 1.4.1. Suppose G(s) is a proper real-rational transfer matrix with state

space realization (A, B, C, D), and it is stabilizable and detectable. Let F and L be

so that A + BF and A − LC are both stable, and define

M̂ (s) = (A − LC, −L, C, I), N̂ (s) = (A − LC, B − LD, C, D) (1.36)

M (s) = (A + BF, B, F, I), N (s) = (A + BF, B, C + DF, D) (1.37)

ˆ = (A + BF, L, C + DF, I), Y ˆ(s) = (A + BF, −L, F, 0)


X(s) (1.38)

X(s) = (A − LC, −(B − LD), F, I), Y (s) = (A − LC, −L, F, 0) (1.39)

Then

G(s) = M̂ −1 (s)N̂ (s) = N (s)M −1 (s) (1.40)

are LCF and RCF, respectively. Moreover, the so-called Bezout identity given below

is satisfied
    
 X(s) Y (s)   M (s) −Y ˆ(s)   I 0 
  =  (1.41)
    
−N̂ (s) M̂ (s) ˆ
N (s) X(s) 0 I

15
The matrices for the state space representation of (1.36)-(1.39) are determined
and are given as follows.
 
6.9983 −0.0025 −1.9544
 
 −0.2552 13.7523 −13.2474
h i  

F = −2.1000 2.2151 3.8604 0.4819 , L =  
 −0.4027 0.0192 11.9981
 

 
3.5602 64.3490 −158.1113
(1.42)
 
−6.9983 0.0025 0.0044 0
 
 0.2552 −13.7523 13.2474 1.0000
 

Al = A − LC =   (1.43)
 0.4027 −0.1478 −13.9131 −0.0082
 

 
−3.5602 −42.8760 184.4213 −0.1362
 
0 0 −1.9500 0
 
0 0 0 1.0000
 
 
Ak = A + BF =   (1.44)
 −12.8822 13.4594 21.7659 2.9482
 

 
177.0393 −165.2652 −299.1340 −40.7659
Bl = B − LD = B and Ck = C + DF = C similarly I is an identity matrix of order
3 × 3 and 0 is of order 1 × 3.

1.5 Representation of Process model with model

Uncertainties
Model uncertainty refers to the difference between the process model and the reality.
This difference in our system is coming from two reasons. One reasons is obvious

16
i.e. the exact system behavior and the nonlinear model behavior. The second rea-
son is that we are using linearized model of the system which further enhances the
uncertainty. The general representation of state space model by considering the
disturbances is as follows

ẋ = Āx + B̄u + Ēd d, y = C̄x + D̄u + F̄d d (1.45)

(1.46)

Similarly the state space model of the uncertain system is as follows

ẋ = (A + ∆A)x + (B + ∆B)u + (Ed + ∆Ed )d (1.47)

y = (C + ∆C)x + (D + ∆D)u + (Fd + ∆Fd )d (1.48)

where Ed and Fd are constant matrices and d is the vector representing the process
disturbance or measurement noise. This may be stochastic or deterministic. We
have model uncertainties in our system in the 3rd and 4th row of matrices A and B
in (1.21). These uncertainties can be represented as follows
   
0 0 1 0 0
   
 0 0 0 1 0 
   
 
∆A =   ∆B =   (1.49)
 0 ∆a32 ∆a33 ∆a34  ∆b3 
  

   
0 ∆a42 ∆a43 ∆a44 ∆b4

The uncertainties considered here are assumed to be norm bounded uncertainty.


Since the operation domain of the systen is that θ ≤ 10◦ , r ≤ 0.5 and F ≤ 20N .
There for the parameters of the system may change at θ = ±10◦ . The system
parameters are calculated at the θ = ±10◦ and the following bounds for deviations
are computed.

0 ≤ ∆a32 ≤ 0.2488, 0 ≤ ∆a33 ≤ 0.0053, −0.001 ≤ ∆a34 ≤ 0,

17
−3.022 ≤ ∆a42 ≤ 0, − 0.07 ≤ ∆a43 ≤ 0, 0 ≤ ∆a44 ≤ 0.0004

Similarly the uncertainties in the system B matrix are

−0.0008 ≤ ∆b3 ≤ 0 0 ≤ ∆b4 ≤ 0.0111

It is of utmost importance that we should determine the upper bound for the uncer-
tainty with the above ranges. For this let us consider the uncertain model given in
(1.47), where the terms ∆A,∆B and ∆Ed are the uncertainties in A,B and Ed. Put
Ed = B, Then the ∆Ed = ∆B. Let us assume that the uncertainty in the system
(1.47) is a norm bounded, there fore we can use the following form
h i h i
∆A ∆B ∆Ed = E∆(t) G H J (1.50)

where E, G, H, J are known matrices with appropriate dimensions and can be given
as follows.
 
0 0    
  0 1 0 0 0
 0 0 
     
E= , G =  0 0 1 0 ,H = J = 3.2  and
  
  
 1 0 
     
  0 0 0 1 0
0 1
 
∆a32 ∆a33 ∆a34
∆(t) =  
∆a42 ∆a43 ∆a44
and is bounded by σ ≤ δ∆ .where δ∆ is the maximum singular value and strongly
depends on the variation of θ. We have computed the maximum singular value of
the uncertainty matrix for different variation of θ. It can be seen in tables (1.2)-
(1.5). In practice the angle θ can be varied in between ±5◦ . So we can consider the
uncertainty given in (1.4). Using the information given in (1.4), it can be concluded
that σ ≤ 1.7221.

18
1.6 Modeling of Faults and Disturbances
Since the system has three sensors and one actuators there fore we can expect faults
in the sensors and faults in the actuator. Consider the system (1.27) with the faults
and disturbances as follows

ẋ = Ax + Bu + Ed d + Ef f (1.51)

y = Cx + Du + Fd d + Ff f (1.52)

where Ef , Ff are constant matrices showing the occurrence of faults. In case of faults
these matrices are nonzero. The fault vector can be defined as

f = col(uf , yf 1 , yf 2 , yf 3 )

where uf and yf represents the actuator and sensor faults respectively. Similarly the
fault coupling matrix to the process Ef can be defined as
 
0 0 0 0
 
0 0 0 0 
 

Ef = (B, 03×3 ) =  
 0.30882 0 0 0 
 
 
−0.62032 0 0 0

The first column of Ef matrix has been defined as B, because any actuator faults
occur in the input channel. The fault coupling matrix to the output can be defined
as  
0 1 0 0
 
Ff =  0 0 1 0 
 
 
0 0 0 1
and the transfer function Gyf can be defined as

Gyf (s) = C(sI − A)−1 Ef + Ff (1.53)

19
The following possibilities are there.

• There is actuator fault and no sensor faults

1.776 × 10−015 s3 − 0.6022s2 − 0.09194s + 12.78


Gf 11 = (1.54)
s4 + 2.051s3 − 21s2 − 37.74s
−0.6022s2 − 0.09194s + 12.78
= (1.55)
s4 + 2.051s3 − 21s2 − 37.74s
3.997 × 10−015 s3 − 0.6203s2 + 6.937s
Gf 21 = (1.56)
s4 + 2.051s3 − 21s2 − 37.74s
−0.6203s2 + 6.937s
= (1.57)
s4 + 2.051s3 − 21s2 − 37.74s
0.3088s3 + 0.04715s2 − 6.551s
Gf 31 = (1.58)
s4 + 2.051s3 − 21s2 − 37.74s

• There is no actuator fault while sensor no 1 is faulty

Gf 12 = 1, Gf 22 = 0, Gf 32 = 0, (1.59)

• There is no actuator fault while sensor no 2 is faulty

Gf 13 = 0, Gf 23 = 1, Gf 33 = 0, (1.60)

• There is no actuator fault while sensor no 3 is faulty

Gf 14 = 0, Gf 24 = 0, Gf 34 = 1, (1.61)

The overall Fault Transfer function matrix can be given as follows


 
G Gf 12 Gf 13 Gf 14
 f 11 
Gyf (s) =  Gf 21 Gf 22 Gf 23 Gf 24  (1.62)
 
 
Gf 31 Gf 32 Gf 33 Gf 34

20
Where the elements of matrix Gyf are defined in (1.54)-(1.61) Similarly for the dis-
turbances, let us assume that Ed = B, F d = D, the disturbance transfer function
matrix can be given as

1.776 × 10−015 s3 − 0.6022s2 − 0.09194s + 12.78


Gy1d = (1.63)
s4 + 2.051s3 − 21s2 − 37.74s
−0.6022s2 − 0.09194s + 12.78
= (1.64)
s4 + 2.051s3 − 21s2 − 37.74s
3.997 × 10−015 s3 − 0.6203s2 + 6.937s
Gy2d = (1.65)
s4 + 2.051s3 − 21s2 − 37.74s
−0.6203s2 + 6.937s
= (1.66)
s4 + 2.051s3 − 21s2 − 37.74s
0.3088s3 + 0.04715s2 − 6.551s
Gy3d = (1.67)
s4 + 2.051s3 − 21s2 − 37.74s

So we can write the above transfer functions as follows

Gyd = col(Gy1d , Gy2d , Gy3d ) (1.68)

1.7 Observer Based Controller Design


In this section the state feedback controllers in both continuous as well as discrete
time are attacked. We first design an observer based state back controller for con-
tinuous time. Then we design the same controllers but for the discrete time system
given in section 1.3.2.

21
1.7.1 Observer Based State Feedback Controller for Contin-

uous Time System

In the section we can describe the two cases for the observer based Controller for
Inverted Pendulum. These are

• Full Order Observer Based Controller


In this case we consider the full order observer based controller. We estimated
all the states of the Inverted Pendulum with assumption that all the sensors
present in the system have noisy outputs.

• Reduced Order Observer Based Controller


In this case perfect measurement are assumed. Since there are three sensors in
the plant, there for we have estimated on output of the plant i.e. the angular
velocity of the pole.

Full Order Observer Based Control

An Observer based state feedback controller with a disturbance compensator is de-


signed. Since as the name indicates it consists of an Observer as well as controller.
An Observer The state and disturbance observer can be written as follows.
    
ẋˆ A Ed x̂
 =   (1.69)
dˆ˙ 0 0 dˆ

It delivers an estimate for x and d.


A state feedback Controller with a disturbance compensator

u = −K x̂ + dˆ + V ω (1.70)

22
where the state feedback gain matrix is given in (1.71).
h i
K= −2.1000 2.2151 3.8604 0.4819 . (1.71)

The state feed back controller is designed such that the closed loop poles are placed
at s1 = −4.0, s2 = −4.5, s3 = −5.0, s4 = −5.5. Similarly the observer gain matrix
(1.72) for the disturbance compensation is designed aiming the closed loop poles are
at s1 = −6.0, s2 = −6.5, s3 = −7.0, s4 = −7.5, s5 = −7.8.
 
6.9983 −0.0025 −1.9544
 
   −0.2552 13.7523 −13.2474
 

L1  
Ldist = =  −0.4027 0.0192 11.9981 (1.72)
   

L2  
 3.5602 64.3490 −158.1113
 

 
0.4596 −0.2586 −7.7164

The observer gain L1 = L in (1.72) is used in Left Coprime factorization mentioned


in (1.4). Similarly the prefilter is designed and its value is found to be V = −2.1.

23
Table 1.1: Definition and Numerical Values of the system parameters.

Constant Numerical value Unit

Kr 2.6 N/V

n11 14.9 V /m

n22 -52.27 V /rad

n33 -7.64 V s/m

n44 -52.27 V s/rad

M0 3.2 Kg

M1 0.329 Kg

M 3.529 Kg

ls 0.44 m

JL 0.072 Kgm2

N 0.1446 Kgm

2
N01 0.23315 Kg 2 m2

N 2 /N01
2
0.0897

Fr 6.2 Kg/s

C 0.009 Kgm2 /s

24
Table 1.2: Distribution of maximum sing value for θ = ±10◦

❅ θ̇
❅ 0 0.02 0.04 0.06 0.08 0.1

ṙ ❅

0 3.0331 3.0332 3.0334 3.0336 3.0340 3.0344

0.1 3.1115 3.1115 3.1115 3.1116 3.1117 3.1120

0.2 3.1900 3.1899 3.1899 3.1900 3.1902 3.1904

0.3 3.2684 3.2684 3.2684 3.2685 3.2687 3.2689

0.4 3.3469 3.3468 3.3469 3.3470 3.3471 3.3473

0.5 3.4254 3.4253 3.4253 3.4254 3.4256 3.4258

0.6 3.5038 3.5038 3.5038 3.5039 3.5040 3.5043

0.7 3.5823 3.5822 3.5823 3.5824 3.5825 3.5827

0.8 3.6608 3.6607 3.6607 3.6608 3.6610 3.6612

25
Table 1.3: Distribution of maximum sing value for θ = ±6◦

❅ θ̇
❅ 0 0.02 0.04 0.06 0.08 0.1

ṙ ❅

0.0 1.7133 1.7134 1.7136 1.7138 1.7141 1.7145

0.1 1.7608 1.7608 1.7608 1.7610 1.7612 1.7614

0.2 1.8083 1.8083 1.8083 1.8084 1.8086 1.8089

0.3 1.8557 1.8557 1.8558 1.8559 1.8561 1.8564

0.4 1.9032 1.9032 1.9033 1.9034 1.9036 1.9039

0.5 1.9507 1.9507 1.9507 1.9509 1.9511 1.9513

0.6 1.9982 1.9981 1.9982 1.9983 1.9985 1.9988

0.7 2.0456 2.0456 2.0457 2.0458 2.0460 2.0463

0.8 2.0931 2.0931 2.0932 2.0933 2.0935 2.0938

26
Table 1.4: Distribution of maximum sing value for θ = ±5◦

❅ θ̇
❅ 0 0.02 0.04 0.06 0.08 0.1

ṙ ❅

0.0 1.4045 1.4046 1.4047 1.4049 1.4052 1.4056

0.1 1.4441 1.4441 1.4442 1.4443 1.4445 1.4448

0.2 1.4837 1.4837 1.4838 1.4839 1.4841 1.4844

0.3 1.5233 1.5233 1.5234 1.5235 1.5237 1.5240

0.4 1.5630 1.5629 1.5630 1.5632 1.5634 1.5637

0.5 1.6026 1.6026 1.6026 1.6028 1.6030 1.6033

0.6 1.6422 1.6422 1.6422 1.6424 1.6426 1.6429

0.7 1.6818 1.6818 1.6819 1.6820 1.6822 1.6825

0.8 1.7214 1.7214 1.7215 1.7216 1.7218 1.7221

27
Table 1.5: Distribution of maximum sing value for θ = ±3◦

❅ θ̇
❅ 0 0.02 0.04 0.06 0.08 0.1

ṙ ❅

0.0 0.8140 0.8141 0.8142 0.8144 0.8147 0.8151

0.1 0.8378 0.8378 0.8379 0.8381 0.8383 0.8386

0.2 0.8617 0.8617 0.8618 0.8619 0.8621 0.8625

0.3 0.8855 0.8855 0.8856 0.8857 0.8860 0.8863

0.4 0.9093 0.9093 0.9094 0.9096 0.9098 0.9101

0.5 0.9331 0.9331 0.9332 0.9334 0.9336 0.9339

0.6 0.9569 0.9570 0.9570 0.9572 0.9574 0.9577

0.7 0.9808 0.9808 0.9809 0.9810 0.9813 0.9816

0.8 1.0046 1.0046 1.0047 1.0048 1.0051 1.0054

28
Chapter 2

Conclusion and Future Work

Modeling of an inverted pendulum along with the friction as well as fault modeling
has been presented. It is a nonlinear system and can be used for implementation of
various control algorithms in control engineering lab. Important concepts of fault
detection and isolation (FDI) scheme such as fault detectability, fault isolability and
fault identifiability with reference to the inverted pendulum has also been presented.
A detailed treatment of Fault detection and isolation schemes has been performed.
The effectiveness of each approach has been exploited using simulation results in
accompnifying figures.

29
Bibliography

[1] D. Angeli, “Almost global stabilization of the inverted pendulum via continuous
state feedback control,” Automatica, vol. 37, Issue 7, pp. 1103–1108, July, 2001.

[2] R.O.Sabre, Nonlinear Control of Underactuated Mechanical System with applica-


tion to Robotics and Aerospace Vehicles. PhD thesis, Department of Electrical
Engineering & Computing Science, MIT, 2001.

[3] C.A.Iba⁀nz, O:G.Frias, and M.S.Casta⁀nón, “Lyapunov based controller for in-
verted pendulum,” Nonlinear Dynamics, vol. 40, pp. 367–374, 2005.

[4] A.Q.Khan and N.Iqbal, “Modeling and design of an optimal regualtor for three
degree of freedom helicopter/twin rotor control system,” Proc. Of IEEE SCON-
EST,Int. Conf. pp. 45-51, Karachi,Pakistan, December, 2004.

[5] A.Q.Khan, “Robust controller design for nonlinear control systems,” Master’s
thesis, DEE, PIEAS, Islamabad, Pakistan, 2004.

30

You might also like