Control System Lab
Control System Lab
LAB MANUAL
Branch: ECE
Vision:
To be among the renowned institutions providing engineering and management
education of excellence, empowered with research, innovation and entrepreneurship
with high ethical values, catering to the needs of industry and society.
Mission:
1. To offer state of the art undergraduate and postgraduate program.
2. To be a learner centric institute imbibing experimental innovation and lifelong
learning skills, addressing societal problems with high ethical values for nation
building.
3. To deliver changing demands of industry and academia through our
stakeholders.
4. To contribute as a professional leader in the growing field of entrepreneurship
and research.
To impart knowledge and skill of Electronics and Communication to develop and sustain a culture of
research while promoting values, innovation, entrepreneurship, ethics and professionalism to meet
the needs of industry and society.
1. To conduct the electronics and communication engineering program with practical exposure,
creating new knowledge and skill-sets by engaging in the research oriented approach and
promoting the academic growth.
2. To promote creative thinking and innovations by the students and faculty.
3. To develop strong industry–academia relationship.
4. To nurture students and infuse professional ethics, human values and positive attitude in the
students.
PEO1:- To provide solid foundation in electronics and communication engineering along with
good communication and entrepreneurship skills for tackling social issues.
PEO2:- To impart students with good scientific and engineering knowledge in order to analyze,
design and create novel products for giving practical solutions to real life
problems.
PEO3:-To create engineers with sound technical knowledge for facing all sorts of challenges in
industry or in pursuance of higher studies.
PEO4:-To motivate students acquire aptitude for lifelong learning along with leadership skills,
team spirit and ethical values so that they upgrade themselves with the latest trends in
the field of engineering in order to serve the society.
1.Graduates of the program will be able to analyze real world engineering problems and provide
it’solution in the field of Electronics and Communication Engineering.
2.Graduates of the program will be able to design and test systems in the field of Embedded
System and ICT.
PSO-1: Graduates of the programme will be able to analyse real world engineering problems and
provides its solution in the field of electronics and communication engineering
PSO-2: Graduates of the programme will be able to design and test systems in the field of embedded
system and ICT.
CO-PO Mapping:
CO1 3 2 2 1 2 - - 1 2 - 2 1 1
CO2 2 2 2 1 2 - - 1 2 - 2 1 1
CO3 2 2 1 1 2 - - - 1 - 1 1 1
CO4 2 2 1 1 2 - - 1 1 - 1 1 1
CO5 2 2 2 1 2 - - - 1 - 1 1 1
3 – High; 2 – Medium; 1 – Low
1 KEC-652 CONTROL 0 0 2 25 25 50 1
SYSTEM LAB
emergency.
2. Students are allowed in the laboratory only when the lab instructor is
present.
3. Open drinks and food are not allowed near the lab benches.
6. Do not plug in external devices without scanning them for computer viruses.
7. Ensure that the temperature in the room stays cool, since there are a
1. Students will perform the experiment as per instructions given and lab manual.
2. Students will maintain a notebook for reading/results of the experiment and get it’s signed by
the lab instructor/faculty.
3. Lab report for each experiment shall be submitted for evaluation in the next week of
performing the experiment.
4. The performance of each experiment will be graded as per the policy.
General Instructions
Every lab requires preparation prior to performing the experiments. Students are
required to perform this preliminary work prior to coming to the lab. For this lab
session your lab instructor will help you get started.
1. Before starting of the laboratory the students are instructed with necessary safety
and precautionary measures that has to be adopted in any electronics laboratory.
2. Well-designed laboratory manual / instruction sheets are provided to students at
the beginning of the session for a particular lab.
3. It is extremely important for students to read equipment manual given to you
before coming to the laboratory. Failure to do so might result in your not being
able to finish this lab session within the allotted time.
4. Be sure that the measuring equipment is set up correctly and you are reading the
correct parameters.
5. Note the readings and result in reading notebook.
Find the stability of system using pole-zero diagrams and bode diagram.
CO 4:
List of Experiments:
1. Different Toolboxes in MATLAB, Introduction to Control Systems Toolbox or its equivalent
open source freeware software like Scilab using Spoken Tutorial MOOCs.
2. Determine transpose, inverse values of given matrix.
3. Plot the pole-zero configuration in s-plane for the given transfer function.
4. Determine the transfer function for given closed loop system in block diagram representation.
5. Plot unit step response of given transfer function and find delay time, rise time, peak time and
peak overshoot.
6. Determine the time response of the given system subjected to any arbitrary input.
7. Plot root locus of given transfer function, locate closed loop poles for different values of k. Also
find out Wd and Wnat for a given root.
8. Create the state space model of a linear continuous system.
9. Determine the State Space representation of the given transfer function.
10. Plot bode plot of given transfer function. Also determine the relative stability by measuring gain
and phase margins.
11. Determine the steady state errors of a given transfer function.
12. Plot Nyquist plot for given transfer function and to discuss closed loop stability. Also determine
the relative stability by measuring gain and phase margin.
Spoken Tutorial (MOOCs):
Spoken Tutorial MOOCs, ' Course on Scilab', IIT Bombay (http://spoken-tutorial.org/)
List of Experiments:
1. Different Toolboxes in SciLab, Introduction to Control Systems Toolbox or its equivalent open
source freeware software like Scilab using Spoken Tutorial MOOCs.
2. Determine transpose, inverse values of given matrix.
3. Plot the pole-zero configuration in s-plane for the given transfer function.
4. Determine the transfer function for given closed loop system in block diagram representation.
5. Plot unit step response of given transfer function and find delay time, rise time, peak time and
peak overshoot.
6. Determine the time response of the given system subjected to any arbitrary input.
7. Plot root locus of given transfer function, locate closed loop poles for different values of k. Also
find out Wd and Wnat for a given root.
8. Create the state space model of a linear continuous system.
9. Determine the State Space errors of a given transfer function.
10. Plot bode plot of given transfer function. Also determine the relative stability by measuring gain
and phase margins.
11. Determine the steady state errors of a given transfer function.
12. Plot Nyquist plot for given transfer function and to discuss closed loop stability. Also determine
the relative stability by measuring gain and phase margin.
Aim: Different Toolboxes in SciLab, Introduction to Control Systems Toolbox or its equivalent open
source freeware software like Scilab using Spoken Tutorial MOOCs
Theory: Scilab is a programming language associated with a rich collection of numerical algorithms
covering many aspects of scientific computing problems. From the software point of view, Scilab is an
interpreted language. This generally allows getting faster development processes, because the user
directly accesses to a high level language, with a rich set of features provided by the library. The Scilab
language is meant to be extended so that user-defined data types can be defined with possibly overloaded
operations. Scilab users can develop their own module so that they can solve their particular problems.
The Scilab language allows dynamically compiling and linking other languages such as FORTRAN and
C: this way, external libraries can be used as if they were a part of Scilab built-in features. Scilab also
interfaces Lab VIEW, a platform and development environment for a visual programming language from
National Instruments.
From the license point of view, Scilab is free software in the sense that the user does not pay for
it and Scilab is open source software, provided under the Cecil license. The software is distributed with
source code, so that the user has an access to Scilab most internal aspects. Most of the time, the user
downloads and installs, a binary version of Scilab since the Scilab consortium provides Windows, Linux
and Mac OS executable versions. An online help is provided in many local languages.
From a scientific point of view, Scilab comes with many features. At the very beginning of
Scilab, features were focused on linear algebra. But, rapidly, the number of features extended to cover
many areas of scientific computing. The following is a short list of its capabilities:
"Hello World!".
-->s=" Hello World!”
s=
Hello World!
-->disp (s)
Hello World
In the previous session, we did not type the characters "-->" which is the prompt, and which is
managed by Scilab. We only type the statement s="Hello World!" with our keyboard and then hit the
<Enter> key. Scilab answer is s = and Hello World!. Then we type disp(s) and Scilab answer is
Hello World.
Figure-1
The editor
Scilab version 5.2 provides a new editor which allows to edit scripts easily. The figure-2 presents the
editor while it is editing the previous "Hello World!" example. The editor can be accessed from the
menu of the console, under the Applications > Editor menu, or from the console, as presented in the
following session.
--> editor ()
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
This editor allows managing several files at the same time, as presented in the figure -2, where we
edit five files at the same time. There are many features which are worth to mention in this editor.
The most commonly used features are under the Execute menu.
Load into Scilab allows to execute the statements in the current file, as if we did a copy and paste.
This implies that the statements which do not end with a ";" character will produce
Figure-2
an output in the console. Evaluate Selection allows to execute the statements which are currently
selected.
Execute File Into Scilab allows to execute the file, as if we used the exec function. The results which
are produced in the console are only those which are associated with printing functions, such as disp
for example.
We can also select a few lines in the script, right click (or Cmd+Click under Mac), and get the
context menu which is presented in figure 3. The Edit menu provides a very interesting feature,
commonly known as a "pretty printer" in most languages. This is the Edit > Correct Indentation
feature, which automatically indents the current selection. This feature is extremely convenient, as it
allows to format algorithms so that the if, for and other structured blocks can be easy to analyze. The
editor provides a fast access to the inline help. Indeed, assume that we have selected the disp
statement, as presented in the figure 4. When we right-click in the editor, we get the context menu,
where the Help about "disp" entry allows to open the help associated with the disp function.
Figure-4
Figure-5
The docking system uses Flex dock, an open-source project providing a Swing docking framework.
Assume that we have both the console and the editor opened in our environment, as presented in
figure-5. It might be annoying to manage two windows, because one may hide the other, so that we
constantly have to move them around in order to actually see what happens. The Flex dock system
allows dragging and dropping the editor into the console, so that we finally have only one window,
with several sub-windows. All Scilab windows are dock able, including the console, the editor, the
help and the plotting windows. In the figure-6, we present a situation where we have docked four
windows into the console window.
Figure-6
Common Operators
Here is a list of common operators in Scilab:
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
+ Addition
− Subtraction
_ Multiplication
/ Division
ˆ Power
’ Complex conjugate transpose
Common Functions
Some common functions in Scilab are: sin, cos, tan, asin, acos, atan, abs, min, max, sqrt, sum. E.g.,
when
we enter: sin(0.5) then it displays: ans: =
0.4794255
Another example:
max(2, 3, abs(-5), sin(1))
ans: = 5.
Special Constants
We may wish to enter some special constants like, i (sqrt(−1) ) and e. It is done by entering %pi, %i
and
%e respectively. There are also constants %t (true) and %f (false) which are Boolean variables.
Boolean variables would be introduced later. Data Structures Scilab supports many data structures.
Examples are: usual (real or complex matrices), polynomial, Boolean, string, function, list, tlist,
sparse, library. Please read Scilab documentation for details. To query for the type of an object, type:
typeof (object).
Entering Matrices
There are many ways to enter a matrix. Here is the simplest method:
1. Separate each element in a row using a blank space or a comma;
2. Separate each row of elements with a semi-colon;
3. Put the whole list of elements in a pair of square brackets.
For example, we wish to enter a 3 × 3 magic square and assign to the variable M.
M = [8 1 6; 3 5 7; 4 9 2]
M=
8. 1. 6.
3. 5. 7.
4. 9. 2.
Programme:
//sample values
A=[1,2,3;4,5,6;7,8,9];
B=[4,2,3;-2,3,3;1,1,3];
y=inv(A)
z=inv(B)
disp(y,"inverse of matrix A");
disp(A*B,"The multiplication of Matrix A with B:");
disp(A+B,"The sum of the Matrices A and B:");
disp(A',"The transpose of the matrix A:");
disp(B',"The transpose of the matrix B:");
disp(det(A),"The determinant of A is:");
disp(det(B),"The determinant of B is:");
inverse of matrix A
3. 11. 18.
12. 29. 45.
21. 47. 72.
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
The sum of the Matrices A and B:
5. 4. 6.
2. 8. 9.
8. 9. 12.
1. 4. 7.
2. 5. 8.
3. 6. 9.
4. -2. 1.
2. 3. 1.
3. 3. 3.
6.661D-16
27.
Short questions:
1. How do you find the inverse of a transpose?
2. What is inverse of a transpose?
3. What is the transpose of the given matrix?
4. How find the inverse of a matrix?
5. What is the formula of a inverse in matrix?
Theory: In mathematics, signal processing and control theory, a pole–zero plot is a graphical
representation of a rational transfer function in the complex plane which helps to convey certain
properties of the system such as: Stability. Causal system / anticausal system. Region of convergence
(ROC)
Poles and Zeros of a transfer function are the frequencies for which the value of the denominator and
numerator of transfer function becomes zero respectively. The values of the poles and the zeros of a
system determine whether the system is stable, and how well the system performs. Control systems, in
the simplest sense, can be designed simply by assigning specific values to the poles and zeros of the
system.
Physically realizable control systems must have a number of poles greater than the number of zeros.
Systems that satisfy this relationship are called proper. We will elaborate on this below.
Let's say we have a transfer function defined as a ratio of two polynomials:
H(s) =N(s)/D(s)
Where N(s) and D(s) are simple polynomials. Zeros are the roots of N(s) (the numerator of the
transfer function) obtained by setting N(s) = 0 and solving for s.
Poles are the roots of D(s) (the denominator of the transfer function), obtained by setting D(s) = 0 and
solving for s. Because of our restriction above, that a transfer function must not have more zeros than
poles, we can state that the polynomial order of D(s) must be greater than or equal to the polynomial
order of N(s).
H(s) =2+3*s+4*s^2/1+s+s^2
Programme:
s=%s
h=syslin('c',n/d);
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
disp(h)
plzr(h)
Result:
Short questions:
1. How do you find the transfer function of a pole-zero plot?
2. What do poles and zeros represent in a transfer function?
3. How do you plot the poles of a transfer function?
4. What happens when transfer function is zero?
5. What is pole and zero in Z transform?
These roots can be real or complex, distinct or repeated. Accordingly, the system natural response
modes are characterized as follows:
Programme:
// Transfer Function and analyze the transient response of closed loop system using step input.
s=%s
num1=s;
den1 =1+s;
TF1 = syslin('c',num1,den1)
disp(TF1)
num2=1;
Result: -->
Experiment: 5
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
Aim: Plot unit step response of given transfer function and finds delay time, rise time, peak time and
peak overshoot.
The response of a system (with all initial conditions equal to zero at t=0-, i.e., a zero state
response) to the unit step input is called the unit step response. If the problem you are trying
to solve also has initial conditions you need to include a zero input response in order to
obtain the complete response.
In electronic engineering and control theory, step response is the time behaviour of the outputs of
a general system when its inputs change from zero to one in a very short time. The concept can
be extended to the abstract mathematical notion of a dynamical system using an evolution parameter.
Programme:
clc;
clear;
close all;
s=%s
num=25;
den =25+4*s+s^2; // input numerator and denomenator of transfer function
TF = syslin('c',num,den) // transfer function of system
disp(TF)
t=0:0.0005:5;
y1 = csim('step',t,TF); // transisent response
title("II order system response");
xgrid;
plot(t, y1)
y=den
disp(y)
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
z=coeff(y)
disp(z)
Wn=sqrt(z(1,1)) // Wn= natural frequency //
disp(Wn)
zeta=z(1,2)/(2*Wn) // damping ratio//
disp(zeta)
Wd=Wn*sqrt(1-zeta^2) // damping frequency//
disp(Wd)
Tp=%pi/Wd //peak time//
disp(Tp)
Mp=100* exp((-%pi * zeta ) / sqrt (1 - zeta ^2) ) // maximum overshoot//
disp(Mp)
Td =(1+0.7*zeta )/Wn //delay time//
disp(Td)
a = atan(sqrt(1-zeta ^2)/zeta )
disp(a)
Tr=(%pi-a )/Wd //rise time//
disp(Tr)
Ts=4/(zeta*Wn) // settling time//
disp(Ts);
Result:
Short questions:
1. What is step response of transfer function?
2. What are the units of the transfer function?
3. What is the unit of impulse response?
4. How do you find the unit step function?
5. How do you calculate transfer function?
Aim: Determine the time response of the given system subjected to any arbitrary input.
In the above transfer function, the power of 's' is the one in the denominator. That is why
the above transfer function is of the first order, and the system is said to be the first order
system.
Where T is known as time constant of the system and it is defined as the time required for
the signal to attain 63.2 % of final or steady state value. Time constant means how fast the
system reaches the final value. As smaller the time constant, as faster is the system
response. If time constant is larger, system goes to move slow.
Programme:
clc;
clear;
close all;
t=0:0.01:5;
zeta=[0.5 1 1.5]
cv=[1 2 3];
s=%s;
for n=1:3
num = 36;
den = s^2 + 2*zeta(n)*6*s +36;
P =syslin('c',num,den); // transfer function//
Ps=csim('step',t,P); // transfer function simulation//
plot2d(t,Ps,style=cv(n));
end;
xgrid;
xtitle(['Step Responses of a II order system for zeta =0.1(underdamped) , zeta =1( c r i t i c a l l y
damped) & zeta =1.5( overdamped )'], 'Time', 'Amplitude' );
legends(['zeta =0.5'; 'zeta=1'; 'zeta =1.5'],[1,2,3]);
Result:
Short questions:
1. What is the response of the system?
2. What is the time response of first order system?
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
3. What is time response of second-order system?
4. What is time domain response in control system?
5. What is step response time?
Experiment-7
Aim: Plot root locus of given transfer function, locate closed loop poles for different values of k.
Also find out Wd and Wnat for a given root.
Result:
EXPERIMENT -8
Aim: To Plot bode plot of given transfer function. Also determine the relative stability by measuring
gain and phase margins.
Software Used: Scilab 6.1.0
Theory: A Bode plot is a graph of the magnitude (in dB) or phase of the transfer function
versus frequency. Of course we can easily program the transfer function into a computer to make
such plots, and for very complicated transfer functions this may be our only recourse.
Bode plots show the frequency response, that is, the changes in magnitude and phase as a
function of frequency. This is done on two semi-log scale plots. The top plot is typically magnitude
or “gain” in dB. The bottom plot is phase, most commonly in degrees.
Phase margin is measured at the frequency where gain equals 0 dB. This is commonly referred to as
the “crossover frequency”. Phase margin is a measure of the distance from the measured phase to a
phase shift of -180°. In other words, how many degrees the phase must be decreased in order to
reach -180°.
Programme:
// To plot the Bode Plot of a given transfer Function
clc;
clear;
close all;
s=%s;
G=(10*(s+3))/(s*(s+2)*(s^2+s+2));
sys=syslin('c',G);
f_min=.0001;f_max=16;
clf();
bode(sys,f_min,f_max,"rad");
Result:
Short questions:
1. What does a Bode plot represent?
2. What is the transfer function of a system?
3. How do you draw a Bode plot phase?
4. Which graph is used for Bode plot?
5. What is pole and zero in Bode plot?
Where,
• R(s) is the Laplace transform of the reference Input signal r(t)r(t)
We know the transfer function of the unity negative feedback closed loop control system as
⇒C(s)=R(s)G(s)1+G(s)⇒C(s)=R(s)G(s)1+G(s)
E(s)=R(s)−R(s)G(s)1+G(s)E(s)=R(s)−R(s)G(s)1+G(s)
⇒E(s)=R(s)+R(s)G(s)−R(s)G(s)1+G(s)⇒E(s)=R(s)+R(s)G(s)−R(s)G(s)1+G(s)
⇒E(s)=R(s)1+G(s)⇒E(s)=R(s)1+G(s)
ess=lims→0sR(s)1+G(s)
Programme:
Programme:
// Plot Nyquist of given transfer function.
clc;
clear;
close;
s=%s;//Avariable used to defind polynomials
G=syslin('c',200,(s+2)*(s+4)*(s+5));//open loop transfer function
//syslin is linear system definition
nyquist(G,'rad')
[GM,PCF]=g_margin(G)//GAIN MARGIN ANDASSOCLSTED CROSSOTER FREQUENCY
[PM,GCF]=p_margin(G)
Programme:
// state space model of a transfer function
clc;
close;
s=%s;
num=25;
den=25+4*s+s^2;
TF=syslin('c',num,den);
disp(TF)
y=den;
disp(y)
z=coeff(y)
disp(z)
q=num
disp(q)
r=coeff(q)
wn=sqrt(r)
disp(wn)
zeta=z(1,2)/(2*wn)
disp(zeta)
mr=1/2*zeta*sqrt(1-zeta^2)
disp(mr)
wr=wn*sqrt(1-2*zeta^2)
disp(wr)
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
bw=wn*sqrt(1-2*zeta^2+sqrt(2-4*zeta^2+4*zeta^4))
disp(bw)