Professional Documents
Culture Documents
Control System Lab Manual EC Branch (KEC-652)
Control System Lab Manual EC Branch (KEC-652)
TECHNOLOGY
5th Km Stone, Delhi-Meerut Road, Ghaziabad, Uttar Pradesh 201003
CONTROL SYSTM LABORATORY MANUAL
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.
7. Determine the time response of the given system subjected to any arbitrary input.
8. Plot unit step response of given transfer function and find delay time, rise time, peak
time, peak overshoot and settling time.
10. Plot root locus of given transfer function, locate closed loop poles for different
values of k.
11. Plot bode plot of given transfer function. Also determine gain and phase margins.
12. Plot Nyquist plot for given transfer function. Also determine the relative stability
by measuring gain and phase margin.
Course Outcomes
At the end of this course students will demonstrate the ability to:
1. Classify different tools in MATLAB along with the basic matrix operations used in
MATLAB.
2. Evaluate the poles and zeros on s-plane along with transfer function of a given
system.
6. Examine the relative stability of a given transfer function using various methods
such as root locus, Bode plot and Nyquist plot.
EXPERIMENT NO: 1
MATLAB is an interactive system whose basic data element is an array that does not
require dimensioning. This allows you to solve many technical computing problems,
especially those with matrix and vector formulations, in a fraction of the time it would
take to write a program in a scalar no interactive language such as C or Fortran.
The name MATLAB stands for matrix laboratory. MATLAB was originally written to
provide easy access to matrix software developed by the LINPACK and EISPACK
projects. Today, MATLAB engines incorporate the LAPACK and BLAS libraries,
embedding the state of the art in software for matrix computation.
MATLAB has evolved over a period of years with input from many users. In university
environments, it is the standard instructional tool for introductory and advanced courses
in mathematics, engineering, and science. In industry, MATLAB is the tool of choice for
high-productivity research, development, and analysis.
Areas in which toolboxes are available include signal processing, control systems, neural
networks, fuzzy logic, wavelets, simulation, and many others.
The MATLAB System: The MATLAB system consists of these main parts:
Desktop Tools and Development Environment: This is the set of tools and facilities that
help you use MATLAB functions and files. Many of these tools are graphical user
interfaces. It includes the MATLAB desktop and Command Window, a command history,
an editor and debugger, a code analyzer and other reports, and browsers for viewing help,
the workspace, files, and the search path.
The MATLAB Mathematical Function Library: This is a vast collection of
computational algorithms ranging from elementary functions, like sum, sine, cosine, and
complex arithmetic, to more sophisticated functions like matrix inverse, matrix
eigenvalues, Bessel functions, and fast Fourier transforms.
The MATLAB Language: This is a high-level matrix/array language with control flow
statements, functions, data structures, input/output, and object-oriented programming
features. It allows both "programming in the small" to rapidly create quick and dirty
throw-away programs, and "programming in the large" to create large and complex
application programs.
Graphics: MATLAB has extensive facilities for displaying vectors and matrices as
graphs, as well as annotating and printing these graphs. It includes high-level functions
for two-dimensional and three-dimensional data visualization, image processing,
animation, and presentation graphics. It also includes low-level functions that allow you
to fully customize the appearance of graphics as well as to build complete graphical user
interfaces on your MATLAB applications.
MATLAB External Interfaces: This is a library that allows you to write C and Fortran
programs that interact with MATLAB. It includes facilities for calling routines from
MATLAB (dynamic linking), calling MATLAB as a computational engine, and for
reading and writing MAT-files.
Different Toolboxes in MATLAB: Toolboxes are specialized collections of M-files
(MATLAB language programs) built for solving particular classes of problems.
Toolboxes represent the efforts of some of the world's top researchers in fields such as
controls, signal processing, system identification, and others. Some of the main toolboxes
are as follows:
• Aerospace Toolbox
• Bioinformatics Toolbox
• Communications Toolbox
• Control System Toolbox
• Curve Fitting Toolbox
• Data Acquisition Toolbox
• Database Toolbox
• Distributed Computing Toolbox
• Filter Design Toolbox
• Financial Toolbox
• Fuzzy Logic Toolbox
• Genetic Algorithm and Direct Search Toolbox
• Image Processing Toolbox
• Instrument Control Toolbox
• Mapping Toolbox
• Model Predictive Control Toolbox
• Neural Network Toolbox
• Partial Differential Equation Toolbox
• Signal Processing Toolbox
• Statistics Toolbox
• Wavelet Toolbox
Control System Toolbox: Control System Toolbox provides tools for systematically
analyzing, designing, and tuning linear control systems. You can specify a linear model
of your system, plot its time and frequency responses to understand how the system
behaves, tune the controller parameters using automated and interactive techniques, and
verify performance requirements, such as rise time and gain/phase margins. Workflow-
based graphical user interfaces (GUIs) guide you through each step of the analysis and
design process.It includes m-file programs for following functions:
➢ Creating Continuous-Time Models
• Creating Discrete-Time Models
• Specifying Time Delays
• Accessing and Modifying the Model Data
• Switching Model Representation
• Connecting ModelsPlotting System Responses
• Analyzing the Response of an RLC Circuit
Experiment-2
Commands Used:-
Syntax:- transpose(matrix)
Syntax:- inv(matrix)
Program:-
clc;
clear all;
close all;
a=[1,0,2;-2,0,5;1,3,4]
trans_a=transpose(a)
inverse_a=inv(a)
[eig_val,eig_vec]=eig(a)
Output:-
a= 1 0 2
-2 0 5
1 3 4
Trans a = 1 -2 1
0 0 3
2 5 4
0.2222 0.1111 0
eig_vec = -2.8572 0 0
0 1.4823 0
0 0 6.3749
XXX-----XXX-----XXX-----XXX
Experiment-3
Objective:- Plot the pole-zero configuration in s-plane for the given transfer function
3𝑠 2 +4𝑠+5
.
𝑠 2 +2𝑠+3
Software Used:- MATLAB R2014a
Theory:- In general the transfer function of a process is the ratio of two polynomials
𝑍(𝑠)
G(s) = 𝑃(𝑠). The roots of the denominator polynomial, P(s), are called poles and
roots of the numerator polynomial, Z(s), are called zeros . The frequencies for which the
values of denominator and numerator become zero in a transfer function are called Poles
and Zeros. Poles and Zeros analyze the performance of a system and check the stability.
The values of Poles and Zeros control the working of a system. Poles in a transfer function
explain that the output has reached to infinity Whereas, the zeros in a transfer function
indicate that the output has reached to zero.
Commands Used:-
Syntax:-tf(num,den)
Syntax:-pzmap(transfer_function)
Syntax:-pole(transfer_function)
Syntax:-zero(transfer_function)
Syntax:-clc;
Systax:-clear all;
Program:-
clc;
clear all;
a=[3,4,5]
b=[1,2,3]
transfer_function=tf(a,b)
pzmap(transfer_function)
pole_of_transfer_function=pole(transfer_function)
zero_of_transfer_function=zero(transfer_function)
Output:-
a = 3 4 5
b = 1 2 3
-1.0000 - 1.4142i
-0.6667 - 1.1055i
XXX-----XXX-----XXX-----XXX
EXPERIMENT - 4
Object:- To determine the transfer function of closed loop system in block diagram
representation.
type of model. The two systems must be either both continuous or both
discrete with identical sample time.
Syntax- series(sys1,sys2).
4. Feedback- feedback returns a model object sys for the negative feedback
interconnection of model objects sys1 and sys2.
Syntax- feedback(sys1,sys2)
5. clc- This command clear the command window.
6. clear all- This command clear the workspace window.
Program:-
clc;
clear all;
h1=tf([1,0],[1])
h2=tf([4],[1])
h3=tf([0.5],[1])
h4=tf([1],[1,2,0])
sys1=parallel(h1,h2);
sys2=series(sys1,h4);
sys3=feedback(sys2,h3);
sys4=feedback(sys3,1)
Output:-
h1 = s h3 = 0.5
1
h2 = 4 h4 = ---------
s^2 + 2 s
s+4
sys1 = s+4 sys2 = ----------
s^2 + 2 s
s+4 s+4
sys3 = --------------- sys4 = ---------------
XXX-----XXX-----XXX-----XXX
EXPERIMENT-5
2𝑠 2 +5𝑠+3
Objective: - To plot unit step response of a given transfer function G(s) = 2 and
5𝑠 +9𝑠+6
find
a) Peak overshoot
b) Peak time
c) Rise time
d) Delay time
Theory: - The unit step function is a highly important function, not only in control systems
engineering, but also in signal processing, systems analysis, and all branches of
engineering. If the unit step function is input to a system, the output of the system is known
as the step response.
Commands used:-
Syntax: step(sys)
Syntax: s = stepinfo(sys)
Program:-
clc;
clear all;
a=[2,5,3];
b=[5,9,6] ;
e= tf (a,b)
step(e)
stepinfo(e)
Output:-
Transfer function:
2 s^2 + 5 s + 3
---------------
5 s^2 + 9 s + 6
RiseTime: 0.3983
SettlingTime: 4.7773
SettlingMin: 0.4951
SettlingMax: 0.5481
Overshoot: 9.6248
Undershoot: 0
Peak: 0.5481
PeakTime: 1.5306
Step Response
0.56
0.54
0.52
0.5
Amplitude
0.48
0.46
0.44
0.42
0.4
0 1 2 3 4 5 6 7
Time (sec)
EXPERIMENT-6
Objective:- Determine the response of the given system subjected to any arbitrary input.
Software used:- MATLAB R2014a
Theory:- The dynamic behavior of a system is manipulated and judged under the
application and working of standard and typical test signals. The characteristics
of an input signal are constant acceleration, constant velocity, a sudden change or a sudden
shock. There are four types of typical test signals: Impulse Step, Ramp, Parabolic and
another important signal is sinusoidal signal.
1. step signal
.
2. Ramp Signal
The ramp signal tells you the constant velocity attribute of actual input signal. It is
being used to determine the behaviour of system with the velocity factor.
When A=1 then the impulse signal is called Unit impulse signal.
Commands used:
Program:
Output:
Experiment-7
2𝑠 2 +5𝑠+3
Objective:-plot rootlocus of the given transfer function as G(s) = 2 .Locate
𝑠 +2𝑠+3
closed loop poles for different values of K. also find out ω d and ωnat for a
given root.
Theory:- Root locus analysis is a graphical method for examining how the roots of a
system change with variation of a certain system parameter, commonly
a gain within a feedback system. This is a technique used as a stability criterion in the
field of classical control theory to determine stability of the system.
Root locus is the locus of the roots of the characteristics of the closed loop system as K is
varied from 0 to infinity. This method is particularly suited to obtaining approximate
results very quickly.
Commands used:-
Syntax: rlocus(sys)
Program:
clc;
clear all;
rlocus(h)
Output:-
Experiment-9
Objective:-Determine the state space representation of given transfer function
21𝑠+5
.
𝑠 3 +4𝑠 2 +21𝑠+5
Theory:-
Commands used:
Syntax:-tf(num, den)
2. tf2ss:-To convert the transfer function into the state space representation.
Syntax:-tf2ss(num,den)
Syntax:-ctrb(A,B)
Syntax:-obsv(A,C)
5. disp():-To print the message on the command window.
Syntax:-disp("message")
Program:-
clc;
clear all;
num=[21 5];
den=[1 4 21 5];
h1=tf(num,den)
[A,B,C,D]=tf2ss(num,den)
co=ctrb(A,B);
if(length(A)-rank(co)==0)
disp('system is controllable');
else
ob=obsv(A,C);
if(rank(ob)==rank(A))
disp('system is observable');
else
disp('system is unobservable');
end
Output:
21 s + 5
h1 = ----------------------
s^3 + 4 s^2 + 21 s + 5
-4 -21 -5
A = 1 0 0
0 1 0
B = 0
C = 0 21 5
D = 0
1 -4 -5
co = 0 1 -4
0 0 1
system is controllable
0 21 5
ob = 21 5 0
Experiment-10
Objective:- plot bode plot of a given transfer function. Also determine the relative
stability by measuring gain and phase margins.
Bode plot is the graphical tool for drawing the frequency response of a system. It is
represented by two separate plots, one is the magnitude vs frequency and the other one is
phase vs frequency. The magnitude is expressed in dB and the frequency is generally
plotted in log scale.
One of the advantages of the Bode plot in s-domain is that the magnitude curve can be
approximated by straight lines which allow the sketching of the magnitude plot without
exact computation.
Commands used:
1. bode: bode creates a Bode plot of the frequency response of a dynamic system
model . The plot displays the magnitude (in dB) and phase (in degrees) of
the system response as a function of frequency. bode automatically determines
frequencies to plot based on system dynamics.
Syntax: bode(sys)
Program:-
clc;
clear all;
bode(H)
Output:-
Experiment-11
Theory: - Steady-state error is defined as the difference between the input (command)
and the output of a system in the limit as time goes to infinity (i.e. when the
response has reached steady state). The steady-state error will depend on the type of input
(step, ramp, etc.) as well as the system type (0, I, or II). Steady-state error analysis is only
useful for stable systems. Now, the Laplace transforms for some standard inputs and
equations to calculate steady-state error from the open-loop transfer function in each case
is given below:
Commands used:-
Program:-
Output:-
Experiment-12
Objective:-Plot nyquist plot for given transfer function and to discuss closed loop
stability. Also determine the relative stability by measuring gain and phase
margin.
Theory:- The Nyquist plot of a transfer function, usually the loop transfer function GH(z),
is a mapping of Nyquist contour in z-plane onto GH(z) plane which is in polar
coordinates. Thus it is sometimes known as polar plot.
Absolute and relative stabilities can be determined from the Nyquist plot using Nyquist
stability criterion. Given the loop transfer function GH(z) of a digital control system, the
polar plot of GH(z) is obtained by setting z = e jωT and varying ω from 0 to ∞.
Nyquist stability criterion: The closed loop transfer function of single input single
output digital control system is described by
𝐺(𝑧)
M(z) =
1+𝐺𝐻(𝑧)
Commands used:-
Syntax: nyquist(sys)
Program:-
Output:-