0% found this document useful (0 votes)
2 views

Dcs Report 2

The lab report focuses on the application of MATLAB for converting s-domain transfer functions into z-domain, emphasizing the significance of sampling time on transient and frequency responses. It compares different methods such as bi-linear transform, first-order hold, and zero-order hold, highlighting their effects on system stability and response accuracy. The report concludes that proper selection of sampling time and transformation methods is essential for accurate digital control system representation.

Uploaded by

Harka Pun
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Dcs Report 2

The lab report focuses on the application of MATLAB for converting s-domain transfer functions into z-domain, emphasizing the significance of sampling time on transient and frequency responses. It compares different methods such as bi-linear transform, first-order hold, and zero-order hold, highlighting their effects on system stability and response accuracy. The report concludes that proper selection of sampling time and transformation methods is essential for accurate digital control system representation.

Uploaded by

Harka Pun
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 15

TRIBHUWAN UNIVERSITY

INSTITUTE OF ENGINEERING
PULCHOWK CAMPUS

A LAB REPORT
ON
Digital Control System
(Lab-2)

Submitted by:

Bibek Pandey (078BEL028)


Bhumi Raj Sharma(078BEL025)
Bhupesh Jaishi(078BEL026)
Bikram Babu Basnet(078BEL029)
Binod Kumar Sah(078BEL030)

Submitted to:

Department of Electrical Engineering


LAB 2
Z-TRANSFORM USING MATLAB

A. OBJECTIVE:
The objectives of the experiment are:
1. Learn the application of MATLAB to use it to convert the s-domain transfer
function into z-domain
2. Study the affects in transient response and frequency response of different
methods and sampling time used in z- Transfer function.

B. Z – TRANSFORM
A z-transform method for transient analysis in digital control and electrical power
system is a well proven method. In principle, the z-plane is used in an intermediate
transform step between the frequency-domain and the time domain. Its positive
feature in comparison to the Laplace transform or any other frequency-domain
transient analysis method includes its property to express time domain expression in a
direct relation with its coefficients without requiring a complex variable analysis.
Further it can be transferred to a frequency-domain transfer function as well to get the
frequency- domain characteristics. A general z-domain transfer function can be
expressed in the following equation.

where C (t) , R (t): output and input respectively

The inverse of z-transform is easily expressed in a time-domain;

C(t) = R(t-k ΔT) - C(t-k ΔT) (2)

A z – transfer function can be composed either from a transient response or from


the circuit parameters.
C. CORELATION BETWEEN LAPLACE TRANSFORM AND
Z-TRANSFORM
Suppose we sample a continuous time variable f(t). Because the sampled signal exists
only at the sampling instants, the sequence of pulses can be represented
mathematically as:

We know the Laplace transform of f(t) is defined as:

Defining:

This is the definition of the z-transform of a continuous time signal f(t) sampled with
a sampling interval of Ts, i.e.

Thus, the z-transform is merely the Laplace Transform of a sampled data sequence
and as such, inherits many of the properties of the Laplace Transform.

The mapping from the s-plane to the z-plane is accomplished through the relationship

This function maps the whole of the left side of the s-plane to a unit circle on the z-
plane:
In the case of Laplace transfer functions, systems are stable if they do no possess
poles on the right half of the s-plane. In the case of sampled data systems, they are
stable if they do not possess poles that lie outside the unit-circle in the z-plane.

D. PREPARATORY WORKS:

Before coming to this laboratory the students are advised to gain a clear
understanding of:

i. Laplace Transform and z-Transfer function

ii. Transient response using Laplace inverse and inverse z-transform methods

iii. Frequency Responses and their importance

E. LABORATORY WORKS:
This laboratory exercise is basically a simulation of the preparatory work that you
should have done before coming to the lab.
1. Start the MATLAB
2. Type: help c2d
3. Type: help tf
Open a new file and write down the following commands (Note % Are comments)

clear;
DT=2e-3;
order=1; % Because here we are going to analyze first order system
ns=[0 1];
ds=[.03 10];
as=tf(ns,ds); % s-domain transfer function
zbi=c2d(as,DT,'tustin'); % z-domain transfer function using
bilinear
zfh=c2d(as,DT,'foh'); % z-domain transfer function using first
order hold
zzh=c2d(as,DT,'zoh'); % z-domain transfer function using zero order
hold

4. Save the file as m-file


5. Run the program
6. go back in main screen of MATLAB and
a. type as ENTER
b. type zbi ENTER
c. type zfh ENTER
d. type zzh ENTER

7. type: help step


8. go back in main program file and type following to compare the step response

T=0:DT:.04;
[ylp,tm]=step(as,T);
[ybi]=step(zbi,T);
[yfh]=step(zfh,T);
[yzh]=step(zzh,T);
plot(tm,ylp,'r',tm,ybi,'b',tm,yfh,'g',tm,yzh);
grid;
title('Step Response');
xlabel('Time sec')
ylabel ('Value')
9. save and run the program observe the differences in step responses (if any)
10. go back in main program file and type following to compare the frequency
response

% Frequency Response
% First is the frequency sampling
startf=1;
decround=6;
f1=1:.1:9.9;
f1=startf*f1;
for l=1:decround
for k=1:90
i=(l-1)*90+k;
f(i)=f1(k)*10^(l-1);
end
end
% below is the numerator and denominator of z-transfer function
[nzbi,dzbi]=tfdata(zbi,'v');
[nzfh,dzfh]=tfdata(zfh,'v');
[nzzh,dzzh]=tfdata(zzh,'v');

na=order+1; % vector order is 1 more than system order


for i=1:decround*90
z=cos(2*pi*f(i)*DT)+ sqrt(-1)*sin(2*pi*f(i)*DT);
s=sqrt(-1)*(2*pi*f(i));
As(i)=0;
Bs(i)=0;
Abi(i)=0;
Bbi(i)=0;
Afh(i)=0;
Bfh(i)=0;
Azh(i)=0;
Bzh(i)=0;
for l1=1:na
As(i)=As(i)+ns(l1)*s^(na-l1);
Bs(i)=Bs(i)+ds(l1)*s^(na-l1);
Abi(i)=Abi(i)+nzbi(l1)*z^(na-l1);
Bbi(i)=Bbi(i)+dzbi(l1)*z^(na-l1);
Afh(i)=Afh(i)+nzfh(l1)*z^(na-l1);
Bfh(i)=Bfh(i)+dzfh(l1)*z^(na-l1);
Azh(i)=Azh(i)+nzzh(l1)*z^(na-l1);
Bzh(i)=Bzh(i)+dzzh(l1)*z^(na-l1);

end
Frqlap(i)=As(i)/Bs(i);
Frqzbi(i)=Abi(i)/Bbi(i);
Frqzfh(i)=Afh(i)/Bfh(i);
Frqzzh(i)=Azh(i)/Bzh(i);
end
figure;
semilogx(f,abs(Frqlap),'r',f,abs(Frqzbi),'b',f,abs(Frqzfh),'g',
f,abs(Frqzzh));
grid;
title('Frquency Response');
xlabel('frequency(Hz)')
ylabel ('Value')
% Program Finish
11. Save and run the program observe the differences in frequency responses (if any)
12. Change the DT=2e-4, save and run the program compare the time and frequency
response from previous one.
13. change the DT=2e-6, save and run the program compare the time and frequency
response from previous one
14. Repeat the procedures for s-domain transfer function for
sampling time of 1, .1, .01 and .001.

F. OBSREVATIONS
Program 1

Output
Program 2

Output
Program 3

Output
Output for DT=2e-4

Output for DT=2e-6


Output for G(s) = 1.42/( 10.9 s^2 + s +1.42 )

i. DT = 1
ii. DT = 0.1

iii. DT = 0.01
iv. DT = 0.001

DISCUSSIONS
1. Discuss the effect of sampling time in step and frequency responses
The sampling time (Ts) plays an important role in the step and frequency response of
digital control systems. A smaller Ts gives a response closer to the continuous system,
making the step response smoother and the frequency response more accurate. On the
other hand, a larger Ts can cause the step response to look rough and may lead to
errors, like aliasing, in the frequency response. While smaller Ts improves accuracy,
it also requires more computation. Using MATLAB shows how Ts affects system
performance and why choosing the right value is important.

2. Describe the differences observed in bi-linear transform method and first and
zero order hold method in step and frequency responses.
The bi-linear transform, first-order hold (FOH), and zero-order hold (ZOH) methods
each produce distinct step and frequency responses in digital control systems. The bi-
linear transform preserves system stability and maps the frequency response
effectively within the Nyquist range, but it may introduce frequency warping, altering
the high-frequency response. The ZOH method approximates a continuous-time
system by holding each sample constant, leading to a more piece wise step response
and introducing a low-pass filter effect in the frequency domain. FOH provides
smoother transitions by linearly interpolating between samples, offering improved
accuracy over ZOH in both step and frequency responses but at the cost of increased
computational complexity. MATLAB simulations highlighted these differences,
showing how each method suits specific applications depending on the required
balance between accuracy, complexity, and computational efficiency.

3. Does the frequency response obeys sampling theorem, explain.

The frequency response of a digital control system follows the sampling theorem if
the sampling rate (fs) is high enough—at least twice the highest frequency (f max) of the
continuous signal. When this condition is met, the digital system can correctly
represent the signal without errors. If the sampling rate is too low (f s<2fmax), it causes
aliasing, where high frequencies are incorrectly shown as lower frequencies, which
messes up the frequency response. MATLAB simulations showed that with the right
sampling rate, the digital system can accurately match the original continuous-time
response, following the sampling theorem.

CONCLUSION

In this lab, the importance of sampling time and its effects on step and frequency
responses were analyzed, along with the differences between bi-linear transform,
zero-order hold, and first-order hold methods. The results showed that proper
selection of sampling time and method is crucial for accurate digital representation of
control systems. MATLAB effectively demonstrated these concepts, highlighting the
need to follow the sampling theorem to avoid errors like aliasing and maintain system
performance.

You might also like