0% found this document useful (0 votes)
831 views68 pages

22ECU403 Integrated Lab

Uploaded by

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

22ECU403 Integrated Lab

Uploaded by

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

Dr.

Ambedkar Institute of Technology, Bengaluru-56


(An Autonomous Institution Affiliated to VTU, Belagavi)

Department of Electronics and Communication


Engineering

Manual with Report

Lab component of Integrated Course

Modern Control Systems


Subject Code: 22ECU403

Student Name :
___________________________
USN :
___________________________
Semester :
___________________________
Section and Batch :
___________________________
Academic Year :
___________________________
Preface

The control systems deals with the design of various autonomous systems to operate under desired

specifications, like Safety in industry, optimal production of goods, noise elimination, stability of the

systems, smooth movement of objects, regulations of drug administration, level control, etc.

This manual is designed to understand the basic principles of control systems, and this manual covers

the practical component of control systems (22ECU403) course prescribed by the Department of Electronics

and Communication Engineering, Dr. Ambedkar Institute of Technology, Bengaluru.

This manual endeavors to prepare the reader to solve and simulate realistic problems involving on

control systems. The control systems experiments can be simulated using MATLAB.

Prepared by
Dr. Mohankumar V.
Assistant Professor
Department of Electronics and Communication Engineering
Dr. Ambedkar Institute of Technology
Bengaluru-560056
Dr. Ambedkar Institute of Technology, Bengaluru-56
(An Autonomous Institution Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering

Manual

Certificate

This is to certify that, Mr./Miss. __________________________________with,

USN_____________________ of Bachelor of Engineering in Electronics and

Communication Engineering – 4th Semester has satisfactorily completed the

Practical component of integrated course : Control Systems (22ECU403) during

the academic year _______________ for the partial fulfillment for the award for B.E.

Degree.

Faculty In-charge
Marks Obtained Name:

/50 Signature
with date:

Marks Obtained In Words: _________________________________________


CONTENTS
Page
Sl. No. Particulars
No.

I Vision and Mission, POs, and PSOs ------------------------------------------------ 5

II Syllabus Copy, Assessment details -------------------------------------------------- 8

III Rubrics--------------------------------------------------------------------------------- 11

IV Consolidated Marks Sheet----------------------------------------------------------- 13

V Introduction to Control Systems and MATLAB---------------------------------- 14

1 Transfer functions of combination of blocks -------------------------------------- 25

2 Conversion from transfer function to state space and vice-versa---------------- 31

3 2D and 3D plots of unit step response of 2nd order system----------------------- 39

4 Time response specifications of second order system -------------------- 43

5 Root Locus plots ----------------------------------------------------------------------- 45

6 BODE Plots ---------------------------------------------------------------------------- 50

7 Study of PI Controller ----------------------------------------------------------------- 55

8 Study of PD Controller --------------------------------------------------------------- 58

9 Study of PID Controller -------------------------------------------------------------- 61

10 Study of Speed Characteristics of DC motors using MATLAB----------------- 64

VI References------------------------------------------------------------------------------- 68

******
Vision and Mission of Dr. Ambedkar Institute of Technology, Benagaluru-

560056

VISION:

To create Dynamic, Resourceful, Adept and Innovative Technical professionals to meet global challenges.

MISSION:

 To offer state-of-the-art under graduate, post graduate and doctoral programs in the fields of
Engineering, Technology and Management
 To generate new knowledge by engaging faculty and students in research, development and
innovation.
 To provide strong theoretical foundation to the students, supported by extensive practical training to
meet the industrial requirements.
 To instil moral and ethical values with social and professional commitment.

Vision and Mission of Electronics and Communication Engineering

Department, Dr. Ambedkar Institute of Technology, Bengaluru-560056

VISION:
"To excel in education and research in Electronics and Communication Engineering and its related areas
through its integrated activities”

MISSION:
 To provide students a strong foundation in Electronics and Communication Engineering.
 To provide high quality technical education in Electronics and Communication Engineering
discipline and its related areas to meet the growing needs and challenges of industry and society.
 To be a contributor to the technology through the process of skill development, value based
education, research and innovation.
Program Outcomes (POs)

Engineering knowledge: Apply the knowledge of mathematics, science, engineering


PO1: fundamentals, and an engineering specialization to the solution of complex engineering
problems.

Problem analysis: Identify, formulate, review research literature, and analyze complex
PO2: engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.

Design/development of solutions: Design solutions for complex engineering problems


and design system components or processes that meet the specified needs with appropriate
PO3:
consideration for the public health and safety, and the cultural, societal, and
environmental considerations.

Conduct investigations of complex problems: Use research-based knowledge and


PO4: research methods including design of experiments, analysis and interpretation of data, and
synthesis of the information to provide valid conclusions.

Modern tool usage: Create, select, and apply appropriate techniques, resources, and
PO5: modern engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations.

The engineer and society: Apply reasoning informed by the contextual knowledge to
PO6: assess societal, health, safety, legal and cultural issues and the consequent responsibilities
relevant to the professional engineering practice.

Environment and sustainability: Understand the impact of the professional engineering


PO7: solutions in societal and environmental contexts, and demonstrate the knowledge of, and
need for sustainable development.

Ethics: Apply ethical principles and commit to professional ethics and responsibilities
PO8:
and norms of the engineering practice.

Individual and team work: Function effectively as an individual, and as a member or


PO9:
leader in diverse teams, and in multidisciplinary settings.

Communication: Communicate effectively on complex engineering activities with the


PO10:
engineering community and with society at large, such as, being able to comprehend and
write effective reports and design documentation, make effective presentations, and give
and receive clear instructions.

Project management and finance: Demonstrate knowledge and understanding of the


PO11: engineering and management principles and apply these to one’s own work, as a member
and leader in a team, to manage projects and in multidisciplinary environments.

Life-long learning: Recognize the need for, and have the preparation and ability to
PO12: engage in independent and life-long learning in the broadest context of technological
change.

Program Specific Outcomes (PSOs)

Capability to use mathematical Techniques to model the real time problems, to optimize
PSO1:
the implementation using mathematical techniques and to analyse the system performance.

Ability to Understand, Analyse and Apply the Electronic Circuits, Digital Circuits, VLSI
PSO2: Circuits, Antennas, Microwaves, Microcontrollers and Embedded Controllers,
Communication Systems concepts to design and implement the real time applications.

Ability to identify and have the social and ethical responsibilities for the betterment of
PSO3: Society and to become an entrepreneur.

******
Syllabus Copy

Control Systems
Integrated Laboratory Component
Course Code: 22ECU403 CIE Marks:20

Teaching Hours/Week (L:T:P: S): 0:0:2:0 Credits (L:T:P:S): 3:0:1:0


Experiments using MATLAB

Sl. NOTE: Every experiment has to be designed, necessary diagrams/plots to be drawn /


No constructed and executed in the specified software. Results are also to be noted and
inferred.

Note: Standard design procedure to be adopted.


Obtain Cascaded, Parallel and Feedback closed loop transfer functions using
1
MATLAB.
2 Convert Transfer function to state space representation and Vice-versa.

3 Obtain 2D and 3D plots of unit step response of 2nd order system.

4 Find the Time Response Specifications of unit step response of 2nd order System

5 Draw root locus using MATLAB

6 Draw BODE PLOTs using MATLAB

7 Study the effect of PI controller using MATLAB

8 Study the effect of PD controller using MATLAB

9 Study the effect of PID controller using MATLAB

10 Study of speed characteristics of DC motors using MATLAB.

******
Assessment Details

1. Continuous Internal Evaluation (CIE):

The maximum Marks prescribed for CIE is 50. CIE includes theory tests components (30 Marks)
and Laboratory components (20 Marks).

(i) Assessment of CIE for the theory component: (30 marks)

a. There shall be two tests (each 25 Marks). Each test includes descriptive questions (20 Marks) and
Quiz (05 Marks).
b. The sum of the two tests performances maximum of 50 Marks scale down to 30 Marks shall be
considered for theory component.
c. The minimum marks to be secured in CIE to appear for SEE shall be 12 (40% of maximum
marks) in the theory component.
d. A makeup test shall be conducted with valid reasons acceptable to the institute, duly
recommended by the Faculty/Mentor and HOD.

(ii) Assessment of CIE for the Practical component:

a. On completion of every experiment/program in the laboratory, the students shall be evaluated


and marks shall be awarded on the same day. The 15 marks are for conducting the experiment
and preparation of the laboratory record, the other 05 marks shall be for the test conducted at the
end of the semester.
b. The CIE marks awarded in the case of the Practical component shall be based on the Continuous
Evaluation of the laboratory report. Each experiment report can be evaluated for 10 marks. Marks
of all experiments' write-ups are added and scaled down to 15 marks.
c. The laboratory test (including viva) at the end of the semester/after completion of all the
experiments shall be conducted for 25 marks and scaled down to 05 marks.
d. Scaled-down marks of write-up evaluations (b) and tests (c) added will be CIE marks for the
laboratory component for 20 marks.
e. The minimum marks to be secured in CIE to appear for SEE shall be 08 (40% of maximum
marks) in the practical component.

(iii) Calculation of Final CIE marks for IC/IPCC Courses

a. Final CIE Marks shall include 30 Marks from two CIE tests component and 20 Marks from
Laboratory component.
b. The following formula is used to award final CIE Score: CIE Score = (Test 1+ Test 2) X 0.6 +
Laboratory component
2. Passing Standard in CIE:

The minimum marks to be secured in CIE to appear for SEE shall be 12 (40% of maximum marks-30)
in the theory component and 08 (40% of maximum marks -20) in the practical component.

3. Semester End Examination (SEE) for IC/IPCC:

 Theory SEE will be conducted for 100 Marks (3 Hours duration) by Institute as per the scheduled
time table, with common Question papers for the course (duration 03 hours)
 The Question paper will have TEN questions. Each question is set for 20 marks.
 There will be TWO questions from each UNIT (with a maximum of 3 sub-questions).
 The students have to answer 5 full questions, selecting one full question from each unit.
 In SEE, the questions from the laboratory component shall be included. The maximum of 04/05
questions to be set from the practical component of IPCC, the total marks of all questions should
not be more than 20 marks.

4. Passing standard in SEE:

SEE will be conducted for 100 marks and students shall secure 35% of the maximum marks to qualify
for the SEE. Marks secured will be scaled down to 50.

5. Weightage of CIE and SEE :


The weightage of Continuous Internal Evaluation (CIE) is 50% and for Semester End Exam (SEE) is
50%.

******
Control Systems
Integrated Laboratory Component
Course Code: 22ECU403 CIE Marks:20

Teaching Hours/Week (L:T:P: S): 0:0:2:0 Credits (L:T:P:S): 3:0:1:0

Rubrics (CIE)
Learning
Aspects of Assessment Excellent Average Poor
Outcome
Understand some concepts /
Recall the concepts, draw the Complete understanding of the concepts / Student lacks clear understanding of the
Participates less in class / read
Write-up diagrams with clear actively participate during lecture /read basic concepts of control systems and
diagrams but unable to interpret
(10) specifications and interpret diagrams. unable to interpret completely.
them accurately.
(4-5 Marks) (0-1 Marks)
(2-3 Marks)
A complete solution / Explain necessary Solution is complete but need minor Solution is complete but did not work,
Design or Develop solution for
Design and theories according to task description modifications / student could have needed several modifications / did not
problem that meet specified
Development with great use of time and followed Specification more make correct use of resource material or
needs by using the concept of
(10) resource/material. closely. instructions.
control systems
(9-10 Marks) (5-8 Marks) (0-4 Marks)

Tool
Software tool usage for Does not know completely how to use
Utilization and Effectively use software tools to collect Use software tools to collect data
constructing various software tools to collect and analyze
Conduction of readings of control systems with minor error.
application of control systems data.
experiment (15-20 Marks) (08-14 Marks)
using MATLAB (0-7 Marks)
(20)

Student answers few questions Student did not answer any question/
Student answers all the questions asked
asked by the teacher with correct maximum questions or students know
Viva-Voce Student has to answer the by the teacher comfortably/fluently with
answer, or student knows the the little bit answers and unable to
(10) questions asked orally correct answer.
answer but unable to answer orally. answer in a proper way.
(9-10 Marks)
(5-8 Marks) (0-4 Marks)
Total=50 Marks

******
Control Systems
Integrated Laboratory Component
Course Code: 22ECU403 CIE Marks:20

Teaching Hours/Week (L:T:P: S): 0:0:2:0 Credits (L:T:P:S): 3:0:1:0

Rubrics (REGULAR LAB)


Learning Aspects of Assessment Excellent Average Poor
Outcome
Complete understanding of the Understand some concepts / Student lacks clear understanding
Write-up Recall the concepts, draw the
concepts / actively participate Participates less in class / read systems of the basic concepts of Electrical
system design with diagram and control System
during lecture /read and interpret but unable to interpret them Circuits and Control Systems and
specifications with clear specifications
schematic diagrams. accurately. unable to interpret completely.
(05)
(4-5 Marks) (2-3 Marks) (0-1 Marks)
Tool Utilization Construction / Realization of Student efficiently construct a Write MATLAB code but with minor Construct/write program only with
and Conduction of systems by implementing system/write MATLAB code/ errors. help from the teacher.
Experiment various configuration on derive transfer function (4-6 Marks) (0-3 Marks)
(08) MATLAB (7-8 Marks)
Interpretation of Getting accurate results as per Getting accurate results with all Getting results only for given inputs Getting partial and wrong results.
Results the design specifications possible inputs (2-3 Marks) (0-1 Marks)
(05) (4-5 Marks)
Report / Student has to write Writing neatly all the observations Writing moderately the observations Writing incomplete observations
Observations observations made during the made during the conduction of in the report in the report.
(07) conduction of experiment and experiment. (4-5 Marks) (0-3 Marks)
plot the graphs and (6-7 Marks)
waveforms.
Viva-Voce Student did not answer any
Student answers all the questions Student answers few questions asked
(05) question/ maximum questions or
asked by the teacher by the teacher with correct answer, or
Student has to answer the students know the little bit
comfortably/fluently with correct student knows the answer but unable
questions asked orally answers and unable to answer in a
answer. to answer orally.
proper way.
(4-5 Marks) (2-3 Marks)
(0-1 Marks)

Total= 30 Marks

******
Dr. Ambedkar Institute of Technology, Bengaluru-56
(An Autonomous Institution Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering

Lab component of Circuit Analysis and Control Systems


(21ECT403)
Consolidated Marks list

Tool
Utilization
Exper Integration Record Viva- Faculty
Write-up and Total
-iment of Results Writing Voce Signature
(5) Conduction of (30)
No. (5) (7) (5) with date.
Experiment
(8)
1

10

Average

Average marks scored by the students in the Scaled down to


regular lab classes (30 Marks) : 15 Marks
Scaled Down to
Final CIE Marks (50 Marks) :
5 Marks

Total out of 20 Marks


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Introduction to Control
Systems and MATALB

Electronics and Communication Engineering Dr.AIT Page 14


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Introduction to Control Systems and MATLAB


Control Systems
A control system manages, commands, directs or regulates the behavior of other devices or the
same systems. It can range from a home heating controller using a thermostat controlling a domestic boiler
to large Industrial control systems which are used for controlling processes or machines.
In the most common form, the feedback control system it is desired to control a process, called the plant,
so its output follows a control signal, which may be a fixed or changing value. The control system compares
the output of the plant to the control signal, and applies the difference as an error signal to bring the output
of the plant closer to the control signal.

The term "control system" may be applied to the essentially manual controls that allow an operator,
for example, to close and open a hydraulic press, perhaps including logic so that it cannot be moved
unless safety guards are in place.

An automatic sequential control system may trigger a series of mechanical actuators in the correct
sequence to perform a task. For example, various electric and pneumatic transducers may fold and glue a
cardboard box, fill it with product and then seal it in an automatic packaging machine. Programmable logic
controllers are used in many cases such as this, but several alternative technologies exist.

In the case of linear feedback systems, a control loop, including sensors, control algorithms and
actuators, is arranged in such a fashion as to try to regulate a variable at a set point or reference value.

MATLAB
MATLAB (an abbreviation of MATrix LABoratory) registered trademark of computer software,
developed by the Math Works Inc. The software is widely used in many of science and engineering fields.
MATLAB is an interactive program for numerical computation and data visualization. MATLAB is
supported on UNIX, Macintosh, and Windows environments. A Windows version of MATLAB is assumed
here. The syntax is very similar for the DOS version.
MATLAB integrates mathematical computing, visualization, and a powerful language to provide a flexible
environment for technical computing. The open architecture makes it easy to use MATLAB and its
companion products to explore data, create algorithms, and create custom tools that provide early insights
and competitive advantages. Known for its highly optimized matrix and vector calculations, MATLAB
offers an intuitive language for expressing problems and their solutions both mathematically and visually.
Typical uses include:
• Numeric computation and algorithm development
• Symbolic computation (with the built-in Symbolic Math functions)
• Modeling, simulation, and prototyping
• Data analysis and signal processing
• Engineering graphics and scientific visualization

Electronics and Communication Engineering Dr.AIT Page 15


Lab Component of Circuit Analysis and Control Systems (22ECU403)
This section introduces the MATLAB environment. We will learn how to create, edit, save, run,
and debug m-files (ASCII files with series of MATLAB statements). And some MATLAB Commands.

Starting and Quitting MATLAB


To start MATLAB click on the MATLAB icon or type in MATLAB, followed by pressing the enter
or return key at the system prompt. The screen will produce the MATLAB prompt >> (or EDU >>), which
indicates that MATLAB is waiting for a command to be entered. In order to quit MATLAB, type quit or
exit after the prompt, followed by pressing the enter or return key.

Display Windows
MATLAB has three display windows. They are
1. A Command Window which is used to enter commands and data to display plots and graphs.
2. A Graphics Window which is used to display plots and graphs
3. An Edit Window which is used to create and modify M-files. M-files are files that contain a program or
script of MATLAB commands.

Entering Commands
Every command has to be followed by a carriage return <cr> (enter key) in order that the command
can be executed. MATLAB commands are case sensitive and lower case letters are used throughout.
To execute an M-file (such as Project_1.m), use short cut function key F5 or go to debug and select run.

MATLAB Expo
In order to see some of the MATLAB capabilities, enter the demo command. This will initiate the
MATLAB EXPO. MATLAB Expo is a graphical demonstration environment that shows some of the
different types of operations which can be conducted with MATLAB.

Abort
In order to abort a command in MATLAB, hold down the control key and press c to generate a
local abort with MATLAB.

The Semicolon (;)


If a semicolon (;) is typed at the end of a command the output of the command is not displayed.

Typing %
When percent symbol (%) is typed in the beginning of a line, the line is designated as a comment.
When the enter key is pressed the line is not executed.

The clc Command


Typing clc command and pressing enter cleans the command window. Once the clc command is
executed a clear window is displayed.

Help

Electronics and Communication Engineering Dr.AIT Page 16


Lab Component of Circuit Analysis and Control Systems (22ECU403)
MATLAB has a host of built-in functions. For a complete list, refer to MATLAB user’s guide or
refer to the on line Help. To obtain help on a particular topic in the list, e.g., inverse, type help inv.

Statements and Variables


Statements have the form
>> variable = expression
The equals (“=”) sign implies the assignment of the expression to the variable. For instance,
to enter a 2 × 2 matrix with a variable name A, we write
>> A == [1 2 ; 3 4] <ret>
The statement is executed after the carriage return (or enter) key is pressed to display
A =1 2
34

Arithmetic Operations
The symbols for arithmetic operations with scalars are summarized in Table.1

Arithmetic operation Symbol Example


Addition + 4+2=6
Subtraction - 4-2=2
Multiplication * 4*2=8
Right division / 4/2=2
Left division \ 4\2=2/4=0.5
Exponentiation ^ 4^2=16

Table.1: Arithmetic Operations with symbol and example.


Display formats

MATLAB has several different screen output formats for displaying numbers. These formats can
be found by typing the help command: help format in the Command Window. A few of these formats are
shown in Table.2.

Command Description Example


Format short Fixed-point with 4 decimal digits >> 351/7
ans = 50.1429
Format long Fixed-point with 14 decimal digits >> 351/7
ans = 50.14285714285715
Format short e Scientific notation with 4 decimal digits >> 351/7
ans = 5.0143e+001
Format long e Scientific notation with 15 decimal digits >> 351/7
ans = 5.014285714285715e001

Electronics and Communication Engineering Dr.AIT Page 17


Lab Component of Circuit Analysis and Control Systems (22ECU403)
Format short g Best of 5 digit fixed or floating point >> 351/7
ans = 50.143
Format long g Best of 15 digit fixed or floating point >> 351/7
ans = 50.1428571428571
Format bank Two decimal digits >> 351/7
ans = 50.14
Format compact Eliminates empty lines to allow more lines with information displayed on the
screen
Format loose Adds empty lines (opposite of compact)
Table.2: Display commands with description and examples
Elementary math built in functions
MATLAB contains a number of functions for performing computations which require the use of
logarithms, elementary math functions, and trigonometric math functions. List of these commonly used
elementary MATLAB mathematical built-in functions are given in Table .3

Function Description
abs(x) Computes the absolute value of x.
sqrt(x) Computes the square root of x.
round(x) Rounds x to the nearest integer.
fix(x) Rounds (or truncates) x to the nearest integer toward 0.
floor(x) Rounds x to the nearest integer toward – ∞
ceil(x) Rounds x to the nearest integer toward ∞
sign(x) Returns a value of – 1 if x is less than 0, a value of 0 if x equals 0, and a value of 1
rem(x,y) otherwise.
Returns the remainder of x/y. for example, rem(25, 4) is 1, and rem(100,21) is 16. This
exp(x) function is also called a modulus function.
log(x) Computes ex, where e is the base for natural logarithms, or approximately 2.718282.
log10(x) Computes ln x, the natural logarithm of x to the base e.
Computes log10 x, the common logarithm of x to the base 10.
Table.3: list of mathematical built in functions with description
Variable names
A variable is a name made of a letter or a combination of several letters and digits. Variable names
can be up to 63 (in MATLAB 7) characters long (31 characters on MATLAB 6.0). MATLAB is case
sensitive. For instance, XX, Xx, xX, and xx are the names of four different variables. It should be noted
here that not to use the names of a built-in functions for a variable. For instance, avoid using: sin, cos, exp,
sqrt, ..., etc. Once a function name is used to define a variable, the function cannot be used.

Predefined variables
MATLAB includes a number of predefined variables. Some of the predefined variables
that are available to use in MATLAB programs are summarized in Table.4
Variable Explanation

Electronics and Communication Engineering Dr.AIT Page 18


Lab Component of Circuit Analysis and Control Systems (22ECU403)
ans This variable contains the result of the last calculation that has not been assigned to
another variable.
eps The value of this variable is approximately and is being used
internally by MATLAB. This number is the default computation accuracy of
MATLAB which is used to round of all numbers for storage in the computer
memory. Do not confuse eps with the number , because

i or j
The complex number with the property that .
pi 3.1415...
Inf This is the value infinity. When one divides 1 by 0, 1/0, the result will be Inf.
NaN This variable is a representation of `Not a Number'. A calculation with NaN always
results in NaN. The command 0/0 produces NaN.
Table.4: Predefined variables with explanation
Commands for managing variables
Table.5 lists commands that can be used to eliminate variables or to obtain information about variables that
have been created. The procedure is to enter the command in the Command Window and the Enter key is
to be pressed.
Command Explanation
who Gives a list of the variables in use.
whos Gives a list of the variables in use as well as some extra information.
clear Removes all variables.
clear x y Removes the variables x and y.

Table.5: commands of managing variables with explanation


Graphics Commands
The basic command for producing a simple 2-D plot is
plot(x values, y values, ‘style option’)
Where x values and y values are vectors containing the x- and y-coordinates of points on the graph.
Style option is an optional argument that specifies the color, line-style, and the point marker style.
The style option in the plot command is a character string that consists of 1, 2, or 3 characters that specify
the color and/or the line style. The different color, line-style and marker style options are summarized in
Table.6 (a).

Color style-option Line style- option Marker style-option


y yellow – solid + plus sign
m magenta – – dashed o circle
c cyan : dotted * asterisk
r red – . dash-dot x x-mark
g green . point

Electronics and Communication Engineering Dr.AIT Page 19


Lab Component of Circuit Analysis and Control Systems (22ECU403)
b blue ^ up triangle
w white s square
k black d diamond, etc.
Table.6 (a): Graphics commands for 2-D plots.
There are several specialized graphics functions available in MATLAB for 2-D plots. The
list of functions commonly used in MATLAB for plotting x-y data are given in Table.6(b).

Function Description
area Creates a filled area plot.
bar Creates a bar graph.
barh Creates a horizontal bar graph.
comet Makes an animated 2-D plot.
compass Creates arrow graph for complex numbers.
contour Makes contour plots.
contourf Makes filled contour plots.
errorbar Plots a graph and puts error bars.
feather Makes a feather plot.
fill Draws filled polygons of specified color.
fplot Plots a function of a single variable.
hist Makes histograms.
loglog Creates plot with log scale on both x and y axes.
pareto. Makes pareto plots
pcolor Makes pseudo color plot of matrix
pie Creates a pie chart.
plotyy Makes a double y-axis plot.
plotmatrix Makes a scatter plot of a matrix.
polar Plots curves in polar coordinates.
quiver Plots vector fields.
rose Makes angled histograms.
scatter Creates a scatter plot.
semilogx Makes semilog plot with log scale on the x-axis.
semilogy Makes semilog plot with log scale on the y-axis.
stairs Plots a stair graph.
stem Plots a stem graph.

Table.6 (b): Graphics commands for 2-D plots.


Input and output functions
To have the MATLAB read or write a separate data file of numerical values, we need to
connect the file to the executing MATLAB program. The MATLAB functions used are summarized in
Table.7.
Function Description

Electronics and Communication Engineering Dr.AIT Page 20


Lab Component of Circuit Analysis and Control Systems (22ECU403)
fopen Connects an existing file to MATLAB or to create a new file from MATLAB.
fid = fopen(‘Filename’, permission code);
where, if fopen is successful, fid will be returned as a positive integer greater than
2. When unsuccessful, a value of – 1 is returned. Both the file name and the
permission code are string constants enclosed in single quotes. The permission code
can be a variety of flags that specify whether or not the file can be written to, read
from, appended to, or a combination of these. Some common codes are:
Code Meaning
‘r’ read only
‘w’ write only
‘r+’ read and write
‘a+’ read and append
The fopen statement positions the file at the beginning.
fclose Disconnects a file from the operating MATLAB program. The use is fclose(fid),
where fid is the file identification number of the file returned by fopen. fclose(‘all’)
will close all files.
fscanf Reads opened files. The use is
A = fscanf(fid, FORMAT, SIZE)
where FORMAT specifies the types of numbers (integers, reals with or without
exponent, character strings) and their arrangement in the data file, and optional
SIZE determines how many quantities are to be read and how they are to be arranged
into the matrix A. If SIZE is omitted, the entire file is read. The FORMAT field is a
string (enclosed in single quotes) specifying the form of the
numbers in the file. The type of each number is characterized by a percent sign
(%), followed by a letter (i or d for integers, e or f for floating-point numbers with
or without exponents). Between the percent sign and the type code, one can insert
an integer specifying the maximum width of the field.
fprintf Writes files previously opened.
fprintf(fid, FORMAT, A)
where fid and FORMAT have the same meaning as for fscanf, with the exception
that for output formats the string must end with \n, designating the end of a line of
output.
Table.7: Input and Output commands with explanation.
Control system commands

The MATLAB Supports control system operations and the commands used in control systems/ engineering
is summarized in table.8.

Command Description
abs Absolute value
acker Compute the K matrix to place the poles of A-BK, see also place

Electronics and Communication Engineering Dr.AIT Page 21


Lab Component of Circuit Analysis and Control Systems (22ECU403)
axis Set the scale of the current plot, see also plot, figure
bode Draw the Bode plot, see also logspace, margin, nyquist1
c2d Continuous system to discrete system
clf Clear figure
conv Convolution (useful for multiplying polynomials), see also deconv
ctrb The controllability matrix, see also obsv
deconv Deconvolution and polynomial division, see also conv
det Find the determinant of a matrix
dlqr Linear-quadratic regulator design for discrete-time systems, see also lqr
eig Compute the eigenvalues of a matrix
eps MATLAB's numerical tolerance
feedback Connect linear systems in a feedback loop
figure Create a new figure or redefine the current figure, see also subplot, axis
for For loop
format Number format (significant digits, exponents)
function Creates function m-files
grid Draw the grid lines on the current plot
gtext Add a piece of text to the current plot, see also text
help Matlab help documentation
hold Hold the current graph, see also figure
if Conditionally execute statements
imag Returns the imaginary part of a complex number, see also real
impulse Impulse response of linear systems, see also step, lsim
input Prompt for user input
inv Find the inverse of a matrix
legend Graph legend
length Length of a vector, see also size
linspace Returns a linearly spaced vector
lnyquist Produce a Nyquist plot on a logarithmic scale, see also nyquist1
log Natural logarithm, also log10: common logarithm
loglog Plot using log-log scale, also semilogx/semilogy
logspace Returns a logarithmically spaced vector
lqr Linear quadratic regulator design for continuous systems, see also dlqr
lsim Simulate a linear system, see also step, impulse
margin Returns the gain margin, phase margin, and crossover frequencies, see also bode
minreal Produces a minimal realization of a system (forces pole/zero cancellations)
norm Norm of a vector
Draw the Nyquist plot, see also lnyquist. Note this command was written to replace
nyquist1
the MATLAB standard command nyquist to get more accurate Nyquist plots.
obsv The observability matrix, see also ctrb

Electronics and Communication Engineering Dr.AIT Page 22


Lab Component of Circuit Analysis and Control Systems (22ECU403)
ones Returns a vector or matrix of ones, see also zeros
place Compute the K matrix to place the poles of A-BK, see also acker
plot Draw a plot, see also figure, axis, subplot.
poly Returns the characteristic polynomial
polyval Polynomial evaluation
print Print the current plot (to a printer or postscript file)
pzmap Pole-zero map of linear systems
rank Find the number of linearly independent rows or columns of a matrix
real Returns the real part of a complex number, see also imag
rlocfind Find the value of k and the poles at the selected point
rlocus Draw the root locus
roots Find the roots of a polynomial
rscale Find the scale factor for a full-state feedback system
Set(gca,'Xtick',xticks,'Ytick',yticks) to control the number and spacing of tick marks
set
on the axes
Generate grid lines of constant damping ratio (zeta) and natural frequency (Wn), see
sgrid
also sigrid, zgrid
size Gives the dimension of a vector or matrix, see also length
sqrt Square root
ss Create state-space models or convert LTI model to state space, see also tf
ssdata Access to state-space data. See also tfdata
stairs Stairstep plot for discrete response
step Plot the step response, see also impulse, lsim
subplot Divide the plot window up into pieces, see also plot, figure
text Add a piece of text to the current plot, see also title, xlabel, ylabel, gtext
tf Creation of transfer functions or conversion to transfer function, see also ss
tfdata Access to transfer function data, see also ssdata
title Add a title to the current plot
Returns the bandwidth frequency given the damping ratio and the rise or settling
wbw
time.
xlabel/ylabel Add a label to the horizontal/vertical axis of the current plot, see also title, text, gtext
zeros Returns a vector or matrix of zeros
Generates grid lines of constant damping ratio (zeta) and natural frequency (Wn),
zgrid
see also sgrid, Sigrid
Table.8: Control System Tool Box Commands with description.

Electronics and Communication Engineering Dr.AIT Page 23


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Experiments on
Control Systems

Electronics and Communication Engineering Dr.AIT Page 24


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Experiment-01: Obtain Cascaded, Parallel and Feedback Closed


Loop Transfer Functions using MATLAB.

AIM: Write MATLAB code to find the transfer function for the given block diagram, simulate it and record
the results.

Theory: Control systems can be represented pictorially by block diagram, i.e., block diagram is a pictorial
representation of control system elements or the whole system. The transfer function of an element or a
whole system to be mentioned inside the block.

Example:
Consider a resistive element (R).
𝑉(𝑠)
Its transfer function =𝑅
𝐼(𝑠)
The block diagram representation is shown in figure (1.1)

Figure 1.1: Block diagram representation of a resistor

In a control system, the elements may be interconnected in the form of cascade, parallel, or feedback loop.
According to block diagram algebra, possible to reduce the interconnected blocks into a single block.
The resultant transfer function is the product of the block transfer functions, if the blocks are in series. The
resultant transfer function is the sum or difference of the block transfer functions, if the blocks are in
parallel. For feedback loop, consider the canonical form shown in figure (1.2).

Figure 1.2: Canonical form of closed loop control system.

The resultant Transfer function of the above system is given by


𝐶(𝑠) 𝐺
=
𝑅(𝑠) 1 ∓ 𝐺𝐻
Note: Negative sign in the denominator, if the system is positive feedback. For negative feedback
positive sign in the denominator.

In MATLAB, commands are available to obtain the resultant transfer function for the above
configurations.

Electronics and Communication Engineering Dr.AIT Page 25


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Example:
12
𝐺1 (𝑠) = , 𝑎𝑛𝑑 𝐺2 (𝑠) = 𝑠 + 4
𝑠+3

MATLAB Code to obtain the transfer function:


num1=[12]
den1=[1 3]
G1=tf(num1, den1)
num2=[1 4]
G2=tf(num2, den2)

 For series connection


𝟏𝟐𝐬 + 𝟒𝟖
𝐓𝐅 =
𝐬+𝟑
MATLAB Code:
series (G1, G2) // MATLAB Command to obtain the TF if the blocks are connected in series

 For parallel connection


𝐬𝟐 + 𝟕𝐬 + 𝟐𝟒
𝐓𝐅 =
𝐬+𝟑
MATLAB Code:
parallel (G1, G2) // MATLAB Command to obtain the TF if the blocks are connected in parallel

 For feedback connection


𝟏𝟐
𝐓𝐅 =
𝟏𝟑𝐬 + 𝟓𝟏

MATLAB Code:
feedback (G1, G2) // MATLAB Command to obtain the TF if the blocks are connected in feedback

Example:
Given block diagram

Figure 1.3: Given block diagram to find the resultant transfer function

Electronics and Communication Engineering Dr.AIT Page 26


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Manual Calculations:
Step1: Block 𝒔 and 𝟏 are connected in parallel, equivalent transfer function (𝒔 + 𝟏)
𝟏 𝟏
Step2: Blocks 𝒔+𝟒 and 𝟐𝒔 are connected in the feedback form, equivalent transfer function 𝟑𝒔+𝟒
Step3: Blocks 𝒔 + 𝟐 and 𝟒𝒔 are connected in the feedback form, equivalent transfer function 𝟓𝒔 + 𝟐.

Figure 1.4: The block diagram simplified from steps 1 to 3.


Step4: The equivalent blocks obtained from steps 1 to 3 are connected in the form of series, its equivalent
𝟓𝒔𝟐 +𝟕𝒔+𝟐
transfer function is 𝟑𝒔+𝟒

Figure 1.5: The block diagram obtained after step4.

Step5: The block obtained from step4 is connected with unity feedback, therefore the resultant transfer
𝟓𝒔𝟐 +𝟕𝒔+𝟐
function is 𝟓𝒔𝟐 +𝟏𝟎𝒔+𝟔

Figure 1.6: The resultant block diagram.


Step6: The resultant Transfer function

𝐶[𝑠] 𝟓𝒔𝟐 + 𝟕𝒔 + 𝟐
=
𝑅[𝑠] 𝟓𝒔𝟐 + 𝟏𝟎𝒔 + 𝟔

MATLAB Code:
clear all
close all
clc
num1=[1 2]
den1=[1];
tf1=tf(num1, den1); % transfer function s+2
num2=[4 0]
den2=[1]
tf2=tf(num2, den2); % transfer function 4s
num3=[1 0]
den3=[1]
tf3=tf(num3, den3);% transfer function s
num4=[1]

Electronics and Communication Engineering Dr.AIT Page 27


Lab Component of Circuit Analysis and Control Systems (22ECU403)
den4=[1 4]
tf4=tf(num4, den4);%transfer function 1/(s+4)
num5=[2 0]
den5=[1]
tf5=tf(num5, den5); % transfer function 2s
tf6=feedback(tf1, tf2)
tf7=parallel(tf3, 1)
tf8=feedback(tf4, tf5)
tf9=series(tf6, tf7)
tf10=series(tf8, tf9)
tf11=feedback(tf10,1)

Result:

Electronics and Communication Engineering Dr.AIT Page 28


Lab Component of Circuit Analysis and Control Systems (22ECU403)
Practice:

NOTE: show the manual calculations on the space provided in the report, paste the MATLAB
Code and result.

Observations:

Electronics and Communication Engineering Dr.AIT Page 29


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Evaluation:

Maximum Obtained
Particulars
Marks Marks
Write-up : system design with specifications 05
Tool Utilization and Conduction of Experiment 08
Interpretation of Results 05
Report / observations 07
Viva-Voce 05
Total 30

Faculty signature with date

******

Electronics and Communication Engineering Dr.AIT Page 30


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Experiment-02: Conversion from transfer function to state space


representation and vice-versa using MATLAB.

AIM: Write a MATLAB code to convert the given transfer function into state space representation and
vice-versa, simulate it and record the results.

Theory:
The ratio of output quantity to the input quantity with zero initial conditions in frequency domain is called
transfer function. The transfer function is a mathematical model of a system, sub-system, or a component.
It is a convenient representation of a linear time invariant system, used for the analysis and design of control
systems.
Mathematically,
𝑌(𝑠)
𝑇𝐹 = / 𝐼𝑛𝑖𝑡𝑖𝑎𝑙 𝐶𝑜𝑛𝑑𝑖𝑡𝑖𝑜𝑛𝑠 = 0
𝑋(𝑠)
State space models is a mathematical model of the system, can be used to analyze and design Linear, Non-
linear, Time Variant, Time Invariant, and MIMO systems. State space model incorporates the initial
conditions of the system.

State model
State Equation X(t) =̇ A X(t) + B U(t) − − − −(2.1)
Output Equation Y(t) = CX(t) + DU(t) − − − −(2.1)

Case(i) : Transfer function to state space representation

Example-1:
Given transfer function
𝒀(𝒔) 𝟒
𝑻𝑭 = = 𝟑
𝑼(𝒔) 𝒔 + 𝟒𝒔𝟐 + 𝟐𝒔 + 𝟏
Manual calculations:
Given transfer function in time domain
𝑑3 𝑦(𝑡) 𝑑2 𝑦(𝑡) 𝑑𝑦(𝑡)
3
+ 4 2
+2 + 𝑦(𝑡) = 4𝑢(𝑡) − − − (1)
𝑑𝑡 𝑑𝑡 𝑑𝑡
𝑋1 (𝑡) = 𝑦(𝑡)
̇
𝑋1 (𝑡) = 𝑋2 (𝑡) = 𝑦̇ (𝑡)
𝑋̈2 (𝑡) = 𝑋3 (𝑡) = 𝑦̈ (𝑡)
𝑋⃛3 (𝑡) = 𝑦⃛(𝑡) = −𝑋1 (𝑡) − 2𝑋2 (𝑡) − 4𝑋3 (𝑡) + 4𝑢(𝑡)
State Model
State equation
̇
𝑋1 (𝑡) 0 1 0 𝑋1 (𝑡) 0
[𝑋2 (𝑡)̇ ]=[ 0 0 1 ] [𝑋 2 (𝑡) ] + [0] 𝑢(𝑡)
𝑋3 (𝑡) ̇ −1 −2 −4 𝑋3 (𝑡) 4
Output Equation
𝑋1 (𝑡)
𝑦(𝑡) = [1 0 0] [𝑋2 (𝑡)] + [0][𝑢(𝑡)
𝑋3 (𝑡)
Electronics and Communication Engineering Dr.AIT Page 31
Lab Component of Circuit Analysis and Control Systems (22ECU403)

MALAB Code:
clear all
close all
clc
num=[4]
den=[1 4 2 1]
G=tf(num,den)
RG=order(G)
[Aa,Bb,Cc,Dd]=tf2ss(num,den) % Controllable form
% phase variable form
V=fliplr(eye(RG))
A=inv(V)*Aa*V
B=Cc'
C=Bb'
D=Dd

Result:

Example-2: Given Transfer Function

𝒀(𝒔) 𝒔 + 𝟏𝟎
𝑻𝑭 = = 𝟑
𝑼(𝒔) 𝒔 + 𝒔𝟐 + 𝒔 + 𝟒
Manual Calculations:

Given transfer function can be written as


𝑌(𝑠) 𝑌(𝑠) 𝑍(𝑠)
=( )𝑋 ( )
𝑈(𝑠) 𝑍(𝑠) 𝑈(𝑠)
Electronics and Communication Engineering Dr.AIT Page 32
Lab Component of Circuit Analysis and Control Systems (22ECU403)
Where,
𝑌(𝑠)
= 𝑠 + 10
𝑍(𝑠)
And
𝑍(𝑠) 1
= 3 2
𝑈(𝑠) 𝑠 + 𝑠 + 𝑠 + 4
In time domain
𝑑𝑧(𝑡)
𝑦(𝑡) = + 10𝑧(𝑡) − − − (2)
𝑑𝑡
𝑑 3 𝑧(𝑡) 𝑑 2 𝑧(𝑡) 𝑑𝑧(𝑡)
𝑢(𝑡) = + + + 4𝑧(𝑡) − − − (3)
𝑑𝑡 3 𝑑𝑡 2 𝑑𝑡
Let,
𝑧(𝑡) = 𝑋1 (𝑡)
𝑑𝑧(𝑡)
= 𝑋̇1 (𝑡) = 𝑋2 (𝑡)
𝑑𝑡
𝑑 2 𝑧(𝑡)
= 𝑋2̇ (𝑡) = 𝑋3 (𝑡)
𝑑𝑡 2
𝑑3 𝑧(𝑡)
= 𝑋̇3 (𝑡) = −𝑋3 (𝑡) − 𝑋2 (𝑡) − 4𝑋1 (𝑡) + 𝑢(𝑡)
𝑑𝑡 3
Similarly, from equation (1)
𝑦(𝑡) = 10𝑋1 (𝑡) + 𝑋2 (𝑡)
State Model
State equation
̇
𝑋1 (𝑡) 0 1 0 𝑋1 (𝑡) 0
[𝑋2 (𝑡)̇ ]=[ 0 0 1 ] [𝑋 2 (𝑡) ] + [0] 𝑢(𝑡)
𝑋3 (𝑡) ̇ −4 −1 −1 𝑋3 (𝑡) 1
Output Equation
𝑋1 (𝑡)
𝑦(𝑡) = [10 1 0] [𝑋2 (𝑡)] + [0][𝑢(𝑡)
𝑋3 (𝑡)
MATLAB Code:

clear all
close all
clc
num=[1 10]
den=[1 1 1 4]
G=tf(num,den)
RG=order(G)
[Aa,Bb,Cc,Dd]=tf2ss(num,den) % Controllable form
% phase variable form
V=fliplr(eye(RG))
A=inv(V)*Aa*V
B=inv(V)*Bb
C=Cc*V
D=Dd

Electronics and Communication Engineering Dr.AIT Page 33


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Result:

Practice :
𝑌(𝑠) 10
1. =
𝑈(𝑠) 𝑠3 +2𝑠2 +3𝑠+1
𝑌(𝑠) 𝑠2 +2𝑠
2. =
𝑈(𝑠) 𝑠3 +2𝑠2 +𝑠+10

Observations:

Electronics and Communication Engineering Dr.AIT Page 34


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Electronics and Communication Engineering Dr.AIT Page 35


Lab Component of Circuit Analysis and Control Systems (22ECU403)
Case (ii): State space to Transfer function representation
Example
Given state model
State equation
̇
𝑋1 (𝑡) 0 1 0 𝑋1 (𝑡) 0
[𝑋2 (𝑡)̇ ]=[ 0 0 1 ] [𝑋 2 (𝑡) ] + [0] 𝑢(𝑡)
𝑋3 (𝑡) ̇ −1 −2 −4 𝑋3 (𝑡) 4
Output Equation
𝑋1 (𝑡)
𝑦(𝑡) = [1 0 0] [𝑋2 (𝑡)] + [0][𝑢(𝑡)
𝑋3 (𝑡)
Manual calculations:
We know that
𝑌(𝑠)
= 𝐶[𝑠𝐼 − 𝐴]−1 𝐵 + 𝐷
𝑈(𝑠)

𝑠 −1 0
(𝑠𝐼 − 𝐴) = [0 𝑠 −1 ]
1 2 𝑠+4

𝑠 2 + 4𝑠 + 2 𝑠+4 1
[ −1 𝑠 2 + 4𝑠 2 ]
(𝑠𝐼 − 𝐴)−1 = −5 −2𝑠 − 1 𝑠 2
3 2
𝑠 + 4𝑠 + 2𝑠 + 1

𝑠 2 + 4𝑠 + 2 𝑠+4 1
𝐶[𝑠𝐼 − 𝐴]−1 = [ ]
𝑠 3 + 4𝑠 2 + 2𝑠 + 1 𝑠3 + 4𝑠 2 + 2𝑠 + 1 𝑠3 + 4𝑠 2+ 2𝑠 + 1

4
𝐶[𝑠𝐼 − 𝐴]−1 𝐵 =
𝑠3 + 4𝑠 2+ 2𝑠 + 1
4
𝐶[𝑠𝐼 − 𝐴]−1 𝐵 + 𝐷 = +0
𝑠3 + 4𝑠 2+ 2𝑠 + 1

𝑌(𝑠) 4
= 3 2
𝑈(𝑠) 𝑠 + 4𝑠 + 2𝑠 + 1

MATLAB Code:
clear all
close all
clc
A = [ 0 1 0; 0 0 1; -1 -2 -4];
B = [0;0;4];
C = [1 0 0];
D = [0];
[num,den] = ss2tf(A,B,C,D)
G=tf(num, den)

Electronics and Communication Engineering Dr.AIT Page 36


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Results:

Practice:

1. State Model
State equation
̇
𝑋1 (𝑡) 0 1 0 𝑋1 (𝑡) 0
̇
[𝑋2 (𝑡)] = [ 0 0 1 ] [𝑋2 (𝑡)] + [0] 𝑢(𝑡)
𝑋3 (𝑡) ̇ −4 −1 −1 𝑋3 (𝑡) 1
Output Equation
𝑋1 (𝑡)
𝑦(𝑡) = [10 1 0] [𝑋2 (𝑡)] + [0][𝑢(𝑡)
𝑋3 (𝑡)

2. State Model
State equation
̇
𝑋1 (𝑡) 0 1 0 𝑋1 (𝑡) 0
[𝑋2 (𝑡)̇ ]=[ 0 0 1 ] [ 𝑋2 (𝑡) ] + [ 0 ] 𝑢(𝑡)
𝑋3 (𝑡) ̇ −1 −1 −1 𝑋3 (𝑡) 10
Output Equation
𝑋1 (𝑡)
𝑦(𝑡) = [1 0 0] [𝑋2 (𝑡)] + [0]𝑢(𝑡)
𝑋3 (𝑡)

Observations:

Electronics and Communication Engineering Dr.AIT Page 37


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Evaluation:

Maximum Obtained
Particulars
Marks Marks
Write-up : system design with specifications 05
Tool Utilization and Conduction of Experiment 08
Interpretation of Results 05
Report / observations 07
Viva-Voce 05
Total 30

Faculty signature with date

******

Electronics and Communication Engineering Dr.AIT Page 38


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Experiment-03: 2D and 3D plots of unit step response of 2nd order


system using MATLAB.

AIM: Write a MATLAB code to obtain 2D and 3D plots of unit step response of the given 2nd order system,
simulate it and record the results.

Theory:
2
𝜔𝑛
An open loop transfer function is connected with a unity feedback. The resultant closed loop
𝑠(𝑠+2𝜉𝜔𝑛 )
2
𝜔𝑛
transfer function is 2 2 , a second order system. Here, 𝜔𝑛 is the natural frequency, 𝜉 is the
𝑠 +2𝜉𝜔𝑛𝑠+𝜔𝑛 )
damping ratio. The step response of 2nd order system will be exponential, oscillatory with constant
amplitude, and damped oscillation, depending on the values of damping factor.
Case(i): 𝜉 > 1
𝜔𝑛 √𝜉 2 √𝜉 2
𝑐(𝑡) = (𝑒 −(𝜉𝜔𝑛−𝜔𝑛 −1)𝑡 − 𝑒 −(𝜉𝜔𝑛+𝜔𝑛 −1)𝑡 )
2√𝜉 2 − 1

Case (ii): 𝜉 = 1
𝑐(𝑡) = 𝜔𝑛2 𝑡𝑒 −𝜔𝑛𝑡

Case (iii): 𝜉 = 0
𝑐(𝑡) = 𝜔𝑛 sin(𝜔𝑛 𝑡)

Case (iv): 0 < 𝜉 < 1


𝜔𝑛 𝑒 −𝜉𝜔𝑛𝑡
𝑐(𝑡) = sin(𝜔𝑑 𝑡 + 𝜃)
√1 − 𝜉 2

Example
𝐶(𝑠) 1
= 2 ; 𝜉 = 0, 0.3, 0.7 1.0
𝑅(𝑠) 𝑠 + 2𝜉𝑠 + 1

1. 2D plot of step response of 2nd order system.

MATLAB Code:
clear all
close all
clc
t = 0:0.2:20;
zeta = [0 0.3 0.7 1 ];
for n = 1:4;
num = [1];
den = [1 2*zeta(n) 1];
[y(1:101,n),x,t] = step(num,den,t);
end
plot(t,y)

Electronics and Communication Engineering Dr.AIT Page 39


Lab Component of Circuit Analysis and Control Systems (22ECU403)
grid
title('2D Plot of Unit-Step Response of 2nd order system')
xlabel('t (sec)')
ylabel('Response')
text(4,1.9,'\zeta = 0')
text(3.1,1.4,'\zeta=0.3')
text(3.2,1.1,'\zeta=0.7')
text(3.2,0.9,'\zeta=1')

Results:

1. 3D plot of step response of 2nd order system.

MATLAB Code:

clear all
close all
clc
t = 0:0.2:20;
zeta = [0 0.3 0.7 1 ];
for n = 1:4;
num = [1];
den = [1 2*zeta(n) 1];
[y(1:101,n),x,t] = step(num,den,t);
end
mesh(t,zeta,y')
title('3D plot of unit step response of 2nd order system')
xlabel('t Sec')
ylabel('\zeta')
zlabel('Response')

Electronics and Communication Engineering Dr.AIT Page 40


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Results:

Practice:

𝑪(𝒔) 𝟏
1. = 𝒔𝟐 +𝟐𝝃𝒔+𝟏
𝑹(𝒔)

 𝝃 = 𝟎, 𝟎. 𝟏, 𝟎. 𝟐, 𝟎. 𝟑, 𝟎. 𝟒,
 𝝃 = 𝟎. 𝟓, 𝟎. 𝟔, 𝟎. 𝟕, 𝟎. 𝟖, 𝟎. 𝟗, 𝟏. 𝟎
 𝝃 =, 𝟎. 𝟒, 𝟎. 𝟓, 𝟎. 𝟔, 𝟎. 𝟕, 𝟎. 𝟖

Observations:

Electronics and Communication Engineering Dr.AIT Page 41


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Evaluation:

Maximum Obtained
Particulars
Marks Marks
Write-up : system design with specifications 05
Tool Utilization and Conduction of Experiment 08
Interpretation of Results 05
Report / observations 07
Viva-Voce 05
Total 30

Faculty signature with date

******

Electronics and Communication Engineering Dr.AIT Page 42


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Experiment-04: Time Response of Second Order System

AIM: Obtain the time response of given second order system and find all the time response
specifications and verify the same using MATLAB.

Example:
130
Given Close Loop Transfer Function, 𝑇(𝑠) = 𝑠2 +15𝑠+130
Time Response Specifications:

... 2ζwn=15 and wn2=130.

Hence,
wn2= 11.4 rad/sec.
ζ=0.6578.
Rise time (Tr) = 0.26 secs.
Peak time (Tp) =0.36 secs.
Settling time (Ts) = 0.53 secs.
Percentage overshoot (%Mp)= 6.43 %

Expected Time Response:


Given system is an underdamped system and Figure (4.1) Shows the expected time response.

Figure 4.1: Time response of the given system.


MATLAB Code:
clear all
close all
clf
clc
num = [130]
den = [1 15 130];
TF = tf(num, den)
omegan = sqrt (den(3))
zeta = den(2)/(2*omegan)
omegad=omegan*sqrt(1-zeta^2)
theta=atan(sqrt(1-zeta^2)/zeta)
Td=(1+0.7*zeta)/omegan
Tr=(pi-theta)/omegad
Ts = 4/ (zeta*omegan)
Tp = pi/(omegad)
mp=exp((-pi*zeta)/sqrt(1-zeta^2 ))*100
figure
step(TF)

Electronics and Communication Engineering Dr.AIT Page 43


Lab Component of Circuit Analysis and Control Systems (22ECU403)
Results:

Practice:
1
1. 𝑇(𝑠) = 𝑠2 +15𝑠+1

1
2. 𝑇(𝑠) = 𝑠2 +1

10
3. 𝑇(𝑠) = 𝑠2 +2𝑠+10
Observations:

Electronics and Communication Engineering Dr.AIT Page 44


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Evaluation:

Maximum Obtained
Particulars
Marks Marks
Write-up : system design with specifications 05
Tool Utilization and Conduction of Experiment 08
Interpretation of Results 05
Report / observations 07
Viva-Voce 05
Total 30

Faculty signature with date

******

Electronics and Communication Engineering Dr.AIT Page 45


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Experiment-05: ROOT-LOCUS

AIM: Draw the Root-Locus for the given system and verify the same using MATLAB.

Example:
𝑲
Given Open Loop Transfer Function, 𝑮(𝒔)𝑯(𝒔) = 𝒔(𝒔+𝟓)(𝒔+𝟏𝟎)
Solution:
1. P=3, Z=0, N=P=3 Branches
2. P-Z=3 Branches approaching to ∞
Starting points (open-loop poles) =0, -5, -10
Terminating points (open-loop zeros) =∞, ∞, ∞
3. Pole zero plot:

Figure 5.1: Unit Step Response of given second order system


4. Angle of Asymptotes: θ1=60o, θ2=180o and θ3=300o
5. Centroid: σ = -5

Figure 5.2: Unit Step Response of given second order system


6. Break away point: s=-2.113
7. Intersection point on imaginary axis: s=±j7.071

Expected ROOT-LOCUS Plot:

Figure 5.3: Unit Step Response of given second order system

Electronics and Communication Engineering Dr.AIT Page 46


Lab Component of Circuit Analysis and Control Systems (22ECU403)
MATLAB Code:

clear all
close all
clc
G=zpk([], [0 -5 -10], 1)
GH=tf(G)
rlocus(GH)
axis("square")
grid off
title("Root-locus plot of G(s)")

Results:

Practice:
𝑲
1. 𝑮(𝒔)𝑯(𝒔) = 𝒔𝟐 (𝒔+𝟓)(𝒔+𝟏𝟎)
𝑲(𝒔+𝟑)
2. 𝑮(𝒔)𝑯(𝒔) = (𝒔+𝟏)(𝒔+𝟐)
𝑲(𝒔+𝟏)(𝒔+𝟐)
3. 𝑮(𝒔)𝑯(𝒔) = 𝒔(𝒔+𝟑)
𝑲(𝒔+𝟏)
4. 𝑮(𝒔)𝑯(𝒔) = (𝒔𝟐 +𝟒𝒔+𝟏𝟑)
𝑲
5. 𝑮(𝒔)𝑯(𝒔) = 𝒔(𝒔𝟐 +𝟖𝒔+𝟑𝟐)

Electronics and Communication Engineering Dr.AIT Page 47


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Observations:

Electronics and Communication Engineering Dr.AIT Page 48


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Evaluation:

Maximum Obtained
Particulars
Marks Marks
Write-up : system design with specifications 05
Tool Utilization and Conduction of Experiment 08
Interpretation of Results 05
Report / observations 07
Viva-Voce 05
Total 30

Faculty signature with date

******

Electronics and Communication Engineering Dr.AIT Page 49


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Experiment-06: BODE PLOTS

AIM: Draw the BODE PLOT for the given system and verify the same using MATLAB.

Example:
𝑲
Given Open Loop Transfer Function, 𝑮(𝒔)𝑯(𝒔) = 𝒔(𝒔+𝟐)(𝒔+𝟏𝟎)

Manual Calculations:
1. Given open-loop Transfer function in time constant form
𝐾
𝑖. 𝑒. , 𝐺(𝑠)𝐻(𝑠) = 20
𝑠(0.5𝑠 + 1)(0.1𝑠 + 1)
. 𝐾′
. . 𝐺(𝑠)𝐻(𝑠) = 𝑠(0.5𝑠+1)(0.1𝑠+1)
K
Where K’ =
20
2. In frequency domain

𝐾′
𝐺(jω)𝐻(jω) = jω(0.5jω+1)(0.1jω+1)
Assume K=1 and Draw the Bode Plot

Sl. Parameter Corner Slope Resultant slope Remarks


No Frequency (ωc)
1 K=1 -- 0dB/decade + 0dB/decade 0dB Straight line

2 1/jω -- -20dB/decade + -20dB/decade --

3 1/(0.5jω+1) ωc1=2rad/sec -20dB/decade + -40dB/decade --

4 1/(0.1jω+1) ωc2=10rad/sec -20dB/decade -60dB/decade --

Expected Bode Plot:

For Marginally stable condition the phase and gain cross over frequencies are equal.

After drawing the bode plot for K= 1 shift the magnitude plot to get ωgc=ωpc [phase plot not affected because

phase angle of gain is zero.

Electronics and Communication Engineering Dr.AIT Page 50


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Figure 6.1: Bode plot for the given system


20 𝑙𝑜𝑔𝐾’ = 22𝑑𝐵
𝐾
𝐾’ =
20
𝐾 = 251.78
Exercise: Find the value of K for required GM and PM
To get required GM or PM or marginally stable conditions shift the magnitude/phase plot and then
calculate K’ and K.

MATLAB Code:

clc
clear all
G = zpk ([], [0 -2 -10], 251.78)
S = tf (G)
bode (G), grid on
title ('BODE PLOT')
[Gm, Pm, Wgc, Wpc] = margin (G);
fprintf('Gain Margin(GM)=%g dB \n', Gm)
fprintf('Phase Margin(PM)=%g Degrees \n',Pm)
fprintf('Gain Cross Over Frequency(wgc)=%g rad/sec \n',Wgc)

Results:

Electronics and Communication Engineering Dr.AIT Page 51


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Practice:
𝟐𝟎
1. 𝑮(𝒔)𝑯(𝒔) = 𝒔(𝟏+𝟑𝒔)(𝟏+𝟒𝒔)
𝟓𝟎𝟎𝟎(𝒔+𝟏𝟎)
2. 𝑮(𝒔)𝑯(𝒔) = (𝒔+𝟏)(𝒔+𝟓𝟎𝟎)
𝒔
𝟏𝟎𝟎(𝟏+ )
𝟏𝟎
3. 𝑮(𝒔)𝑯(𝒔) = 𝒔 𝟐
𝒔(𝟏+ )
𝟏𝟎𝟎

Electronics and Communication Engineering Dr.AIT Page 52


Lab Component of Circuit Analysis and Control Systems (22ECU403)
Observations:

Electronics and Communication Engineering Dr.AIT Page 53


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Evaluation:

Maximum Obtained
Particulars
Marks Marks
Write-up : system design with specifications 05
Tool Utilization and Conduction of Experiment 08
Interpretation of Results 05
Report / observations 07
Viva-Voce 05
Total 30

Faculty signature with date

******

Electronics and Communication Engineering Dr.AIT Page 54


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Experiment-07: PI Controller

AIM: To simulate and study the effect of PI Controller.

Example: Obtain the step response of the given system by introducing PI controller using
MATLAB.
1
Given, transfer function of a plant is 𝑃(𝑠) = 𝑠2 +20𝑠+30

Solution:
Block Diagram

Figure 7.1 : Block diagram of cliosed loop control system.


We Know that, the tranfer function of PI controller
𝐾𝑖
𝐶(𝑠) = 𝐾𝑃 +
𝑠
Tranfer function after introducing PI controller
(𝐾𝑃 𝑠 + 𝐾𝐼 )
𝑇(𝑠) = 3 2
𝑠 + 10𝑠 + (20 + 𝐾𝑃 )𝑠 + 𝐾𝐼
Let, KP=20 and KI=50

MATLAB Code:
clf
clc
clear all
kp=20;
ki=50
num1=[kp, ki];
den1=[1 0];
controller_tf = tf (num1, den1);
num2=1;
den2=[1 20 30];
plant_tf=tf(num2, den2);
overall_tf=feedback(controller_tf*plant_tf, 1);
t=0:0.01:2;
step (overall_tf, t);

Results:

Electronics and Communication Engineering Dr.AIT Page 55


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Practice:
1
1. 𝑃(𝑠) = 𝑠2 +10𝑠+20
1
2. 𝑃(𝑠) = 𝑠+10
Observations:

Electronics and Communication Engineering Dr.AIT Page 56


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Evaluation:

Maximum Obtained
Particulars
Marks Marks
Write-up : system design with specifications 05
Tool Utilization and Conduction of Experiment 08
Interpretation of Results 05
Report / observations 07
Viva-Voce 05
Total 30

Faculty signature with date

******

Electronics and Communication Engineering Dr.AIT Page 57


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Experiment-08: PD Controller

AIM: To simulate and study the effect of PD Controller.

Example: Obtain the step response of the given system by introducing PD controller using
MATLAB.
1
Given, transfer function of a plant is 𝑃(𝑠) = 𝑠2 +20𝑠+30

Solution:

Figure 8.1 : Block diagram of cliosed loop control system

We Know that, the tranfer function of PI controller


𝐶(𝑠) = 𝐾𝑃 + 𝐾𝑑 𝑠
Tranfer function after introducing PI controller
(𝐾𝐷 𝑠 + 𝐾𝑃 )
𝑇(𝑠) = 2
𝑠 + (10 + 𝐾𝐷 )𝑠 + (20 + 𝐾𝑃 )
Let, KP=200 and KD=10

MATLAB Code:
clf
clc
clear all
kp=300;
kd=10
num1=[kd, kp];
den1=1;
controller_tf = tf (num1, den1);
num2=1;
den2=[1 20 30];
plant_tf=tf(num2, den2);
overall_tf=feedback(controller_tf*plant_tf, 1);
t=0:0.01:2;
step (overall_tf, t);

Results:

Electronics and Communication Engineering Dr.AIT Page 58


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Practice:
1
1. 𝑃(𝑠) = 𝑠2 +10𝑠+20
1
2. 𝑃(𝑠) =
𝑠+10

Observations:

Electronics and Communication Engineering Dr.AIT Page 59


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Evaluation:

Maximum Obtained
Particulars
Marks Marks
Write-up : system design with specifications 05
Tool Utilization and Conduction of Experiment 08
Interpretation of Results 05
Report / observations 07
Viva-Voce 05
Total 30

Faculty signature with date

******

Electronics and Communication Engineering Dr.AIT Page 60


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Experiment-09: PID Controller

AIM: To simulate and study the effect of PID Controller.

Example: Obtain the step response of the given system by introducing PID controller using
MATLAB.
1
Given, transfer function of a plant is 𝑃(𝑠) = 𝑠2 +20𝑠+30

Solution:
Block Diagram

Figure 9.1 : Block diagram of cliosed loop control system


We Know that, the tranfer function of PI controller
𝐾𝑖
𝐶(𝑠) = 𝐾𝑃 + + 𝐾𝐷 𝑠
𝑠
Tranfer function after introducing PI controller
(𝐾𝐷 𝑠 2 + 𝐾𝑃 𝑠 + 𝐾𝐼 )
𝑇(𝑠) = 3
𝑠 + (10 + 𝐾𝐷 )𝑠 2 + (20 + 𝐾𝑃 )𝑠 + 𝐾𝐼
Let, KP=300, KI=250 and KD=40

MATLAB Code:
clf
clc
clear all
kp=300;
ki=250;
kd=40;
num1=[kd, kp, ki];
den1=[1 0];
controller_tf = tf (num1, den1);
num2=1;
den2=[1 20 30];
plant_tf=tf(num2, den2);
overall_tf=feedback(controller_tf*plant_tf, 1);
t=0:0.01:2;
step (overall_tf, t);

Results:

Electronics and Communication Engineering Dr.AIT Page 61


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Practice:
1
1. 𝑃(𝑠) = 𝑠2 +10𝑠+20
1
2. 𝑃(𝑠) =
𝑠+10

Observations:

Electronics and Communication Engineering Dr.AIT Page 62


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Evaluation:

Maximum Obtained
Particulars
Marks Marks
Write-up : system design with specifications 05
Tool Utilization and Conduction of Experiment 08
Interpretation of Results 05
Report / observations 07
Viva-Voce 05
Total 30

Faculty signature with date

******

Electronics and Communication Engineering Dr.AIT Page 63


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Experiment-10: Speed Characteristics of DC motor

AIM: Obtain the torque-speed characteristics of DC motor using MATLAB.

Circuit configuration:

Torque speed equation of DC motor:


𝑉(𝐾) (𝐾)2
𝑇= −( ) ∗ 𝜔 − − − (1)
𝑅𝑎 𝑅𝑎
Where,
T = motor torque
V = supply voltage
ω = rotational speed
K = motor constant
Ra = Armature resistance

MATLAB Code:

clear all;
close all;
clc;

Speed=0:50:1000;
V=input ("Enter the supply voltage :")
N=input ("Enter the motor's constant speed value :")
Ra=input ("Enter the armature resistance value :")
EMF=1;
K=((EMF*60)/(N*2*3.14));
T=((V*K)/Ra)-(((K)^2 /Ra)*Speed);
%plot (speed, T)

plot(Speed,T,'color','b','linewidth',2);
xlabel ("Speed (RPM)");
ylabel ("Torque (Nm)");
title ("DC motor Speed Vs Torque Charactersitics");
axis ([0 500 0 250]);
Electronics and Communication Engineering Dr.AIT Page 64
Lab Component of Circuit Analysis and Control Systems (22ECU403)

Example Run:
Enter the supply voltage: 30
Enter the motor’s constant speed value: 100
Enter the armature resistance value: 0.015

Expected Characteristics:

Figure 10.1 : Simulaton results.

Results:

Electronics and Communication Engineering Dr.AIT Page 65


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Practice: Study the characteristics of DC motor for other input specifications.

Observations:

Electronics and Communication Engineering Dr.AIT Page 66


Lab Component of Circuit Analysis and Control Systems (22ECU403)

Evaluation:

Maximum Obtained
Particulars
Marks Marks
Write-up : system design with specifications 05
Tool Utilization and Conduction of Experiment 08
Interpretation of Results 05
Report / observations 07
Viva-Voce 05
Total 30

Faculty signature with date

******

Electronics and Communication Engineering Dr.AIT Page 67


Lab Component of Circuit Analysis and Control Systems (22ECU403)

References

1: Modern Control Systems, Richard C. Dorf and Robert H. Bishop, Pearson, 13th Edition, 2017.
2: Modern Control Engineering, Katsuhiko Ogata, Prentice Hall, 5th Edition, 2010.
3: Control Systems Engineering, I J Nagrath and M Gopal, New Age International Publishers, 4th
edition, 2006.

******

Electronics and Communication Engineering Dr.AIT Page 68

You might also like