0% found this document useful (0 votes)
2 views13 pages

CT Labmanual

The document outlines four experiments focused on analyzing system stability and frequency response using various methods such as frequency response, Routh method, Hurwitz method, and Bode plot. Each experiment includes objectives, theoretical background, functions used, sample programs, and conclusions, emphasizing the importance of system stability in control systems. Additionally, assignments are provided for further exploration and generalization of the methods discussed.

Uploaded by

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

CT Labmanual

The document outlines four experiments focused on analyzing system stability and frequency response using various methods such as frequency response, Routh method, Hurwitz method, and Bode plot. Each experiment includes objectives, theoretical background, functions used, sample programs, and conclusions, emphasizing the importance of system stability in control systems. Additionally, assignments are provided for further exploration and generalization of the methods discussed.

Uploaded by

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

EXPERIMENT 1

FREQUENCY RESPONSE

Objective: To find the frequency response of any system

Theory:

The frequency response of any system gives information about variation in system gain in terms
of operating frequency. In electronics circuit, most of the component are sensitive in terms of
frequency so this graph gives the characteristic of electronics system. Some systems may
amplify components of certain frequencies, and attenuate components of other frequencies.
The way that the system output is related to the system input for different frequencies is called
the frequency response of the system.The frequency response is the relationship between the
system input and output in the Fourier Domain as shown in Fig. 1.

Fig.1.1 System Transfer Function

In this system, X(jω) is the system input, Y(jω) is the system output, and H(jω) is the frequency
response. We can define the relationship between these functions as:
H(jω) =Y(jω) /X(jω).

Function and its use:

ADD or remove commands according to practical performance

clc: Clear Command Window


clc;

clear: kills variable


clear;

mscanf: reads input from the standard input (interface to the C scanf function )
The mscanf function reads characters from Scilab window.

disp: displays variables


disp(variable/string);

length: length of the object


n = length(M);

sqrt: square root


y=sqrt(x);

xgrid: add a grid on a 2D or 3D


xgrid([color] [, thickness] [, style])

title: display a title on a graphic window


title(my_title);

xlabel: sets the x-axis label


xlabel([axes_handle], label, [property_name, property_value,...])

ylabel: sets the y-axis label


ylabel([axes_handle], label, [property_name, property_value,...])

plot: plot 2d graph


plot(x,y,<LineSpec>,<GlobalProperty>)

Sample Program:

To implement low pass filter. Consider c=.1 ,r=1k ohm.

clc;
c=.1*10^-6;
r=1000;
f=0:100:2000;
for i=1:length(f);
H=1/sqrt(1+(2*%pi*f(i)*r*c)^2);
Hd(i)=20*log10(H);
end
xgrid(3,1,50);
xlabel('frequency in HZ');
ylabel('gain in dB');
plot(f,Hd);
Simulation results
ADD DETAILS IN GRAPH IF POSSIBLE. ex. Datatip

Fig.1.2 Frequency Response of RC Circuit


Observations:

Assignment Program:

1) Make the above program generalized in terms of user defined frequency range and cut-off
frequency and plot the frequency response. Also display cutoff frequency in console and graph.

ADD OUTPUT, GRAPHS if have, OBSERVATIONS AFTER EVERY PROGRAM

2) Modify the program for different order of low pass filter and plot its frequency response.

3) Write program for different other types of filters.

Conclusion:
EXPERIMENT 2

ROUTH METHOD

Objective: To find stability by the Routh method

Theory:

Routh methods used for finding the stability of any system. In this method, we generate the
routh array. In this routh array all the vaules in the first column are positive then the system is
stable. If any one value from the first column of the routh array is negative then the system is
unstable. In this case, we find how many time change in sign in the first column. This number is
same as a number of the pole in right-hand side plan which is responsible for instability.

Function and its use:

input: prompt for user input


x = input(message [, "string"])

routh_t: Routh's table


r=routh_t(h ,k [,normalized])

roots: roots of polynomials


x=roots(p)

Sample Program:

clc;
clear;
s=%s;
p=(s^4+8*s^3+18*s^2+16*s+5);
r=routh_t(p);
z=r(:,1);
m=length(z);
f=0;
for i=1:m
if z(i)<0 then
disp("entered equation is UNSTABLE");
f=1;
break;
end
end
if f==0 then
disp("entered equation is STABLE")
end
c=0;
for i=1:m-1
if ((z(i)<0&z(i+1)>0)|(z(i)>0&z(i+1)<0)) then
c=c+1;
end
end
disp(p);
disp("number of pole which is in right hand side is :");
disp(c);
disp("routh array:");
disp(r);
disp("roots of polynomial:");
f=roots(p);
disp(f);

Simulation results:

Fig.2.1 Routh Array for stability


Assignment Program 1:

Generalized form of above program which include user define system characteristic Equation
and it gives number of pole which is in right hand side and give roots of the equation.

Assignment Program 2:
Write the programme code for check the stability for the following two special cases of control
system:
Case i: The routh array have any one values in first column is zero.
Case ii: The entire one row in the routh array is zero.

Conclusion:
EXPERIMENT 3

HURWITZ METHOD

Objective: To find stability by the Hurwitz method

Theory:

Hurwitz method is also used for finding the stability of any system. In this method, we generate
one matrix by given characteristic equation then we generate another m x m matrix where m is
the highest degree of characteristic Equation. After finding the matrix we find their determinant if
all determinant’s value is positive then the system is stable.

Function and its use:

fix: round towards zero


y=fix(x)

matrix: reshape a vector or a matrix to a different size matrix


y=matrix(v,n,m)

size: size of objects


n = size(x, sel)

det: determinant
det(X)

Sample Program :

clc;
clear;
close;
s=%s;
a=input("enter coefficient ");
m=length(a);
p=0;
for i=1:m
p=p+a(i)*s^(m-i);
end
r=coeff(p);
disp(p);
D1=r(4);
d2=[r(4) r(5);r(2) r(3)]
D2=det(d2);
d3=[r(4) r(5) 0;r(2) r(3) r(4);0 r(1) r(2)]
D3=det(d3);
d4=[r(4) r(5) 0 0;r(2) r(3) r(4) r(5); 0 r(1) r(2) r(3); 0 0 0 r(1)]
D4=det(d4);
disp(D1,"D1=");
disp(D2,"D2=");
disp(D3,"D3=");
disp(D4,"D4=");
if(D1&D2&D3&D4>=0)
printf("entered equation is STABLE");
else
printf("entered equation is UNSTABLE");
end

Simulation results:

Fig.3.1 Output Result by Hurwitz matrix


Assignment Program 1:

Generalized form of above program which includes user define system for different polynomial
equations.

Assignment Program 2:

Generalized form of Hurwitz method for system stability using object oriented programming in
C/C++.

Conclusion:
EXPERIMENT 4

BODE PLOT

Objective: Plot magnitude and phase response using bode plot for control systems.

Theory:

Bode plot is a graph of the frequency response of a system. It is usually a combination of


a Bode magnitude plot, expressing the magnitude (usually in dB) of the frequency response,
and a Bode phase plot, expressing the phase shift. Both low and high frequency characteristics
of transfer function can be shown in one diagram. Gain margin and phase margin can be
obtained with minimum computational effort. It indicate clearly relative stability of the system.

Function and its use:

g_margin: gain margin and associated crossover frequency


gm=g_margin(h)

p_margin: phase margin and associated crossover frequency


phm=p_margin(h)

Sample Program:

clear;
clc;
clf;
s=%s;
x=syslin('c',((10)/(s*(1+(0.5*s))*(1+(0.01*s)))));
bode(x,1e-1,1e+3);
disp("system equation is:")
disp(x);
[gm,wpc]=g_margin(x);
disp("gain margin is:");
disp(gm);
disp("phase crossover freq. is:");
disp(wpc);

[pm,wgc]=p_margin(x);
disp("phase margin is:");
disp(pm);
disp("gain crossover freq. is:");
disp(wgc);
if wgc<wpc then
if gm>0 & pm>0 then
disp("this system is stable");
end
end
if wgc>wpc then
if gm<0 | pm<0 then
disp("this system is unstable");
end
end
if wgc>=wpc then
if gm==0 & pm==0 then
disp("this system is conditionaly stable");
end
end

Simulation results:

system equation is:


10
-------------------
s + 0.51s2 + 0.005s3

gain margin is: 20.172003

phase crossover freq. is: 2.2507908

phase margin is: 22.754445

gain crossover freq. is: 0.6767695

This system is stable

Graph:

Fig.4.1 Bode Magnitude and Phase Plot


Assignment Program:
General form of above program which includes user defined system equation in form of
G(s)*H(s).

Conclusion:

You might also like