0% found this document useful (0 votes)
87 views62 pages

Control Theory - 3141708 Lab Manual - 4th Sem

Uploaded by

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

Control Theory - 3141708 Lab Manual - 4th Sem

Uploaded by

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

A Laboratory Manual for

Control Theory
(3141708)

B.E. Semester 4 (IC)

Government Engineering College, Gandhinagar

Directorate of Technical
Education ,Gandhinagar,Gujarat
Government Engineering College, Gandhinagar
Certificate
This is to certify thatMr./Ms. ___________________________________
________ Enrollment No. _______________of B.E. Semester
_____Instrumentation and Control Engineering of this Institute (GTU Code:
_____ )hassatisfactorily completed the Practical / Tutorial work for the
subject Control Theory (3141708) for the academic year 2022-23.

Place: __________
Date: __________

Name and Sign of Faculty member

HeadoftheDepartment
Control Theory (3141708)

Preface

Main motto of any laboratory/practical/field work is for enhancing required skills as well as
creating ability amongst students to solve real time problem by developing relevant
competencies in psychomotor domain.By keeping in view, GTU has designed competency
focused outcome-based curriculum for engineering degree programs where sufficient weightage
is given to practical work. It shows importance of enhancement of skills amongst the students
and it pays attention to utilize every second of time allotted for practical amongst students,
instructors and faculty members to achieve relevant outcomes by performing the experiments
rather than having merely study type experiments. It is must for effective implementation of
competency focused outcome-based curriculum that every practical is keenly designed to serve
as a tool to develop and enhance relevant competency required by the various industry among
every student. These psychomotor skills are very difficult to develop through traditional chalk
and board content delivery method in the classroom. Accordingly, this lab manual is designed
to focus on the industry defined relevant outcomes, rather than old practice of conducting
practical to prove concept and theory.

By using this lab manual students can go through the relevant theory and procedure in advance
before the actual performance which creates an interest and students can have basic idea prior to
performance. This in turn enhances pre-determined outcomes amongst students. Each
experiment in this manual begins with competency, industry relevant skills, course outcomes as
well as practical outcomes (objectives). The students will also achieve safety and necessary
precautions to be taken while performing practical.

This manual also provides guidelines to faculty members to facilitate student centric lab
activities through each experiment by arranging and managing necessary resources in order that
the students follow the procedures with required safety and necessary precautions to achieve the
outcomes. It also gives an idea that how students will be assessed by providing rubrics.

Engineering Thermodynamics is the fundamental course which deals with various forms of
energy and their conversion from one to the another. It provides a platform for students to
demonstrate first and second laws of thermodynamics, entropy principle and concept of energy.
Students also learn various gas and vapor power cycles and refrigeration cycle. Fundamentals of
combustion are also learnt.

Utmost care has been taken while preparing this lab manual however always there is chances of
improvement. Therefore, we welcome constructive suggestions for improvement and removal
of errors if any.
Control Theory (3141708)

Practical – Course Outcome matrix

Course Outcomes (COs):

CO1: Explain modeling of electrical, mechanical and electromechanical process systems


CO2: Analysis of properties of control systems, such as sensitivity,
stability, tracking, in time and frequency domains
CO3: Apply differential equations, transfer functions, block diagrams,
and state variables in control system design.
CO4: Use and apply soft computing tools for the analysis of control theory.
Sr. CO CO CO CO
Objective(s) of Experiment
No. 1 2 3 4
Introduction to MATLAB for control systems.
1. √
Simulation and study of systems and models using
2. √ √
control design software.
Find unit step response of first order system using
3. scilab. √ √
Building and analyzing multi block models using
4. control design software. √ √
Find Unit step response of first and second order system √
5. using MATLAB. √

Simulate and analyse steady state error for type ‘0’, ‘1’ √
6. and ‘2’ system for step and impulse input. √

7. Stability analysis using control design software. √ √


Analyze marginal stability using root locus method.
8. √ √
Frequency Response analysis using bode plot.
9. √ √
Stability analysis using Nyquist stability criteria.
10. √ √
Analysis of state variable models using control design
11. software. √ √ √
To find zeros and poles from transfer function and vice
12. versa by MATLAB/ scilab. √ √
Control Theory (3141708)

Industry Relevant Skills

The following industry relevant competency are expected to be developed in the student by
undertaking the practical work of this laboratory.
1. Apply fundamentals of system dynamics
2. Apply suitable control strategy
Guidelines for Faculty members
1. Teacher should provide the guideline with demonstration of practical to the students
with all features.
2. Teacher shall explain basic concepts/theory related to the experiment to the students
before starting of each practical
3. Involve all the students in performance of each experiment.
4. Teacher is expected to share the skills and competencies to be developed in the
students and ensure that the respective skills and competencies are developed in the
students after the completion of the experimentation.
5. Teachers should give opportunity to students for hands-on experience after the
demonstration.
6. Teacher may provide additional knowledge and skills to the students even though not
covered in the manual but are expected from the students by concerned industry.
7. Give practical assignment and assess the performance of students based on task
assigned to check whether it is as per the instructions or not.
8. Teacher is expected to refer complete curriculum of the course and follow the
guidelines for implementation.

Instructions for Students


1. Students are expected to carefully listen to all the theory classes delivered by the faculty
members and understand the COs, content of the course, teaching and examination
scheme, skill set to be developed etc.
2. Students shall organize the work in the group and make record of all observations.
3. Students shall develop maintenance skill as expected by industries.
4. Student shall attempt to develop related hand-on skills and build confidence.
5. Student shall develop the habits of evolving more ideas, innovations, skills etc. apart from
those included in scope of manual.
6. Student shall refer technical magazines and data books.
7. Student should develop a habit of submitting the experimentation work as per the schedule
and s/he should be well preparedfor the same.

Common Safety Instructions


1. Students are expected to carefully
Control Theory (3141708)

Index
(Progressive Assessment Sheet)
Sr. Objective(s) of Experiment Page Date of Date of Assessme Sign. of Remar
No. No. perform submiss nt Teacher ks
ance ion Marks with date
Introduction to MATLAB for control
1.
systems.
Simulation and study of systems and models
2.
using control design software.
Find unit step response of first order system
3.
using scilab.
Building and analyzing multi block models
4.
using control design software.
Find Unit step response of first and second
5. order system using MATLAB.

Simulate and analyse steady state error for type


6. ‘0’, ‘1’ and ‘2’ system for step and impulse
input.
7. Stability analysis using control design
software.
Analyze marginal stability using root locus
8.
method.
Frequency Response analysis using bode plot.
9.
Stability analysis using Nyquist stability
10.
criteria.
Analysis of state variable models using control
11.
design software.
To find zeros and poles from transfer function
12.
and vice versa by MATLAB/ scilab.
Total

Experiment No: 1
Introduction to MATLAB for control systems.
Date:

Competency and Practical Skills: Demonstrate transfer function using MATLAB.

Relevant CO: CO4

Objectives: (a) Study basics of MATLAB for control system.

Equipment/Instruments: Computer system with MATLAB.

Theory
Matlab (Matrix laboratory) is an interactive software system for numerical computations and
graphics. As the name suggests, Matlab is especially designed for matrix computations: solving
Control Theory (3141708)

systems of linear equations, computing eigenvalues and eigenvectors, factoring matrices, and so
forth. In addition, it has a variety of graphical capabilities, and can be extended through programs
written in its own programming language. Many such programs come with the system; a number
of these extend Matlab's capabilities to nonlinear problems, such as the solution of initial value
problems for ordinary differential equations.
Matlab is designed to solve problems numerically, that is, in finite-precision arithmetic. Therefore
it produces approximate rather than exact solutions, and should not be confused with a symbolic
computation system (SCS) such as Mathematica or Maple. It should be understood that this does
not make Matlab better or worse than an SCS; it is a tool designed for different tasks and is
therefore not directly comparable.
In the following sections, I give an introduction to some of the most useful features of Matlab. I
include plenty of examples; the best way to learn to use Matlab is to read this while running
Matlab, trying the examples and experimenting.

Entering vectors and matrices; built-in variables and functions; help

The basic data type in Matlab is an n-dimensional array of double precision numbers. Matlab 5
differs from earlier versions of Matlab in that other data types are supported (also in the fact that
general, multi-dimensional arrays are supported; in earlier versions, every variable was a two-
dimensional array (matrix), with one-dimensional arrays (vectors) and zero-dimensional arrays
(scalars) as special cases). The new data types include structures (much like structures in the C
programming language--data values are stored in named fields), classes, and ``cell arrays'', which
are arrays of possibly different data types (for example, a one-dimensional array whose first entry
is a scalar, second entry a string, third entry a vector). I mostly discuss the basic features using n-
dimensional arrays, but I briefly discuss the other data types later in the paper.

The following commands show how to enter numbers, vectors and matrices, and assign them to
variables (>> is the Matlab prompt on my computer; it may be different with different computers
or different versions of Matlab. I am using version 5.2.0.3084. On my Unix workstation, I start
Matlab by typing matlab at the Unix prompt.):

>> a = 2
a=
2
>> x = [1;2;3]
x=
1
2
3
>> A = [1 2 3;4 5 6;7 8 0]
A=
1 2 3
4 5 6
7 8 0
Notice that the rows of a matrix are separated by semicolons, while the entries on a row are
separated by spaces (or commas).

A useful command is ``whos'', which displays the names of all defined variables and their types:

>>whos
Name Size Bytes Class
A 3x3 72 double array
Control Theory (3141708)

a 1x1 8 double array


x 3x1 24 double array

Grand total is 13 elements using 104 bytes


Note that each of these three variables is an array; the ``shape'' of the array determines its exact
type. The scalar a is a 1 ×1 array, the vector x is a 3 ×1 array, and A is a 3 ×3 array (see the
``size'' entry for each variable).

One way to enter a n-dimensional array (n>2) is to concatenate two or more (n-1)-dimensional
arrays using the cat command. For example, the following command concatenates two 3 ×2
arrays to create a 3 ×2 ×2 array:

>> C = cat(3,[1,2;3,4;5,6],[7,8;9,10;11,12])
C(:,:,1) =
1 2
3 4
5 6
C(:,:,2) =
7 8
9 10
11 12
>>whos
Name Size Bytes Class
A 3x3 72 double array
C 3x2x2 96 double array
a 1x1 8 double array
x 3x1 24 double array

Grand total is 25 elements using 200 bytes


Note that the argument ``3'' in the cat command indicates that the concatenation is to occur along
the third dimension. If D and E were k × m× n arrays, the command
>>cat(4,D,E)
would create a k × m× n× 2 array (try it!). Matlab allows arrays to have complex entries. The
complex unit

is represented by either of the built-in variables i or j:


>>sqrt(-1)
ans =
0 + 1.0000i
This example shows how complex numbers are displayed in Matlab; it also shows that the square
root function is a built-in feature.

The result of the last calculation not assigned to a variable is automatically assigned to the
variable ans, which can then be used as any other variable in subsequent computations. Here is an
example:

>> 100^2-4*2*3
ans =
9976
>>sqrt(ans)
ans =
Control Theory (3141708)

99.8799
>> (-100+ans)/4
ans =
-0.0300
The arithmetic operators work as expected for scalars. A built-in variable that is often useful is :
>>pi
ans =
3.1416

Above I pointed out that the square root function is built-in; other common scientific functions,
such as sine, cosine, tangent, exponential, and logarithm are also pre-defined. For example:

>>cos(.5)^2+sin(.5)^2
ans =
1
>>exp(1)
ans =
2.7183
>>log(ans)
ans =
1
Other elementary functions, such as hyperbolic and inverse trigonometric functions, are also
defined.

At this point, rather than providing a comprehensive list of functions available in Matlab, I want
to explain how to get this information from Matlab itself. An extensive online help system can be
accessed by commands of the form help <command-name>. For example:

>> help ans

ANS The most recent answer.


ANS is the variable created automatically when expressions
are not assigned to anything else. ANSwer.

>> help pi

PI 3.1415926535897....
PI = 4*atan(1) = imag(log(-1)) = 3.1415926535897....

A good place to start is with the command help help, which explains how the help systems works,
as well as some related commands. Typing help by itself produces a list of topics for which help is
available; looking at this list we find the entry ``elfun--elementary math functions.'' Typing help
elfun produces a list of the math functions available. We see, for example, that the inverse tangent
function (or arctangent) is called atan:

>>pi-4*atan(1)
ans =
0

It is often useful, when entering a matrix, to suppress the display; this is done by ending the line
with a semicolon (see the first example in the next section). The command more can be used to
cause Matlab to display only one page of output at a time. Typing more on causes Matlab to pause
Control Theory (3141708)

between pages of output from subsequent commands; as with the Unix ``more'' command, a space
character then advances the output by a page, a carriage return advances the output one line, and
the character ``q'' ends the output. Once the command more on is issued, this feature is enabled
until the command more off is given.

Graphs

The simplest graphs to create are plots of points in the cartesian plane. For example:

>> x = [1;2;3;4;5];
>> y = [0;.25;3;1.5;2];
>>plot(x,y)
The resulting graph is displayed in Figure 1.

Figure 1: A simple Matlab graph

Notice that, by default, Matlab connects the points with straight line segments. An alternative is
the following (see Figure 2):

>>plot(x,y,'o')
Control Theory (3141708)

Figure 2: Another simple Matlab graph

Arithmetic operations on matrices


Matlab can perform the standard arithmetic operations on matrices, vectors, and scalars (that is,
on 2-, 1-, and 0-dimensional arrays): addition, subtraction, and multiplication. In addition, Matlab
defines a notion of matrix division as well as ``vectorized'' operations. All vectorized operations
(these include addition, subtraction, and scalar multiplication, as explained below) can be applied
to n-dimensional arrays for any value of n, but multiplication and division are restricted to
matrices and vectors
.
Standard operations
If A and B are arrays, then Matlab can compute A+B and A-B when these operations are defined.
For example, consider the following commands:
>> A = [1 2 3;4 5 6;7 8 9];
>> B = [1 1 1;2 2 2;3 3 3];
>> C = [1 2;3 4;5 6];
>>whos
Name Size Bytes Class

A 3x3 72 double array


B 3x3 72 double array
C 3x2 48 double array

Grand total is 24 elements using 192 bytes

>> A+B
ans =
2 3 4
6 7 8
10 11 12
>> A+C
Control Theory (3141708)

??? Error using ==> +


Matrix dimensions must agree.
Matrix multiplication is also defined:
>> A*C
ans =
22 28
49 64
76 100
>> C*A
??? Error using ==> *
Inner matrix dimensions must agree.
If A is a square matrix and m is a positive integer, then A^m is the product of m factors of A.
However, no notion of multiplication is defined for multi-dimensional arrays with more than 2
dimensions:
>> C = cat(3,[1 2;3 4],[5 6;7 8])
C(:,:,1) =
1 2
3 4
C(:,:,2) =
5 6
7 8
>> D = [1;2]
D=
1
2
>>whos
Name Size Bytes Class

C 2x2x2 64 double array


D 2x1 16 double array

Grand total is 10 elements using 80 bytes

>> C*D
??? Error using ==> *
No functional support for matrix inputs.
By the same token, the exponentiation operator ^ is only defined for square 2-dimensional arrays
(matrices).
Solving matrix equations using matrix division
If A is a square, nonsingular matrix, then the solution of the equation Ax=b is . Matlab
implements this operation with the backslash operator:
>> A = rand(3,3)
A=
0.2190 0.6793 0.5194
0.0470 0.9347 0.8310
0.6789 0.3835 0.0346
>> b = rand(3,1)
b=
0.0535
0.5297
0.6711
Control Theory (3141708)

>> x = A\b
x=
-159.3380
314.8625
-344.5078
>> A*x-b
ans =
1.0e-13 *
-0.2602
-0.1732
-0.0322
(Notice the use of the built-in function rand, which creates a matrix with entries from a uniform
distribution on the interval (0,1). See help rand for more details.) Thus A\b is
(mathematically) equivalent to multiplying b on the left by (however, Matlab
does not compute the inverse matrix; instead it solves the linear system directly). When used with
a nonsquare matrix, the backslash operator solves the appropriate system in the least-squares
sense; see help slash for details. Of course, as with the other arithmetic operators, the
matrices must be compatible in size. The division operator is not defined for n-dimensional arrays
with n>2.
Vectorized functions and operators; more on graphs
Matlab has many commands to create special matrices; the following command creates a row
vector whose components increase arithmetically:
>> t = 1:5
t=
1 2 3 4 5
The components can change by non-unit steps:
>> x = 0:.1:1
x=
Columns 1 through 7
0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000
Columns 8 through 11
0.7000 0.8000 0.9000 1.0000
A negative step is also allowed. The command linspace has similar results; it creates a vector
with linearly spaced entries. Specifically, linspace(a,b,n) creates a vector of
length n with entries
>>linspace(0,1,11)
ans =
Columns 1 through 7
0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000
Columns 8 through 11
0.7000 0.8000 0.9000 1.0000
There is a similar command logspace for creating vectors with logarithmically spaced entries:
>>logspace(0,1,11)
ans =
Columns 1 through 7
1.0000 1.2589 1.5849 1.9953 2.5119 3.1623 3.9811
Columns 8 through 11
5.0119 6.3096 7.9433 10.0000
See help logspace for details.
A vector with linearly spaced entries can be regarded as defining a one-dimensional grid, which is
Control Theory (3141708)

useful for graphing functions. To create a graph of y = f(x) (or, to be precise, to graph points of the
form (x,f(x)) and connect them with line segments), one can create a grid in the vector x and then
create a vector y with the corresponding function values.
It is easy to create the needed vectors to graph a built-in function, since Matlab functions
are vectorized. This means that if a built-in function such as sine is applied to a array, the effect is
to create a new array of the same size whose entries are the function values of the entries of the
original array. For example (see Figure 3):
>> x = (0:.1:2*pi);
>> y = sin(x);
>>plot(x,y)

Figure 3: Graph of y = sin(x)


Matlab also provides vectorized arithmetic operators, which are the same as the ordinary
operators, preceded by ``.''. For example, to graph
:
>> x = (-5:.1:5);
>> y = x./(1+x.^2);
>>plot(x,y)
(the graph is not shown). Thus x.^2 squares each component of x, and x./z divides each
component of x by the corresponding component of z. Addition and subtraction are performed
component-wise by definition, so there are no ``.+'' or ``.-'' operators. Note the difference
between A^2 and A.^2. The first is only defined if A is a square matrix, while the second is
defined for any n-dimensional array A.

Some miscellaneous commands

An important operator in Matlab is the single quote, which represents the (conjugate) transpose:

>> A = [1 2;3 4]
A=
1 2
3 4
Control Theory (3141708)

>> A'
ans =
1 3
2 4
>> B = A + i*.5*A
B=
1.0000 + 0.5000i 2.0000 + 1.0000i
3.0000 + 1.5000i 4.0000 + 2.0000i
>> B'
ans =
1.0000 - 0.5000i 3.0000 - 1.5000i
2.0000 - 1.0000i 4.0000 - 2.0000i
In the rare event that the transpose, rather than the conjugate transpose, is needed, the ``.'''
operator is used:
>> B.'
ans =
1.0000 + 0.5000i 3.0000 + 1.5000i
2.0000 + 1.0000i 4.0000 + 2.0000i
(note that ' and .' are equivalent for matrices with real entries).

The following commands are frequently useful; more information can be obtained from the on-
line help system.

Creating matrices

 zeros(m,n) creates an matrix of zeros;


 ones(m,n) creates an matrix of ones;
 eye(n) creates the identity matrix;
 diag(v) (assuming v is an n-vector) creates an diagonal matrix with v on the
diagonal.

The commands zeros and ones can be given any number of integer arguments; with k arguments,
they each create a k-dimensional array of the indicated size.

formatting display and graphics

 format
o format short 3.1416
o format short e 3.1416e+00
o format long 3.14159265358979
o format long e 3.141592653589793e+00
o format compact suppresses extra line feeds (all of the output in this paper is in
compact format).
 xlabel('string'), ylabel('string') label the horizontal and vertical axes, respectively, in the
current plot;
 title('string') add a title to the current plot;
 axis([a b c d]) change the window on the current graph to

grid adds a rectangular grid to the current plot;


Control Theory (3141708)

 hold on freezes the current plot so that subsequent graphs will be displayed with the
current;
 hold off releases the current plot; the next plot will erase the current before displaying;
 subplot puts multiple plots in one graphics window.

Miscellaneous

 max(x) returns the largest entry of x, if x is a vector; see help max for the result when x is
a k-dimensional array;
 min(x) analogous to max;
 abs(x) returns an array of the same size as x whose entries are the magnitudes of the
entries of x;
 size(A) returns a 1 ×k vector with the number of rows, columns, etc. of the k-dimensional
array A;
 length(x) returns the ``length'' of the array, i.e. max(size(A)).
 save fname saves the current variables to the file named fname.mat;
 load fname load the variables from the file named fname.mat;
 quit exits Matlab

Transfer function using MATLAB.


B( s ) 2
=
A (s ) ( s+1 )(s +2)
num=[0 0 2];
den=[1 3 2];
System=tf(mum,den)

Simulation Exercise:
1. Create a row vector R with values (0, 1, 3, 5, 1, 12, 14, 15).
2. Create a column vector C with values (0, 1, 3, 5, 1, 12, 14, 15).
3. Create 3×3 matrix of random elements.
4. Create 3×3 unity matrix.
5. Perform following Basic matrix operations:
a) Addition
b) Subtraction
c) Transposing
d) Matrix multiplication
e) Element wise multiplication
f) Exponential
g) Element wise Exponential
6. Create a random vector R of 1,000 uniformly distributed numbers. (Hint: use the rand
command.)
7. Create a random vector R of 1,000 normally distributed numbers. (Hint: use the randn com-
mand.)
8. Show how to create Multiple Plots and Subplots with random vector created in question 6 and
7.
9. Create a function which returns the product of given input number.
10. Generate first and second order transfer function using MATLAB

RESULT:
Control Theory (3141708)

CONCLUSION:

Quiz:
1. What is open lop control system?
2. What is closed loop control system?
3. What is green engineering?

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

Rubrics:
1. Understand objectives of experiment.
2. Effective use of soft computing tools.
3. Question answer during lab session.
4. Outcome analysis and conclusion writing ability.
5. Submission in time.

References: https://www.mathworks.com/

References used by the students:


Control Theory (3141708)

Experiment No: 2
Simulation and study of systems and models Using Control Design Software.
Date:

Competency and Practical Skills:


1. Simulate electrical and mechanical system models.

Relevant CO: CO1, CO4.

1. Objectives:
(a) Simulate electrical system models.
(b) Simulate mechanical system models.
(c) Study systems models
Equipment/Instruments: Computer system with MATLAB.

Theory:
The first step in the control design process is to develop appropriate mathematical models of the
system to be controlled. These models may be derived either from physical laws or experimental
data. In this section, introduced the state-space and transfer function representations of dynamic
systems. Then review some basic approaches to modeling mechanical and electrical systems and
show how to generate these models in MATLAB for further analysis.
Mechanical Systems:
Newton's laws of motion form the basis for analyzing mechanical systems. Newton’s second law,
Equation(1) given below, states that the sum of the forces acting on a body equals the product of
its mass and acceleration. Newton's third law, states that if two bodies are in contact, then they
experience the same magnitude contact force, just acting in opposite directions.

……..(1)
When applying this equation, it is best to construct a free-body diagram (FBD) of the system
showing all of the applied forces.
The free-body diagram for this system is shown below. The spring force is proportional to the
displacement of the mass, , and the viscous damping force is proportional to the velocity of the
mass, . Both forces oppose the motion of the mass and are, therefore, shown in the
negative -direction. Note also that corresponds to the position of the mass when the spring
is unstretched.
Control Theory (3141708)

Now proceed by summing the forces and applying Newton’s second law, Equation (1), in each
direction. In this case, there are no forces acting in the -direction; however, in the -direction we
have:
…….(2)
This equation, known as the governing equation, completely characterizes the dynamic state of
the system. Later, we will see how to use this to calculate the response of the system to any
external input, , as well as to analyze system properties such as stability and performance.
To determine the state-space representation of the mass-spring-damper system, we must reduce
the second-order governing equation to a set of two first-order differential equations. To this end,
choose the position and velocity as our state variables.

…….(3)
The position variable captures the potential energy stored in the spring, while the velocity variable
captures the kinetic energy stored by the mass. The damper only dissipates energy, it doesn't store
energy. Often when choosing state variables it is helpful to consider what variables capture the
energy stored in the system.
The state equation in this case is:

……(4)
If, for instance, we are interested in controlling the position of the mass, then the output equation
is:

………(5)

Entering State-Space Models into MATLAB:


m = 1;
k = 1;
b = 0.2;
F = 1;
A = [0 1; -k/m -b/m];
B = [0 1/m]';
C = [1 0];
D = [0];
sys = ss(A,B,C,D)

The Laplace transform for this system assuming zero initial conditions is

and, therefore, the transfer function from force input to displacement output is
Control Theory (3141708)

Entering Transfer Function Models into MATLAB:

s = tf('s');
sys = 1/(m*s^2+b*s+k)

Simulation Exercise:
1. Find state variable model for below given system and simulate using control design
software.

2. Find transfer function model for system given in question-1 and simulate using control
design software.
3. Find state variable model for below given system and simulate using control design
software.

4. Find transfer function model for system given in question-3 and simulate using control
design software.

CONCLUSION:

Quiz:
1. Explain need of system modeling.
2. What is transfer function?
3. What is open loop control system?
Control Theory (3141708)

4. What is closed loop control system?

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

Rubrics:
1. Understand objectives of experiment.
2. Group work while performing experiment.
3. Question answer during lab session.
4. Outcome analysis and conclusion writing ability.
5. Submission in time.

References: https://www.mathworks.com/

References used by the students:

Experiment No: 3
Find unit step response of first order system using scilab.
Date:

Competency and Practical Skills:


1. Simulation of the linear systems for step input using scilab.

Relevant CO: CO2, CO4.

Objectives: (a) Time response of first order system using scilab.

Equipment/Instruments: Computer system with scilab.

Theory:

Scilab is a programming language associated with a rich collection of numerical algorithms


covering many aspects of scienti_c computing problems.
From the software point of view, Scilab is an interpreted language. This generally allows
to get 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-de_ned data types can be de_ned with possibly overloaded operations. Scilab users can
develop their own module so that they can solve their particular problems. The Scilab language
allows to dynamically compile and link 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
LabVIEW, a platform and development environment for a visual programming language from
National Instruments.
From a scienti_c 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
Control Theory (3141708)

cover many areas of scienti_c computing. The following is a short list of its capabilities:
Linear algebra, sparse matrices
Polynomials and rational functions
Interpolation, approximation,
Linear, quadratic and non linear optimization
Ordinary Di_erential Equation solver and Di_erential Algebraic Equations solver
Classic and robust control
Linear Matrix Inequality optimization,
Di_erentiable and non-di_erentiable optimization,
Signal processing
Statistics
Scilab provides many graphics features, including a set of plotting functions, which allow to
create 2D and 3D plots as well as user interfaces. The Xcos environment provides an hybrid
dynamic systems modeler and simulator.
simulation (time response) of linear system
Syntax
[y, x] = csim(u, t, sl)
[y, x] = csim(u, t, sl, x0)
[y, x] = csim(u, t, sl, x0, tol)
Arguments
u: function, list or string (control)
t: real vector specifying times with, t(1) is the initial time (x0=x(t(1))).
Sl: A SISO or SIMO linear dynamical system, in state space, transfer function or zpk
representations, in continuous time.
y: a matrix such that y=[y(t(i)], i=1,..,n
x: an optional matrix such that x=[x(t(i)], i=1,..,n
tol: a 2 vector [atolrtol] defining absolute and relative tolerances for ode solver (see ode)

Description
Simulation of the controlled linear system sl. sl is assumed to be a continuous-time system
represented by a syslin list.
u is the control and x0 the initial state.
y is the output and x the state.
The control can be:
1. A function : [inputs]=u(t)
2.alist: list(ut,parameter1,....,parametern) such that: inputs=ut(t,parameter1,....,parametern) (ut is a
function)
3.The string "impuls" for impulse response calculation (here sl must have a single input
and x0=0). For systems with direct feedthrough, the infinite pulse at t=0 is ignored.
4. The string "step" for step response calculation (here sl must have a single input and x0=0)
5. a vector giving the values of u corresponding to each t value.
Example
s=poly(0,'s');
rand('seed',0);
w=ssrand(1,1,3);
w('A')=w('A')-2*eye();
t=0:0.05:5;
//impulse(w) = step (s * w)
plot2d([t',t'],[(csim('step',t,tf2ss(s)*w))',0*t'])
Control Theory (3141708)

Time response analysis:


A simple first order step response.

s = %s
poly (0 , ’ s ’)
K = 1 , T = 1 // Gain and t ime constant
SimpleSys = syslin ( ’ c ’ , K/(1+T*s ) )
t=0 : 0 . 0 1 : 1 5 ;
y1 = cs im ( ’ s t e p ’ , t , SimpleSys ) ; // s t e p r e s p o n s e
p l o t (t , y1)

Exercise:
10
1. Find step response for the system with transfer function: G ( S )= using scilab.
S +4
K
2. Find step response for the system with transfer function: G ( S )= using scilab,
TS+1
Consider different values of K=0.2, 1, 2 and T=1, 2, 3.
Control Theory (3141708)

Conclusion:

Quiz:
1. What is first order system?
2. Explain importance of standard test signals.

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Rubrics:
1. Understand objectives of experiment.
2. Group work while performing experiment.
3. Question answer during lab session.
4. Outcome analysis and conclusion writing ability.
5. Submission in time.

References: https://www.scilab.org/software/scilab

References used by the students:


Control Theory (3141708)

Experiment No: 4
Building and analyzing multi block models using control design software.

Date:

Competency and Practical Skills:


Building multi block models using control design software.

Relevant CO: CO3, CO4..

Objectives: (a) Analyzing multi block models using control design software
Equipment/Instruments: Computer system with MATLAB.

Theory:
Series:-Series connection of two LTI models:
Syntax:
Description:
sys = series (sys 1,sys 2)
sys = series (sys 1,sys 2,outputs 1,inputs 2)
Series connects two LTI models in series. This function accepts any type ofLTI model. The
two systems must be either both continuous or both discrete with identical sample time static
gains are neutral and can be specified as regular matrices.
sys = series (sys 1,sys 2) forms the basic series connection shown below.

u
Sys1 Sys2 y

This command is equivalent to the direct multiplication.

syssys1sys2

Parallel:-Parallel connection of two LTI models


Syntax:
Description:
sys = parallel (sys 1,sys 2)
sys = parallel (sys 1,sys 2,inp 1,inp 2,out 1,out 2)

Parallel connects two LTI models in parallel. This function accepts any type of LTI model. The
two systems must be either both continuous or both discrete with identical sample time static
gains are neutral and can be specified as regular matrices.
sys = parallel (sys 1,sys 2) forms the basic parallel connection shown below.
Control Theory (3141708)

Sys

Sys1
U y
Sys2

This command is equivalent to the direct Addition.

SysSys1Sys2

Feedback:-
Syntax:
Feedback connection of two LTI models:
sys = feedback (sys 1,sys 2)
sys = feedback (sys 1,sys 2, sign)
sys = feedback (sys 1,sys 2, feedin, feedout, sign)
Description: sys = feedback (sys 1,sys 2) returns an LTI model sys for the negative feedback
interconnection.
+
u Sys1 y

Sys2

The closed loop model system has u as input vector and y as output vector. The LTI model
models sys 1 and sys 2 must be both continuous or both discrete with identical sample times.

SERIESCONNECTIONOFMULTIBLOCKMODELS

Create the series connection, denoted by the transfer function T(s), of the two systemwhose
Transfer function G1(s) & G2(s).

Use MATLAB to make series connection of the type shown below:


2 S +3
Where, G1 ( s )= 2 and G2(s) has a zero at s=-2, poles at s=-0.5 & -8, and a gain of 5.
5 S +2 S+2
Give both transfer functions and zpk forms of the series connection.

Use MATLAB to make series connection of the type shown below:

u(s) G1(s) G2(s) y(s)


Control Theory (3141708)

In each case create T(s) of the combined system as a ratio of polynomial and determine its zeroes,
poles and gain.
>> G1=tf([2 3],[5 2 2])

Transfer function:
2s+3
5 s^2 + 2 s + 2

>> G2=zpk(-2, [-0.5 8],5)

Zero/pole/
gain:
5 (s+2)
(s+0.5) (s-8)

>> T=series(G1,G2)

Zero/pole/gain:
2 (s+2) (s+1.5)
(s+0.5) (s-8) (s^2 + 0.4s + 0.4)

>> F=tf(T)

Transfer function:
2 s^2 + 7 s + 6
s^4 - 7.1 s^3 - 6.6 s^2 - 4.6 s - 1.6
PARALLELCONNECTIONOFMULTIBLOCK MODELS

From the parallel connection of the two transfer functions given below. Determine the
zero’s, poles and gain T(s).
H1(s)= 2S+6
S2S8
H2(S)= (s+4)
S+1S24S1
H1=(tf([2 6],[118]);
s=tf(‘s’);
H2=(s+4)/((s+1)(s^2+4*s+1))
H=parallel(H1,H2)
[z,p,k]=zpk(H)

FEEDBACKCONNECTION OFMULTIBLOCKMODELS

Use MATLAB to create the feedback system where T(s) of single block is given below.
Determine the zero’s, poles and gain. Given tf:

G(s)= H(s)=
2s+1
4S25S
8

4s+7
S+1S
8
G=tf([21],[458];

H=(4s+7)/((s+1)*(s+8))

Fed=feedback(G,H)

Exercise:
Find the transfer function for below system.

Conclusion:

Quiz:
1. Explain system simplification techniques.
2. Compare block diagram with signal flow graph.
3. Why simplification(reduction) needed?

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Rubrics:
1. Understand objectives of experiment.
2. Group work while performing experiment.
3. Question answer during lab session.
4. Outcome analysis and conclusion writing ability.
5. Submission in time.

References: https://www.mathworks.com/

References used by the students:


Experiment No: 5
Find Unit step response of first and second order system using MATLAB.
Date:

Competency and Practical Skills:


1. Simulation of first and second order system using MATLAB for step input.

Relevant CO: CO2, CO4.

Objectives: (a) Time response analysis for first and second order system using MATLAB.
Equipment/Instruments: Computer system with MATLAB.

Theory:
The Laplace transform of a system unit step response is the product of the system’s transfer
function, G(s) and 1/s, the transform of the unit step function. The poles of the resulting transform
are the poles of G(s) and a pole at s = 0(due to the unit-step input).
The step response can be computed and plotted using the step command from the Control System
Toolbox.
STEP FUNCTION: Step response of LTI systems.
SYNTAX:
step(sys)
step(sys,t)
step(sys1,sys2,….,sysN)
step(sys1,sys2,….,sysN,t)
step(sys1,’PlotStyle1’,…..,sysN,’PlotStyleN’)
[y,t,x]=step(sys)

DESCRIPTION:
Step calculates the unit step response of a linear system. Zero initial state is assumed in the State-
Space case. When invoked with no output arguments, this function plots the step response on the
screen.
Step (sys) plots the step response of an arbitrary LTI model sys. This model can be continuous or
discrete, and SISO or MIMO. The step response of multi-input systems is the collection of step
response for each input channel. The duration automatically based on the system poles and zeros.
Step(sys,t) sets the simulation horizon explicitly. You can specify either a final time t=Tfinal (in
seconds), or a vector of evenly spaced time samples of the form.
t= 0:dt: Tfinal.
First Order system:
Transfer Functions:
G(s) = 1/ (s+1)

>>num=[1];
>>den=[1 1];
>>h=tf(num,den)
Transfer function:1/s+1
>>step(h)
Second Order System:
(2)Process transfer function is given by G(s)=ω^2/s(s+2ξω)(open loop), where ω=5
,ξ=0.6,
Find the unit step response of unity feedback control system.

1. G(s)=ω^2/s(s+2ξω)

>>num=[25];
>>den=[1 6 25];
>>g=tf(num,den)

Transfer function: 25
s^2 + 6s+ 25
>>step(g)

Use different damping ratio 0,0.2,0.4…..make conclusion of your observation for


Second order control systen, where ω=1.
a) Forξ=0.
>>num=[1];
>>den=[1 0 1];
>>g=tf(num,den)
>>step(g)

b) Forξ=0.2
>>num=[1];
>>den=[1 0.4 1];
>>g=tf(num,den)
>>step(g)

c) Forξ=0.2
>>num=[1];
>>den=[1 0.4 1];
>>g=tf(num,den)

d) Forξ=1
>>num=[1];
>>den=[1 1 1];
>>g=tf(num,den)
>>step(g)

Exercise:
5
1. Find the impulse and step response of given transfer function: G ( S )=
.
S +2
2. Find the damping ratio ,damped natural frequency, maximum peak overshoot, rise time,
settling time with system having unity feedback and open loop
K
transfer function G ( S )= .
S (S+10)

Conclusion:

Quiz:
1. What is damped natural frequency?
2. What is maximum peak overshoot?
3. Explain effects of different damping ration on system performance.
Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

Rubrics:
1. Understand objectives of experiment.
2. Group work while performing experiment.
3. Question answer during lab session.
4. Outcome analysis and conclusion writing ability.
5. Submission in time.

References: https://www.mathworks.com/

References used by the students:


Experiment No: 6
Simulate and analyse steady state error for type ‘0’, ‘1’ and ‘2’ system for step
and impulse input.
Date:

Competency and Practical Skills:


1. Simulate type ‘0’, ‘1’ and ‘2’ system for step and impulse input.

Relevant CO: CO2, CO4.

Objectives: (a) Analyse steady state error for type ‘0’, ‘1’ and ‘2’ system for step and impulse
input.
Equipment/Instruments: Computer system with MATLAB.
Exercise:
1. Obtain step response of a Type ‘0’ system having forward path transfer function of
1
G ( s )= 2 . Comment on steady state error.
s +s +2
2. Obtain impulse response ofaType‘0’systemhavingforwardpathtransferfunctionof
1
G ( s )= 2 .Comment on steady state error.
s +s +2

3. Obtain step response of a Type ‘1’systemhavingforward path transfer function of


1
G ( s )= .Comment on steady state error.
s (s¿¿ 2+ s+ 4)¿

4. Obtain impulse response of a Type ‘1’systemhavingforward path transfer function of


1
G ( s )= .Comment on steady state error.
s (s¿¿ 2+ s+ 4)¿

5. Obtain step response of a Type ‘2’systemhavingforward path transfer function of


1
G ( s )= 2 .Comment on steady state error.
s (s¿¿ 2+ s+ 4)¿

6. Obtain impulse response of a Type ‘2’systemhavingforward path transfer function of


1
G ( s )= 2 .Comment on steady state error.
s (s¿¿ 2+ s+ 4)¿

Conclusion:

Quiz:
1. What is type of the system?
2. What steady state error?
3. Explain effects on steady state error if type of the system changed for step input.

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

Rubrics:
1. Understand objectives of experiment.
2. Group work while performing experiment.
3. Question answer during lab session.
4. Outcome analysis and conclusion writing ability.
5. Submission in time.

References:

References used by the students:


Experiment No: 7
Stability analysis Using Control Design Software.
Date:

Competency and Practical Skills:


2. Apply Control Design Software for Stability.

Relevant CO: CO2, CO4.


Objectives: (a) Analyse Stability using Control Design Software.

Equipment/Instruments: Computer system with MATLAB.

Theory:
Poles and Stability
If pi is a pole of G(s), then the natural, or zero-input, the response of G(s) will consist of the mode
functions epit if pi is distinct, and tq epit, q = 0, 1,. . ., r – 1, if p i has multiplicity r. Thus the natural
response will decay to zero if Re[p i] < 0 for i = 1, . . . , n-that is, if all the poles are in the open left-
half of the s-plane, i.e., the left half-plane excluding the imaginary axis. Such a system is said to
be asymptotically stable.
If all the poles are in the open left-half plane except for distinct poles on the imaginary axis
and at the origin, the natural response will consist of undamped sinusoids or a nonzero constant,
and the system is said to be marginally stable.
If some of the poles are in the right-half of the s-plane or on the imaginary axis with multiplicity
greater than one, then the natural response will be unbounded and the system is said to be unstable.

Determine Transfer Function Poles


For G(s) given in TF form, the MATLAB function tf2zp can be used to determine the poles of G(s)
and its stability. Alternatively, since we are interested only in the poles, we can apply the
polynomial roots function root to the denominator of G(s) to find its poles. The following example
illustrates the use of roots to determine the system’s stability.
Here Bounded Input Bounded Output (BIBO) definition of stability is used which states
that a system is stable if the output remains bounded for all bounded (finite) inputs. Practically, this
means that the system will not "blow up" while in operation.
The transfer function representation is especially useful when analyzing system stability. If
all poles of the transfer function (values of for which the denominator equals zero) have negative
real parts, then the system is stable. If any pole has a positive real part, then the system is unstable.
If we view the poles on the complex s-plane, then all poles must be in the left-half plane (LHP) to
ensure stability. If any pair of poles is on the imaginary axis, then the system is marginally stable
and the system will tend to oscillate. A system with purely imaginary poles is not considered BIBO
stable. For such a system, there will exist finite inputs that lead to an unbounded response. The
poles of an LTI system model can easily be found in MATLAB using the pole command, an
example of which is shown below:
s = tf('s');
G = 1/(s^2+2*s+5)
pole(G)
G=
1
-------------
s^2 + 2 s + 5
Continuous-time transfer function.
ans =
-1.0000 + 2.0000i
-1.0000 - 2.0000i
Thus this system is stable since the real parts of the poles are both negative. The stability of a
system may also be found from the state-space representation. In fact, the poles of the transfer
function are the eigenvalues of the system matrix . We can use the eig command to calculate the
eigenvalues using either the LTI system model directly, eig(G), or the system matrix as shown
below.
[A,B,C,D] = ssdata(G);
eig(A)
ans =
-1.0000 + 2.0000i
-1.0000 - 2.0000i

Simulation Exercise:
20
1. Find stability of the system with open-loop transfer function G(s)= 2 . Consider
s +3 s +8
unity feedback.
s+ 1
2. Find stability of the system with open-loop transfer function G(s)= 2 . Consider
s +10 s +20
unity feedback.
4
3. Comment on stability of the system with open-loop transfer function G(s)= 3 2 .
s + s +2 s−10
Consider unity feedback.

[ ] []
4. Consider the system with state space 3 ẋ=0Ax+ Bu∧ y=Ax + Du with
0 2 model
A= 1 0 0 , B= 0 , C=[ 1 0 0 ] , D=[ 0 ] .
Comment on stability. 0 4 1 2

Conclusion:
Quiz:
1. What is BIBO stability?
2. What is characteristic equation?
3. What is relative stability?

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

Rubrics:
1. Understand objectives of experiment.
2. Group work while performing experiment.
3. Question answer during lab session.
4. Outcome analysis and conclusion writing ability.
5. Submission in time.

References: https://www.mathworks.com/

References used by the students:


Experiment No: 8
Analyze marginal stability using root locus method.

Date:

Competency and Practical Skills:


1. Develop root locus using MATLAB.

Relevant CO: CO2, CO4.

Objectives: (a) Analyze marginal stability using root locus method.


Equipment/Instruments: Computer System with MATLAB.

Theory:
rlocus : Evans roots locus.

SYNTAX : rlocus (sys)


rlocus(sys,k)
rlocus(sys1,sys2,)
[r,k]=rlocus(sys)
R=rlocus(sys)
DESCRIPTION:
rlocus computes the every root locus of a SISO open loop model. The root
locus gives the closed loop pole trajectories as a function of the function gain k root loci are used
to study the effect of various varying feedback gains on closed loop pole location.
rlocus(sys) calculates and plots the roots locus of the open loop SISO model
system.

Transfer Functions:

G(s)=(k)/s(s+4)(s^2+4s+20)

>>k=260;
>>num=[260];
>>den=[181620800];
>>g=tf(num,den)

Transfer function:
260
s^5+8s^4 +16 s^3 +20 s^2+80s

>>rlocus(g)

RootLocus
10

8
6

4
Imagin Axis

0
-2

-4
-6

-8
-10
-15 - - 0 5 10
10 5
RealAxis

Simulation Exercise:
1. DrawrootlocusPlotofthefollowingtransferfunctionusingMATLABandfindthevalueofgainK
formarginalstability.Alsoverifyresulttheoretically:
K
G ( s )= .
S ( S +1 )
2. DrawrootlocusPlotofthefollowingtransferfunctionusingMATLABandfindthevalueofgainK
formarginalstability.Alsoverifyresulttheoretically:
K
G ( s )= .
S ( S +2 ) (S+10)

Conclusion:

Quiz:
1. What is root locus?
2. What is marginal stability?
3. Explain break away and break in points?

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

Rubrics:
1. Understand objectives of experiment.
2. Effective use of soft computing tools.
3. Question answer during lab session.
4. Outcome analysis and conclusion writing ability.
5. Submission in time.

References: https://www.mathworks.com/

References used by the students:


Experiment No: 9
Frequency Response analysis using bode plot.
Date:

Competency and Practical Skills:


1. Simulate bode plot using MATLAB.

Relevant CO: CO2, CO4.

Objectives: (a) Analyze frequency response using bode plot.

Equipment/Instruments: Computer System with MATLAB.

Theory:
Bode plots were first introduced by H.W. Bode, when he was working at Bell labs in the United
States. Now before I describe what are this plots it is very essential here to discuss a few
advantages over other stability criteria. Some of the advantages of this plot are written below:
Advantages of Bode Plot

1. It is based on the asymptotic approximation, which provides a simple method to plot the
logarithmic magnitude curve.
2. The multiplication of various magnitude appears in the transfer function can be treated as
an addition, while division can be treated as subtraction as we are using a logarithmic
scale.
3. With the help of this plot only we can directly comment on the stability of the system
without doing any calculations.
4. Bode plots provides relative stability in terms of gain margin and phase margin.
5. It also covers from low frequency to high frequency range.

Now there are various terms related to this plot that we will use frequently in this article.

1. Gain Margin: Greater will the gain margin greater will be the stability of the system. It
refers to the amount of gain, which can be increased or decreased without making the
system unstable. It is usually expressed in dB.
2. Phase Margin: Greater will the phase margin greater will be the stability of the system. It
refers to the phase which can be increased or decreased without making the system
unstable. It is usually expressed in phase.
3. Gain Cross Over Frequency: It refers to the frequency at which magnitude curve cuts the
zero dB axis in the bode plot.
4. Phase Cross Over Frequency: It refers to the frequency at which phase curve cuts the
negative times the 180degreeaxis in this plot.
5. Corner Frequency: The frequency at which the two asymptotes cuts or meet each other is
known as break frequency or corner frequency.
6. Resonant Frequency: The value of frequency at which the modulus of G (jω) has a peak
value is known as resonant frequency.
7. Factors: Every loop transfer function (i.e. G(s) × H(s)) product of various factors like
constant term K, Integral factors (jω), first order factors ( 1 + jωT) (±n) where n is an
integer, second order or quadratic factors.
8. Slope: There is a slope corresponding to each factor and slope for each factor is
expressed in the dB per decade.
9. Angle: There is an angle corresponding to each factor and angle for each factor
is expressed in the degrees.
Bode Plot
These are also known as logarithmic plot (because we draw these plots on semi-log papers) and
are used for determining the relative stabilities of the given system. Now in order to determine
the stability of the system using bode plot we draw two curves, one is for magnitude called
magnitude curve another for phase called Bode phase plot.

Now there are some results that one should remember in order to plot the Bode curve. These
results are written below:

 Constant term K: This factor has a slope of zero dB per decade. There is no corner
frequency corresponding to this constant term. The phase angle associated with this
constant term is also zero.
 Integral factor 1/(jω)n: This factor has a slope of -20 × n (where n is any integer)dB per
decade. There is no corner frequency corresponding to this integral factor. The phase
angle associated with this integral factor is-90 ×n here n is also an integer.
 First order factor 1/ (1+jωT): This factor has a slope of -20 dB per decade. The
cornerfrequencycorrespondingtothisfactoris1/Tradianpersecond.Thephaseangleassociated
with this first factor is-tan-1(ωT).
 First order factor (1+jωT): This factor has a slope of 20 dB per decade. The
cornerfrequencycorrespondingtothisfactoris1/Tradianpersecond.Thephaseangleassociated
with this first factor is tan-1(ωT).
 Second order or quadratic factor: [{1/(1+(2ζ/ω)} × (jω) + {(1/ω 2)} × (jω)2)]: This
factorhasaslopeof-40dBperdecade.Thecornerfrequencycorrespondingtothisfactorisωn
radian per second. The phase angle associated with this first factor is- tan -1{ (2ζω /ωn) /
(1-(ω / ωn)2)} .

Keeping all these points in mind we are able to draw the plot for any kind of system. Now let us
discuss the procedure of making a bode plot:
1. Substitute the s=jωin the open loop transfer function G(s) ×H(s).
2. Find the corresponding corner frequencies and tabulate them.
3. Now we are required one semi-log graph chooses a frequency range such that the plot
should start with the frequency which is lower than the lowest corner frequency. Mark
angular frequencies on the x-axis, mark slopes on the left hand side of the y-axis
bymarkingazeroslopeinthemiddleandontherighthandsidemarkphaseanglebytaking-180
degrees in the middle.
4. Calculate the gain factor and the type or order of the system.
5. Now calculate slope corresponding to each factor.

For drawing the Magnitude curve:


(a) Mark the corner frequency on the semi log graph paper.
(b)Tabulate these factors moving from top to bottom in the given sequence.
1. Constant term K.
2. Integralfactor1/(jω)n.
3. Firstorderfactor1/(1+jωT).
4. First order factor (1+jωT).
5. Second order or quadratic factor :[{1/(1+(2ζ/ω)}×(jω) +{(1/ω2)} ×(jω)2)]

(c) Now sketch the line with the help of corresponding slope of the given factor. Change the
slope at every corner frequency by adding the slope of the next factor. You will get magnitude
plot.
(d) Calculate the gain margin.

For drawing the Bode phase plot:


1. Calculate the phase function adding all the phases of factors.
2. Substitute various values to above function in order to find out the phase at different
points and plot a curve. You will get a phase curve.
3. Calculate the phase margin.
Stability Conditions of Bode Plots:
1. For Stable System: Both the margins should be positive. Or phase margin should be
greater than the gain margin.
2. For Marginal Stable System: Both the margins should be zero. Or phase margin should be
equal to the gain margin.
3. For Unstable System: If any of them is negative. Or phase margin should be less than the
gain margin.

Syntax: bode (sys)


bode (sys, w)
bode (sys1, sys2, sys3, sysN)
bode (sys1, ’plotstyle1’,sysN, ’plotstyleN’)
[mas, phase, w]=bode[sys]

Description: Bode computes the magnitude and phase of the frequency response of LTI models.
When invoked without left side arguments. Bode producesa bode plot on the screen with
magnitude is plotted in decibels and the phase in degrees. The decibels calculation for mas is
computed as system’s frequency response. It is used to analyze system properties such as gain
margin, phase margin, pc gain, bandwidth, disturbance rejection and stability.

Draw a Bode Diagram of the system. Determine the resonant peak, resonant frequency and
bandwidth.

R(s) 1 C(s)
s(0.5s  1)( s  1)
Program:
num=[0 0 0 1];
den=[0.5 1.5 1 0];
sysp=tf(num,den)
sys=feedback(sysp,1)
w=logspace(-1,2,100)
[mag,phase,w]=bode(sys,w)
[mp,k]=max(mag)
resonantpeak=20*log10(mp)
resonantfreq=w(k)
n=1
while 20*log(mag(n))>=-3; n=n+1;
end
bandwidth=w(n)
Output:

>>bandwidth
bandwidth = 1.2328
>>resonantfreq
resonantfreq = 0.8111
>>resonantpeak
resonantpeak = 5.2808

Simulation Exercise:
1. Draw bode Plot of the following transfer function using MATLAB and find the value of
K
gain K such that gain margin 20db. Also verify result theoretically:G ( s )= .
S ( S +2 ) (S+7)
2. Draw bode Plot of the following transfer function using MATLAB and comment on
K
G ( s )=
stability. Also verify result : ( S +3 ) (S+ 4) .

Conclusion:

Quiz:
1. What is gain margin?
2. What is phase margin?
3. What is phase crossover frequency margin?
4. What is gain crossover frequency margin?

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

Rubrics:
1. Understand objectives of experiment.
2. Effective use of soft computing tools.
3. Question answer during lab session.
4. Outcome analysis and conclusion writing ability.
5. Submission in time.

References: https://www.mathworks.com/

References used by the students:


Experiment No: 10
Stability analysis using Nyquist stability criteria.

Date:
Competency and Practical Skills:
1. Simulate Nyquist contour using MATLAB.

Relevant CO: CO2, CO4.


Objectives: (a) Analyse stability using Nyquist stability criteria.

Equipment/Instruments: Computer System with MATLAB.

Theory:

The stability analysis of a feedback control system is based on identifying the location of the
roots of the characteristic equation on s-plane. The system is stable if the roots lie on left hand
side of s-plane. Relative stability of a system can be determined by using frequency response
methods like Nyquist plot and Bode plot. Nyquist criterion is used to identify the presence of
roots of a characteristic equation in a specified region of s-plane. To understand Nyquist plot we
need to know about some of the terminologies .Contour : Closed path in a complex plane is
called contour

Nyquist path or Nyquist contour

The Nyquist contour is a closed contour in the s-plane which completely encloses the entire right
hand half of s-plane. In order to enclose the complete RHS of s-plane a large semicircle path is
drawn with diameter along jω axis and centre at origin. The radius of the semicircle is treated as
infinity.
Nyquist Encirclement
A point is said to be encircled by a contour if it is found inside the contour.
Nyquist Mapping
The process by which a point in s-plane transformed into a point in F(s) plane is called mapping
and F(s) is called mapping function.

Steps of drawing the Nyquist path


Step1-Checkforthe poles of G(s)H(s)of jω axis including that at origin.
Step2–Select the proper Nyquist contour–a)Include the entire right half of s-plane by drawing a
semicircle of radius R with R tends to infinity.
Step3–Identify the various segments on the contour with reference to Nyquist path
Step4–Performthemappingsegmentbysegmentsubstitutingtheequationforrespective segment in the
mapping function. Basically we have to sketch the polar plots of the respective segment.
Step 5 - Mapping of the segments are usually mirror images of mapping of respective path of +ve
imaginary axis.
Step6-Thesemicircularpathwhichcoverstherighthalfofsplanegenerallymapsintoapoint in G(s)
H(s)plane.
Step 7- Interconnect all the mapping of different segments to yield the required Nyquist diagram.
Step 8 – Note the number of clockwise encirclement about (-1, 0) and decide stability byN = Z–
P.

is the Open loop transfer function (O.L.T.F)

is the Closed loop transfer function (C.L.T.F)

N(s) = 0 is the open loop zero and D(s) is the open loop pole From stability point of view no
closed loop poles should lie in the RH side of s-plane . Characteristics equation 1 + G(s) H(s) = 0
denotes closed loop poles .

Now as 1+ G(s) H(s) = 0 hence q(s) should also be zero.


Therefore, from the stability point of view zeroes of q(s) should not lie in RHP of s-plane. To
define the stability entire RHP (Right Hand Plane) is considered. We assume a semicircle which
encloses all points in the RHP by considering the radius of the semicircle R tends to infinity. [R
→ ∞]. The first step to understand the application of Nyquist criterion in relation to determination
of stability of control systems is mapping from s-plane to G(s) H(s) - plane. s is considered as
independent complex variable and corresponding value of G(s) H(s) being the dependent variable
plotted in another complex plane called G(s) H(s) - plane. Thus for every point in s-plane there
exists a corresponding point in G(s) H(s) - plane. During the process of mapping the independent
variable s is varied along a specified path in s - plane and the corresponding points in G(s)H(s)
plane are joined. This completes the process of mapping from s-plane to G(s)H(s) - plane.

Nyquist stability criterion says that N = Z - P where N is the total no. of encirclement about the
origin, P is the total no. of poles and Z is the total no. of zeroes. Case 1:- N = 0 (no encirclement),
so Z = P = 0 & Z = P If N = 0, P must be zero therefore system is stable. Case 2:- N > 0
(clockwise encirclement), so P = 0 , Z ≠0 & Z > P For both cases system is unstable. Case 3 :- N <
0 (counterclockwise encirclement), so Z = 0, P ≠0 & P > Z System is stable
Consider a unity feedback system with the open loop transfer function

20( s2 +s +0 .5 )
G(s)H(s)= s (s +1)( s+10 )

Draw the Nyquist Plot


Program:

num=[0 20 20 10];
den=[1 11 10 0];
nyquist(num,den)
grid
axis([-2 3 -3 3])

Output:

Simulation Exercise:
1. Obtain Nyquist Plot of the following transfer function using MATLAB:
2
G ( s )=
S ( S +2 ) (S+ 4) . Comment on stability of the system.
2. Obtain Nyquist Plot of the following transfer function using MATLAB:
(S +2)
G ( s )=
S ( S +2 ) ( S+ 5 ) (S +20) . Comment on stability of the system.

Conclusion:
Quiz:
1. Explain polar plot.
2. What is Nyquist contour?
3. What is Nyquist Mapping

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

Rubrics:
1. Understand objectives of experiment.
2. Effective use of soft computing tools.
3. Question answer during lab session.
4. Outcome analysis and conclusion writing ability.
5. Submission in time.

References: https://www.mathworks.com/

References used by the students:


Experiment No: 11
Analysis of State Variable Models Using Control Design Software.

Date:

Competency and Practical Skills:


1. Develop state variable model using MATLAB.

Relevant CO: CO3, CO4.


Objectives: Analyse state variable model using Control Design Software.

Equipment/Instruments: Computer System with MATLAB.

Before the concept of state space analysis of control system, it is very important to discuss here the
differences between the conventional theory of control system and modern theory of control
system.

The conventional control theory is completely based on the frequency domain approach while the
modern control system approach is based on time domain approach.
In the conventional theory of control system we have linear and time invariant single input single
output (SISO) systems only but with the help of theory of modern control system we can easily do
the analysis of even nonlinear and time variant multiple inputs multiple outputs (MIMO) systems
also.
In the modern theory of control system the stability analysis and time response analysis can be
done by both graphical and analytically method very easily.

Now state space analysis of control system is based on the modern theory which is applicable to all
types of systems like single input single output systems, multiple inputs and multiple outputs
systems, linear and nonlinear systems, time varying and time invariant systems. Let us consider
few basic terms related to state space analysis of modern theory of control systems.

State in State Space Analysis: It refers to smallest set of variables whose knowledge at t=t0together
with the knowledge of input for t ≥ t0 gives the complete knowledge of the behavior of the system
at any time t ≥ t0.
State Variables in State Space analysis: It refers to the smallest set of variables which help us to
determine the state of the dynamic system. State variables are defined by x1(t), x2(t) Xn(t).
State Vector : Suppose there is a requirement of n state variables in order to describe the complete
behavior of the given system, then these n state variables are considered to be n components of a
vector x(t). Such a vector is known as state vector.
State Space : It refers to the n dimensional space which has x1 axis, x2axis,…., xn axis.

State Space Equations


Let us derive state space equations for the system which is linear and time invariant. Let us
consider multiple inputs and multiple outputs system which has r inputs and m outputs. Where
r=u1, u2, u3 ...........ur. And m = y1, y2...........ym. Now we are taking n state variables to
describe
the given system hence n = x1, x2,...........xn.

Also we define input and output vectors as,

Transpose of input vectors,

Where T is transpose of the matrix. Transpose of output vectors,

Where T is transpose of the matrix. Transpose of state vectors,


Where T is transpose of the matrix.

These variables are related by a set of equations which are written below and are known as state
space equations

Representation of State Model using Transfer Function


Decomposition: It is defined as the process of obtaining the state model from the given transfer
function. Now we can decompose the transfer function using three different ways:
1. Direct decomposition,
2. Cascade or series decomposition,
3. Parallel decomposition.
In all the above decomposition methods we first convert the given transfer function into the
differential equations also called the dynamic equations. After converting into differential
equations we will take inverse Laplace transform of the above equation then corresponding to the
type of decomposition we can create model. We can represent any type of transfer function in
state model. We have various types of model like electrical model, mechanical model etc.
Expression of Transfer Matrix in terms of A, B, C and D. We define transfer matrix as the
Laplace transform of output to the Laplace transform of input.
On writing the state equations again and taking the Laplace transform of both the state equation
(assuming initial conditions equal to zero) we have

We can write the equation as

Where I is an identity matrix.


Now substituting the value of X(s) in the equation Y(s) and putting D=0 (means is a null
matrix) we have

Inverse of matrix can substitute by adj of matrix divided by the determinant of the matrix, now
on rewriting the expression we have of

|sI-A| is also known as characteristic equation when equated to zero.

For below given system:

Y (s ) s
= 3
U (s ) s +14 s +56 s+160
2

Program:

num=[0 0 4 16 12];
den=[1 12 44 48 0];

[A B C D]=tf2ss(num,den)

Output:

>> A

A=

-12 -44 -48 0

1 0 0 0

0 1 0 0

0 0 1 0
>> B

B=

>> C

C=

0 4 16 12

>> D

D=

0
For below given state space model:

[ x 1 ¿ ][ x 2 ¿] ¿ ¿ ¿
. .

¿
[]
x1
y= [ 1 0 0 ] x 2
x3
Program:

A= [0 1 0; 0 0 1; -5 -25 -5];

B= [0; 25; -120];

C= [1 0 0];

D= [0];

[num,den]=ss2tf(A,B,C,D);
(num,den);
printsys

Output:
>>num
num =
0 0.0000 25.0000 5.0000
>>den
den =
1.0000 5.0000 25.0000 5.0000
num/den =
8.8818e-015 s^2 + 25 s + 5
--------------------------
s^3 + 5 s^2 + 25 s + 5

Simulation Exercise:
1. RepresentfollowingsysteminstatespaceusingMATLAB.Alsoverifyresults.
20
G ( S )=
(S+ 2)( S+3)
2. Find thetransfer function forthe system 𝑥̇=𝐴𝑥+𝐵𝑢𝑎𝑛𝑑𝑦=𝑐𝑥with
A=
[ 0
−2 −3 ] []
1 0
, B= , A=[ 0 ] 1, D= [ 0 ].
2

Conclusion:

Quiz:
1. What is a state variable?
2. What is state space?
3. What is a state equation?

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

Rubrics:
1. Understand objectives of experiment.
2. Effective use of soft computing tools.
3. Question answer during lab session.
4. Outcome analysis and conclusion writing ability.
5. Submission in time.
References: https://www.mathworks.com/

References used by the students:

Experiment No: 12
To find zeros and poles from transfer function and vice versa by MATLAB.
Date:

Competency and Practical Skills:


(1) Find zeros and poles from transfer function.
(2) Find transfer function from zeros and poles.
Relevant CO: CO3, CO4.
Objectives: Stability analysis based on location of poles and zeros.

Equipment/Instruments: Computer system with MATLAB.

Theory:
Find the zeros and poles of transfer function using matlab.
2
4 s +16 s+12
G ( S )=4 3 2
s +12 s +44 s + 48 s
Program:
num=[0 0 4 16 12];
den=[1 12 44 48 0];
[z,p,k]=tf2zp(num,den)

Output:
>>z
z=
-3
-1
>>p
p=
0
-6.0000
-4.0000
-2.0000

>>k
k=
4

Find the transfer function using zero, pole and gain k using Matlab.
There is no zero, poles are at -1+2j and -1-2j, k=10

Program:
z=[];
p=[-1+2*j;-1-2*j];
k=10;
[num,den]=zp2tf(z,p,k)
Y=tf(num,den)

Output:
num/den =
10
-------------
s^2 + 2 s + 5
Find the transfer function using zero, pole and gain k using Matlab.
There is a zero at 0, poles are at -1+2j and -1-2j, k=10
Program:
z=[0];
p=[-1+2*j;-1-2*j];
k=10;
[num,den]=zp2tf(z,p,k)
printsys(num,den)

Output:
num/den =
10 s
-------------
s^2 + 2 s + 5

Find the transfer function using zero ,pole and gain k using Matlab
There is a zero at -1, poles are at-2,-4 and -8, k=12

Program:
z=[-1];
p=[-2;-4;-8];
k=12;
[num,den]=zp2tf(z,p,k)
printsys(num,den)

Output:
num/den =
12 s + 12
------------------------
s^3 + 14 s^2 + 56 s + 64

Comment on stability of the systems based on location of poles and zeros.


Conclusion:

Quiz:
1. Explain poles and zeros of the system?
2. Discuss how location of poles affects system stability.
3. Explain effects of zeros on system dynamics.

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

Rubrics:
1. Understand objectives of experiment.
2. Effective use of virtual simulator.
3. Question answer during lab session.
4. Outcome analysis and conclusion writing ability.
5. Submission in time.

References: https://www.mathworks.com/

References used by the students:

You might also like