0% found this document useful (0 votes)
6 views60 pages

dcs1_2_114 (1)

The document outlines a course on Digital Control Systems, focusing on digital control theory and design methods, including practical applications and programming with microcontrollers. Key topics include Z-transformation, PID controller design, linear quadratic optimal control, and machine learning in digital control. The course also covers intelligent control algorithms and their implementation in real engineering systems, with a structured assessment approach for students.

Uploaded by

lulumy.c
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views60 pages

dcs1_2_114 (1)

The document outlines a course on Digital Control Systems, focusing on digital control theory and design methods, including practical applications and programming with microcontrollers. Key topics include Z-transformation, PID controller design, linear quadratic optimal control, and machine learning in digital control. The course also covers intelligent control algorithms and their implementation in real engineering systems, with a structured assessment approach for students.

Uploaded by

lulumy.c
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

2025/2/17

Digital Control Systems


(Chapter 1/2)

Stone Cheng
鄭泗東

National Yang Ming Chiao Tung University


國立陽明交通大學 機械工程學系
Page: 1

Digital Control Systems


課程目標:
1. 本課程內容為學習數位控制理論與設計方法, 經由應用實例, 建立系統
數位控制器設計概念
2. 修課學生能以電腦或微控制器撰寫程式, 實現數位控制器及數位濾波
器設計
課程概述:
1. 類比與數位訊號轉換之數理函數理論發展
2. Z-轉換、系統訊號取樣與動態分析
3. 動態系統之PID/Lead/Lag/Lead-Lag數位控制器與數位濾波器設計
4. 極點配置設計和系統狀態估測(Pole-assignment design and state
estimation)
5. 線性二次最佳控制(Linear Quadratic Optimal Control)
6. 機器學習數位控制 Machine Learning Digital Control 理論與設計實務
7. 如何將數位控制器理論設計逐步實現在實際工程系統上: 案例分析
(UAV無人機之飛行數位控制、機構行程神經網路控制)

Page: 2

1
2025/2/17

Digital Control Systems


課程綱要 :
⚫ Introduction: Digital Control Systems
⚫ Linear Discrete Time Systems and The Z-Transform
⚫ Signal Sampling and Reconstruction
⚫ Signal Dynamic Response and Stability Analysis
⚫ Digital Controller Design of Dynamic Systems
⚫ Linear Quadratic Optimal Control
⚫ Machine learning and Neural Network Digital Control
⚫ Digital Controller Design and Implementation: Case
Study and Design Assignment.

Page: 3

Intelligent Control Algorithm


⚫ 常見的控制法則為基於線性系統,為了處理系統具有非線性特性,發展智慧
型控制演算法,或是將最佳化理論加入控制工程領域中。
⚫ 四種常用智慧型控制演算法,分別是模糊邏輯推論系統(Fuzzy inference
system, FIS)、神經網路(Neural network, NN)、基因演算法(
Genetic algorithm, GA)及專家系統(Expert system)。其中,又以有
無專家經驗的加入作為分界。
⚫ 模糊邏輯推論系統與專家系統在設計時則加入專家經驗與既定規則,但是當
考量因素變多後,參數的組合和規則也變得較複雜,系統設計的時間成本將
會提高。
⚫ 神經網路與基因演算法的演算機制沒有專家經驗的考量,透過自動調整參數(
即時學習)達到控制目標。
⚫ 許多研究選擇自適應(Self-adaptive)演算法並降低經驗導向的設計考量
,其中以神經網路機器學習技術被最廣泛地使用。
Page: 4

2
2025/2/17

Neural Network in Machine Learning Control

⚫ 機器學習作為系統響應最佳化問題的延伸,控制系統普遍採用
神經網路與其變形搭建而成,並使用梯度下降演算法進行神經
網路權重參數更新。
⚫ 機器學習領域之強化學習,以演算法取得預期利益的最大化,
其策略函式模型採用神經網路與其變形搭建而成
⚫ 以溫度控制為例,系統響應為輸出溫度,最佳化目標為輸出溫
度等於輸出溫度指令,其中差異為溫度誤差值,將溫度誤差值
曲線最小化之過程為溫度誤差梯度下降。

Page: 5

Neural Network System

類神經網路系統演算法不斷在發展,影響人工智慧技術精進…
⚫ 類神經網路: 1943
⚫ 隨機梯度下降法 : 1951
⚫ 反向傳播演算法: 1975
⚫ ADAM 參數優化器: 2014

與環境互動強化學習之類神經網路: AlphaGo
與人互動強化學習之類神經網路: 生成式人工智慧

Page: 6

3
2025/2/17

Digital Control Systems


參考書目:
Text book: Charles L. Phillips, H. Troy Nagle, “Digital Control
System Analysis and Design” Third Edition, Prentice Hall
課程進行方式、課程要求及評分標準:
課堂講課、程式與作業檢討; 討論及考試、學生需對課程內容瞭解程度
提出簡要說明
評分標準:
⚫課後作業及平時學期課中表現: 20%
⚫第一次期中考 Midterm test 1: 20%
⚫第二次期中考 Midterm test 2: 30%
⚫期末考 Final Exam. (open book) : 30%

Page: 7

Digital Control Systems

Prerequisite:
⚫ Laplace Transform
⚫ Linear feedback control
⚫ Matlab programming

Page: 8

4
2025/2/17

Introduction : Digital Control Systems

Closed-loop systems that contain digital computers

•Compensator
•Controller
•Filter

D/A

Clock
sampling period

A/D
quantized signal

Closed-loop system
Page: 9

Digital Control Systems


Linear time-invariant discrete-time system

A Linear System is one for which the principle of superposition applies.

A system is said to be time-invariant or constant if the response to


the time-shifted input will yield a correspondingly time-shifted
output.

Signals are classified into 2 main classes:


⚫ Continuous-Time Signals: A signal x(t) , that is a real-valued
function of the time variable t , which is taken from a set of real
number.
⚫ Discrete-Time Signals: A signal x[n] , that is a function of the time
discrete-time variable tn , where n is taken from a set of integer
values.
Page: 10

5
2025/2/17

System Characterization: Linearity

Linear
a1x1(t) System a1y1(t)

a1x1(t)+ a2x2(t) + and a1y1(t)+ a2y2(t)

Linear
a2x2(t) System a2y2(t)

Page: 11

System Characterization: Time-Invariant

Time-Invariant
x(t) System y(t)

x(t-t1) D y(t-t1)

t1
Time shift

Page: 12

6
2025/2/17

System Characterization: Discrete-Time Signals


Class Example: tn=n*T, T=0.5sec
Class Example
1
1

0.8
0.8

0.6
0.6

0.4 0.4

0.2 0.2

X[n]
0
X(t)

-0.2 -0.2

-0.4 -0.4

-0.6 -0.6

-0.8 -0.8

-1 -1
0 5 10 15 20 25 30 0 10 20 30 40 50 60
Time (sec) n

Sampling time=0.5sec
Class Example: tn=n*T, T=2sec Class Example: tn=n*T, T=5sec
1 1

0.8 0.8
Distortion
0.6 0.6

0.4 0.4

0.2 0.2
X[n]

X[n]
0 0

-0.2 -0.2

-0.4 -0.4

-0.6 -0.6

-0.8 -0.8

-1 -1
0 5 10 15 0 1 2 3 4 5 6
n n

Sampling time=2sec Sampling time=5sec Page: 13

Digital Control Systems : Examples

(飛機,汽車等)帶坡度轉彎

Page: 14

7
2025/2/17

Digital Control Systems : Examples

disturbance : wind…

disturbance

Page: 15

Digital Control Systems : The Control Problem


Generally, a controller is required to process the error signals in
order that certain control criteria will be satisfied.

Control problem:
1. Disturbance rejection
2. Steady-state errors
3. Transient response
4. Sensitivity to parameter changes in the plant

Solving the control problem will involve:


1. Choosing sensors to measure the feedback signals
2. Choosing actuator to drive the plant
3. Developing the plant, sensor, and actuator math. models
4. Designing the Controller based on the math. models and the
control criteria
5. Evaluating the system design by simulation, and by testing
Page: 16

8
2025/2/17

Transient response

Page: 17

Digital Control Systems : Servomotor system model

The schematic diagram of a simple DC motor driving an inertial


load is shown in the following figure:
T : Torque generated by motor
J : Load moment of inertia
b: Viscous friction constant
 : Angular displacement

The mechanical part of the motor equations is derived using


Newton's law: J + b = K  i = T K : Torque constant力矩常數
T T

And the electrical part of the motor equations can be described


by: di
R  i + L = Vinput − e e : back electromotive force (EMF)
dt 反電動勢
Using Laplace Transforms, the transfer function of the system:
(s)
H (s) =
V (s)
Page: 18

9
2025/2/17

Digital Control Systems : Servomotor system model

J + b = K T  i  J   ( s ) s 2 + b   ( s ) s = K T  I ( s )
di
Ri + L = V − e  R  I ( s ) + L  I ( s ) s = V ( s ) − K E   ( s )  s 
dt
 R + Ls   I ( s ) = V ( s ) − K E   ( s ) s KE 為馬達反電動勢常數

 R + Ls    J   ( s ) s 2 + b   ( s ) s  + K E  K T   ( s ) s = K T V ( s )
(s) KT
=
V ( s ) s ( R + Ls )( J  s + b ) + K E  K T 

Plant H ( s)
V (s) KT (s)
s[( Ls + R)( Js + b) + K E  KT ]

Page: 19

Digital Control Systems : Antenna Pointing System

Page: 20

10
2025/2/17

Digital Control Systems : Antenna Pointing System

Amplifier Plant
+ error KT
S Ka s[( Ls + R)( Js + b) + K E  KT ]

Sensor

Page: 21

AC Servo Drive with Digital PID controller

1  n  e ( n ) − e ( n − 1)
u ( n ) = Kp  e ( n ) +  
Ki  i = 0
e ( i )  T  + Kd
 T
n e (i ) Kd
u ( n ) = Kp  e ( n ) +   T + e ( n ) − e ( n − 1) 
i =0 Ki T 

V-cmd e(n) u(n) Servo


+S + S
PID controller PI controller PWM Encoder
motor
− −
V-FB I-Loop current
V-Loop ADC

Velocity Position
Speed Estimator= Kdp(P/ T )
Pulse

Page: 22

11
2025/2/17

PMSM AC Servo Drive Block Diagram 3 phase AC Power

P-Loop V-Loop I-Loop


(Park/Clarke T)-1
Pcmd Vcmd
e(n)
Iqcmd Vq
VA P DC
S +S +S
P PID PI A,B,C
+ VB PWM 3f
Pfbk — Vfbk — Ifbk — VC Timers inverter
Idcmd=0 Vd
d,q,0
PI
Velocity + – U V W

Speed e
Estimator
Id Ia Ib ib
a,b a,b,c
Iq
Ib Ia ADC ia
d,q a,b
Park T Clarke T
Position pulses Encoder PM Sync.
Motor

System Configuration of Field-oriented PM Synchronous Motor


Page: 23

Chapter 1 Exercises

Third Edition Fourth Edition


1.2 (b) 1.1-2 (b)
1.4 1.1-4
1.7 1.5-1
1.10 1.5-4
1.16 1. 6-1

Page: 24

12
2025/2/17

Why Digital Control ?

Vi Vo
x Gc(s) y

s + 0.1
Example : Lead Compensator: Gc ( s ) = 0.2  implemented by analog circuit
s+2
Vo R f (1 + R2Cs ) Rf
= C
Vi  RRC 
( R1 + R2 ) 1 + 1 2 s 

4
1 + R2 
Vi 2

-
R 1
Vo
R1 R2 3 +

Gc ( s ) = 0.2 
s + 0.1
= 0.01
(1 + 10s )

8
s+2 (1 + 0.5s )
R1 R2C Rf RC active filter
R2C = 10 , = 0.5 , = 0.01
R1 + R2 R1 + R2
Page: 25

Why Digital Control ?


R1R2C Rf
R2C = 10 , = 0.5 , = 0.01
R1 + R2 R1 + R2
10
Set R2 = 330
330K   C=
K = 30.3 FF 
30.3µ 330 K  , 33 F
330 K 
10 R1 0.5
 = 0.5  R1 = 7.37 K 
R2  R1 = 117.37K
R1 + R2 9.5
and R f = 0.01 ( R1 + R2 )  R f = 3.47
3.47KK

Rf
C
4

Vi 2 -

R1 R2 3 +
1
Vo
8

A painful routine to select R1,R2,Rf , and C if compensator needs to be changed.


Page: 26

13
2025/2/17

Why Digital Control ?


s + 0.1
Example : Lead Compensator: Gc ( s ) = 0.2  implemented by digital system
s+2
Plant natural freq. n = 2 rad/sec,
chose the sampling frequency to s = 20  n , and sampling period T = 0.22 sec
( a ) Applying Tustin's rule to transform s-domain compensator to z-domain gives
 2 ( z − 1) 
 + 0.1
T ( z + 1)  = 0.166  z − 0.978 = 0.166  1 − 0.978 z
−1
Gd  z  = Gc ( s ) s = 2( z −1) = 0.2  
T ( z +1)  2 ( z − 1)  z − 0.639 1 − 0.639 z −1
 + 2  Digital controller
 T ( z + 1) 
( b ) Computer implementation of digital Lead compensator
1 − 0.978 z −1 Y  z 
Gd  z  = 0.166  =  Y  z  − 0.639 z −1Y  z  = 0.166 X  z  − 0.162 z −1 X  z 
1 − 0.639 z −1
X z
⎯⎯⎯⎯⎯ ⎯
Inverse Z transform
→ y n  = 0.639 y n − 1 + 0.166 x n  − 0.162 x n − 1

Page: 27

Why Digital Control ?


y n  = 0.639 y n − 1 + 0.166 x n  − 0.162 x n − 1
C programming
...
y = 0.639* y + 0.166* x -0.162* last_x;
last_x = x;
...

MainISR:

DAC

Wait for 0.22sec end


s + 0.1
Lead Compensator: Gc ( s ) = 0.2 
s+2
implemented by digital system Page: 28

14
2025/2/17

Why Digital Control ?

Digital
Control
System

Page: 29

Why Digital Control ?


Analog
signal

Analog
signal

Digital Control Systems

Page: 30

15
2025/2/17

Why Digital Control ?

Page: 31

Why Digital Control ?


Analog control circuit Digital Controller
Flexible programming,
System
Fixed circuit easy to set up and
integration
adjustments
High (ADC,DAC,
Cost Low (R/L/C OP amp)
µ computer)
Parameters replace hardware
revise firmware program
amendment components
Automatic self-tuning,
Performance
standstill dynamic tuning during
adjustment
system operation

Page: 32

16
2025/2/17

Why Digital Control ?


Digital Signal
Controllers are ready
in the market !
(TI TMS320R2812 : 32-
Bit Digital Signal
Controller with RAM)
ADC Conversion 80 ns
Time

Page: 33

Z Transform ⚫ Properties Transfer Function


of ⚫ Inverse Z Transform Representation
A Discrete-Time
Signals

Z Transform and
Discrete-Time
Systems

The basic knowledge


of Digital Control System

Page: 34

17
2025/2/17

Introduction to the Z-Transform ( z= esT )


For a linear time-invariant (LTI) continuous-time system:
⚫ The input-output relation of the system is described by a
differential equation. To solve the differential equation, the
Laplace transform is often used.
For a discrete-time system:
⚫ The input-output relation is expressed in terms of a difference
equation which consists of multiplications and summations.
⚫ Instead of a continuous waveform, only sampled value of x(t) are
measured. Namely,

x (t ) ⎯⎯⎯⎯
sampling
→  x nT    t − nT 
n= −

⚫ Recall Laplace Transform definition



x (t )  X ( s ) =  x (t )  e − st dt
−

Page: 35

Introduction to the Z-Transform ( z= esT )



→  x nT    t − nT 
x ( t ) ⎯⎯⎯⎯sampling
sampled value of x(t)
n=−

x ( t )  X ( s ) =  x (t )  e − st dt Laplace Transform of x(t)
−

   
X ( s ) =    x nT    t − nT   e − st dt
−
 n=− 

     t − nT   e − st dt 
= 
n=−
x nT 
 − 
Exists only when t=nT

 
= 
n=−
x nT   e − snT =  x nT   (e )
n= −
sT − n


Define z = e sT
 X (z) =  x  n  z
n=−
−n The variable changed
from s to z
Page: 36

18
2025/2/17

Introduction to the Z-Transform ( z= esT )



Fourier Transform : X ( ) =  x ( t )  e− jt dt
−

Laplace Transform : X ( s ) =  x ( t )  e− st dt , s =  + j
−
Since the sampled signal x[n] is a subset of x(t), we can also
apply the Laplace transform to it, that is:

X ( s ) =  x  n   e − st dt
−

As x[n] only exists at sampling instants, this means that we can


replace the integral with a summation, that is,
 
( )
 −n
X ( s ) =  x  n   e dt = − st
 x  n  e − snT
=  x  n   e sT
−
n =− n =−

Defining z= esT, then


 Called the z-transform
X ( z) =  x  n  ( z )
−n
( Transfer the discrete-time data x[n] into
n =− a function of a complex variable, z )
Page: 37

Introduction to the Z-Transform

⚫ As a result, the z-transform defines a function of a continuous


(complex) variable “z”, and that the input side of the equation sums
over all n.
⚫ The z-transform is a variant form of the Fourier transform that is
particularly useful for time-discretized (sampled) functions.


X ( z ) =  x n ( z ) = x  0 + x 1 z −1 + x  2 z −2 + ...
−n
or
n =0

E ( z ) = z e ( k )  = e  0 + e 1 z −1 + e  2 z −2 + ... (2-7)



E ( z ) =  e k  ( z )
−k
(2-8)
k =0

Page: 38

19
2025/2/17

Introduction to the Z-Transform


Why do we need another transform again?
⚫ Analogous to Laplace Transform in LTI Continue-Time, we will
obtain the transfer function of LTI Discrete-Time systems by the
method of Z-Transform analysis.
⚫ The Laplace transform deals with differential equations, the s-
domain, and the s-plane. Correspondingly, the z-transform deals
with difference equations, the z-domain, and the z-plane.
⚫ The two techniques are not a mirror image of each other; the s-
plane is arranged in a rectangular coordinate system, while the
z-plane uses a polar format.

Page: 39

Introduction to the Z-Transform


Laplace Transform : X ( s ) =  x ( t )  e − st dt , s =  + j
−

−8
H (s) =
s+4
⎯⎯⎯⎯⎯⎯⎯⎯
Inverse Laplace Transform
→ h (t ) = ( −8e ) −4 t
 u (t )
designed can be implemented
controller pole =−4
LHP by analog circuit
or filter ( converge )

z-Transform : X ( z ) =  x n   ( z )
−n

n =0

5 z 5 n
H z = ⎯⎯⎯⎯⎯⎯
Inverse z-Transform
→ h[n ] = ( 3)  u n 
designed
3 z−3 3
controller pole =3 can be implemented
or filter outside by computer program
unit circle ( diverge )

Page: 40

20
2025/2/17

Introduction to the Z-Transform



X ( z ) =  x  n ( z )
−n
z-transform definition:
n =0

Example: Find the z-transform of  [n],  [n-q], u[n], anu[n]



•   n     n ( z ) =   0 ( z ) = 1
−n −0

n =0

•   n − q      n − q  ( z ) ⎯⎯→   0 ( z )
n=q −n −q
= z −q
n =0
 
• u  n   u  n ( z ) =  ( z ) , Since u  n  =1 for all n  0
−n −n

n =0 n =0

1 z
= 1 + z −1 + z −2 + z −3 ... = −1
=
1− z z −1

( ) + (a z ) + (a z )
−1 −2 −3 1 z
• a nu  n    a n ( z )
−n
= 1 + a −1 z −1 −1
... = =
( )
−1
n =0 1 − a −1 z z−a
Page: 41

Introduction to the
 
Z-Transform
• a u n − 1   a u n − 1 ( z ) =  a u n − 1 ( a −1 z )
n −1 n −1 −n −1 −n

n =0 n =0

Since u n − 1 = 1 for all n  1

= a −1 0 + ( a −1 z ) + ( a −1 z ) + ( a −1 z ) ...
−1 −2 −3

 
= a −1 1 + ( a −1 z ) + ( a −1 z ) + ( a −1 z ) ... − 1
−1 −2 −3

 
 z  a 1
= a −1  − 1 = a −1 =
z−a  z−a z−a
 
=  ( e − a z −1 ) =
1 z
• e − an u n    e − an ( z )
−n n
− a −1
=
n =0 n =0 1− e z z − e−a
Laplace   −1  −( s + a )t  
• e − at u ( t ) ⎯⎯⎯⎯
→ X ( s ) =  e − at  e − st dt =  e −( s + a )t dt =
Transform
e 
0 0 s+a 0 

=
s+a
e (
−1 − ( s + a ) 
− e − ( s + a )0 =
1
s+a
)
Page: 42

21
2025/2/17

Properties of the Z-Transform


Let x(n), X(z) implies that x(n) and X(z) are in the z-transform relation.
The following are some of the important properties of the z-transform.
1.
This property is called the linearity. This holds because the
summation in the z-transform is a linear operation.
x n  X [ z] x  n − n0   ( z ) X z
− n0
2.
The delay of n0 in the time domain results in the multiplication of z –n0
in the frequency domain. A unit delay corresponds to the
multiplication of z −1.

(Proof) By definition: x  n − n0    x n − n ( z )
−n
0
n = n0
 
−( m + n0 )
let m = n − n0  n = m + n0   x  m  ( z ) = (z)  x m ( z ) = (z) X z
− n0 −m − n0

m =0 m =0

Page: 43

Properties of the Z-Transform

Page: 44

22
2025/2/17

Introduction to the Z-Transform

Find the z transform of the following signals:


(a) x[n] = [0 2 4 6 8]
X(z)=2z-1+4 z-2+6 z-3+8 z-4
(b) x[n] = (0.5)n·n·u[n]

n  u  n 
z
( )
and ( 0.5 ) f  n   F 0.5−1  z = F ( 2 z )
n

( z − 1)
2

z d  z 
u  n   n  u  n  ⎯⎯⎯⎯⎯⎯ ⎯→ − z 
Derivative of Transform

z −1 dz  z − 1 
d  z   −z 1  z
−z   = −z  + =
dz  z − 1   ( z − 1) z − 1  ( z − 1)2
2

2z 0.5 z 0.5 z 0.5
thus, X ( z ) = = = =
( 2 z − 1) ( z − 0.5)  z 1 − 0.5 z  z 1 − 0.5 z −1
( ) ( )
2 2 2 2
−1

Page: 45

Existence of the Z-Transform


By definition:
  x  n
X ( z ) =  x  n ( z ) =
−n

n =0 n =0 zn
The z-transform exists if
 x  n
X (z)   n
  for some z
n =0 z
 x  n  grows no faster than z = e Tn =  n
n

 x  n 
n 1
If x  n    n then X ( z )    = , z 
z
n
z
n

n =0 n =0
1−
z
 X ( z ) exists for z  
Page: 46

23
2025/2/17

S plane and Z plane mapping


The mapping due to z=esT produces the following characteristics:
⚫ The imaginary axis in the s-plane maps into the unit circle in the z-plane;
⚫ The left-half of the s-plane maps into the interior of the unit circle in
the z-plane;
⚫ The right-half of the s-plane maps into the exterior of the unit circle in
the z-plane;
⚫ Every infinitely wide horizontal strip in the s-plane of height s rad/s
maps into the entire z-plane.

S (=+j) plane Z (=ej) plane


Im(s) Im(z)
z = ej =cos+jsin


Re(s)= Re(z)

Page: 47

Corresponding line locations


between the s-plane and the z-plane
S (=+j) plane Z (=esT =rej ) plane s =  + j , z = e sT
Im(s)  + j
Im(z)
( + j )T s
=e =e
 
j
s s
= e e
Re(s) Re(z)

   
= e s   cos + j sin 
r  s s
 Re( z ) 
 Im( z ) 
s =   j
 
s =   j   , z = e sT
T 
 
  j  T
=e  T
= e  j
= e   cos (  ) + j sin (  ) 
r  
 Re( z ) Im( z ) 

= −r Page: 48

24
2025/2/17

Corresponding pole locations


between the s-plane and the z-plane

Unstable
poles

Unstable
poles

Page: 49

Transient Response characteristic


s =   j
 of the z-plane pole location
d = rad/s  
T s =  j 
T 
1取樣時間內
½ 頻率週期
Unit
circle

T
1 Unstable poles

Page: 50

25
2025/2/17

Region Of Converge of Z-Transform


Example:  1  n
 − 2n n0
  1 n x  n  =  3 
  n0 
  3  0 n0
x  n =  −n
   −n
 1  1
n

 
 2  n0 0 n =0+    − 2n  ( z )
  3 
n =1  
−1 −n  n
1
( z ) + 1 +    ( z )
1

−n −n 1
   ROC: z and z  2
n =−  2  n =1  3  3
ROC: z  2 and z 
1  1 1   1  2    1 3 
3 =   − 21  z −1 +   − 22  z −2 +   − 23  z −3 + ...
 3    3    3  
   
 1   1   
= − 1 + 1 +  − 1  1   1  3z z
1  1 − 1 z −1  = − = −
 1− z 
 2   3  1 −1   1 − 2 z −1  3z − 1 z − 2
 1− z 
2 3z 5z  3 
= + −1 =
2 − z 3z − 1 ( 2 − z )( 3z − 1) =
5z
( 2 − z )( 3z − 1)
Different x[n] with the same z-transform result.
Page: 51

2.6 Inverse z-Transform


As in Laplace Transform, if x[n] has the z-transform X[z], the
discrete-time signal x[n] can be given by inverse z-transform:
1
x  n = X  z z
2 j 
n −1
dz

Many of the transform X[z] of practical interest are rational


functions, which can be expressed as a sum of partial fractions:
Long Division expansion (Power Series Method):
B z z
X  z = , example: X  z  = = 0 + 1 z −1 + 3  z −2 + 7  z −3 ...
A z  z − 3z + 2
2

x  n  =  0,1,3, 7,15,... , x  n  = 2n − 1
Partial Fraction expansion:
X  z B z z z
= , example: X  z  = =
z z  A z  z − 3z + 2 ( z − 1)( z − 2 )
2

Page: 52

26
2025/2/17

Inverse z-Transform
Partial Fraction expansion:
Example:
z z −1 2
(a) X  z  = 2 = = +
z − 3z + 2 ( z − 1)( z − 2 ) ( z − 1) ( z − 2 )
1
a n −1u  n − 1   x  n  =  − (1) + 2 ( 2 )  u  n − 1
n −1 n −1

z−a  
X  z 1 −1 1
(b) = = +
z ( z − 1)( z − 2 ) ( z − 1) ( z − 2 )
−z z z
X  z = + a nu  n  
( z − 1) ( z − 2 ) z−a
 x  n  =  − (1) + ( 2 )  u  n  = −1 + 2n
n n
 
Page: 53

Inverse z-Transform
X  z B z
Why Partial Fraction expansion? : =
z z  A z 
If we expand rational X [ z ] into partial fractions,
we shall always obtain an answer that is multiplied by u[n -1].
8 z − 19 3 5
ex. X  z  = = +
( z − 2 )( z − 3) z − 2 z − 3
 x[n] = 3 ( 2 ) + 5 ( 3)  u[n -1]
n −1 n −1

 
X  z 8 z − 19 ( −19 / 6 ) + 3 / 2 + 5 / 3
 = =
z z ( z − 2 )( z − 3) z z −2 z −3
19 3  z  5  z 
X  z = − +  +  
6 2 z −2  3 z −3
19 3 n 5 n
 x[n] = −  [n] +  ( 2 ) + ( 3)  u[n]
6 2 3 
Page: 54

27
2025/2/17

Inverse z-Transform
Partial Fraction expansion: Complex Poles
2 z ( 3z + 17 ) 2 z ( 3z + 17 )
Example: X  z  = =
( z − 1) ( z 2
− 6 z + 25 ) ( z − 1)( z − 3 − j 4 )( z − 3 + j 4 )
X  z 2  1.6e − j 2.246 1.6e − j 2.246 
= + +  ( Heaviside "Cover-Up" Method )
z ( z − 1)  ( z − 3 − j 4 ) ( z − 3 + j 4 ) 
2z  z z 
X  z = + 1.6e − j 2.246 + 1.6e − j 2.246 
( z − 1)  ( z − 3 − j 4) ( z − 3 + j 4 ) 
z 2z
a nu  n     2u  n 
z−a ( z − 1)

r a cos ( b n +  ) u  n  , a = a e
n jb

( 0.5re ) z + ( 0.5re ) z
j − j

z−a z − a

 0.5r = 1.6 ,  = −2.246 , a = 3 + j 4 = 5e j 0.927 ,  a = 5, b = 0.927


x  n  =  2 + 3.2 ( 5 ) cos ( 0.927n − 2.246 )  u  n 
n
  Page: 55

2.7 Simulation Diagram and Flow Graphs


Transfer Function Representation

⚫ First order input/output difference equation

y  n + ay  n − 1 = bx  n  Y  z  + az −1Y  z  = bX  z 
bz bz
Y  z = X  z  H  z = assuming y  −1 = 0
z+a z+a
⚫ Second order input/output difference equation

y  n  + a1 y  n − 1 + a2 y  n − 2 = b0 x  n  + b1 x  n − 1
 Y  z  + a1 z −1Y  z  + a2 z −2Y  z  = b0 X  z  + b1 z −1 X  z 
assuming y  −1 = y  −2 = 0
b0 z 2 + b1 z b0 z 2 + b1 z
Y  z = 2 X  z  H  z = 2
z + a1 z + a2 z + a1 z + a2

Page: 56

28
2025/2/17

Transfer Function Representation


⚫ Step response to a first order input/output difference equation
z bz
Step input: u  n    H  z = : Transfer Function = Step Response
z −1 z+a
z bz
X  z H  z = Y  z   = Y  z
z −1 z + a
Y  z z bz 1 bz j k ( j + k ) z + ja − k
=   = = + =
z z − 1 z + a z ( z + a )( z − 1) z − 1 z + a ( z + a )( z − 1)
b
j=
 j+k =b j + ja = b 1+ a Y  z  b  1  ab  1
    =  + 
 ja − k = 0 ja = k ab z  1 + a  z − 1  1+ a  z + a
k=
1+ a
 b  z  ab  z
Y  z =   + 
 1+ a  z −1  1+ a  z + a
 b  n  ab 
y  n =   (1) +   ( − a ) , n = 0,1, 2,3,...
n

 1+ a   1+ a 
 b 
y  n =   1 + ( −1) ( a )  , n = 0,1, 2,3,...
n n +1

 1+ a 
Page: 57

Transfer Function Representation


⚫ Step response to a second order input/output difference equation
z z
Step input: u n    H z = 2 : Transfer Function = Step Response
z −1 z − 0.7 z + 0.1
z z
X  z  H  z = Y  z   = Y z
z − 1 z 2 − 0.7 z + 0.1
Y z z z 1 z k m n
=   = = + +
z z − 1 z 2 − 0.7 z + 0.1 z ( z − 0.2 )( z − 0.5)( z − 1) z − 1 z − 0.5 z − 0.2
k ( z − 0.2 )( z − 0.5) + m ( z − 0.2 )( z − 1) + n ( z − 0.5)( z − 1)
=
( z − 0.2 )( z − 0.5)( z − 1)
k = 2.5
 k +m+n =0 −2
 m= Y  z  2.5 −2 0.6 0.5 0.6
0.2k + 0.4m + n = 0  0.6  = + +
0.7k + 1.2m + 1.5n = −1 z z − 1 z − 0.5 z − 0.2
 n=
0.5
0.6
z −2 z 0.5 z
Y  z  = 2.5 + +
z − 1 0.6 z − 0.5 0.6 z − 0.2
 −2   0.5 
 y n  = ( 2.5)(1) +   ( 0.5) +   ( 0.2 ) , n = 0,1, 2,3,...
n n n

 0.6   0.6  Page: 58

29
2025/2/17

Physical meaning to the variable z



Real
x  n − q  u  n − q    x  n − q u  n − q  ( z )
−n
Translation
n =0
Property 
=  x  n − q  ( z ) , let i = n − q  n = i + q
−n

n=q
 
−( i + q )
=  x i  ( z ) = z − q  x i  ( z ) = z − q X  z 
−i

i =0 i =0

Example :
x  n u  n  X  z
x  n − 1 u  n − 1  z −1 X  z 

⚫ We see that a transfer function of z –1 is a delay of one period.


⚫ In DSP program, a delay of one period means last sampled data.

Page: 59

Transfer Function of Interconnections

⚫ A transfer function of z-1 is a delay of one period called unit-delay


element.

y[n] = x[n –1]


⚫ y[n] is equal to one-step time delay of the input x[n]

y[n] = x[n –1]  Y[z] = z -1 X[z]

x[n] D y[n] = x[n-1]

Page: 60

30
2025/2/17

Time Shifting

f(t1+T)=x(t1) set t= t1+T  t1= t – T  f(t)=x(t–T)

⚫ If T is positive, the
t1
shift is to the right
(delay).
⚫ If T is negative, the
shift is to the left
t1 (advance)
⚫ x(t-2) is x(t) delayed
t1+T
(right-shifted) by 2
seconds.

Page: 61

Solution of Difference Equations


Example 2.8, 2.9 : Finding the solution of difference equation,
1, k even
f [k ] : m ( k ) = e ( k ) − e ( k − 1) − m ( k − 1) , where k  0, e ( −1) = m ( −1) = 0 and e ( k ) = 
0, k odd
2.8: Recursion Process
m ( 0 ) = e ( 0 ) − e ( −1) − m ( −1) =1 , m (1) = e (1) − e ( 0 ) − m ( 0 ) = −2
m ( 2 ) = e ( 2 ) − e (1) − m (1) =3 , m ( 3) = e ( 3) − e ( 2 ) − m ( 2 ) = −4
m ( 4 ) = e ( 4 ) − e ( 3) − m ( 3) =5 , m ( 5) = e ( k ) − e ( 2 ) − m ( 2 ) = −6
2.9: z-transform and Long Division expansion
z −1
m ( k ) = e ( k ) − e ( k − 1) − m ( k − 1)  M ( z ) = E ( z ) − z −1E ( z ) − z −1M ( z )  M ( z ) = E (z)
z +1
M ( z ) 1 − z −1 1, k even 1
= , e (k ) =   E ( z ) = 1 + z −2 + z −4 + z −6 + ... =
E ( z ) 1 + z −1  0, k odd 1 − z −2
z −1 1 z −1 z2 z2
M (z) = = = 2 Long Division expansion
z +11− z −2
z + 1 ( z − 1)( z + 1) z + 2 z + 1
M ( z ) = 1 − 2 z −1 + 3z −2 − 4 z −3 + 5z −4 + ...  m ( k ) = 1, −2, 3, −4,5, ...
Page: 62

31
2025/2/17

Transfer Function of Interconnections


b0 z 2 + b1 z + b2 b0 z 2 + b1 z + b2
H  z =  Y  z  = X  z
z 2 + a1 z + a2 z 2 + a1 z + a2
assuming y  −1 = y  −2 = 0
b0 + b1 z −1 + b2 z −2
Y  z = X  z
1 + a1 z −1 + a2 z −2
 Y  z  + a1 z −1Y  z  + a2 z −2Y  z  = b0 X  z  + b1 z −1 X  z  + b2 z −2 X  z 
 y  n  + a1 y  n − 1 + a2 y  n − 2 = b0 x  n  + b1 x  n − 1 + b2 x  n − 2
y  n  = −a1 y  n − 1 − a2 y  n − 2 + b0 x  n  + b1 x  n − 1 + b2 x  n − 2
Plot the signal-flow diagram to realize the system need 4 delays
(memory address) and 4 summations. How to reduce the computation?
Y  z  + a1 z −1Y  z  + a2 z −2Y  z  = b0 X  z  + b1 z −1 X  z  + b2 z −2 X  z 
Y  z  = b0 X  z  + ( b1 X  z  − a1Y  z ) z −1 + ( b2 X  z  − a2Y  z ) z −2 2 delays
4 summations
Y  z  = b0 X  z  + ( b1 X  z  − a1Y  z ) + ( b2 X  z  − a2Y  z ) z −1  z −1
Page: 63

Transfer Function of Interconnections


N N

⚫ Nth order input/output difference equation: y  n  +  ai y  n − i  =  bi x  n − i 


i =1 i =1

y  n  + a1 y  n − 1 + a2 y  n − 2 + ... + aN y  n − N  = b0 x  n  + b1 x  n − 1 + ... + bN x  n − N 
 Y  z  + a1 z −1Y  z  + a2 z −2Y  z  + ... + a N z − N Y  z  = b0 X  z  + b1 z −1 X  z  + ... + bN z − N X  z 
assuming y  −1 = y  −2 = ... = y  − N  = 0
b0 z N + ... + bN −1 z + bN b0 z N + ... + bN −1 z + bN
Y  z = X  z   H  z  =
z N + a1 z N −1 + ... + aN −1 z + aN z N + a1 z N −1 + ... + aN −1 z + aN

H  z =
b0 z N + ... + bN −1 z + bN
= b0
( z − z1 )( z − z2 ) ... ( z − zN )
N −1
z + a1 z + ... + aN −1 z + aN
N
( z − p1 )( z − p2 ) ... ( z − pN )

⚫ The frequency response (amplitude and phase) of a system are


determined by the location of pole/zero of the transfer function H[z].
⚫ To obtain physical insight into the characteristics of a discrete-time
system, a graphical technique is used.

Page: 64

32
2025/2/17

System Interconnections
Realization of H [z]
Cascade

Parallel

Page: 65

System Interconnections
Realization of H [z]
Realize the following transfer function H(z) using the basic
blocks of adders, scalars, and delay units.
Y (z) z ( z − 1)
2

H ( z) = =
X ( z) ( z − 0.2 )  ( z 2 − z + 0.29 )
Y (z) z ( z − 1)
2

H (z) = = = M1 ( z )  M 2 ( z )
X ( z ) ( z − 0.2 )  ( z 2 − z + 0.29 )
 ( z − 1) = (1 − z −1 )
 1( )
M z =
Y (z) ( z − 1)  z ( z − 1) 
 ( z − 0.2 ) (1 − 0.2 z −1 )
 = 
X ( z ) ( z − 0.2 )  ( z 2 − z + 0.29 )  (1 − z −1 )
 M 2( )
z =

 (1 − z −1 + 0.29 z −2 )
Page: 66

33
2025/2/17

System Interconnections
Realization of H [z]
Y ( z)
=
z ( z − 1)
2

= M1 ( z )  M 2 ( z ) =
(1 − z )
−1


(1 − z ) −1

X (z) ( z − 0.2 )  ( z 2 − z + 0.29 ) (1 − 0.2 z ) (1 − z


−1 −1
+ 0.29 z −2 )
M (z) =
(1 + az −1
)
(1 − bz −1 )
M1
X[z] S S S S Y[z]

M 1 = X + M 1  z −1  ( 0.2 )
Z-1 Z-1 M1 1
 =
(1 − 0.2 z −1 )
(1 + az )
−1
X

M1 ( z ) = 0.2 –1 S –1 Y = M 1 + M 1  z −1  ( −1)
(1 − bz )
−1
b a Y
=
(1 − z −1 )  Y = (1 − z −1 )
–0.29 Z-1 M1 1 X (1 − 0.2 z −1 )
X[z] 1 1 M[z]
S
Z-1 Z-1

a b
Page: 67

System Interconnections
Realization of H [z]

Feedback

Y (z) H1 ( z ) H1 ( z )
H (z) = = =
X (z) 1 + H1 ( z ) H 2 ( z ) 1+ T ( z )

T ( z ) = H1 ( z ) H 2 ( z )
Page: 68

34
2025/2/17

System Realization

Direct Form II M z =


1
a0
( X  z  − a1z −1M  z )
1
M(z) X z
a0
 M  z =
a
1 + 1 z −1
a0
Y  z  = b0 M  z  + b1z −1M  z  = ( b0 + b1z −1 ) M  z 
1
X z
Y  z  = ( b0 + b1z −1 ) 0
a
a
1 + 1 z −1
a0
Y  z  ( b0 + b1 z )
−1

 =
X  z  a0 + a1 z −1
Y  z  b0 + b1 z −1 + ... + bN −1 z − ( N −1) + bN z − N
=
X  z  a0 + a1 z −1 + ... + a N −1z − ( N −1) + a N − N
Page: 69

System Realization

Cascade

M1 ( z ) =
(1 + az )
−1

(1 + bz )
−1

Page: 70

35
2025/2/17

System Realization

Parallel

Page: 71

System Realization
b0 z N + ... + bN −1 z + bN b0 + b1 z −1... + bN −1 z − N +1 + bN z − N
H  z = =
z N + a1 z N −1 + ... + aN −1 z + aN 1 + a1 z −1 + ... + aN −1 z − N +1 + aN z − N
 
(
= b0 + ... + bN −1 z − N +1 + bN z − N  ) −1
1
− N +1 −N 
= H1  z  
1
H2  z
 1 + a1 z + ... + aN −1 z + aN z 

X[z] M[z] Y[z]


H1[z] 1/H2[z]

X[z] b0 M[z] M[z] Y[z]


S M = X  H1
S 1
Y =M
Z-1 (
= X b0 + ... + bN −1 z − N +1 + bN z − N ) Z-1 H2
b1 -a1 Y  H2 = M
S S ( )
Y  1 + a1 z −1 + ... + aN −1 z − N +1 + aN z − N = M

(
Y = M − Y  a1 z −1 + ... + aN −1 z − N +1 + aN z − N )

Z-1 Z-1
bN-1 -aN-1
S S
Z-1 Z-1
bN -aN Page: 72

36
2025/2/17

System Realization
X[z] M[z] Y[z]
1/H2[z] H1[z]

1
X =M  X  H2 = M
H2
Y = M  H1
( )
X  1 + a1 z −1 + ... + aN −1 z − N +1 + aN z − N = M

(
X = M − X  a1 z −1 + ... + aN −1 z − N +1 + aN z − N ) (
= M b0 + ... + bN −1 z − N +1 + bN z − N )
X[z] M[z] M[z] b0 Y[z]
S S
Z-1 Z-1
-a1 b1
S S reduce
“delay”
process
Z-1 Z-1
-aN-1 bN-1
S S
Z-1 Z-1
-aN bN
Page: 73

System Realization
Example:

Y ( z) z + 7 1 + 7 z −1
= =
X ( z ) z + 1 1 + z −1
Y ( z ) + Y ( z ) z −1 = X ( z ) + 7  X ( z ) z −1
y  n  = x  n  + 7  x  n − 1 − y  n − 1
 yn = xn + 7 * xn _ prev − yn _ prev;
  yn = xn + 7 * xn _ prev − yn;
C programming  yn _ prev = yn; 
 xn _ prev = xn;  xn _ prev = xn;

X[z] 1 Y[z]
S
Memory -1 Memory
Z Z-1
update update
1 2
7 –1

Page: 74

37
2025/2/17

System Analysis using the Transfer Function

Cascade Transfer Functions

Y ( z ) z + K 08 1 + K 08 z −1
= =
X ( z ) z − K 09 1 − K 09 z −1
 yn = xn + K 08* xn _ prev − K 09 * yn _ prev;

C programming  yn _ prev = yn;
 xn _ prev = xn; Page: 75

System Analysis using the Transfer Function

Example: Determine the transfer function of the following discrete-


time system:

u(k) y(k)

M1 ( z) =
(1 + az )
−1

(1 − bz )
−1

X[z] 1 1 M[z]
S
Z-1 Z-1

a b
Page: 76

38
2025/2/17

System Analysis using the Transfer Function

X[z] 1 1 M[z]
S
Z-1 Z-1

a b

M1 ( z ) =
(1 + az ) −1

(1 − bz ) −1 Y ( z) 0.5  z −1
=
X ( z ) 0.5 − ( 0.5611 2 ) z −1 + ( 0.3025 2 ) z −2
Page: 77

System Analysis using the Transfer Function

x[n] m[n]
y[n]
D D
D

x[n-1] m[n-1] y[n-1]

Y (z) z + Kt1C 1 + Kt1Cz −1


= =
X (z) z − Kt1D 1 − Kt1Dz −1
 yn = xn + Kt1C * xn _ prev + Kt1D * yn _ prev;
( yn = xn + Kt1C * xn _ prev + Kt1D * yn;)

C programming 
( yn _ prev = yn;)
 xn _ prev = xn;
Page: 78

39
2025/2/17

Digital computer data arithmetic

Two‘s-complement (1’s C +1) arithmetic is the


most common method of representing signed
integers on computers.

8-bit data length, why 1128(DEC), 80(HEX)?

1 + Kt1E  z −1 1 + 0.99218 z −1 1 + ( 7Fh )  z


−1

G (z) = = = ?
1 − Kt1F  z −1 1 − 0.65625 z −1 1 − ( 54h )  z −1
Kt1E
0.99218  = 0.99218  Kt1E = 0.99218 128 = 127=7FH
128
Kt1F
0.65625  = 0.65625  Kt1F = 0.65625 128 = 84=54H
128
1 + Kt1E  z −1 1 − 0.98437 z −1 1 + ( 82h )  z
−1

G (z) = = = ?
1 − Kt1F  z −1 1 − 0.65625 z −1 1 − ( 54h )  z −1
Kt1E
0.98437  = −0.98437  Kt1E = −0.98437 128 = −126=82H
128 Page: 79

System Analysis using the Transfer Function

D D
D

Page: 80

40
2025/2/17

Approximation of Continuous Systems


Y (s) a 1
= H (s) = z = e sT  s = ln z
X (s) s+a T
Approximation

H1  z  =
a
s
( z − 1) ⎯⎯⎯⎯⎯⎯⎯⎯
( Forward rectangular rule ) 1
→ 
1
=
z −1
( z − 1) + a 1 s z − 1 1 − z −1

H2 z =
a
s
( z − 1) ⎯⎯⎯⎯⎯⎯⎯⎯
( Backward rectangular rule ) 1
→ 
z
( z − 1) / z + a z s z −1

H3 z =
a
s2
( z − 1) ⎯⎯
( Tustin's method )
⎯⎯ ⎯⎯
1 1 z −1
→ 
2
( z − 1) + a ( z + 1) s 2 z +1
( z + 1)
Bilinear transformation: It approximates
s with a ratio of two linear functions in z.
Page: 81

System Analysis using the Transfer Function

PID Controller G(t)


Kp

+ Up
e Ud
R + S Td d/dt + S C
– +
Ui

Feedback 1/Ti dt


-
G ( t ) = u p ( t ) + ui ( t ) + ud ( t )
⚫ Td is the derivative time
u p (t ) = Kp  e(t ) ⚫ Ti is the integral time
1 t ⚫ In discrete terms, the derivative gain is
ui ( t ) =  e ( )d defined as Kd = Td/Ts
Ti 0 ⚫ the integral gain is defined as Ki = Ts /Ti
de(t )
ud (t ) = Td  ⚫ where Ts is the sampling period and of the
dt PID controller

Page: 82

41
2025/2/17

System Analysis using the Transfer Function

400
Root locus of GP ( s ) =
1516.8s + 1
pole = 6.6 10−4

G ( s ) = u p ( s ) + ui ( s ) + ud ( s )
PID

1.6 24 s 2 + 8s + 1.6
=8+ + 24 s =
s s
−8  64 − 4  24  1.6
zero1,2 =
48
= −0.167  j 0.198
pole = 0
Page: 83

System Analysis using the Transfer Function

Plant only
Closed loop

Plant+PID
Closed loop

17 sec
Page: 84

42
2025/2/17

Page: 85

PID Parameters Calculation


1 t de ( t )
C ( t ) = Kp  e ( t ) +  e ( t ) dt + Td
Ti 0 dt
n de ( t ) e ( n ) − e ( n − 1)
( )  ( )
t
0 e t dt 
i =0
e i  Ts ;
dt

Ts
Ts  n  Td
 C ( n ) = Kp  e ( n ) +   e ( i )  +
Ti  i =0
( e ( n ) − e ( n − 1) )
 Ts
Ts Td
Ki = ; Kd =
Ti Ts
Ts = Sampling Time
Ti = Integration Time Constant
Td = Derivative Time constant
Page: 86

43
2025/2/17

PID Parameters Calculation


1 t de ( t )
C ( t ) = Kp  e ( t ) +  e ( t ) dt + Td
Ti 0 dt
n de ( t ) e ( n ) − e ( n − 1)
( )  ( )
t
0 e t dt 
i =0
e i  Ts ;
dt

Ts
Ts  n  Td
 C  n  = Kp  e  n  +  
Ti  i =0
e  i  + ( e  n − e n − 1)
 Ts
Ts  1  Td
C  z  = Kp  e  z  + 
Ti  1 − z −1  
e z +
 Ts
(
e  z  − z −1e  z  )
 1 
C  z  = Kp  e  z  + Ki 
1 − z
−1   (
e z + Kd e  z  − z −1e  z 

)
  −1 
Ki
(
C  z  =  Kp  + 1 − z −1 + Kd 1 − z  e  z 
 
)

 
1
 (
C  z  = Kp  e  z  + Ki  e  z  1 + z + z −2 + ... + Kd e  z  − z −1e  z 

)
Page: 87

PID Controller Implementation (Motor speed control)

Kp +
Ki
1− Z −1
+ Kd 1 − Z −1 ( )
(
Kp  e  z  + Ki  e  z  1 + z −1 + z −2 + ... + Kd e  z  − z −1e  z  )
e(n-1)
Z-1 Kd
– +
+
Speed e(n) + Current
command Kp command
+ +

+
Ki
+
Speed Feedback

Z-1
integrator

PID block diagram

Page: 88

44
2025/2/17

PID block in DSP program

Err Up Ui

Ud

I controller
anti − windup

Ui  n  =Ui  n − 1 +Ki*Up  n  +Kc*SatErr


Ui ( z ) = Ui ( z )  z −1 + Ki *Up ( z )
Ui ( z ) Ki z
= = Ki
Up ( z ) 1 − z −1 z −1

Page: 89

Low-pass filter realization memory last_C

700
+
=12214 rad/sec R 1100 16/65536 C
LPF -3db Freq.= 1944 Hz
+
-9

-10

700 Z-1
dB

-11

-12
+ S
-13
2 3 4 5
R 1100 16/65536 C
10 10 10 10
+
LPF -3db Phase= -6 Deg
10

5
C 0.2685  Z 1100
= =
deg

0
R Z − 0.1709 65536
− 700  Z −1
-5
16
-10
2 3 4 5 65536
10 10 10 10
 C = 1100  R + 700  C  Z −1
Rad/sec
Hz
16
S = 1100  R + 700  C  Z −1
 16 
C = S
 65536 

Page: 90

45
2025/2/17

System Analysis using the Transfer Function


1
G (s) = ,  = RC = 1  f c = 1 / 2 = 0.16 Hz ⎯⎯⎯
>2X
→ f s = 5Hz  T = 0.2sec
( RCs + 1)
 1  1 − e −T
G ( z ) = z
1 − e−Ts

1  z −1 1
 z −
1  z −1  z z  z =
=  = z   z − 1 − z − e −T   ( s + 1)  z − e
−T

 s ( s + 1)  z  s s + 1
 = s = 2 f s
z −1 z − e−T − z + 1 1 − e−T 1 1 − e−T 0.1813
= 1− = =  G (s) = ⎯⎯→ G z = =
z − e−T z − e−T z − e−T ( s + 1) z − e−T z − 0.8187

0.1813
z = e jT  G   =
( cos  − 0.8187 ) + j sin  =T
0.1813  sin  
 G   = and G   = − tan −1 
( cos  − 0.8187 ) + ( sin  )
2 2
 cos  − 0.8187 
Spectrum diagram (Linear scale)
0.1 1 10
0.02Hz 15Hz
100
0.16Hz

Bode diagram (Log scale) Page: 91

System Analysis using the Transfer Function


1
G (s) = ,  = RC = 1  c = 1 / 2 = 0.16 Hz ⎯⎯⎯
>2X
→ f s = 5Hz  T = 0.2sec
( RCs + 1)
 1 − e −Ts 1  z −1 1 1  z −1  z z 
G ( z ) = z  =  z −  = z   z − 1 − z − e −T 
 s ( s + 1)  z  s s + 1
z −1 z − e −T − z + 1 1 − e −T 1 − e −T 0.1813
= 1− = =  G z = =
z − e −T z − e −T z − e −T z − e −T z − 0.8187
0.1813
z = e jT  G   =
( cos  − 0.8187 ) + j sin  =T
0.1813  sin  
 G   = and G   = − tan −1 
( cos  − 0.8187 ) + ( sin  )
2 2
 cos  − 0.8187 

10 Spectrum diagram (Linear scale)


0.1
1 100
0.16Hz

Bode diagram (Log scale) Page: 92

46
2025/2/17

2.8 State Variables


⚫ Input/Output description of dynamic system by difference
equation.---external
⚫ State Space description of dynamic system by state equation.---
internal
⚫ The state of a system is a summary of the part of its past history
which will affect its future behavior represented by state
variables.

u1 ( k )   x1 ( k )   x1 ( k + 1) 
In electronic systems,
Input State  the 
    state variables are
 x2 ( k + 1) 
f
vector
u2 ( k ) 
u (k ) =  
, vector
 x2 ( k ) 
X (k ) =   =
number ( k +energy
X of 1) = 
storage elements in the 
     
circuit (capacitors and
ur ( k )   xn ( k )   x p ( k + 1) 
inductors).  

State variables
y ( k ) = g  x ( k ) , u ( k ) 
Output
vector Page: 93

強化學習訓練
Angle Weight matrix A and bias matrix B
機體角度

Ax+B
Angular Velocity 4
PWM
機體角速度 Ax+B Ax+B output

Position
機體空間位置
Simulink

Velocity
機體速度
States C++ Code
(pos,vel…) Compile and
upload Page: 94

47
2025/2/17

2.8 State Variables

 x1 ( k ) 
System  
 x2 ( k ) 
Internal X (k ) =  
state
Input Output  
 xn ( k )

U(k) Y(k)
X(k)

Page: 95

2.8 State Variables


⚫ The state variables represent the minimum amount of information
needed for system model.
⚫ An important representation for discrete-time linear systems is the
state-space formulation. The state-space representation is especially
powerful for multi-input, multi-output (MIMO) linear systems.
⚫ Given the system states xn(k), system dynamics f[ ], g[ ], and the input
function u(k); we can determine all subsequent states xn(k+1) and
output y(k).

If the system is linear and time-invariant(coefficients are constants):


x ( k + 1) = f  x ( k ) , u ( k )  x ( k + 1) = A  x ( k ) + B  u ( k )
 
 y ( k ) = g  x ( k ) , u ( k ) 
   y ( k ) = C  x ( k ) + D  u ( k )

Page: 96

48
2025/2/17

2.8 State Variables


 X ( k + 1) = A  X ( k ) + B  u ( k )

 y ( k ) = C  X ( k ) + D  u ( k )

⚫ XN is called the state vector of the system, its size (N) is
determined by the number of elements in the system that can
store energy independently.
⚫ A is the N×N state transition matrix, and it determines the
dynamics of the system (its poles or resonant modes).

Page: 97

Difference Equations and State Equations

⚫ Any explicit LTI difference equation can be converted to state-


space form.
⚫ In state-space form, many properties of the system are readily
obtained. For example, using standard utilities (such as in
Matlab), there are functions for computing the modes of the
system (its poles), an equivalent transfer-function description,
stability information, and whether or not modes are “observable”
and/or “controllable” from any given input/output point.

Page: 98

49
2025/2/17

Difference Equations and State Equations


Example:
Find a state-variable model of the system described by the difference equation
y ( k + 2 ) = u ( k ) + 1.7 y ( k + 1) − 0.72 y ( k )
⚫ system state x(k),
Let internal state x ( k ) is defined as
⚫ dynamics f[ ], g[ ]
 x1 ( k ) = y ( k ) ⚫ input function u(k)
?  x1 ( k + 1) = x2 ( k )
 x2 ( k ) = x1 ( k + 1) = y ( k + 1)
 x2 ( k + 1) = y ( k + 2 ) = u ( k ) + 1.7 x2 ( k ) − 0.72 x1 ( k )
 x1 ( k + 1) = 0  x1 ( k ) + 1 x2 ( k ) + 0  u ( k )

  x2 ( k + 1) = −0.72  x1 ( k ) + 1.7  x2 ( k ) + 1 u ( k )

 y (k ) = 1 x1 ( k ) + 0  x2 ( k )
  0 1 0  X ( k + 1) = A  X ( k ) + B  u ( k )
 X ( k + 1) =  A  X ( k ) + B  u ( k ) 
  −0.72 1.7  1   y ( k ) = C  X ( k ) + D  u ( k )
 y k = 1C 0 X k + 0D 0 u k
 ( )   ( )   ( )
Page: 99

From Difference Equations to State Equations via z-transform


Difference Equation:
y k  + an −1 y k − 1 + an −2 y k − 2 + ... + a0 y k − n  = bn −1u k − 1 + ... + b0u 0
z-Transform:
 Y  z  + an −1 z −1Y  z  + an −2 z −2Y  z  + ... + a0 z − nY  z  = bn −1z −1U  z  + ... + b0 z − nU  z 
assuming y  −1 = y  −2 = ... = y  −n  = 0
z − nY  z z n + an −1 z n −1 + an −2 z n −2 + ... + a0  = z − nU  z bn −1 z n −1 + ... + b1z1 + b0 
b0 + b1 z1 + ... + bn −2 z n −2 + bn −1 z n −1
Y  z = U  z
z n + an −1 z n −1 + ... + a1 z + a0
Y  z b + b z1 + ... + bn −2 z n −2 + bn −1 z n −1
= G z = 0 n 1
U  z z + an −1 z n −1 + ... + a1 z + a0
G[z] is the system transfer function, represented the function
of system internal states.

Y  z  b + b z1 + ... + bn −2 z n −2 + bn −1z n −1  E  z 
= G z =  0 n 1  上下同乘E[z]
U  z  z + an −1 z + ... + a1 z + a0  E  z 
n −1

Page: 100

50
2025/2/17

Difference Equations to State Equations via z-transform


( )
U  z  = z n + an −1 z n −1 + ... + a1 z + a0 E  z  = z n E  z  + an −1 z n −1 E  z  + ... + a1 zE  z  + a0 E  z 
u ( k ) = e  k + n  + an −1 e  k + n − 1 + ... + a2 e  k + 2 + a1 e  k + 1 + a0 e  k 
( )
xn k +1 ( )
xn−1 k +1 ( )
x2 k +1 ( )
x1 k +1 ()
x1 k
xn  k  x3 k  x2 k 
     

xn ( k + 1) = −an −1 xn ( k ) − ... − a1 x2 ( k ) − a0 x1 ( k ) + u ( k ) Process started with


xn −1 ( k + 1) = xn ( k ) defining the state variables
x1(k)=e[k],…

x2 ( k + 1) = x3 ( k )
x1 ( k + 1) = x2 ( k )
 x1 ( k + 1)   0
A B
1 0 0 0 0   x1 ( k )  0 
    
 x2 ( k + 1)   0 0 1 0 0 0   x2 ( k )  0 
 =   +  u k
       ( )
 xn −1 ( k + 1)   0 0 0 0 0 1   xn −1 ( k )  0 
    
 xn ( k + 1)   −a0 −a1 −a2 −a3 −a1 −an −1   x ( k )  1 
 n 
X ( k + 1) = A  X ( k ) + B  u ( k )
Page: 101

Difference Equations to State Equations via z-transform


Y z b + b z1 + ... + bn −2 z n −2 + bn −1 z n −1 E  z 
= G z = 0 n 1
U z z + an −1 z n −1 + ... + a1 z + a0 E  z 
Y  z  = ( b0 + b1 z1 + ... + bn −2 z n −2 + bn −1z n −1 ) E  z 
= b0 E  z  + b1 zE  z  + ... + bn −2 z n −2 E  z  + bn −1 z n −1E  z 
y ( k ) = b0 e k  + b1 e k + 1 + ... + bn −2 e k + n − 2 + bn −1 e k + n − 1
()
x1 k x1 k +1 ( ) ( )
xn −2 k +1 ( )
xn −1 k +1
   
x2 k 



xn −1 k




xn  k 
     

 x1 ( k )  0
C    
 x2 ( k )   0 
y ( k ) = b0 b1 ... bn −2 bn −1    +   u (k )
   
 xn −1 ( k ) 0
 xn ( k )  0
y (k ) = C  X (k ) + D  u (k )
 
D Page: 102

51
2025/2/17

State-Variable Block Diagram Description

( )
U  z  = z n + an −1 z n −1 + ... + a1 z + a0 E  z  = z n E  z  + an −1 z n −1 E  z  + ... + a1 zE  z  + a0 E  z 
u ( k ) = e  k + n  + an −1e  k + n − 1 + ... + a2e  k + 2 + a1e  k + 1 + a0e  k 
u ( k ) − an −1e  k + n − 1 − ... − a2 e  k + 2 − a1e  k + 1 − a0e  k  = e  k + n 
(
or U  z  = 1 + an −1 z −1 + ... + a1 z1− n + a0 z − n E  z  )
 E  z  = U  z  − an −1 z E  z  − ... − a1 z
−1 1− n
E  z  − a0 z − n E  z 
Internal states

e[k+n] e[k+n-1] e[k+2] e[k+1] e[k]


u(k) + z-1 z-1 z-1 z-1 z-1

-an-1

-a2
-a1
-a0
Page: 103

State-Variable Block Diagram Description

(
Y  z  = b0 + b1 z1 + ... + bn −2 z n −2 + bn −1 z n −1 E  z  )
y ( k ) = b0 e  k  + b1e  k + 1 + ... + bn − 2e  k + n − 2 + bn −1e  k + n − 1

Control canonical form of discrete-time system + y(k)

bn-1 b2 b1 b0

u(k) e[k+n] e[k+n-1] e[k+2] e[k+1]


+ z–1 z–1 z–1 z–1 z–1 e[k]
x1(k)=e[k]

-an-1

-a2
-a1
-a0
Page: 104

52
2025/2/17

State-Variable Block Diagram Description


Difference Equation:
y k  + an −1 y k − 1 + an −2 y k − 2 + ... + a0 y k − n  = bn −1u k − 1 + ... + b0u 0

Control canonical form + y(k)


of discrete-time system

bn-1 b2 b1 b0

u(k) e[k+n] e[k+n-1] e[k+2] e[k+1]


+ z–1 z–1 z–1 z–1 z–1 e[k]
x1(k)=e[k]

-an-1

-a2
-a1
-a0
Page: 105

State-Variable Block Diagram Description

Y ( z) 2 z − 0.6 2 − 0.6 z −1
= G ( z) = =
X ( z) z + 0.5 1 + 0.5 z −1
1. Direct programming
Y ( z ) = 2  X ( z ) − 0.6 z −1 X ( z ) − 0.5  z −1  Y ( z )
 y[n] = 2 x[n] − 0.6 x[n − 1] − 0.5 y[n − 1]

+
x(k) − y(k)
2 z -1 0.3 S Y(z)
X(z)

0.5 z -1

Page: 106

53
2025/2/17

State-Variable Block Diagram Description


Y (z) 2 z − 0.6 2 − 0.6 z −1
= G (z) = =
X (z) z + 0.5 1 + 0.5z −1
2. Standard programming: rewrite the pulse transfer function,
Y (z) Y (z) H (z)  
= (1 − 0.3z −1 )  
2
=  −1 
X (z) H (z) X (z)  1 + 0.5 z 

+
h(k) h(k-1) − y(k) x(k) + h(k) h(k-1)
z -1 0.3 S Y(z) 2 S z -1
H(z) z-1H(z) X(z) H(z) z-1H(z)

0.5
+
x(k) + − y(k)
2 S z -1 0.3 S Y(z)
X(z)

0.5
Page: 107

State-Variable Block Diagram Description


Y (z) 2 z − 0.6 2 − 0.6 z −1
= G (z) = =
X (z) z + 0.5 1 + 0.5z −1
3. Ladder programming: rewrite the pulse transfer function,
Y (z) 2 z − 0.6 1 1
= G (z) = = 2+ = 2+
X (z) z + 0.5 −0.625 z +
1

1
− 0.3125
−3.2 1.6  z −1
−1.6  z −1
=2+
1 + 0.3125 (1.6  z −1 )

x(k) + y(k)
2 S
X(z) + Y(z)
+
S –1.6 z -1

−0.3125
Page: 108

54
2025/2/17

State-Variable Block Diagram Description

 b1 = 2
Y  z b0 + b1 z1 + ... + bn −2 z n −2 + bn −1 z n −1 2 z − 0.6 
= G  z = =  b0 = −0.6
U  z z n + an−1 z n−1 + ... + a1 z + a0 z + 0.5  a = 0.5
 0
Control canonical form + y(k)

ek1=0; //clear initial state


for(;;) { 2 -0.6
ek=ek1; //store state e[k+1] to mem. e[k]=e[k+1]z -1
ek1=u-0.5*ek; //calculate e[k+1]
y=2*ek1-0.6*ek; //calculate output y
u(k) } e[k+1]
+ k=0, ek=0, ek1=0, y=2*0+0 Z–1 e[k]
k=1 , ek=0, ek1=a2, y=2*a2+0.6*0
x2(k) x1(k)=e[k]
k=2 , ek=a2, ek1=a3, y=2*a3+0.6*a2
k=3 , ek=a3, ek1=a4, y=2*a4+0.6*a3
k=4 , ek=a4, ek1=a5, y=2*a5+0.6*a4
k=5 , ek=a5, ek1=a6, y=2*a6+0.6*a5

-0.5
Page: 109

State-Variable Block Diagram Description


b0 = 43.4491
Y  z b0 + b1z1 + ... + bn − 2 z n − 2 + bn −1z n −1 43.4491 
= G z = = 2   a0 = 0.5157
U  z z n + an −1z n −1 + ... + a1z + a0 z + (−1.4863) z + 0.5157 
 a1 = −1.4863
Control canonical form of discrete-time system
ek2=0; //clear initial state + y(k)
ek1=0; //clear initial state
for(;;) {
ek=ek1; //store state e[k+1] to mem. e[k]=e[k+1]z -1
ek1=ek2; //store state e[k+2] to mem. e[k+1]=e[k+2]z -1 43.4491
ek2=u+1.4863*ek1-0.5157ek; //calculate e[k+2]
y=43.4491*ek; //calculate output y
} x3(k) x2(k)
u(k) k=0, ek=0, ek1=0, ek2=a1,y=0 e[k+2] e[k+1] e[k]
+ k=1, ek=0, ek1=a1, ek2=a2,y=0 z–1 z–1
k=2, ek=a1, ek1=a2, ek2=a3,y=43.4491*a1 x1(k)=e[k]
k=3, ek=a2, ek1=a3, ek2=a4,y=43.4491*a2
k=4, ek=a3, ek1=a4, ek2=a5,y=43.4491*a3
k=5, ek=a4, ek1=a5, ek2=a6,y=43.4491*a4

1.4863
-0.5157
Page: 110

55
2025/2/17

State-vector Block Diagram Description

x ( k + 1) = A  x ( k ) + B  u ( k )

y ( k ) = C  x ( k ) + D  u ( k )

x(k+1) x(k)
u(k) B + Z–1 C + y(k)

Page: 111

Difference Equations to State Equations via z-transform


Difference Equation: Summary and Example
y k  + an −1 y k − 1 + an −2 y k − 2 + ... + a0 y k − n  = bn −1u k − 1 + ... + b0u 0
z-Transform:
Y  z b + b z1 + ... + bn −2 z n −2 + bn −1 z n −1 z2 + 2z + 1
= G z = 0 n 1 e. g. 3
U z n −1
z + an −1 z + ... + a1 z + a0 z + 2 z 2 + z + 0.5
State Equation:
 x1 ( k + 1)   0
  
 x2 ( k + 1)   0
 =
1
0
0
1 A 0
0
0
0
0   x1 ( k )  0
 
0   x2 ( k )   0 


B 
 +   u (k )
       
 xn −1 ( k + 1)  0 0 0 0 0 1   xn −1 ( k ) 0
    
−an −1   x ( k )  1 
 xn ( k + 1)   −a0 −a1 −a2 − a3 −a1
 n 
  x1 ( k + 1)   0 1 0   x1 ( k )  0
 x1 ( k )      
    x2 ( k + 1) =  0 0 1   x2 ( k )  +  0  u ( k )
  
 x2 ( k ) 

C
  x3 ( k + 1)   −0.5 −1 −2   x3 ( k )  1 
 
y ( k ) = b0 b1 ... bn −2 bn −1    e. g. 
    x1 ( k ) 
x (
 n −1 k )   
 xn ( k )  y ( k ) = 1 2 1  x2 ( k )
  
 x3 ( k ) 
 Page: 112

56
2025/2/17

State Equation Block Diagram Description


Example 2.18: the order of the numerator is equal to denominator

Y z b + b z1 + b2 z 2 b2 + b1 z −1 + b0 z −2 E  z 
= G  z = 0 2 1 =
U  z z + a1 z + a0 1 + a1 z −1 + a0 z −2 E  z 
 

Y  z  = b0 z E  z  + b1 z E  z  + b2 E  z  
−2 −1
 
 
 X 1  z  X 2  z  
 
U  z  =  E  z  + a1 z −1E  z  + a0 z −2 E  z    E  z  = U  z  − a0 X 1  z  − a1 X 2  z 
 
 
 X 2  z  X 1  z  

 Y  z  = b0 X 1  z  + b1 X 2  z  + b2  U  z  − a0 X 1  z  − a1 X 2  z 
Y  z  = ( b0 − b2  a0 ) X 1  z  + ( b1 − b2  a1 ) X 2  z  + b2U  z 

C(b − b a )  xx (kk )  + b  u (k )


y ( k ) = ( b0 − b2a0 ) 1

 ( )
1 2 1 2

D
2

 y (k ) = C  X (k ) + D  u (k )
Page: 113

State Equation Block Diagram Description


Example 2.19 x1(k+1)

x2(k+1)

x ( k + 1) = A  x ( k ) + B  u ( k )

Derive the state equation of above figure: y ( k ) = C  x ( k ) + D  u ( k )
 x1 ( k + 1) = 0.5  x1 ( k ) + u1 ( k ) + u2 ( k )
  x1 ( k + 1)  0.5 0   x1 ( k )  1 1  u1 ( k ) 
  =  +  
 y1 ( k ) = x1 ( k ) + 2  x2 ( k )
  x2 ( k + 1)   1 −1  x2 ( k )  0 1 u2 ( k ) 

 x2 ( k + 1) = x1 ( k ) − x2 ( k ) + u2 ( k )
  y1 ( k )  1 2   x1 ( k )  0 0   u1 ( k ) 
  =  +  
 y2 ( k ) = x2 ( k ) + u2 ( k )
  y2 ( k )  0 1   x2 ( k )  0 1  u2 ( k ) 
Page: 114

57
2025/2/17

2.9 State Variable Formulations


For a given system, no unique state-variable formulation.
Y z 1
=
X  z  z 2 − 1.7 z + 0.72
x1 x2
 1  1 
=  
 z − 0.9   z − 0.8 

x1
 10   −10 
= + 
 z − 0.9   z − 0.8 
x2

1
=
0.72 + z ( z − 1.7 )
1/ 0.72
=
1
1+  z ( z − 1.7 )
0.72 

Page: 115

Similarity Transformations
Derive different state equation models through Similarity
Transformations to describe the same system relative to new state-
variable coordinates:

x ( k + 1) = A  x ( k ) + B  u ( k )

y ( k ) = C  x ( k ) + D  u ( k )
By Linear Transformation:
x ( k ) = Pw ( k ) , P is a n  n constant matrix, and P −1 exists.
Pw ( k + 1) = AP  w ( k ) + B  u ( k ) w ( k + 1) = P -1 AP  w ( k ) + P -1B  u ( k )
 
y ( k ) = CP  w ( k ) + D  u ( k ) y ( k ) = CP  w ( k ) + D  u ( k )
w ( k + 1) = A w  w ( k ) + B w  u ( k )

y ( k ) = Cw  w ( k ) + Dw  u ( k )
A w = P -1 AP is called Similarity Transformation
Page: 116

58
2025/2/17

Similarity Transformations
 0.8 1  0 
 x ( k + 1) =    x (k ) +    u(k )
Example 2.21 :   0 0.9  1 
y k = 1 0  x k
 ( )   ( )
 餘因子矩陣 
T
 1 1
1 −1  Cof   −1 1  0.5 0.5
P 
Choose P=   and P −1 =  = = 
1 1  P 2  −0.5 0.5
  1.35 0.55
 A w = P AP= 
-1

  −0.45 0.35
   1.35 0.55 0.5
 0.5  w ( k + 1) =    w (k ) +    u(k )
 B w =P -1B =     −0.45 0.35 0.5
0.5  y k = 1 −1  w k
 ( )   ( )

 Cw = CP= 1 −1
Since the eigenvalues of A are the poles
the characteristic equation of A: of the system, it follows that the
zI − A = ( z − 0.8 )( z − 0.9 ) = zI − A w eigenvalues of P-1AP are the same. In
other words, eigenvalues are unaffected
( z − 1.35)( z − 0.35) − (−0.45* 0.55) by a similarity transformation.
Page: 117

 a11 a12 a13 


A =  a21 a23   M 21 = 12
a a13 a a13
a22 ; M 22 = 11 ;...
a32 a33 a31 a33
 a31 a32 a33 
 C21 = (−1) 2 +1 M 21 = − M 21 ; C22 = (−1) 2 + 2 M 22 = M 22

The matrix of cofactors for an n  n matrix P is the matrix whose (i, j ) entry is the cofactor Cij of P.
a a12  C C12 
 Cof  P  =  11  ; where Cij = ( −1)  M ij
i+ j
P=  11
a22 
 a21  21
C C 22 

 ( −1)  a22 ( −1)  a21   ( −1) 1 ( −1) 1 1


1+1 1+ 2 1+1 1+ 2
1 −1 −1
P=    Cof  
P =   =  =
1 
 ( −1)  a12 ( −1)  a11  ( −1)  ( −1) ( −1) 1 1
1+1 1+1 2 +1 2+ 2
1 1 

Page: 118

59
2025/2/17

x ( k + 1) = A  x ( k ) + B  u ( k )  zX ( z ) = A  X ( z ) + B  U ( z )
 
y ( k ) = C  x ( k ) + D  u ( k ) Y ( z ) = C  X ( z ) + D  U ( z )
 B U ( z )
 X ( z )( zI − A ) = B U ( z )  X ( z ) =
 ( zI − A )

Y z = C  X z + D U z = CB  U ( z ) + D  U z =  CB + D  U z
 ( ) ( ) ( )
( zI − A )
( ) 
 ( zI − A )
 ( )


Y ( z)  CB 
 = G (z) =  + D transfer function
U (z)  ( zI − A ) 

 0.8 1  0
x ( k + 1) =    x (k ) +   u (k )
Example 2.21 :   0 0.9  1 
y k = 1 0  x k
 ( )   ( )
Page: 119

Chapter 2 Exercises
Fourth Edition
2-4 2.2-1
2-13 2.5-2
2-15 2.6-1
2-19 2.8-2
2-24 2.11-2
2-34 2.11-3

Page: 120

60

You might also like