Chapter_3_Design_of_Digital_Control_Systems_Using_State_Space_Methods
Chapter_3_Design_of_Digital_Control_Systems_Using_State_Space_Methods
Systems
Nigusu Teshome,
Lecturer/Electrical and Computer Engineering Department,
Institute of Technology,
University of Gondar, Ethiopia.
eMail : [email protected]
Chapter 3
𝐱 𝑡 = 𝑒 𝐀𝑡 𝐱 0 + 𝑒𝐀 𝑡−𝜏 𝐁𝑢 𝜏 𝑑𝜏
0
Cont’d…
• The discrete equivalent of this solution can be obtained by considering 𝑡 = 𝑘𝑇:
𝑘𝑇
𝐱 𝑘𝑇 = 𝑒 𝐀𝑘𝑇 𝐱 0 + 𝑒𝐀 𝑘𝑇−𝜏 𝐁𝑢 𝜏 𝑑𝜏
0
at 𝑡 = (𝑘 + 1)𝑇:
𝑘+1 𝑇
𝐱 𝑘 + 1 𝑇 = 𝑒𝐀 𝑘+1 𝑇
𝐱 0 + 𝑒𝐀 𝑘+1 𝑇−𝜏
𝐁𝑢 𝜏 𝑑𝜏
0
𝑘𝑇+𝑇
= 𝑒 𝐀𝑇 𝑒 𝐀𝑘𝑇 𝐱 0 + 𝑒𝐀 𝑘𝑇−𝜏
𝐁𝑢 𝜏 𝑑𝜏
0
Cont’d…
𝑘𝑇 𝑘𝑇+𝑇
𝐱 𝑘 + 1 𝑇 = 𝑒 𝐀𝑇 𝑒 𝐀𝑘𝑇 𝐱 0 + 𝑒𝐀 𝑘𝑇−𝜏
𝐁𝑢 𝜏 𝑑𝜏 + 𝑒𝐀 𝑘𝑇−𝜏
𝐁𝑢 𝜏 𝑑𝜏
0 𝑘𝑇
𝑘𝑇+𝑇
= 𝑒 𝐀𝑇 𝐱(𝑘𝑇) + 𝑒𝐀 𝑘𝑇−𝜏 𝐁𝑢 𝜏 𝑑𝜏
𝑘𝑇
𝑘𝑇+𝑇
= 𝑒 𝐀𝑇 𝐱(𝑘𝑇) + 𝑒 𝐀𝑇 𝑒𝐀 𝑘𝑇−𝜏 𝐁𝑢 𝜏 𝑑𝜏
𝑘𝑇
Cont’d…
• Since, for 𝑘𝑇 ≤ 𝑡 ≤ 𝑘𝑇 + 𝑇, 𝑢 𝑡 = 𝑢 𝑘𝑇 , we may substitute, 𝑢 𝜏 = 𝑢 𝑘𝑇
in this last equation.
𝑘𝑇+𝑇
𝐱 𝑘 + 1 𝑇 = 𝑒 𝐀𝑇 𝐱 𝑘𝑇 + 𝑒 𝐀𝑇 𝑒𝐀 𝑘𝑇−𝜏 𝐁𝑢 𝑘𝑇 𝑑𝜏
𝑘𝑇
𝑘𝑇+𝑇
= 𝑒 𝐀𝑇 𝐱 𝑘𝑇 + 𝑒𝐀 𝑘𝑇+𝑇−𝜏
𝐁𝑢 𝑘𝑇 𝑑𝜏
𝑘𝑇
• Let λ = 𝑘𝑇 + 𝑇 − 𝜏 ⟹ 𝑑𝜆 = −𝑑𝜏
at 𝜏 = 𝑘𝑇 ⟹ 𝜆 = 𝑇
𝜏 = 𝑘𝑇 + 𝑇 ⟹ 𝜆 = 0
Cont’d… 0
𝐱 𝑘 + 1 𝑇 = 𝑒 𝐀𝑇 𝐱 𝑘𝑇 + 𝑒 𝐀𝜆 𝐁𝑢 𝑘𝑇 (−𝑑𝜆)
𝑇
𝑇
= 𝑒 𝐀𝑇 𝐱 𝑘𝑇 − 𝑒 𝐀𝜆 𝐁𝑢 𝑘𝑇 (−𝑑𝜆)
0
𝑇
= 𝑒 𝐀𝑇 𝐱 𝑘𝑇 + 𝑒 𝐀𝜆 𝐁𝑢 𝑘𝑇 𝑑𝜆
0
𝑇 𝐀𝜆
= 𝑒 𝐀𝑇 𝐱 𝑘𝑇 + 0
𝑒 𝐁𝑑𝜆 𝑢 𝑘𝑇 (1)
• Let us define
𝐆 = 𝑒 𝐀𝑇
𝑇 𝐀𝜆 𝑇 A𝜆
𝐇= 0
𝑒 𝐁𝑑𝜆 = 0
𝑒 𝑑𝜆 𝐁
Cont’d…
and also the discrete equivalent of the continuous time state-space output equation can be
obtained by considering 𝑡 = 𝑘𝑇.
𝑦(𝑘𝑇) = 𝐂𝐱(𝑘𝑇) + 𝐷𝑢(𝑘𝑇) (2)
In general, as it is shown in Equations (1) and (2), the discrete equivalent of the
continuous time state-space equation will be defined as follows:
𝐱{ 𝑘 + 1 𝑇} = 𝐆𝐱(𝑘𝑇) + 𝐇𝑢(𝑘𝑇)
𝑒 −𝑎𝑇 1 1 − 𝑒 −𝑎𝑇
= − =
−𝑎 −𝑎 𝑎
• From this, the discrete state-space equations will be:
𝑥 𝑘 + 1 𝑇 = 𝐺𝑥 𝑘𝑇 + 𝐻𝑢 𝑘𝑇
1−𝑒 −𝑎𝑇
= 𝑒 −𝑎𝑇 𝑥(𝑘𝑇) + 𝑢(𝑘𝑇)
𝑎
𝑦 𝑘𝑇 = 𝐶𝑥 𝑘𝑇 + 𝐷𝑢 𝑘𝑇
= 𝑥(𝑘𝑇)
Exercise: Obtain the discrete time state-space equation of the following continuous time system.
𝑌(𝑠) 1
=
𝑈(𝑠) 𝑠(𝑠 + 2)
Solution of the LTI Discrete Time State-Space Equations
The solution of the discrete time state-space equations can be obtained by using two
different approaches.
Method 1: Recursion Procedure
• Consider the following discrete time state and output equations:
𝐱 𝑘 + 1 = 𝐆𝐱 𝑘 + 𝐇𝑢 𝑘
𝑦 𝑘 = 𝐂𝐱 𝑘 + 𝐷𝑢 𝑘
• The solution of the state equation for any positive integer 𝑘 may be obtained directly by
recursion as follows:
𝐱 1 = 𝐆𝐱 0 + 𝐇𝑢(0)
𝐱 2 = 𝐆𝐱 1 + 𝐇𝑢 1
= 𝐆 𝐆𝐱 0 + 𝐇𝑢 0 + 𝐇𝑢(1)
= 𝐆2 𝐱 0 + 𝐆𝐇𝑢 0 + 𝐇𝑢(1)
Cont’d…
𝐱 3 = 𝐆𝐱 2 + 𝐇𝑢 2
= 𝐆 𝐆2 𝐱 0 + 𝐆𝐇𝑢 0 + 𝐇𝑢(1) + 𝐇𝑢(2)
= 𝐆3 𝐱 0 + 𝐆2 𝐇𝑢 0 + 𝐆𝐇𝑢 1 + 𝐇𝑢(2)
𝐱 4 = 𝐆𝐱 3 + 𝐇𝑢 3
= 𝐆 𝐆3 𝐱 0 + 𝐆2 𝐇𝑢 0 + 𝐆𝐇𝑢 1 + 𝐇𝑢(2) + 𝐇𝑢(3)
= 𝐆4 𝐱 0 + 𝐆3 𝐇𝑢 0 + 𝐆2 𝐇𝑢 1 + 𝐆𝐇𝑢 2 + 𝐇𝑢(3)
.
.
.
𝐱 𝑘 = 𝐆𝑘 𝐱 0 + 𝐆𝑘−1 𝐇𝑢 0 + 𝐆𝑘−2 𝐇𝑢 1 + 𝐆𝑘−3 𝐇𝑢 2 + ⋯ + 𝐇𝑢(𝑘 − 1)
𝑘−1
𝐱 𝑘 = 𝐆𝑘 𝐱 0 + 𝐆 𝑘−𝑗−1 𝐇𝑢 𝑗
𝑗=0
Cont’d…
Method 2: 𝓩-Transform Approach
• Consider the discrete time state-space state equation:
𝐱 𝑘 + 1 = 𝐆𝐱 𝑘 + 𝐇𝑢 𝑘
• Taking the 𝓏-transform of this equation, we get
∞
= 𝐱(𝜆)𝑧 −𝜆 𝑧
𝜆=1
∞
=𝑧 𝐱(𝜆)𝑧 −𝜆
𝜆=1
• But
∞
𝐱(𝜆)𝑧 −𝜆 = 𝑥 1 𝑧 −1 + 𝑥 2 𝑧 −2 + 𝑥 3 𝑧 −3 + ⋯
𝜆=1
∞
𝐱(𝜆)𝑧 −𝜆 = 𝑥 0 + 𝑥 1 𝑧 −1 + 𝑥 2 𝑧 −2 + 𝑥 3 𝑧 −3 + ⋯
𝜆=0
Cont’d…
• From this
∞ ∞
𝐱(𝜆)𝑧 −𝜆 − 𝐱 𝜆 𝑧 −𝜆 = 𝑥 0 + 𝑥 1 𝑧 −1 + 𝑥 2 𝑧 −2 + 𝑥 3 𝑧 −3 + ⋯ − {𝑥 1 𝑧 −1 + 𝑥 2 𝑧 −2 + 𝑥 3 𝑧 −3 + ⋯ }
𝜆=0 𝜆=1
∞ ∞
𝐱(𝜆)𝑧 −𝜆 − 𝐱 𝜆 𝑧 −𝜆 = 𝐱(0)
𝜆=0 𝜆=1
∞ ∞
𝐱 𝜆 𝑧 −𝜆 = 𝐱(𝜆)𝑧 −𝜆 − 𝐱(0)
𝜆=1 𝜆=0
• Then
∞
𝒵 𝐱 𝑘+1 =𝑧 𝐱(𝜆)𝑧 −𝜆
𝜆=1
∞
=𝑧 𝐱(𝜆)𝑧 −𝜆 − 𝐱(0)
𝜆=0
Cont’d…
∞
= 𝑧𝐗(𝑧) − 𝑧𝐱(0)
• Then, the 𝓏-transform of the discrete time state equation will be:
𝒵 𝐱 𝑘+1 = 𝒵 𝐆𝐱 𝑘 + 𝐇𝑢(𝑘)
𝑧𝐗 𝑧 − 𝑧𝐱 0 = 𝐆𝐗 𝑧 + 𝐇𝑈(𝑧)
𝑧𝐗 𝑧 − 𝐆𝐗 𝑧 = 𝑧𝐱 0 + 𝐇𝑈(𝑧)
[𝑧𝐈 − 𝐆]𝐗 𝑧 = 𝑧𝐱 0 + 𝐇𝑈(𝑧)
𝐗 𝑧 = [𝑧𝐈 − 𝐆]−1 {𝑧𝐱 0 + 𝐇𝑈(𝑧)}
= [𝑧𝐈 − 𝐆]−1 𝑧𝐱 0 + [𝑧𝐈 − 𝐆]−1 𝐇𝑈(𝑧)
Cont’d…
• Taking the inverse 𝓏-transform of both sides gives us the following equation:
𝐱 𝑘 = 𝒵 −1 {𝐗 𝑧 }
= 𝒵 −1 { [𝑧𝐈 − 𝐆]−1 𝑧} 𝐱 0 + 𝒵 −1 { 𝑧𝐈 − 𝐆 −1
𝐇𝑈 𝑧 }
Example 3.2: Obtain the solution of the following discrete time state-space equations
by using 𝓏-transform approach.
0 1 1 1
𝐱 𝑘+1 = 𝐱 𝑘 + 𝑢(𝑘) , 𝐱 0 =
−0.16 −1 1 −1
𝑦(𝑘) = 1 0 𝐱(𝑘)
𝐱 𝑘 = 𝒵 −1 𝐗 𝑧
−17 22 25
𝑧 𝑧 𝑧
6 + 9 + 18
= 𝒵 −1 𝑧 + 0.2 𝑧 + 0.8 𝑧 − 1
3.4 −17.6 7
𝑧 𝑧 𝑧
6 + 9 + 8
𝑧 + 0.2 𝑧 + 0.8 𝑧 − 1
Cont’d…
−17 𝑘
22 𝑘
25
(−0.2) + (−0.8) +
𝐱(𝑘) = 6 9 18
3.4 𝑘
17.6 𝑘
7
(−0.2) − (−0.8) +
6 9 8
𝑦 𝑘 = 𝐂𝐱 𝑘
= 1 0𝐱 𝑘
−17 𝑘 22 𝑘 25
(−0.2) + (−0.8) +
6 9 18
= 1 0 3.4 17.6 7
𝑘 𝑘
(−0.2) − (−0.8) +
6 9 8
−17 𝑘 22 𝑘 25
= (−0.2) + (−0.8) +
6 9 18
Pulse Transfer Function
The state-space representation of an 𝑛𝑡ℎ order LTI discrete time system with 𝑟 inputs
and 𝑚 outputs can be given by:
𝐱 𝑘 + 1 = 𝐆𝐱 𝑘 + 𝐇𝑢 𝑘 (1)
𝑦 𝑘 = 𝐂𝐱 𝑘 + 𝐷𝑢 𝑘 (2)
• Taking the 𝓏-transform of Equations (1) and (2), we obtain:
𝑧𝐗 𝑧 − 𝑧𝐱 0 = 𝐆𝐗 𝑧 + 𝐇𝑈(𝑧)
𝑌 𝑧 = 𝐂𝐗 𝑧 + 𝐷𝑈(𝑧)
• In order to obtain the pulse transfer function, 𝐱 0 = 0. Then, we obtain:
𝐗 𝑧 = [𝑧𝐈 − 𝐆]−1 𝑧𝐱 0 + [𝑧𝐈 − 𝐆]−1 𝐇𝑈 𝑧
= [𝑧𝐈 − 𝐆]−1 𝐇𝑈 𝑧
Cont’d…
and
𝑌 𝑧 = 𝐂𝐗 𝑧 + 𝐷𝑈(𝑧)
−1
= 𝐂{ 𝑧𝐈 − 𝐆 𝐇𝑈 𝑧 } + 𝐷𝑈(𝑧)
= {𝐂 𝑧𝐈 − 𝐆 −1 𝐇 + 𝐷}𝑈(𝑧)
• For SISO system,
𝑌(𝑧) −1 𝑯
= 𝐂 𝑧𝐈 − 𝐆 +𝐷
𝑈(𝑧)
= 𝐹(𝑧)
• Therefore, the pulse transfer function will be:
−𝟏
𝐹 𝑧 = 𝐂 𝑧𝐈 − 𝐆 𝐇+𝐷
Cont’d…
Example 3.3: For a system that is described by the following discrete time state-space
equations, find the pulse transfer function of the system.
1 0.4323 0.2838
𝐱 𝑘+1 = 𝐱 𝑘 + 𝑢(𝑘)
0 0.1353 0.4323
𝑦(𝑘) = 1 0 𝐱(𝑘)
Solutions: The pulse transfer function of this system can be obtained by:
𝐹 𝑧 = 𝐂 𝑧𝐈 − 𝐆 −1 𝐇 +𝐷
−1
𝑧 0 1 0.4323 0.2838
= 1 0 − +0
0 𝑧 0 0.1353 0.4323
−1
𝑧−1 −0.4323 0.2838
= 1 0
0 𝑧 − 0.1353 0.4323
Cont’d…
1 0.4323
𝑧 − 1 (𝑧 − 1)(𝑧 − 0.1353) 0.2838
𝐹 𝑧 = 1 0
1 0.4323
0
𝑧 − 0.1353
1 0.4323 0.2838
=
𝑧 − 1 (𝑧 − 1)(𝑧 − 0.1353) 0.4323
0.2838𝑧+0.1485
=
(𝑧−1)(𝑧−0.1353)
3.1 Control Law Design
The state-space description of a continuous system is:
𝐱(𝑡) = 𝐅𝐱(𝑡) + 𝐆𝑢(𝑡)
𝑦(𝑡) = 𝐇𝐱(𝑡) + 𝐽𝑢(𝑡)
𝛼𝑐 𝑧 = 𝑧 − 𝛽1 𝑧 − 𝛽2 … 𝑧 − 𝛽𝑛 = 0 (**)
• So
|𝑧𝐈 − 𝚽 + 𝚪𝐊| = 𝑧 − 𝛽1 𝑧 − 𝛽2 … 𝑧 − 𝛽𝑛
Example 3.4: Design a control law for a system described by:
1 𝑇 𝑇 2 2
𝑥 𝑘+1 = 𝑥 𝑘 + 𝑢(𝑘)
0 1 𝑇
• The desired closed-loop poles are at 𝑠 = −1 ± 𝑗. Use a sampling period of 𝑇 = 0.1 𝑠𝑒𝑐.
Cont’d
Solution: The desired closed-loop poles in the z-plane are:
𝑧1 = 𝑒 𝑠1 𝑇 = 𝑒 (−1+𝑗)𝑇 = 𝑒 −1+𝑗 ∗0.1 = 𝑒 −0.1 𝑒 0.1𝑗 = 0.9 + 𝑗0.09
𝑧2 = 𝑒 𝑠2 𝑇 = 𝑒 (−1−𝑗)𝑇 = 𝑒 −1−𝑗 ∗0.1 = 𝑒 −0.1 𝑒 −0.1𝑗 = 0.9 − 𝑗0.09
• Then the desired characteristic equation is:
𝑧 − 𝑧1 𝑧 − 𝑧2 = 𝑧 2 − 1.8𝑧 + 0.82 = 0
∴ 𝐾1 = 2 and 𝐾2 = 1.9
3.1.2 Pole Placement Using Control Canonical Form
• The system matrices 𝚽, 𝚪 and 𝐇 can be written in control canonical form as the
following:
−𝑎1 −𝑎2 −𝑎3 1
𝚽𝑐 = 1 0 0 , 𝚪𝑐 = 0 , 𝐇𝑐 = [𝑏1 𝑏2 𝑏3 ]
0 1 0 0
𝑧 3 + 𝛼1 𝑧 2 + 𝛼2 𝑧 + 𝛼3 = 0 2
Then equating Equations (1) and (2), the necessary values for control gains are:
𝐾1 = 𝛼1 − 𝑎1
𝐾2 = 𝛼2 − 𝑎2
𝐾3 = 𝛼3 − 𝑎3
3.1.3 Pole Placement Using CACSD
MATLAB has two functions that perform the calculation of 𝐊:
place.m
and
acker.m
acker.m is based on Ackermann’s formula and is satisfactory for SISO systems
of order less than 10 and can handle systems with repeated roots. The relation is:
−1
𝐊 = 0 … 1 𝚪 𝚽𝚪 𝚽 2 𝚪 … 𝚽 𝑛−1 𝚪 𝛼𝑐 (𝚽)
where 𝑄C = [𝚪 𝚽𝚪 𝚽 2 𝚪 … 𝚽 𝑛−1 𝚪] is called the controllability matrix and must be full rank
for the matrix to be invertible and for the system to be controllable.
𝛼𝑐 𝚽 = 𝚽 𝑛 + 𝛼1 𝚽 𝑛−1 + 𝛼2 𝚽 𝑛−2 + ⋯ + 𝛼𝑛 𝐈
and 𝛼1 , 𝛼2 , … , 𝛼𝑛 are coefficients of the desired characteristic equation.
place.m is applicable for higher order systems and can handle MIMO systems,
but will not handle systems where the desired roots repeated.
Cont’d ...
Example 3.5: Design a control law for the system
𝑇2
1 𝑇
𝐱 𝑘+1 = 𝐱 𝑘 + 2 𝑢(𝑘)
0 1
𝑇
The desired closed-loop poles are at z = 0.2 ± 𝑗0.1. Use a sampling period of 𝑇 = 0.1 𝑠𝑒𝑐.
Phi = 1 T; 0 1
Gam = 𝑇 ^2 2 ; T
K = acker(Phi, Gam, p)
Cont’d ...
From a continuous system
𝑎 𝑏 𝑒
𝐱 = 𝐅𝐱 + 𝐆𝑢 𝐅= 𝐆= 𝑓
𝑐 𝑑
𝑦 = 𝐇𝐱 + 𝐽𝑢 𝐇 = [𝑔 ℎ] 𝐽=0
𝑇 = 0.1, desired poles at z = 0.7, 0.7
• MATLAB command:
T = 0.1
F = a b; c d
G = e ;f
H= g h
J= 0
sysC = ss(F, G, H, J)
sysD = c2d(sysC, T, ′ZOH′)
p = 0.7; 0.7
[Phi, Gam, H, J] = ssdata(sysD)
K = acker(Phi, Gam, p)
3.2 Estimator Design
Typically, all state elements may not be measurable and available for
feedback.
Therefore, the missing portion of the state needs to be reconstructed for use in the
control law by using estimator.
There are two basic kinds of estimates of the state, 𝐱 𝑘 :
1. Current estimate, 𝐱 𝑘 :
• We call it the current estimate, 𝐱 𝑘 , if based on measurements 𝑦 𝑘 up to and
including the 𝑘th instant.
2. Predictor estimate, 𝐱 𝑘 :
• We call it the predictor estimate, 𝐱 𝑘 , if based on measurements up to 𝑦 𝑘 − 1 .
3.2.1 Prediction Estimators
Consider the model of plant dynamics is
𝐱(𝑘 + 1) = 𝚽𝐱(𝑘) + 𝚪𝑢(𝑘)
𝑦(𝑘) = 𝐇𝐱(𝑘)
• This model can be approximated by an estimator equation as
𝐱 𝑘 + 1 = 𝚽𝐱 𝑘 + 𝚪𝑢 𝑘 + 𝐋𝑝 𝑦 𝑘 − 𝐇𝐱 𝑘
= 𝚽 − 𝐋𝑝 𝐇 𝐱 𝑘 + 𝚪𝑢 𝑘 + 𝐋𝑝 𝑦(𝑘)
where 𝐋𝑝 is feedback gain matrix.
• We call this a prediction estimator because
a measurement at time 𝑘 results in an estimate
of the state vector that is valid at time 𝑘 + 1,
that is, the estimate has been predicted one cycle
in the future.
=𝚽 𝐱 𝑘 −𝐱 𝑘 − 𝚽𝐋𝑐 𝐇 𝐱 𝑘 − 𝐱 𝑘
= 𝚽 − 𝚽𝐋𝑐 𝐇 𝐱 𝑘 − 𝐱 𝑘
= 𝚽 − 𝚽𝐋𝑐 𝐇 𝐞(𝑘)