0% found this document useful (0 votes)
15 views

SSLEXP4

The document describes how to analyze the stability of a system using Bode plots and root locus plots in MATLAB. It explains the theory behind Bode plots, gain margin, phase margin and root locus plots. It then provides the MATLAB code to generate Bode plots and root locus plots for multiple transfer functions and analyze the stability parameters.

Uploaded by

Amit Maurya
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)
15 views

SSLEXP4

The document describes how to analyze the stability of a system using Bode plots and root locus plots in MATLAB. It explains the theory behind Bode plots, gain margin, phase margin and root locus plots. It then provides the MATLAB code to generate Bode plots and root locus plots for multiple transfer functions and analyze the stability parameters.

Uploaded by

Amit Maurya
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/ 9

EleDepartment of Electronics and Telecommunication Engineering g

Semester S.E. Semester IV – EXTC Engineering


Subject Software Simulation Laboratory
Subject Professor In- Prof. Vibha Wali
charge
Assisting Teachers Prof. Anuja Gote
Laboratory M414 Digital Electronics Laboratory

Student Name
Roll Number
Grade and Subject
Teacher’s Signature

Experiment Number Experiment no. 4


Experiment Title To study the system’s stability with its transfer function using:
1. Bode plot
2. Root locus
Resources / Apparatus Hardware: Software:
Required IBM PC Compatible Computer MATLAB r2011, MATLAB
System Activator, MATLAB Deactivator.

Objectives Knowledge of MATLAB software and its instruction set.


(Skill Set / Knowledge Skills to develop and design Logic needed to solve Problem.
Tested / Imparted) Skills of Simulating analogous elements and its representative
analysis.

Theory : Basics of Bode Plot

Bode plot is the representation of the magnitude and phase of G(j*w) (where the frequency
vector w contains only positive frequencies). To see the Bode plot of a transfer function, you
can use the Matlab bode command. For example,
bode(50,[1 9 30 40])
displays the Bode plots for the transfer function:

50 / (s^3 + 9 s^2 + 30 s + 40)

P age |1
Gain and Phase Margin
Let's say that we have the following system:

Where K is a variable (constant) gain and G(s) is the plant under consideration.

The gain margin is defined as the change in open loop gain required to make the system
unstable. Systems with greater gain margins can withstand greater changes in system
parameters before becoming unstable in closed loop. Keep in mind that unity gain in
magnitude is equal to a gain of zero in dB.

The phase margin is defined as the change in open loop phase shift required for making a
closed loop system unstable.

The phase margin is the difference in phase between the phase curve and -180 deg at the
point corresponding to the frequency that gives us a gain of 0dB (the gain cross over
frequency, Wgc).

P age |2
Likewise, the gain margin is the difference between the magnitude curve and 0dB at the point
corresponding to the frequency that gives us a phase of -180 deg (the phase cross over
frequency, Wpc).

We can find the gain and phase margins for a system directly, by using Matlab. Just enter the
margin command. This command returns the gain and phase margins, the gain and phase
cross over frequencies, and a graphical representation of these on the Bode plot. Let's check
it out: margin(50,[1 9 30 40])

P age |3
Basics of Root Locus
Root locus plot of dynamic system

Syntax
rlocus(sys)
rlocus(sys1,sys2,...)
[r,k] = rlocus(sys)
r = rlocus(sys,k)
Description
Rlocus computes the root locus of a SISO open-loop model. The root locus gives the closed-
loop pole trajectories as a function of the feedback gain k (assuming negative feedback).
Root loci are used to study the effects of varying feedback gains on closed-loop pole
locations. In turn, these locations provide indirect information on the time and frequency
responses.
rlocus (sys) calculates and plots the root locus of the open-loop SISO model sys. This
function can be applied to any of the following negative feedback loops by
setting sys appropriately.

If sys has transfer function


h(s)=
n(s)d(s)
the closed-loop poles are the roots of
d(s)+kn(s)=0 rlocus adaptively selects a set of positive gains k to produce a smooth plot.
Alternatively,
rlocus(sys,k) uses the user-specified vector k of gains to plot the root locus.

P age |4
rlocus(sys1,sys2,...) draws the root loci of multiple LTI models sys1, sys2,... on a single plot.
You can specify a color, line style, and marker for each model, as in

rlocus(sys1,'r',sys2,'y:',sys3,'gx').
[r,k] = rlocus(sys) and r = rlocus(sys,k) return the vector k of selected gains and the complex
root locations r for these gains. The matrix r has length(k) columns and its jth column lists
the closed-loop roots for the gain k(j).

Examples
Root Locus Plot of Dynamic System
Plot the root-locus of the following system.

h = tf([2 5 1],[1 2 3]);


rlocus(h)

You can use the right-click menu for rlocus to add grid lines, zoom in or out, and invoke the
Property Editor to customize the plot. Also, click anywhere on the curve to activate a data
marker that displays the gain value, pole, damping, overshoot, and frequency at the selected
point.

ALGORITHM:

1. Declare the variable‘s’ as the s domain function variable.


2. Declare all the transfer function whose bode plot is to be obtained.
3. Now declare the position of bode plot for respective transfer function using subplot.
4. Finally declare ‘bode’ or ‘root locus’ to plot the response and ‘margin’ to calculate its

P age |5
parameters.

FLOWCHART:

CODE: BODE PLOT CODE: ROOT LOCUS PLOT

clc; clc;
clear all; clear all;
close all; close all;
s=tf('s'); …declaration of function variable s=tf('s'); …declaration of function
variable
h= tf ([100 300],[1 6 5]);
g= tf ([10],[0.04 0.5 1 0]); h= tf ([100 300],[1 6 5]);
i= tf ([30],[0.4505 1.38 1 0]); T.F.’s g= tf ([10],[0.04 0.5 1 0]);
j= tf ([2],[0.2 1.2 1 0]); i= tf ([30],[0.4505 1.38 1 0]); T.F.’s
j= tf ([2],[0.2 1.2 1 0]);
subplot(2,2,1)
bode(h); bode plot for T.F. 1 subplot(2,2,1) Root Locus of T.F. 1
margin(h) rlocus(tf1);
grid on
subplot(2,2,2) Root Locus of T.F. 2
subplot(2,2,2) rlocus(tf2);
bode(tf2) bode plot for T.F. 2
margin(tf2) subplot(2,2,3) Root Locus of T.F. 3
grid on rlocus(tf3);

subplot(2,2,3) subplot(2,2,4) Root Locus of T.F. 4


bode(tf3) bode plot for T.F. 3 rlocus(tf4);
margin(tf3)
grid on

subplot(2,2,4)
bode(tf4) bode plot for T.F. 4

P age |6
margin(tf4)
grid on

RESULTS: BODE PLOT

ROOT LOCUS

P age |7
CONCLUSION:

P age |8
P age |9

You might also like