Faculty of Architecture and Engineering
Department of Computer Engineering
Program
Master of Science in Electronics and Communication Engineering
MSc ECE 1
Submitted on ...../....../2023
Group 2 Msc ECE 1 Signatures Points Accepted by:
Rikardo Brahja Prof.Dr. Gëzim Karapici
Viktor Çukaj
Artjola Tabaku
Tirana, 2023
Project Data
1. Given the discrete transfer function:
Y ( z) 2
Gp ( z) 2 (1.1)
U ( z ) z 1.3z 0.4
U ( z) Y ( z)
Gp(z)
Fig. 1 Dicrete system with transfer function Gp(z)
a) Find the poles of this transfer function and draw them in the complex plane z. Draw the
unit circle as well, to verify whether the poles are inside or outside the circle.
b) Is this system stable?
c) Find the final value lim y (k ) using Final Value Theorem, when the input signal is:
k
u (k ) 1 (1.2)
y kT
d) Formulate an Octave script to plot the transient process for .
Solution
a) Transfer function poles are found from the solution of the following equation:
z 2 1.3z 0.4 0 (1.3)
From where:
1.3 1.32 4 0.4 1.3 0.3 z1 0.8
1 z2 (1.4)
2 2 z2 0.5
Below is the Octave script for plotting pole – zero of the transfer function given in (1.1).
%Pole zero map
Gpznum=2
Gpzden=[1 -1.3 0.4]
T=1
Gpz=tf(Gpznum, Gpzden,T)
figure(1)
pzmap(Gz), hold on
x = -1:0.01:1;
y = (1 - x .^ 2) .^ 0.5;
Project N.1 in Automatic Control - AY 2022-2023 2
plot(x,y, "linewidth", 2, x,-y, "linewidth", 2);
xlabel('Real axis \sigma', 'fontsize',14)
ylabel('Imaginary axis j \omega', 'fontsize',14)
title(['Pole Zero Map for k=',num2str(k),' T=',num2str(k)],'fontsize',16)
legend('off')
grid minor
b) The system is stable because the two roots of the equation (1.3) are inside of the unit
circle.
c) c) Based on the final value theorem:
lim y(k ) lim ( z 1)Y ( z ) lim ( z 1)G( z )U ( z )
k z 1 z 1
2 z (1.5)
lim ( z 1) 2 20
z 1
z 1.3z 0.4 z 1
d) To plot the unit step response, we’ve written the following Octave script.
%Step Response of Digital System
figure(2);
step(Gz,'r');
title(['Step response for k=',num2str(k),' T=',num2str(T)],'fontsize',16)
xlabel('t=kT(sec)','fontsize',14)
ylabel('y(kT)','fontsize',14)
% Modifying Line width and font sizes in the axis
% 1. Modifying Line width
h = findobj(gca, 'type', 'line');
set(h, 'LineWidth', 2)
% Modifying font sizes in the axis
set(gca, "linewidth", 1, "fontsize", 15)
Project N.1 in Automatic Control - AY 2022-2023 3
Fig. 2 Unit Step Response
We notice that the transient response after about 25 sec. reaches the stabilized value y () 20 ,
so the system is stable.
2. Find inverse z – transform of the discrete transfer function
Given the discrete transfer function:
1
F z (1.6)
z 2.5 z 1
2
a) Find the inverse z transform using partial fraction decomposition.
Solution
a) Using partial fraction decomposition
1 1 A B
F z (1.7)
z 2.5z 1 z 2 z 0.5 z 2 z 0.5
2
where:
1 1
A lim z 2
z 2 z 2 z 0.5 1.5
(1.8)
B lim z 0.5 1 1
z 0.5 z 2 z 0.5 1.5
To calculate the residues using Octave, below is presented the following Octave script.
% calculation of residues
clear all, clc, clf()
num = [1]; % numerator of F(z)
den = [1 -2.5 1]; % denominator of F(z)
[r, p, k] = residue(num,den) % calculation of residues
Project N.1 in Automatic Control - AY 2022-2023 4
Results
r=
0.6667
-0.6667
p=
2.0000
0.5000
k = []
From the table of z-Transform:
k 1 z 1
1 1
a Z 1
= Z 1 (1.9)
1 az z a
so:
k
1 k 1 1 1 41
f (k ) 2 k 1 2k (1.10)
1.5 2 3 32
3. Find Digital Transfer Function from Continuous Transfer Function
Continuous Transfer Function of the process is given in Fig. 3:
s 1
G p (s) (1.11)
0.1s 1
Find Digital Transfer Function if the sampling period is T 0.25sec.
A/D
T Y ( z)
D/A - ZOH Process y (kT )
*
sT
Y (s)
u (kT ) U ( z ) 1 e U ( s ) Gp(s)
U * (s) s Y (s)
Fig. 3 The Process and the D/A converter
a) Write an Octave script for finding Digital Transfer Function of the process in cascade
with ZOH
T=0.25; % sampling time
Gpnum=[1 1]
Gpden=[0.1 1];
Gps=tf(Gpnum,Gpden) %open−loop transfer function
Gpz=c2d(Gps,T,'zoh') %convert to discrete−time
Gpz=minreal (Gpz) % simplify
Project N.1 in Automatic Control - AY 2022-2023 5
Results
Gp(z) =
10 z - 9.082
------------
z - 0.08208
Sampling time:
T = 0.25
4. “PI” Controller Design
Consider a car, which has a weight m = 1000 kg. Assuming the average coefficient of friction
b=100, design a speed control system such that the car reaches 100 km/h from 0 km/h in the
settling time ts=8 s with an overshoot of no more than 20% (OS% =20)
Controller Process
R(s) E(s) U(s) 1 Y(s)
Gc(s)
ms b
Fig. 4 Block diagram of the continuous system
Solution
Let’s take a PI controller with e transfer function
ki
Gc ( s ) k p (1.12)
s
Closed loop transfer function:
Gc ( s)G p ( s) 0.001k p s 0.001ki
G ( s) (1.13)
1 Gc ( s )G p ( s ) s 2 (0.1 0.001k p ) s 0.001ki
Performance indicators in the complex plan (position of the desired poles) are defined as
follows
(a) Real part of the desired poles
4 4
0.5 (1.14)
ts 8
(b) Damping factor for a given OS%=5%
Project N.1 in Automatic Control - AY 2022-2023 6
ln(OS % /100) ln(5 /100)
0.69 0.7 (1.15)
2 ln(5 /100)
2 2
ln(OS % /100)
2
(c) Natural Frequency
0.5
n 0.83 (1.16)
0.7
Desired Closed Loop Transfer Function :
n2 0.69
Gdes ( s) 2 (1.17)
s 2n n s 1.15s 0.69
2 2
Comparing the coefficients near the same powers of s of the denominators of (1.17) and (1.13),
we find
0.1 0.001k p 1.15 k p 1050
(1.18)
0.001ki 0.69 ki 690
Simulations in Scilab
Fig. 5 Continuous System block diagram
Fig. 6 Unit Step Response
Project N.1 in Automatic Control - AY 2022-2023 7
Digital Controller with sampling time 30 x bandwidth
1
PI controller with sampling period T 0.15 sec. seconds using bilinear
30 0.53
transformation is:
k 690 1083z 1016
Gc ( z ) Gc ( s ) s 2 z 1 k p i 1050
T z 1
s s 2 z 1 s s 2 z 1 z 1
T z 1 T z 1
(1.19)
Fig. 7 Hybrid system
Fig. 8 Hybrid system simulation
Project N.1 in Automatic Control - AY 2022-2023 8