Professional Documents
Culture Documents
CS CHP 3-4 Combine
CS CHP 3-4 Combine
2
Introduction
The classical control theory and methods (such as root locus) that we
have been using in class to date are based on a simple input-output
description of the plant, usually expressed as a transfer function. These
methods do not use any knowledge of the interior structure of the
plant, and limit us to single-input single-output (SISO) systems, and as
we have seen allows only limited control of the closed-loop behavior
when feedback control is used.
Modern control theory solves many of the limitations by using a much
“richer” description of the plant dynamics. The so-called state-space
description provide the dynamics as a set of coupled first-order
differential equations in a set of internal variables known as state
variables, together with a set of algebraic equations that combine the
state variables into physical output variables.
3
Definition of System State
u1 (t ) y1 (t )
u2 (t ) Inner state variables y2 (t )
x1 , x2 , xn
ur (t ) y p (t )
𝑥 = 𝑆𝑡𝑎𝑡𝑒 𝑉𝑒𝑐𝑡𝑜𝑟
𝑑 𝑥(𝑡)
𝑥= = 𝐷𝑒𝑟𝑖𝑣𝑎𝑡𝑖𝑣𝑒 𝑜𝑓 𝑡ℎ𝑒 𝑆𝑡𝑎𝑡𝑒 𝑉𝑒𝑐𝑡𝑜𝑟
𝑡
𝑢 = 𝐼𝑛𝑝𝑢𝑡 𝑉𝑒𝑐𝑡𝑜𝑟
𝑦 = 𝑂𝑢𝑡𝑝𝑢𝑡 𝑉𝑒𝑐𝑡𝑜𝑟
𝐴 = 𝑆𝑡𝑎𝑡𝑒 𝑀𝑎𝑡𝑟𝑖𝑥 = 𝑆𝑦𝑠𝑡𝑒𝑚 𝑀𝑎𝑡𝑟𝑖𝑥
𝐵 = 𝐼𝑛𝑝𝑢𝑡 𝑀𝑎𝑡𝑟𝑖𝑥
𝐶 = 𝑂𝑢𝑡𝑝𝑢𝑡 𝑀𝑎𝑡𝑟𝑖𝑥
𝐷 = 𝐹𝑒𝑒𝑑𝑏𝑎𝑐𝑘 𝑚𝑎𝑡𝑟𝑖𝑥
State-Space Equations (Model)
State equation: x (t ) A x(t ) B u (t )
Dynamic equations
Output equation: y (t ) C x(t ) D u (t )
State variable
x1 (t ) u1 (t ) y1 (t ) x1 (0)
x (t ) u (t ) y (t ) x (0)
x(t ) 2 u (t ) 2 y (t ) x(0) 2
2
n n1
x (t ) r r1
u (t ) p p1
y (t ) n n1
x ( 0)
A nn B nr C pn
D pr
6
Block Diagram Representation Of State Space Model
+
+ x (t ) 1 x(t )
u (t ) B C
+
y (t )
- s
7
Input/Output Models vs State-Space Models
State Space Models:
consider the internal behavior of a system
can easily incorporate complicated output variables
have significant computation advantage for computer simulation
can represent multi-input multi-output (MIMO) systems and nonlinear
systems
Input/Output Models:
are conceptually simple
are easily converted to frequency domain transfer functions that are more
intuitive to practicing engineers
are difficult to solve in the time domain (solution: Laplace transformation)
8
Some definitions
System variable: any variable that responds to an input or initial
conditions in a system
State variables: the smallest set of linearly independent system
variables such that the values of the members of the set at time t0
along with known forcing functions completely determine the value of
all system variables for all t ≥ t0
State vector: a vector whose elements are the state variables
State space: the n-dimensional space whose axes are the state variables
State equations: a set of first-order differential equations with b
variables, where the n variables to be solved are the state variables
Output equation: the algebraic equation that expresses the output
variables of a system as linear combination of the state variables and
the inputs.
General State Representation
1. Select a particular subset of all possible system variables, and call
state variables.
2. For nth-order, write n simultaneous, first-order differential equations
in terms of the state variables (state equations).
3. If we know the initial condition of all of the state variables at 𝑡0 as
well as the system input for 𝑡 ≥ 𝑡0 , we can solve the equations
State-Space Representation of nth-Order Systems of Linear
Differential Equations
Consider the following nth-order system:
(𝒏) (𝒏−𝟏)
𝒚 + 𝒂𝟏 𝒚 + … + 𝒂𝒏−𝟏 𝒚 + 𝒂𝒏 𝒚 = 𝒖
where y is the system output and u is the input of the System.
The system is nth-order, then it has n-integrators (State Variables)
Let us define n-State variables
11
State-Space Representation of nth-Order Systems of Linear
Differential Equations (Cont.)
Then the last Equation can be written as
12
State-Space Representation of nth-Order Systems of Linear
Differential Equations (Cont.)
Then, the stat-space state equation is
where
13
State-Space Representation of nth-Order Systems of Linear
Differential Equations (Cont.)
Since, the output equation is
where
14
Example #1
y
K
From the diagram, the system Equation is M f(t)
𝑀𝑦 + 𝐵𝑦 + 𝐾𝑦 = 𝑓(𝑡) B
This system is of second order. This means that the system involves two
integrators (State Variables).
Let us define the state variables
𝑥1 = 𝑦
𝑥2 = 𝑦
Then, we obtain
𝑥1 = 𝑦 = 𝑥2
1 1 −𝐵 𝐾 1
𝑥2 = 𝑦 = −𝐵𝑦 + 𝐾𝑦 − 𝑓 𝑡 = 𝑥2 − 𝑥1 − 𝑓 𝑡
𝑀 𝑀 𝑀 𝑀 𝑀
15
Example #1 (Cont.)
Then, the State Space equation is
0 1 𝑥 0
𝑥1 1
= −𝐾 −𝐵 𝑥 + 1 𝑓(𝑡)
𝑥2 2
𝑀 𝑀 𝑀
The output Equation is
𝑥1
𝑦= 1 0 𝑥
2
The System Block diagram is
16
Example #2 +
R L +
R 1 R R
x1 x1 1 xˆ1 xˆ1 1
1
L L
x L LC x L ei (t ) xˆ L ei (t )
2 0 2 0 xˆ2 L 0
2 0
1
x1 xˆ1
y (t ) 1 0 y (t ) 1 0
x2 xˆ2 17
y2 y1
Example #3 K
M2 M1 f (t )
B3 B2 B1
x1 y1
x1 x1
let x2 y 2
x3 y1 x2 x2 f (t )
x3 x3
x4 y 2
x4 x4
18
Example #4
Find the state space model for a system that described by the following
differential equation
c 9c 26c 24c 24r
Solution:
The system is 3rd order, then it has three states as follows
x1 c x1 x2
differentiation
x2 c x2 x3
x1 0 1 0 x1 0
x 0 0 1 x 0 r
2 2
x3 24 26 9 x3 24
x1
y 1 0 0 x2
x3
State-Space Representations of
Transfer Function Systems
21
State-Space Representation in Canonical Forms
We here consider a system defined by
where u is the control input and y is the output. We can write this
equation as
24
Diagonal Canonical Form
Diagonal Canonical Form greatly simplifies the task of computing the
analytical solution to the response to initial conditions.
We here consider the transfer function system given by (2). We have the
case where the dominator polynomial involves only distinct roots. For
the distinct root case, we can write (2) in the form of
25
Diagonal Canonical Form (Cont.)
The diagonal canonical form of the state-space representation of this
system is given by
26
Example #5
Obtain the state-space representation of the transfer function system
(16) in the controllable canonical form.
27
Example #6
Find the state-space representation of the following transfer function
system (13) in the diagonal canonical form.
28
State Space model to Transfer
Function
29
State Space model to Transfer Function
The state space model
x Ax Bu
y Cx Du
by Laplace transform
sX s AX s BU s X s sI A BU s
1
Y s CX s DU s
Y s C sI A B D U s
1
U s
Example (2)
Find the transfer function from the following transfer function
0 1 0 10
x 0 0 1 x 0 u y 1 0 0 x
1 2 3 0
Solution:
s 1 0
sI A 0 s 1
1 2 s 3
( s 2 3 s 2) s3 1
1 s ( s 3 ) s
adj ( sI A) s ( 2 s 1) s 2
sI A
1
det(sI A) s 3 3s 2 2 s 1
Example (2)
T s C sI A B D
1
( s 2 3s 2) s3 1 10
1 0 0 1 s ( s 3) s
0
s ( 2 s 1) s 2
0
T (s)
s 3 3s 2 2 s 1
10( s 2 3s 2)
T s 3
s 3s 2 2s 1
System Poles from State Space model
poles and check the stability of the following state space Example find the
System model
0 2 5
x x u y 1 0 x
1 3 0
Solution:
s 2
Since sI A
1 s 3
s 2
To find the poles sI A s ( s 3) 2 0
1 s3
34
State-Space Modeling with MATLAB
MATLAB uses the controllable canonical form by default when converting from
a state space model to a transfer function. Referring to the first example
problem, we use MATLAB to create a transfer function model and then convert
it to find the state space model matrices:
35
State-Space Modeling with MATLAB
Note that this does not match the result we obtained in the first example. See
below for further explanation. No we create an LTI state space model of the
system using the matrices found above:
36
State-Space Modeling with MATLAB
we can generate the observable and controllable models as follows:
37
State transition matrix
38
Introduction
d
x(t ) Ax (t ) Bu (t )
dt
y (t ) Cx(t ) Du(t )
39
Homogeneous solution
x (t ) Ax (t ) 1 1
x(t ) L [( sI A) ]x(0)
sX ( s) x(0) AX ( s)
e At x(0)
X ( s) ( sI A) 1 x(0)
1 1
State transition matrix (t ) e L [( sI A) ]
At
x(t0 ) e At 0 x(0)
At 0
x(0) e x(t0 )
At At 0 A ( t t 0 )
x(t ) e e x(t0 ) e x(t0 ) (t t0 ) x(t0 )
40
State Transition Matrix Properties
1 1
(t ) e L [(sI A) ]
At
1. ( 0) I
2. 1 (t ) (t )
3. x(0) (t ) x(t )
4. (t 2 t1 ) (t1 t0 ) (t 2 t0 )
(t ) (kt )
k
5.
41
Non-homogeneous solution
d
x(t ) Ax (t ) Bu (t )
dt
y (t ) Cx(t ) Du(t )
sX ( s) x(0) AX ( s) BU ( s )
( sI A) X ( s) x(0) BU ( s )
1 1
X ( s) ( sI A) x(0) ( sI A) BU ( s )
x(t ) L1[( sI A) 1 ]x(0) L1[( sI A) 1 BU ( s)]
t
x(t ) (t ) x(0) (t ) Bu ( )d Convolution
0
Homogeneous
42
Non-homogeneous solution (Cont.)
t
x(t ) (t ) x(0) (t ) Bu ( )d
0
t
x(t ) (t t0 ) x(t0 ) (t ) Bu ( )d
t0
t
y (t ) C(t t0 ) x(t0 ) C(t ) Bu ( )d Du(t )
t0
43
Example 1
x1 0 1 x1 0
x 2 3 x 1u (t )
2 2
x(0) 0 0 u (t ) unit step
T
let
2e t
e 2t
e 1 e 2t
(t ) L1[(sI A) 1 ] e At t 2t t 2t
2 e 2 e e 2e
t
x(t ) (t ) x(0) (t ) Bu( )d
0
x1 e t e 2t
1 1
Ans: x 2 2 L1[(sI A) 1 BU (s)]
2 e t e 2t
44
How to find State transition matrix
(t ) e At L1[(sI A) 1 ]
Methode 2: (t ) e At
45
1 1
Method 1: (t ) L [(sI A) ]
x1 0 1 0 x1 0 0
x 0 4 3 x 1 0 u1
2 2 u
x3 1 1 2 x3 0 1 2
x1
y1 (t ) 1 0 0
y (t ) 0 0 1 x2
2 x
3
s 2 6 s 11 s 2 3
1 adj ( sI A) 1
( sI A) 3 s 2
2
3s
sI A s ( s 4)( s 2) 3 3s
s4 s 1 s 2
4 s
46
Method 2: (t ) e At
e t 0 0
(t ) e 0
At
e 2t 0
0 0 3t
e
47
Diagonization
1 1 v1 v1 1
(2 I A)V2 0
3 3 v2 v2 1
1 1 3 0
P V1 V2
1
P AP
3 1 0 1
50
In the case of A matrix is phase-variable form and
1 2 3 n
1 1 1
P v1 v2 vn 1 n
2 Vandermonde matrix
for phase-variable form
n 1 n 1
1 n 1
2 n
1
2
1
P AP
3
4
t 1
e Pe P
At
51
Case 2: i distinct
1 0 1 1 0 1
A 0 1 0 I A 0 1 0 ( 1)( 1)( 2)
0 0 2 0 0 2
1 2 0 0 1 v1
(1 I A)V1 0 0 0 v2 0 depend
v1 1 v1 0
0v1 0v2 v3 0 v2 0 0v1 0v2 v3 0 v2 1
v3 0 v3 0
V1 V2
52
3 2 1 0 1 v1
(3 I A)V3 0 1 0 v2 0
0 0 0 v3
v1 1
v1 0v2 v3 0 v2 0
v3 1
1 0 1 1 0 0
P V1 V2 V3 0 1 0 P 1 AP 0 1 0
0 0 1 0 0 2
53
Case 3: i distinct Jordan form
1 2 3
P v1 v2 v3 P AP Jordan
1
form
Generalized eigenvectors
3 1 3 1
A ( 2) 2
1 1 1 1
1 1 v11 v11 1
(1 I A)V1 0
1 1 v12 v12 1
1 1 v21 1 v21 1
(1 I A)V2
1 1 v22 1 v22 0
1 1 2 1
P V1 V2
1 ˆ
P AP A
1 0 0 2
e 2t
Aˆ t te 2t Aˆ t 1
e 2t
e Pe P
At
e
55
Method 3:
56
An an 1 An 1 a1 A a0 I 0
An an 1 An 1 a1 A a0 I
An 1 an 1 An a1 A2 a0 A
an 1 (an 1 An 1 a1 A a0 I ) a1 A2 a0 A
any
f ( A) k0 I k1 A k2 A2 kn An
f ( A) 0 I 1 A 2 A n 1 A
2 n 1
n 1
k 0
k A k
57
Example: 1 2
A 100
? A
0 1
let f ( A) A100 0 I 1 A
1 2
( 1)( 2) 0 , 1 1, 2 2
0 2
f (1 ) 1
100
0 11 1100
0 2 2100
f (2 ) 2
100
0 12 2 100
1 2100 1
1 0 1 2 1 2101
2
f ( A) A (2 2 )
100 100
(2 1)
100
0 1 0 1 0 1
58
Example: 3 1
e ?
At
A
2 0
3 1
0 , 1 1, 2 2
2
t 2t 1 0 2t t 3 1
e 2e e
At
0 1 ( e e ) 2
0
2e 2t e t e 2 t e t
2t t 2t t
2e 2e e 2e
59
60
61
62
linear system by Meiling CHEN 63
linear system by Meiling CHEN 64
linear system by Meiling CHEN 65
Controllability and Observability
66
Introduction
The main objective of using state-space equations to model systems is
the design of suitable compensation schemes to control these systems.
Typically, the control signal u(t) is a function of several measurable
state variables. Thus, a state variable controller, that operates on the
measurable information is developed.
State variable controller design is typically comprised of three steps:
Assume that all the state variables are measurable and use them to design a
full-state feedback control law. In practice, only certain states or
combination of them can be measured and provided as system outputs.
An observer is constructed to estimate the states that are not directly
sensed and available as outputs. Reduced-order observers take advantage of
the fact that certain states are already available as outputs and they don’t
need to be estimated.
Appropriately connecting the observer to the full-state feedback control law
yields a state-variable controller, or compensator. 67
Introduction
a given transfer function G(s) can be realized using infinitely many
state-space models
certain properties make some realizations preferable to others
one such property is controllability
68
Motivation1: Controllability
x1 2 1 x1 1
x 0 1 x 0 u (t )
2 2
x1
y 1 0
x2
x2 (0) x1 (0)
uncontrollable s s
u x 2 s 1 x2 1 x1 s 1 x1 1 y
1 2
1
controllable
69
Controllability and Observability
Plant:
x Ax Bu , x R n
y Cx Du
Definition of Controllability
70
Controllability Matrix
Consider a single-input system (u ∈ R):
Here,
72
Controllability Matrix
det(U ) 0 if u R
Controllability Matrix U B AB A2 B An1B
Example: An Uncontrollable System
U (s) 1 s -1 x1
1 0 1
x x u 1
0 3 0 1
Y (s)
y 1 2x -1 x2 2
s
※ State x2 is uncontrollable. 3
73
Proof of controllability matrix
xk 1 Axk Buk
xk 2 Axk 1 Buk 1
xk 2 A( Axk Buk ) Buk 1 A2 xk ABuk Buk 1
xk n An xk An 1 Buk An 2 Buk 1 ABuk ( n 2 ) Buk ( n 1)
xk n An xk An 1 Buk An 2 Buk 1 ABuk ( n 2 ) Buk ( n 1)
uk
xk n An xk An 1 B AB B
uk ( n 2 )
uk ( n 1)
Initial condition
74
Motivation2: Observability
x1 2 0 x1 3
x 0 1 x 1 u (t )
2 2
x1
y 1 0
x2
x2 (0) x1 (0)
s s
u 1 x 2 s 1 x2 x1 s 1 x1 1 y
1 2
3
observable
unobservable
75
Controllability and Observability
Plant:
x Ax Bu , x R n
y Cx Du
Definition of Observability
76
Observability Matrix
A, C Observable rank (V ) n det(V ) 0 if y R
C
CA
Observability M atrix V CA
2
CAn 1
0 1 0
x x u U (s) 1 s -1 x2 s -1 x1 Y (s)
0 2 1
y 0 4x 2
※ State x1 is unobservable.
77
Proof of observability matrix
xk 1 Ax k Bu k
yk Cxk Duk (1)
yk 1 Cxk 1 Duk 1
yk 1 C ( Ax k Bu k ) Duk 1 CAx k CBu k Duk 1 (2)
yk n 1 CAn 1 xk CAn 2 Bu k CAn 3 Bu k 1 CBu k ( n 2) Duk ( n 1) (n)
C
CA
(1), (2), (n) xk
n 1
CA
yk Duk yk 1 CBu k Duk 1 CABu k ( n 3) CBu k ( n 2 ) Duk ( n 1)
0 1
Controllability Matrix V B AB
1 0
rank (V ) rank ( N ) 2
C 0 1
Obervability Matrix N
CA 1 0
79
Controllability and Observability
Theorem I
xc (t ) Ac xc (t ) Bc u(t )
Controllable canonical form Controllable
Theorem II
xo (t ) Ao xo (t ) B o u (t )
y (t ) Co xo (t )
0 2 2
Observable canonical form xo xo u
1 3 1
2 2
U B AB y 0 1xo rank[U ] 1 n
1 1 rank[V ] 2 n
C 0 1
V
CA 1 3
81
Linear system (Analysis)
Theorem III x (t ) Jx (t ) Bu (t )
Jordan form
y (t ) Cx(t ) Du(t )
Jordan block
J1 B1
J J2
B B2 Least row
has no zero
row
J 3 B3
C C1 C2 C3
If b12 0 uncontrollable
If c11 0 unobservable
83
0 0 0
0 0
1 1 1 b11
1 0 1 0 b12
1 0 0 1 b13
x 1 x 1 1 2 u
2
1 0 1 0
2 1 0 0 1 b21
2
1 1 2 0 0 2 0
y 1 0 1 2 0 1 1 x
1 0 2 3 0 2 2
85
Example
2 1 2 1 1
2 2 1 1
2 1 1 1 L.I.
x 2 x 3 2 1u
1 1 1 0 0
1 1 0 1
1 1 0 0
L.I.
2 2 1 3 1 1 1
y 1 1 1 2 0 0 0
1 1 1 1 0 0 0
L.I. L.D.
86
Kalman Canonical Decomposition
Diagonalization: x Ax Bu & y Cx Du
u(t )
SCO SC O
y (t )
SCO
91
Example
1 0 0 b11
x 0 2 0 x b12 u
Plant: 0 0 3 b13
y c11 c12 c13 x
92
Pole-zero Cancellation in Transfer Function
From Sec. 5.2, state equation x Ax Bu
y Cx Du
may be transformed to
n
Cmi bmi Cm1bm1 C b
H ( s) mn mn
i 1 s i s 1 s n
93
Example
4 0 2
x x u
1 2 1
Plant: 1 2, 2 4
y 0 1x
Transfer Function
H ( s) C sI A B
Y ( s) 1
U ( s)
s 2 0 2
0 1
1
s 2s 4 1 s 4 1
2s 2
0 1
1
s 2s 4 s 2
1
s4
Transfer Function
T ( s) C sI A B
Y ( s) 1 1
U ( s) s3
95
Minimum Realization
Realization:
Realize a transfer function via a state space equation.
Example
1
Realization of the T.F. T ( s )
s3
U (s) 1 s -1 1 Y (s)
Method 1:
Y ( s) 1
T ( s) 3
U ( s) s3
Method 2: U (s) 1 s -1 1 Y (s)
Y ( s) 1 s2
T ( s) 3
U ( s) s3 s2 1
-1
s
Example 5.8
5
Realization of the T.F. T ( s )
s3 U (s) 1 s -1 5 Y (s)
Y ( s)
T ( s)
5 3
U ( s) s3
97
98