HW 1
HW 1
HW 1
PROJECT 1
TEAM MEMBERS:
Mehmet Hüseyin Kılınçkıran 040190503
Furkan Yüksel 040210747
İsmail Tuna Kurt 040190618
Oğuzhan Buda 040200612
Project 1 17.03.2024
QUESTION 1
A)
Equation 1 is our base equation. We assume initial conditions are zero, and apply
Laplace Transform for both sides in Equation 2
Y ( s) 2
G(s)= = 2 (3)
U (s) s +5 s+6
Ts
1−e
GZOH (s)= (5)
s
Multiply ZOH function with T(s) and imply simple fraction operations Equation 6
Ts
1−e 2 A B C
T ( s)= ∗( 2 )=1−e Ts⋅( + + ) (6)
s s +5 s +6 s s+2 s+ 3
2
Project 1 17.03.2024
Ts 1/3 1 2/3
T (s)=1−e ⋅( − + ) (7)
s s+2 s+ 3
Ts −1 Z−1
Ζ {1−e }=1−Z =
Z
1/3 1 Z
Ζ{ }= ⋅( )
s 3 Z−1
1 Z (8)
Ζ{ }=
s+2 Z−e 2 T
2/3 2 Z
Ζ{ }= ⋅( )
s+3 3 Z−e(−3 T)
Z−1 Z Z 2Z
Ζ {T (s)}= ⋅( − + ) (9)
Z 3 Z−3 Z −e(−2 T )
3 Z−3 e
(−3T )
Sampling period T = 0.1s, substituting in Equation 10 and using the Matlab script in
Text 1 brings the results in Equation 10, the Z transform of differential equation in
Equation 1.
T = 0.1;
z = tf('z',T)
TZ = minreal(1/3- ...
(z-1)/(z-0.818)+ ...
(2*z-2)/(3*z-2.22))
Text 1: Matlab script 1
0.008667 Z +0.007107
T ( Z )= (10)
Z 2−1.558 Z +0.6053
3
Project 1 17.03.2024
B)
To find the difference equation the transfer function is equalized to the input/output in
equation 11.
Y (Z ) 0.008667 Z+ 0.007107
= (11)
U (Z ) Z 2−1.558 Z +0.6053
Y (Z ) 0.008667 Z+ 0.007107
= (12)
U (Z ) Z 2−1.558 Z +0.6053
4
Project 1 17.03.2024
C)
The output in figure 1 is obtained as the output of Matlab code above in the Text 1.
QUESTION 2
A)
Block reduction method and rules are used in order of Eq.15, Eq.16, Eq.17, Eq.18,
Eq.19, Eq.20, Eq.21.
R* (s)⋅G1 (s )⋅G2 (s)−C* ( s)⋅G1 ( s)⋅G2 (s)−C * (s)⋅H (s )⋅G2 (s)=C( s) (17)
* * * * *
( R (s)⋅G1 (s )⋅G2 (s )−C ( s)⋅G1 ( s)⋅G 2 ( s)−C (s )⋅H (s )⋅G2 (s )) =(C(s)) (18)
R* ( s)⋅(G1 (s)⋅G2 (s))* =C* (s)⋅G1 (s)⋅G2 (s)−C * (s)⋅H (s )⋅G2 (s)+C * (s ) (19)
* * * * *
R ( s)⋅(G 1 (s)⋅G2 (s)) =C (s)⋅G 1 (s)⋅G2 (s)−C (s)⋅H (s )⋅G2 (s)+C (s ) (20)
In Eq.22, the transfer function of the system is reached. And applied Z transform to
Eq.22 reaches the discrete time closed loop transfer function in Eq.23
* *
R (s ) G 1 G2 (s)
*
= * * (22)
C (s) G 1 G 2 (s)+ H (s)G 2 (s )+1
R (Z) G1 G2 (Z )
= (23)
C (Z) G1 G 2 (Z)+ H (s)G 2(Z )+1
6
Project 1 17.03.2024
B)
Block reduction method and rules are used in order of Eq.24, Eq.25, Eq.26
* * *
((R (s)−(C ( s)⋅H (s)) ⋅D2 ( s))⋅D 1 (s )−(C (s)⋅H ( s)) ⋅D 2 (s))⋅G(s)=C ( s) (24)
* * * * * * *
R (s)⋅D 1 G ( s)−CH (s)⋅D 2 D 1 G (s )−CH (s)⋅D2 G ( s)=C (s) (26)
*
C (s)
T (Z )= * (27)
R (s )
QUESTION 3
A)
2 2 2 2
Z X (Z)−Z X (0)−Z X (1)−1.2 ZX ( Z)−1.2 ZX (0)+ 0.35 X ( Z)=Z U ( Z )−Z U (0)−ZU (1)
(30)
7
Project 1 17.03.2024
The fractional part in X(z) and its residues are found in Eq. 31, Eq.32, Eq.33
3 2
Z + 2.2 Z −2.2 Z
X (Z)= 3 2 (31)
Z −2.2 Z +1.55 Z−0.35
A B C
X (Z)=1+ + + (32)
Z−1 Z−0.7 Z−0.5
Z −1 {1}= δ (k ) (36)
6.66 Z 1
=6.66⋅Z −1 =6.66⋅Z −1
Z−1 Z−1 1−Z −1 (37)
6.66
Z−1 { }=6.66 u(k −1)
Z−1
8
Project 1 17.03.2024
1.98 −1 Z
=Z ⋅1.98⋅( )
Z−0.7 Z −0.7
(38)
−1 1.98 (k−1)
Z { }=1.98⋅0.7
Z−0.7
1.98 Z
=Z −1⋅1.98⋅( )
Z−0.7 Z −0.7
(39)
1.98
Z −1 { }=1.98⋅0.7(k−1)
Z−0.7
B)
Separated into residues of X(s) in Eq.41
3 s+6 A B
X (s)= = + (41)
( s+ 3)(s +6) s+3 s +6
−1 4
X ( s)= + (42)
s+3 s+ 6
−1 4
Z {X (s )}=Z { + }→ (43)
s +3 s+6
−1 4 −Z 4Z
Z {X (s )}=Z { + }→ + (44)
s +3 s+6 Z−e (−3 T )
Z−e(−6 T )
9
Project 1 17.03.2024
C)
Analytically calculate the z-transform of the expression given in Eq.45
(−Ts)
1−e 2
X (s)= 2 (45)
s (s +a)
Separate the z-transform of the part with polynomial numerator and denominator is
taken by dividing X(s) into two parts in Eq.46.
X (s)=1−e
(−Ts)
⋅F (s) (46)
2 A B C
F( s)= = + + (47)
(s⋅(s +a) ) s (s +a) (s+ a)
2 2
2 −2 −2
A= , B= , C= 2 (48)
a 2
a a
(−Ts)
1−e 2
X (s)= ⋅( ) (49)
s (s +a)2
2 2 2
Z {X (s )}=Z {1−e(−Ts)⋅( 2
− 2
− 2 )} (50)
(a ⋅s) (a⋅( s+a) ) (a ⋅(s +a))
Ts
Z =e →Z {1−e
(−Ts)
}=1−Z
−1
(51)
10
Project 1 17.03.2024
2 2
⋅T⋅e (−aT)⋅Z−1 2
⋅1
−1 2 1 a a (52)
Z {X (s )}=1−Z ⋅( 2 1
− (−aT ) −1 2
− (−aT) −1
)
a 1−Z ( 1−e Z ) 1−e Z
2 2 −1 T⋅e(−aT)⋅Z−1 2 1
Z {X (s )}= 2
− ⋅(1−Z ) (−aT ) −1 2
− 2⋅(1−Z−1 ) (53)
a a
(−aT) −1
(1−e Z ) a 1−e Z
11