Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
11 views76 pages

CSE Labmanul and Assignment

This document is a laboratory manual for the Control Systems course (3131101) for B.E. Semester 3 students at Government Engineering College Rajkot. It outlines the course objectives, prerequisites, lab work expectations, and provides a structured approach to practical experiments using MATLAB/SCILAB for system modeling and analysis. The manual emphasizes competency-based learning and includes guidelines for both faculty and students to enhance practical skills relevant to the industry.

Uploaded by

henilsojitra2103
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)
11 views76 pages

CSE Labmanul and Assignment

This document is a laboratory manual for the Control Systems course (3131101) for B.E. Semester 3 students at Government Engineering College Rajkot. It outlines the course objectives, prerequisites, lab work expectations, and provides a structured approach to practical experiments using MATLAB/SCILAB for system modeling and analysis. The manual emphasizes competency-based learning and includes guidelines for both faculty and students to enhance practical skills relevant to the industry.

Uploaded by

henilsojitra2103
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/ 76

A Laboratory Manual for

CONTROL SYSTEMS
(3131101)

B.E. Semester 3 (E.C.)

Directorate of Technical Education,


Gandhinagar, Gujarat
Government Engineering College Rajkot [020]

Certificate

This is to certify that Mr./Ms. ___________________________________


________ Enrollment No. _______________ of B.E. Semester ___________
E.C. Engineering of this Institute (GTU Code: _____ ) has satisfactorily
completed the Practical / Tutorial work for the subject Control Systems
(3131101) for the academic year 2022-23.

Place: __________
Date: __________

Name and Sign of Faculty member

Head of the Department


CONTROL SYSTEMS (3131101)

Type of course: Modeling, performance analysis and control with


potential application to engineering systems.

Prerequisite: Knowledge of Linear algebra, Differential equations and Laplace transform.

Rationale: This course explores the fundamentals of systems and


control. The course has following primary focuses:
(1) Understanding and predicting behavior of the system.
(2) Differentiate between the open loop and closed loop systems.
(3) Design and analysis of closed loop control systems.
(4) Analyze the condition for system stability.
(5) Understand different methods for finding the relative and
absolute stability of the system.
(6) Evaluate the performance of the system for different excitation.
.

Legends: R: Remembrance; U: Understanding; A: Application, N: Analyze and E:


Evaluate C: Create and above Levels (Revised Bloom’s Taxonomy)

*This specification table shall be treated as a general guideline for


students and teachers. The actual distribution of marks in the question
paper may vary from above table

Course Outcomes:
After learning the course the students should be able to:
Sr. CO statement
No.
CO-1 Analyze and Evaluate system behavior in time and frequency domains
based on the mathematical model of the system.
CO-2 Apply control theory to linear system for system modeling using
differential equations and transfer function realizations.
CO-3 Analyze and apply all the stability techniques for closed loop
system
performance parameters.
CO-4 Comprehend the need of different types of controllers and
compensators to obtain the required dynamic response of the system.
CO-5 Synthesis system equations for state space models of linear systems.

Lab Work: SCILAB/ MATLAB based assignments and simulations


covering design, analysis and modelling of control systems relevant to
curriculum.
CONTROL SYSTEMS (3131101)

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 psycho-motor 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 psycho-motor 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. It also gives
an idea that how students will be assessed by providing rubrics.

Utmost care has been taken while preparing this lab manual along with assignments
however always there is chances of improvement. Therefore, we welcome constructive
suggestions for improvement and removal of errors if any. Also this is a suggested list of
Experiments/Assignments, faculty may modify & add as per the feasibility and the
resources available change & update in any part/program or else as per the requirement.
CONTROL SYSTEMS (3131101)

Experiments- CO mapping Table

Sr. CO CO CO CO CO
Objective(s) of Experiment
No. 1 2 3 4 5
Plot the various continuous time signals using
1. √
MATLAB.
Plot the various discrete time signals using
2. √
MATLAB.
To plot the continuous time signals & discrete
3. time signals (Mathematical Functions like sin, √
cos, etc.) using MATLAB.
To evaluate transfer function model using
4. √
different MATLAB SYNTAX.
To perform block diagram reduction using
5. √
MATLAB commands.
Reduce the block diagram using MATLAB
6. √
function.
Using Simulink check Step function and
7. impulse function and verify with MATLAB √
code.
To plot Root Locus of different system using
8. √
MATLAB.

9. To plot bode plot using MATLAB functions. √

To perform PID controller using MATLAB


10. √
Simulink.

11. Assignment 1 √ √

12. Assignment 2 √ √

13. Assignment 3 √ √ √
CONTROL SYSTEMS (3131101)

Practical – Course Outcome matrix


Sr. CO statement
No.
CO-1 Analyze and Evaluate system behavior in time and frequency domains
basedon the mathematical model of the system.
CO-2 Apply control theory to linear system for system modeling using
differentialequations and transfer function realizations.
CO-3 Analyze and apply all the stability techniques for closed loop
system performance parameters.
CO-4 Comprehend the need of different types of controllers and
compensators to obtain the required dynamic response of the system.
CO-5 Synthesis system equations for state space models of linear systems.

Sr.
Objective(s) of Experiment Date Sign
No.
Plot the variouscontinuous time signals using
1.
MATLAB.
Plot the various discrete time signals using
2.
MATLAB.
To plot the continuous time signals & discrete time
3. signals (Mathematical Functions like sin, cos, etc.)
using MATLAB.
To evaluate transfer function modelusing
4.
different MATLAB SYNTAX.
To perform block diagram reduction using
5.
MATLAB commands.
Reduce the block diagram usingMATLAB
6.
function.
Using Simulink check Step function and impulse
7.
function and verify withMATLAB code.
To plot Root Locus of different systemusing
8.
MATLAB.

9. To plot bode plot using MATLABfunctions.

To perform PID controller usingMATLAB


10.
Simulink.

11. Assignment 1

12. Assignment 2

13. Assignment 3
Guidelines for Faculty members
1. Teacher should provide the guideline with demonstration of MATLAB/SCILAB based program to the
students with all features positively.
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 practical.
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/individual for the performance.
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 should develop a habit of submitting the experimentation work as per the schedule and he/she
should be well prepared for the same.
Index
(Progressive Assessment Sheet)

Sr. No. Objective(s) of Experiment Page Date of Date of Assessm Sign. of Remar
No. perfor submis ent Teacher ks
mance sion Marks with
date
Plot the variouscontinuous time
1.
signals using MATLAB.
Plot the various discrete time signals
2.
using MATLAB.
To plot the continuous time signals &
discrete time signals (Mathematical
3.
Functions like sin, cos, etc.) using
MATLAB.
To evaluate transfer function model
4.
using different MATLAB SYNTAX.
To perform block diagram reduction
5.
usingMATLAB commands.
Reduce the block diagram using
6.
MATLAB function.
Using Simulink check Step function
7. and impulse function and verify with
MATLAB code.
To plot Root Locus of different system
8.
using MATLAB.
To plot bode plot using MATLAB
9.
functions.
To perform PID controller using
10.
MATLAB Simulink.
11. Assignment 1

12. Assignment 2

13. Assignment 3
Total
EXPERIMENT: - 1

AIM: - Plot the variouscontinuous time signals using MATLAB.


MATLAB Functions: -
1. Plot: - Plot function can able to plot various graphs.
 The plot function takes two parameters, the first is X-axis values and the
second is Y-axis values.
 Plot function plot continuous graph.
 Function syntax: Plot(x, y)

2. Subplot: - subplot function can show more than 1 graph in the output window
at the same time.
 Subplot function takes three parameters, the first is number of rows the
second is number of columns and the third is graph number.
 Function syntax: subplot(rows, columns, no. of graph)

3. Xlabel: - xlable function shows title of X-axis.


 Function syntax: xlable(“title”)

4. Ylable: - ylable function shows title of Y-axis.


 Function syntax: ylable(“title”)

MATLAB code: -
n=-5:1:5;
y=(n==2)
subplot (3,1,1)
plot(n,y)
xlabel('t')
ylabel('u(t)')

n=0:0.5:10;
y=(n>=3)
subplot (3,1,2)
plot (n,y)
xlabel('t')
ylabel('u(t)')

n=0:1:10;
y=n;
subplot (3,1,3)
plot(n,y)
xlabel('x')
ylabel('y')

output: -
EXPERIMENT: - 2

Aim: - Plot the various discrete time signals using MATLAB.

5. Stem: - stem function plots discrete graph.


 The stem function takes two parameters, the first is X-axis values and
the second is Y-axis values.
 Plot function plot discrete graph.
 Function syntax: stem (x, y)

MATLAB code: -
n=0:0.2:10;
y=(n==4);
subplot (3,1,1)
stem(n,y)
xlabel('t')
ylabel('u(t)')

n=0:0.2:10;
y=(n>=5);
subplot (3,1,2)
stem(n,y)
xlabel('t')
ylabel('u(t)')

n=-5:0.2:5;
y=n;
subplot (3,1,3)
stem(n,y)
xlabel('x')
ylabel('y')
Output: -
EXPERIMENT: - 3

AIM: - To plot the continuous time signals & discrete time signals (Mathematical Functions
like sin, cos, etc.) using MATLAB.
MATLAB functions: -

1. Trigonometric functions: - MATLAB support all trigonometric functions like


sin, cos, tan, cosec, sec, cot. These are takes suitable angle for print graph.
 Function syntax: sin(x), cos(x), ten(x), etc.

2. Exponential: - Exponential function takes only one parameter.


 Function syntax: exp(x)

3. Title: - Title functions will give title of the graph.


 Function syntax: title(“text”)

MATLAB code: -
t=0:0.2:20;
y =exp(t);
subplot (4,2,1);
plot(y,'r');
title('exponential');
subplot (4,2,2);
stem(y,'r');
title ('exponential discrete');

t=0:0.2:20;
y=sin(t);
subplot (4,2,3);
plot(y,'g');
title('sin');
subplot (4,2,4);
stem(y,'g');
title ('sine discrete');

t=0:0.2:20;
y=cos(t);
subplot (4,2,5);
plot(y,'b');
title('cos');
subplot (4,2,6);
stem(y,'b');
title ('cos discrete');
t=-1.5:0.1:1.5;
y=tan(t);
subplot (4,2,7);
plot(y,'y');
title('tan');
subplot (4,2,8);
stem(y,'y');
title ('tan discrete');

OUTPUT: -
EXPERIMENT 4
Aim: - To evaluate transfer function modelusing different MATLAB SYNTAX.
MATLAB Functions: -

1. tf: - tf Construct transfer function or convert to transfer function.


 tf functions takes two parameters first one is array of numerator and
second is array of denominator. It is creates-continuous time transfer
function.
 Function syntax: sys = tf(num, den)
 sys = tf (num, den, ts) creates a discrete-time transfer function
with sample time ts (set ts =-1 if the sample time is undetermined).

2. tf2zpk: - this function returns value of zeros, poles, and gain of input transfer
function.
 Function syntax: [z, p, k] = tf2zpk (num, den)

3. zp2tf: - function zp2tf is use for conversion of zero, poles, and gain to transfer
function.
 Function syntax: [num, den] = zp2tf (z, p, k)

4. roots: - roots Find polynomial roots of the transfer function.


 Function syntax: val = roots(num)

5. Input: - input function take inputs from the user.


 Function syntax: x = input (‘enter the value of array:’)

6. pzmap: - pzmap computes the poles and zeros of the dynamic system and plots
them in the complex plane. The poles are plotted as x's and the zeros are plotted
as o's.
 Function syntax: pzmap (num, dem)
 [p, z] = pzmap(sys) returns the poles and zeros of the system in two
column vectors p and z. No plot is drawn on the screen.

Part A
Aim: - To get transfer function using tf function.
Input: -
num = input ('enter numerator')
den = input ('enter denotator')
sys = tf (num, den)

Output: -
enter numerator [ 4 5 6]

num =

4 5 6

enter denotator [ 8 3 4 2]

den =

8 3 4 2

sys =

4 s^2 + 5 s + 6

8 s^3 + 3 s^2 + 4 s + 2

Continuous-time transfer function.

Part B

Aim: - To get all zeros, poles, and gain value from the transfer function.

Input: -
num = input ('enter numerator')
den = input ('enter denotator')
sys = tf (num, den)
[z, p, k] = tf2zpk (num, den)

Output: -
enter numerator [ 2 3 6 1]

num =

2 3 6 1

enter denotator [ 1 5 9 6 3]

den =
1 5 9 6 3

sys =

2 s^3 + 3 s^2 + 6 s + 1

s^4 + 5 s^3 + 9 s^2 + 6 s + 3

Continuous-time transfer function.

z=

0.0000 + 0.0000i

-0.6595 + 1.5252i

-0.6595 - 1.5252i

-0.1811 + 0.0000i

p=

-2.1726 + 0.9491i

-2.1726 - 0.9491i

-0.3274 + 0.6531i

-0.3274 - 0.6531i

k=

Part C
Aim: - To get transfer function from the value of zeros, poles, and gain.
Input: -
z = input ('Enter the value of Zeros:')
p = input ('Enter the value of poles:')
k = input ('Enter the value of k:')
sys = tf (num, den)
rev = zpk (z, p, k)

Output: -
Enter the value of Zeros: [ 1 2 3]

z=
1 2 3
Enter the value of poles: [2 6 7 3]

p=
2 6 7 3

Enter the value of k:[2]

k=
2

sys =

2 s^3 + 3 s^2 + 6 s + 1

s^4 + 5 s^3 + 9 s^2 + 6 s + 3

Continuous-time transfer function.

rev =

2 (s-1) (s-2) (s-3)

(s-2) (s-3) (s-6) (s-7)

Continuous-time zero/pole/gain model.

Part D
Aim: - To find roots of the transfer function and print graph on pzmap.
Input: -
num = input ('enter numerator')
den = input ('enter denotator')
sys = tf (num, den)
poles = roots(den)
zeros = roots(num)
pzmap (num, den)

Output: -
enter numerator [ 26 35 22 20]

num =

26 35 22 20

enter denotator [11 25 36 34 40]


den =

11 25 36 34 40

sys =

26 s^3 + 35 s^2 + 22 s + 20

11 s^4 + 25 s^3 + 36 s^2 + 34 s + 40

Continuous-time transfer function.

poles =

-1.2680 + 0.9262i
-1.2680 - 0.9262i
0.1317 + 1.2073i
0.1317 - 1.2073i

zeros =

-1.1811 + 0.0000i
-0.0825 + 0.8028i
-0.0825 - 0.8028i
EXPERIMENT 5
Aim: - To perform block diagram reduction usingMATLAB commands.
MATLAB Function: -
1. Series: - series function can do Series connection of two input/output
models.
 Function syntax: M = series (M1, M2, OUTPUTS1, INPUTS2)

2. Conv: - conv Convolution and polynomial multiplication.


 Function syntax: C = conv (A, B)

3. Parallel: - paraller function can do Parallel connection of two


input/output models.
 Function syntax: M = parallel (M1, M2, IN1, IN2, OUT1,
OUT2)

4. Cloop: - cloop is obsolete, use FEEDBACK instead.

 Function syntax: [numcl, dencl] =cloop (num, den, -1);

5. Feedback: - Feedback connection of two input/output systems.

 Negative feedback is assumed and the model M maps u to y. To


apply positive feedback, use the syntax M = feedback (M1, M2,
+1)

 Function syntax: M = feedback (M1, M2,


FEEDIN,FEEDOUT,SIGN)

Part A
Aim: - use series function to reduce given block diagram.
Input:
num1 = input ('enter the value of numerator :')
den1 = input ('enter the value of denominator :')
num2 = input ('enter the value of numerator :')
den2 = input ('enter the value of denominator :')
[num12, den12] = series (num1, den1, num2, den2)
printsys (num12, den12);
Output:
enter the value of numerator: [1 0]
num1 =
1 0
enter the value of denominator: [9 17]
den1 =
9 17
enter the value of numerator:9*[1 3]
num2 =
9 27
enter the value of denominator: [2 9 27]
den2 =
2 9 27
num12 =
0 9 27 0
den12 =
18 115 396 459

num/den =
9 s^2 + 27 s

18 s^3 + 115 s^2 + 396 s + 459


Aim: using conv function reduce the series block in block diagram.
Input:
num1 = [1 0]
den1 = [9 17]
num2 = 9*[1 3]
den2 = [2 9 27]
num12 =conv (num1, num2)
den12 = conv (den1, den2)
printsys (num12, den12)

Output
num1 =
1 0
den1 =
9 17
num2 =
9 27
den2 =
2 9 27

num12 =
9 27 0
den12 =
18 115 396 459
num/den =
9 s^2 + 27 s

18 s^3 + 115 s^2 + 396 s + 459


Part B
Aim: - using parallel function reduce given block diagram.

Input:
num1 = input ('enter the value of numerator:')
den1 = input ('enter the value of denominator:')
num2 = input ('enter the value of numerator:')
den2 = input ('enter the value of denominator:')
[num12, den12] = parallel (num1, den1, num2, den2)
printsys (num12, den12)

Output:
enter the value of numerator: [1 2]
num1 =
1 2
enter the value of denominator: [1 2 3]
den1 =
1 2 3
enter the value of numerator: [1 3]

num2 =
1 3
enter the value of denominator: [1 -4 1]
den2 =
1 -4 1
num12 =
0 2 3 2 11
den12 =
1 -2 -4 -10 3
num/den =
2 s^3 + 3 s^2 + 2 s + 11

s^4 - 2 s^3 - 4 s^2 - 10 s + 3


Part C
Aim: - Closed loop transfer function with unity feedback can be simplified using
cloop command.

Input:
num = 9;
den = [1 5]
[numcl, dencl] = cloop (num, den, -1);
Printsys (numcl, dencl)

Output:
num =
9
den =
1 5
num/den =
9

s + 14

Part D
Aim: - If the feedback is not unity then we can use feedback command to simplify
the canonical form.

Input:
num1 = input ('enter the value of numerator:')
den1 = input ('enter the value of denominator:')
num2 = input ('enter the value of numerator:')
den2 = input ('enter the value of denominator:')
[numcl, dencl] = feedback (num1, den1, num2, den2, -1)
Printsys (numcl, dencl)

Output:
enter the value of numerator:[1]
num1 =
1
enter the value of denominator: [1 1]
den1 =
1 1
enter the value of numerator: [2]
num2 =
2
enter the value of denominator: [1 0]
den2 =
1 0
numcl =
0 1 0
dencl =
1 1 2
num/den =
s

s^2 + s + 2
EXPERIMENT: - 6
Aim: - Reduce the block diagram using MATLAB function.
Question. 1

1
s2
1
s

Input
numk = 10;

denk = 1;

num1 = 1;

den1 = [1 1];

numf1 = 1;

denf1 = [1 2];

numf2 = 1;

denf2 = [1 0];

sys1 = tf (num1, den1)

[num12, den12] = series (num1, den1, numk, denk);

sys2 = tf (num12, den12)

[numf12, denf12] = feedback (num12, den12, numf1, denf1);

sys3 = tf (numf12, denf12)


[numf21, denf22] = feedback (numf12, denf12, numf2, denf2);

sys = tf (numf21, denf22)

output
sys1 =

s+1

Continuous-time transfer function.

sys2 =

10

s+1

Continuous-time transfer function.

sys3 =

10 s + 20

s^2 + 3 s + 12

Continuous-time transfer function.

sys =

10 s^2 + 20 s

s^3 + 3 s^2 + 22 s + 20

Continuous-time transfer function.


Question. 2

Input
numk = -10;

denk = 1;

num1 = [7 7];

den1 = [1 3 0];

num2 = 1;

den2 = [1 2 1];

sys1 = tf (num1, den1)

[numk1, denk1] = series (num1, den1, numk, denk);

sysk1 = tf (numk1, denk1)

[num12, den12] = parallel (numk1, denk1, num2, den2);

sys12 = tf (num12, den12)

[numf, denf] = feedback (num12, den12, num2, den2, -1);

sysf = tf (numf, denf)

[num, den] = cloop (numf, denf, -1);


sys = tf (num, den)

output
sys1 =

7s+7

s^2 + 3 s

Continuous-time transfer function.

sysk1 =

-70 s - 70

s^2 + 3 s

Continuous-time transfer function.

sys12 =

-70 s^3 - 209 s^2 - 207 s - 70

s^4 + 5 s^3 + 7 s^2 + 3 s

Continuous-time transfer function.

sysf =

-70 s^5 - 349 s^4 - 695 s^3 - 693 s^2 - 347 s - 70

s^6 + 7 s^5 + 18 s^4 - 48 s^3 - 196 s^2 - 204 s - 70

Continuous-time transfer function.


sys =

-70 s^5 - 349 s^4 - 695 s^3 - 693 s^2 - 347 s - 70

s^6 - 63 s^5 - 331 s^4 - 743 s^3 - 889 s^2 - 551 s - 140

Continuous-time transfer function.

Question. 3

Input
num1 = 1

den1 = [1 3]

num2 = 2

den2 = [1 1]

num3 = 1

den3 = [1 0]

numf1 = 0.3
denf1 = 1

numf2 = 0.4

denf2 = 1

numk = 10

denk = 1

[numk1, denk1] = series (num1, den1, numk, denk);

sys1 = tf (numk1, denk1)

[num11, den11] = feedback (numk1, denk1, numf1, denf1);

sys2 = tf (num11, den11)

[num12, den12] = series (num11, den11, num2, den2);

sys3 = tf (num12, den12)

[num13, den13] = feedback (num12, den12, numf2, denf2);

sys4 = tf (num13, den13)

[num, den] = series (num13, den13, num3, den3);

sys = tf(num,den)

Output
sys1 =

10

s+3

Continuous-time transfer function.


sys2 =

10

s+6

Continuous-time transfer function.

sys3 =

20

s^2 + 7 s + 6

Continuous-time transfer function.

sys4 =

20

s^2 + 7 s + 14

Continuous-time transfer function.

sys =

20

s^3 + 7 s^2 + 14 s

Continuous-time transfer function.


EXPERIMENT: -7
Aim: - Using Simulink check Step function and impulse function and verify with
MATLAB code.

1. Step Function

Simulink Diagram

Output
2. Impulse Function

Simulink Diagram

Output
MATLAB Code
num = input ('Enter the value of Numerator:')

den = input ('Enter the value of Denominator: ')

t = tf (num, den)

subplot (2,1,1)

stepplot(t)

subplot (2,1,2)

impulseplot(t)

Output
Enter the value of Numerator:[1]

num =

Enter the value of Denominator: [4 2 5]

den =

4 2 5

t=

4 s^2 + 2 s + 5

Continuous-time transfer function.


EXPERIMENT: - 8
Aim: - To plot Root Locus of different system using MATLAB.
MATLAB Functions: -
rlocus(sys): - rlocus(sys) computes and plots the root locus of the single-input,
single-output LTI model SYS. The root locus plot is used to analyze the negative
feedback loop. and shows the trajectories of the closed-loop poles when the feedback
gain K varies from 0 to Inf. rlocus automatically generates a set of positive gain values
that produce a smooth plot.

rlocus (sys, k): - rlocus (SYS, K) uses a user-specified vector K of gain values.
rlocus (sys1, sys2, …): - rlocus (SYS1, SYS2, …) draws the root loci of several
models SYS1, SYS2, ... on a single plot. You can specify a color, line style, and marker
for each model,
for example: rlocus (sys1,'r’, sys2,'y:’, sys3, 'b')

[r, k] = rlocus(sys): - [r, k] = rlocus(sys) or r = rlocus (sys, k) returns the matrix R of


complex root locations for the gains K. R has LENGTH(K) columns and its j-the column lists
the closed-loop roots for the gain K(j).

Part A
MATLAB Code
num = input ('Enter the value of numerator:')

den = input ('Enter the value of denominator:')


s = tf (num, den)

rlocus(s)

Output
Enter the value of numerator: [ 1 3 10]

num =

1 3 10

Enter the value of denominator: [1 4 105 202]

den =

1 4 105 202

s=

s^2 + 3 s + 10
s^3 + 4 s^2 + 105 s + 202

Continuous-time transfer function.

Part B
MATLAB Code
num = input ('Enter the value of numerator:')
den = input ('Enter the value of denominator:')
k = input ('Enter the value of gain')
s = tf (num, den)
r = rlocus (s, k)
rlocus (s, k)
Output
Enter the value of numerator: [ 1 2]

num =

1 2

Enter the value of denominator: [ 1 5 8 0 0]

den =

1 5 8 0 0
Enter the value of gain [10]

k=

10

s=

s+2

s^4 + 5 s^3 + 8 s^2

Continuous-time transfer function.

r=

-2.7286 + 0.7401i

-2.7286 - 0.7401i

0.2286 + 1.5652i

0.2286 - 1.5652i

Part C
MATLAB Code
num = input ('Enter the value of numerator:')

den = input ('Enter the value of denominator:')

s = tf (num, den)

[r, k] = rlocus(s)

rlocus (s, k)

Output
Enter the value of numerator: [ 1 2]

num =

1 2

Enter the value of denominator: [ 1 5 8 0 0]

den =

1 5 8 0 0

s=

s+2

s^4 + 5 s^3 + 8 s^2

Continuous-time transfer function.

r=

1.0e+02 *

Columns 1 through 6
0.0000 + 0.0000i 0.0000 + 0.0001i 0.0000 + 0.0001i 0.0000 + 0.0001i 0.0000 +
0.0002i 0.0000 + 0.0002i

0.0000 + 0.0000i 0.0000 - 0.0001i 0.0000 - 0.0001i 0.0000 - 0.0001i 0.0000 - 0.0002i
0.0000 - 0.0002i

-0.0250 + 0.0132i -0.0250 + 0.0132i -0.0250 + 0.0132i -0.0250 + 0.0132i -0.0250 +


0.0132i -0.0250 + 0.0132i

-0.0250 - 0.0132i -0.0250 - 0.0132i -0.0250 - 0.0132i -0.0250 - 0.0132i -0.0250 - 0.0132i
-0.0250 - 0.0132i
Columns 7 through 12

0.0000 + 0.0002i 0.0000 + 0.0002i 0.0000 + 0.0003i 0.0000 + 0.0003i 0.0000 +


0.0004i 0.0000 + 0.0004i

0.0000 - 0.0002i 0.0000 - 0.0002i 0.0000 - 0.0003i 0.0000 - 0.0003i 0.0000 - 0.0004i
0.0000 - 0.0004i

-0.0250 + 0.0132i -0.0250 + 0.0132i -0.0250 + 0.0132i -0.0250 + 0.0132i -0.0250 +


0.0132i -0.0250 + 0.0132i

-0.0250 - 0.0132i -0.0250 - 0.0132i -0.0250 - 0.0132i -0.0250 - 0.0132i -0.0250 - 0.0132i
-0.0250 - 0.0132i

Columns 13 through 18

0.0000 + 0.0005i 0.0000 + 0.0006i 0.0000 + 0.0007i 0.0000 + 0.0008i 0.0000 +


0.0009i 0.0000 + 0.0010i

0.0000 - 0.0005i 0.0000 - 0.0006i 0.0000 - 0.0007i 0.0000 - 0.0008i 0.0000 - 0.0009i
0.0000 - 0.0010i

-0.0250 + 0.0132i -0.0250 + 0.0132i -0.0250 + 0.0132i -0.0250 + 0.0132i -0.0250 +


0.0132i -0.0250 + 0.0132i

-0.0250 - 0.0132i -0.0250 - 0.0132i -0.0250 - 0.0132i -0.0250 - 0.0132i -0.0250 - 0.0132i
-0.0250 - 0.0132i

Columns 19 through 24

0.0000 + 0.0012i 0.0000 + 0.0014i 0.0000 + 0.0016i 0.0000 + 0.0018i 0.0000 +


0.0021i 0.0000 + 0.0024i

0.0000 - 0.0012i 0.0000 - 0.0014i 0.0000 - 0.0016i 0.0000 - 0.0018i 0.0000 - 0.0021i
0.0000 - 0.0024i

-0.0250 + 0.0132i -0.0250 + 0.0132i -0.0250 + 0.0132i -0.0250 + 0.0131i -0.0250 +


0.0131i -0.0250 + 0.0131i

-0.0250 - 0.0132i -0.0250 - 0.0132i -0.0250 - 0.0132i -0.0250 - 0.0131i -0.0250 - 0.0131i
-0.0250 - 0.0131i

Columns 25 through 30
0.0001 + 0.0028i 0.0001 + 0.0033i 0.0001 + 0.0038i 0.0001 + 0.0044i 0.0002 +
0.0051i 0.0002 + 0.0059i

0.0001 - 0.0028i 0.0001 - 0.0033i 0.0001 - 0.0038i 0.0001 - 0.0044i 0.0002 - 0.0051i
0.0002 - 0.0059i

-0.0251 + 0.0130i -0.0251 + 0.0130i -0.0251 + 0.0129i -0.0251 + 0.0127i -0.0252 +


0.0126i -0.0252 + 0.0124i

-0.0251 - 0.0130i -0.0251 - 0.0130i -0.0251 - 0.0129i -0.0251 - 0.0127i -0.0252 - 0.0126i
-0.0252 - 0.0124i

Columns 31 through 36

0.0003 + 0.0068i 0.0005 + 0.0079i 0.0006 + 0.0091i 0.0009 + 0.0105i 0.0013 +


0.0121i 0.0018 + 0.0140i

0.0003 - 0.0068i 0.0005 - 0.0079i 0.0006 - 0.0091i 0.0009 - 0.0105i 0.0013 - 0.0121i
0.0018 - 0.0140i

-0.0253 + 0.0121i -0.0255 + 0.0117i -0.0256 + 0.0112i -0.0259 + 0.0105i -0.0263 +


0.0097i -0.0268 + 0.0086i

-0.0253 - 0.0121i -0.0255 - 0.0117i -0.0256 - 0.0112i -0.0259 - 0.0105i -0.0263 - 0.0097i
-0.0268 - 0.0086i

Columns 37 through 42

0.0024 + 0.0160i 0.0032 + 0.0182i 0.0036 + 0.0192i 0.0040 + 0.0202i 0.0040 +


0.0202i 0.0040 + 0.0202i

0.0024 - 0.0160i 0.0032 - 0.0182i 0.0036 - 0.0192i 0.0040 - 0.0202i 0.0040 - 0.0202i
0.0040 - 0.0202i

-0.0274 + 0.0071i -0.0282 + 0.0050i -0.0286 + 0.0035i -0.0290 + 0.0003i -0.0290 +


0.0000i -0.0287 + 0.0000i
-0.0274 - 0.0071i -0.0282 - 0.0050i -0.0286 - 0.0035i -0.0290 - 0.0003i -0.0290 + 0.0000i
-0.0293 + 0.0000i

Columns 43 through 48
0.0042 + 0.0206i 0.0053 + 0.0232i 0.0067 + 0.0260i 0.0082 + 0.0291i 0.0099 +
0.0324i 0.0119 + 0.0361i

0.0042 - 0.0206i 0.0053 - 0.0232i 0.0067 - 0.0260i 0.0082 - 0.0291i 0.0099 - 0.0324i
0.0119 - 0.0361i

-0.0269 + 0.0000i -0.0241 + 0.0000i -0.0228 + 0.0000i -0.0220 + 0.0000i -0.0214 +


0.0000i -0.0211 + 0.0000i
-0.0314 + 0.0000i -0.0366 + 0.0000i -0.0406 + 0.0000i -0.0444 + 0.0000i -0.0484 +
0.0000i -0.0527 + 0.0000i

Columns 49 through 54
0.0140 + 0.0400i 0.0164 + 0.0443i 0.0190 + 0.0490i 0.0219 + 0.0542i 0.0251 +
0.0599i 0.0287 + 0.0661i

0.0140 - 0.0400i 0.0164 - 0.0443i 0.0190 - 0.0490i 0.0219 - 0.0542i 0.0251 - 0.0599i
0.0287 - 0.0661i

-0.0208 + 0.0000i -0.0206 + 0.0000i -0.0204 + 0.0000i -0.0203 + 0.0000i -0.0202 +


0.0000i -0.0202 + 0.0000i

-0.0572 + 0.0000i -0.0622 + 0.0000i -0.0676 + 0.0000i -0.0735 + 0.0000i -0.0800 +


0.0000i -0.0872 + 0.0000i

Columns 55 through 57

0.0326 + 0.0730i 0.9401 + 1.6456i Inf + 0.0000i

0.0326 - 0.0730i 0.9401 - 1.6456i Inf + 0.0000i

-0.0201 + 0.0000i -0.0200 + 0.0000i -0.0200 + 0.0000i

-0.0950 + 0.0000i -1.9102 + 0.0000i Inf + 0.0000i

k=

1.0e+06 *

Columns 1 through 11

0 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000


0.0000

Columns 12 through 22

0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0.0000

Columns 23 through 33

0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0.0000

Columns 34 through 44

0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0.0000

Columns 45 through 55
0.0000 0.0000 0.0001 0.0001 0.0001 0.0001 0.0002 0.0003 0.0003 0.0005
0.0006

Columns 56 through 57

6.8615 Inf

Part D
MATLAB Code
num1 = input ('Enter the value of numerator1:')

den1 = input ('Enter the value of denominator1:')

s1 = tf (num1, den1)

num2 = input ('Enter the value of numerator2:')

den2 = input ('Enter the value of denominator2:')

s2 = tf (num2, den2)

rlocus (s1,'r’, s2,'b')

Output
Enter the value of numerator1: [ 1 2]

num1 =

1 2

Enter the value of denominator1: [1 5 8 0 0]


den1 =

1 5 8 0 0

s1 =

s+2

s^4 + 5 s^3 + 8 s^2

Continuous-time transfer function.

Enter the value of numerator2: [1 3 10]

num2 =

1 3 10

Enter the value of denominator2: [ 1 4 105 202]

den2 =

1 4 105 202

s2 =

s^2 + 3 s + 10

s^3 + 4 s^2 + 105 s + 202

Continuous-time transfer function.


EXPERIMENT: - 9
Aim: - to plot bode plot using MATLAB functions.
MATLAB commands: -
bode (SYS): - bode (SYS) draws the Bode plot of the dynamic system SYS. The
frequency range and number of points are chosen automatically.

bode (SYS, {WMIN, WMAX}): - bode (SYS, {WMIN, WMAX}) draws the Bode
plot for frequencies between WMIN and WMAX in radians/Time Unit (relative to
the time units specified in SYS. Time Unit, the default being seconds).\

bode (SYS, W): - bode (SYS, W) uses the vector W of frequencies (in
radians/Time Unit) to evaluate the frequency response. See LOGSPACE to generate
logarithmically spaced frequency vectors.

bode (SYS1, SYS2, ….., W): - bode(SYS1,SYS2,...,W) graphs the Bode response
of several systems SYS1,SYS2,... on a single plot. The frequency vector W is optional.
You can specify a color, line style, and marker for each model, for

example: bode (sys1, 'r', sys2, 'y--', sys3, 'gx').

[MAG, PHASE]: - [MAG, PHASE] = bode (SYS, W) and [MAG, PHASE, W] =


bode (SYS) return the response magnitudes and phases in degrees (along with the
frequency vector W if unspecified). No plot is drawn on the screen.

Part A

Input
num=input (‘Enter the numerator:’)

den=input (‘Enter the denotator:’)

sys=tf (num, den)

bode (sys)

grid on
Output
Enter the numerator:

[20]

num =

20

Enter the denotator:

[ 0.1 1.0 0]

den =

0.1000 1.0000 0

sys =

20

0.1 s^2 + s

Continuous-time transfer function.


Part B
Input
num1=input ('Enter the numerator1:')

den1=input ('Enter the denominator1:’)

num2=input ('Enter the numerator 2:')

den2=input ('Enter the denominator2: ')

sys1=tf (num1, den1)

sys2=tf (num2, den2)

bode (sys1, sys2)

grid on
Output

Enter the numerator1: [20]

num1 =

20

Enter the denominator1: [0.1 1 0]

den1 =

0.1000 1.0000 0

Enter the numerator 2: [80]

num2 =

80
Enter the denominator2: [1 22 40 0]

den2 =

1 22 40 0

sys1 =

20
0.1 s^2 + s

Continuous-time transfer function.

sys2 =

80

s^3 + 22 s^2 + 40 s

Continuous-time transfer function.

Part C
Input
num1=input ('Enter the numerator1:')

den1=input ('Enter the denominator1:')

num2=input ('Enter the numerator 2:')


den2=input ('Enter the denominator2: ')

sys1=tf (num1, den1)

sys2=tf (num2, den2)

bode (sys1,'r’, sys2,'b--')

grid on
Output

Enter the numerator1: [20]

num1 =

20

Enter the denominator1: [0.1 1 0]

den1 =

0.1000 1.0000 0

Enter the numerator 2: [80]

num2 =

80

Enter the denominator2: [1 22 40 0]

den2 =

1 22 40 0

sys1 =

20

0.1 s^2 + s

Continuous-time transfer function.

sys2 =
80

s^3 + 22 s^2 + 40 s

Continuous-time transfer function.

Part D
Input
num=input (‘Enter the numerator:’)

den=input (‘Enter the denotator:’)

sys=tf (num, den)

bode (sys, {0.1 1000})

grid on
Output
Enter the numerator: [20]
num =

20

Enter the denotator: [0.1 1 0]

den =

0.1000 1.0000 0

sys =

20

0.1 s^2 + s

Continuous-time transfer function.


Part E
Input
num=input (‘Enter the numerator:’)

den=input (‘Enter the denotator:’)

sys=tf (num, den)

bode(sys)

[mag, phase, wout] = bode (sys, {0.1 1000})

grid on
Output

Enter the numerator: [20]

num = 20

Enter the denotator: [0.1 1 0]

den =

0.1000 1.0000 0

sys =

20

0.1 s^2 + s

Continuous-time transfer function.


mag(:,:,1) = 16.3343
57.3315
199.9900
mag(:,:,18) =
mag(:,:,10) =
mag(:,:,2) = 13.9363
49.0343
171.0818
mag(:,:,19) =
mag(:,:,11) =
mag(:,:,3) = 11.8791
41.9345
146.3512
mag(:,:,20) =
mag(:,:,12) =
mag(:,:,4) = 10.1125
35.8587
125.1944
mag(:,:,21) =
mag(:,:,13) =
mag(:,:,5) = 8.5939
30.6586
107.0947
mag(:,:,22) =
mag(:,:,14) =
mag(:,:,6) = 7.2867
26.2072
91.6101
mag(:,:,23) =
mag(:,:,15) =
mag(:,:,7) = 6.1598
22.3958
78.3626
mag(:,:,24) =
mag(:,:,16) =
mag(:,:,8) = 5.1868
19.1314
67.0287
mag(:,:,25) =
mag(:,:,17) =
mag(:,:,9) = 4.3456

Page | 54
mag(:,:,34) = 0.0544
mag(:,:,26) =
0.5803
3.6180 mag(:,:,43) =

mag(:,:,35) = 0.0400
mag(:,:,27) =
0.4398
2.9890 mag(:,:,44) =

mag(:,:,36) = 0.0293
mag(:,:,28) =
0.3307
2.4469 mag(:,:,45) =

mag(:,:,37) = 0.0215
mag(:,:,29) =
0.2471
1.9822 mag(:,:,46) =

mag(:,:,38) = 0.0158
mag(:,:,30) =
0.1837
1.5875 mag(:,:,47) =

mag(:,:,39) = 0.0115
mag(:,:,31) =
0.1361
1.2560 mag(:,:,48) =

mag(:,:,40) = 0.0085
mag(:,:,32) =
0.1005
0.9819 mag(:,:,49) =
mag(:,:,41) =
0.0062
mag(:,:,33) = 0.0740

0.7588 mag(:,:,50) =
mag(:,:,42) =

Page | 55
0.0045
phase(:,:,7) =
mag(:,:,59) =
mag(:,:,51) = -91.4615
2.7327e-04
0.0033
phase(:,:,8) =
mag(:,:,60) =
mag(:,:,52) = -91.7083
1.9999e-04
0.0024
phase(:,:,9) =
phase(:,:,1) =
mag(:,:,53) = -91.9967
-90.5729
0.0018
phase(:,:,10) =
phase(:,:,2) =
mag(:,:,54) = -92.3337
-90.6697
0.0013
phase(:,:,11) =
phase(:,:,3) =
mag(:,:,55) = -92.7275
-90.7829
9.5256e-04
phase(:,:,12) =
phase(:,:,4) =
mag(:,:,56) = -93.1874
-90.9151
6.9715e-04
phase(:,:,13) =
phase(:,:,5) =
mag(:,:,57) = -93.7245
-91.0697
5.1022e-04
phase(:,:,14) =
phase(:,:,6) =
mag(:,:,58) = -94.3515
-91.2504
3.7340e-04

Page | 56
phase(:,:,15) = -107.2295

-95.0832 phase(:,:,32) =
phase(:,:,24) =
-141.6477
phase(:,:,16) = -109.9262

-95.9363 phase(:,:,33) =
phase(:,:,25) =
-145.9069
phase(:,:,17) = -112.9652

-96.9302 phase(:,:,34) =
phase(:,:,26) =
-149.9273
phase(:,:,18) = -116.3517

-98.0866 phase(:,:,35) =
phase(:,:,27) =
-153.6483
phase(:,:,19) = -120.0727

-99.4301 phase(:,:,36) =
phase(:,:,28) =
-157.0348
phase(:,:,20) = -124.0931

-100.9872 phase(:,:,37) =
phase(:,:,29) =
phase(:,:,21) = -160.0738
-128.3523
-102.7867
phase(:,:,38) =
phase(:,:,30) =
phase(:,:,22) = -162.7705
-132.7662
-104.8580
phase(:,:,39) =
phase(:,:,31) =
phase(:,:,23) = -165.1420
-137.2338

Page | 57
phase(:,:,48) =
phase(:,:,40) = -178.9303
-176.2755
-167.2133
phase(:,:,57) =
phase(:,:,49) =
phase(:,:,41) = -179.0849
-176.8126
-169.0128
phase(:,:,58) =
phase(:,:,50) =
phase(:,:,42) = -179.2171
-177.2725
-170.5699
phase(:,:,59) =
phase(:,:,51) =
phase(:,:,43) = -179.3303
-177.6663
-171.9134
phase(:,:,60) =
phase(:,:,52) =
phase(:,:,44) = -179.4271
-178.0033
-173.0698 wout =

phase(:,:,53) = 1.0e+03 *
phase(:,:,45) =
-178.2917 0.0001
-174.0637 0.0001
0.0001
phase(:,:,54) = 0.0002
phase(:,:,46) = 0.0002
-178.5385 0.0002
-174.9168 0.0003
0.0003
phase(:,:,55) = 0.0003
phase(:,:,47) = 0.0004
-178.7496 0.0005
-175.6485 0.0006
0.0007
phase(:,:,56) = 0.0008

Page | 58
0.0009 0.0126 0.1796
0.0010 0.0148 0.2099
0.0012 0.0173 0.2454
0.0014 0.0202 0.2868
0.0017 0.0236 0.3353
0.0019 0.0276 0.3919
0.0023 0.0322 0.4582
0.0027 0.0377 0.5356
0.0031 0.0441 0.6261
0.0036 0.0515 0.7318
0.0042 0.0602 0.8555
0.0050 0.0704 1.0000
0.0058 0.0823
0.0068 0.0962
0.0079 0.1124
0.0092 0.1314
0.0108 0.1536

Page | 59
Part F
Input
num=input (‘Enter the numerator:’)

den=input (‘Enter the denotator:’)

sys = tf (num, den)

bode (sys)

[mag, phase, wout] = bode (sys)

grid on

Output
Enter the numerator:

[20]

num =

20

Enter the denotator:

[0.1 1 0]

den =

0.1000 1.0000 0

sys =

Page | 60
20

0.1 s^2 + s

Continuous-time transfer function.

mag(:,:,1) = mag(:,:,5) = mag(:,:,9) =

199.9900 62.5031 33.3821

mag(:,:,2) = mag(:,:,6) = mag(:,:,10) =

99.9800 53.4394 28.5279

mag(:,:,3) = mag(:,:,7) = mag(:,:,11) =

85.4914 45.6868 24.3738

mag(:,:,4) = mag(:,:,8) = mag(:,:,12) =

73.1004 39.0553 20.8178

Page | 61
mag(:,:,13) = 9.3610

mag(:,:,24) =

19.9007

mag(:,:,19) = 3.2980

mag(:,:,14) = 7.9441

mag(:,:,25) =

17.7727

mag(:,:,20) = 2.7116

mag(:,:,15) = 6.7240

mag(:,:,26) =

15.1639

mag(:,:,21) = 2.2076

mag(:,:,16) = 5.6718

mag(:,:,27) =

12.9275

mag(:,:,22) = 1.7775

mag(:,:,17) = 4.7630

mag(:,:,28) =

11.0088

mag(:,:,23) = 1.4142

mag(:,:,18) = 3.9773
mag(:,:,29) =

Page | 62
mag(:,:,40) =

1.1116

mag(:,:,35) = 0.0462

mag(:,:,30) = 0.2121 mag(:,:,41) =

0.8633 0.0339

mag(:,:,36) =

mag(:,:,31) = 0.1573 mag(:,:,42) =

0.6631 0.0249

mag(:,:,37) =

mag(:,:,32) = 0.1162 mag(:,:,43) =

0.5044 0.0199

mag(:,:,38) =

mag(:,:,33) = 0.0856 mag(:,:,44) =

0.3804 0.0182

mag(:,:,39) =

mag(:,:,34) = 0.0630 mag(:,:,45) =

0.2849 0.0133

Page | 63
mag(:,:,51) = -90.5729

mag(:,:,46) = 0.0020

phase(:,:,2) =

0.0098

mag(:,:,52) = -91.1458

mag(:,:,47) = 0.0015

phase(:,:,3) =

0.0071

mag(:,:,53) = -91.3398

mag(:,:,48) = 0.0011

phase(:,:,4) =

0.0052

mag(:,:,54) = -91.5666

mag(:,:,49) = 7.9984e-04

phase(:,:,5) =

0.0038

mag(:,:,55) = -91.8318

mag(:,:,50) = 1.9999e-04

phase(:,:,6) =

0.0028
phase(:,:,1) = -92.1418

Page | 64
phase(:,:,7) = -95.4629

phase(:,:,18) =

-92.5042

phase(:,:,13) = -101.8119

phase(:,:,8) = -95.7106

phase(:,:,19) =

-92.9277

phase(:,:,14) = -103.7421

phase(:,:,9) = -96.3811

phase(:,:,20) =

-93.4225

phase(:,:,15) = -105.9593

phase(:,:,10) = -97.4508

phase(:,:,21) =

-94.0005

phase(:,:,16) = -108.4908

phase(:,:,11) = -98.6949

phase(:,:,22) =

-94.6754

phase(:,:,17) = -111.3587

phase(:,:,12) = -100.1393

Page | 65
phase(:,:,23) = phase(:,:,34) =

-114.5749 phase(:,:,29) = -158.6413

-139.4647

phase(:,:,24) = phase(:,:,35) =

-118.1364 phase(:,:,30) = -161.5092

-143.8228

phase(:,:,25) = phase(:,:,36) =

-122.0198 phase(:,:,31) = -164.0407

phase(:,:,26) = -147.9802

phase(:,:,37) =

-126.1772

phase(:,:,32) = -166.2579

phase(:,:,27) = -151.8636

phase(:,:,38) =

-130.5353

phase(:,:,33) = -168.1881

phase(:,:,28) = -155.4251

phase(:,:,39) =
-135

Page | 66
-169.8607

phase(:,:,45) = -177.8582

phase(:,:,40) = -175.3246

phase(:,:,51) =

-171.3051

phase(:,:,46) = -178.1682

phase(:,:,41) = -175.9995

phase(:,:,52) =

-172.5492

phase(:,:,47) = -178.4334

phase(:,:,42) = -176.5775

phase(:,:,53) =

-173.6189

phase(:,:,48) = -178.6602

phase(:,:,43) = -177.0723

phase(:,:,54) =

-174.2894

phase(:,:,49) = -178.8542

phase(:,:,44) = -177.4958

phase(:,:,55) =

-174.5371
phase(:,:,50) = -179.4271

Page | 67
0.0039 0.2287

0.0046 0.2674

wout = 0.0053 0.3127

0.0063 0.3656

1.0e+03 * 0.0073 0.4276

0.0086 0.5000

0.0001 0.0100 1.00

0.0002 0.0117

0.0002 0.0137

0.0003 0.0160

0.0003 0.0187

0.0004 0.0219

0.0004 0.0256
0.0005 0.0299

0.0006 0.0350

0.0007 0.0409

0.0008 0.0478

0.0010 0.0559

0.0010 0.0654
0.0011 0.0765

0.0013 0.0894

0.0015 0.1000

0.0018 0.1046

0.0021 0.1223
0.0024 0.1430

0.0029 0.1672
0.0033 0.1955

Page | 68
Page | 69
EXPERIMENT 10
Aim: To perform PID controller using MATLAB Simulink.

MATLAB Description: PID Create a pid controller in parallel form.


Construction:

SYS = pid (Kp, Ki, Kd, Tf) creates a continuous-time pid controller

in parallel form with a first-order derivative filter:

Ki Kd*s

Kp + +

s Tf*s+1

The scalars Kp, Ki, Kd, and Tf specify the proportional gain,
integral gain, derivative gain, and filter time constant. The Tf

value must be nonnegative for stability. The default values are

Kp=1, Ki=0, Kd=0, and Tf=0. If a parameter is omitted, its default

value is used. For example, pid(Kp,Ki,Kd) creates a pid controller

with pure derivative term. The resulting SYS is of type pid if

Kp,Ki,Kd,Tf are all real, and of type GENSS if one of the gains

is tunable (see REALP and GENMAT).

SYS = pid(Kp,Ki,Kd,Tf,Ts) creates a discrete-time pid controller

with sample time Ts>0. The discrete-time pid formula is

Kd

Kp + Ki * IF(z) + --------------

Tf + DF(z)

where IF(z) and DF(z) are the discrete integrator formulas for the

integral and derivative terms. Use the "IFormula" and "DFormula"

properties to specify these formulas. Available formulas include:

'ForwardEuler' Ts/(z-1)

Page | 70
'BackwardEuler' Ts*z/(z-1)

'Trapezoidal' (Ts/2)*(z+1)/(z-1)

The default formula is ForwardEuler. The 'IFormula' and 'DFormula'

settings are ignored for continuous-time PIDs. The following

settings are disallowed because they generate unstable PIDs:

(1) (Kd > 0, Tf = 0) and DFormula='Trapezoidal'

(2) (Kd > 0, Tf > 0) and DFormula='ForwardEuler' and Ts>=2*Tf

You can set additional properties by using name/value pairs.

Simulink Diagram:

Page | 71
Output:

Page | 72
ASSIGNMENT – 1
1) Define open loop and close loop control system. Enlist the differences between N
open loop and close loop control system.
2) Discuss block diagram reduction techniques with diagram. A
3) Compare Block diagram reduction and Signal Flow graph. N
4) Obtain the Transfer Function for the given electrical circuit. E

5) Discuss Force-Voltage (F-V) analogous system with analogous quantity. U


6) Reduce the block diagram given as under and obtain the closed loop E
Transfer function (See Fig. 1 & 2)

Fig. 1
E

Fig. 2
7) For a signal flow graph shown in figure, determine transfer function using E
Mason’s Gain Formula.

8) Discuss Force-Current (F-I) analogous system with analogous quantity. U

Page | 73
ASSIGNMENT – 2
1) Derive the expression for unit step response of under damped second order N
system.
2) Derive an expression for the rise time for a 2nd order control system subjected to N
a unit step input.
3) Define the term i) Rise time ii) Peak time iii) Settling time iv) Peak Overshoot N
4) Define sensitivity and justify that closed loop control system is better than open A
loop control system in the context of sensitivity.
5) Derive the equation of steady state error for closed loop transfer function. A
6) A unity feedback control system is characterized by the open loop transfer E
function G(s) =1/[s(s+1)]. Determine the steady state errors for unit step, unit
ramp and unit acceleration input.
7) Determine type of system and error coefficients for unity feedback system E
having following open loop transfer function.

8) Determine the stability of a system having following characteristic equation: E


s6 + s5 + 5s4 + 3s3 + 2s2 - 4s -8 = 0.
9) Explain effect of adding a pole at origin. R

ASSIGNMENT – 3
1) Define Routh’s criteria. State advantages and limitations of Routh’s criteria. N
2) Construct Routh’s array and determine the stability of the system whose E
characteristic equation is s6+2s5+8s4+12s3+20s2+16s+16=0
3) Enlist the rules for the construction of root locus. R
4) Draw the root locus for the given open loop transfer function E
G(s) = K/[s(s+1)].
5) Explain Nyquist criterion for the stability in brief. R
6) Construct bode plot for the system whose open loop transfer function is given E
by: G(s)H(s)= 100s/s+2. Comment on stability for the given system.
7) Write a brief note on correlation between transient response and frequency U
response.
8) Draw the polar plot for the system whose open loop transfer function is 10/s+10. E
9) List advantages of state variable analysis. U

Page | 74

You might also like