Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Control System Lab Manual V 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 173

Control Systems

Lab Manual
(Based on OBE System)

(Version 1.0: Spring 2019)

Prepared by:
Engr. M.Farhan
(Lecturer, UET Campus Kohat)

1
List of Experiment
Lab - 1: Modeling – Transfer Function...................................................................................................... 06
Exercises
Assessment Sheet
Lab - 2: Transfer Function block in Simulink.......................................................................................... 21
Exercises
Assessment Sheet
Lab - 3: The Representation of a State Space Expression in MATLAB............................................. 43
Exercises
Assessment Sheet
Lab - 4: Transient Response Analysis with MATLAB............................................................................. 57
Exercises
Assessment Sheet
Lab - 5: System Stability Analysis using MATLAB.................................................................................. 77
Exercises
Assessment Sheet
Lab - 6: Steady State Analysis with MATLAB ........................................................................................... 85
Exercises
Assessment Sheet
Lab - 7: Time Response Characteristics and LTI Viewer...................................................................... 98
Exercises
Assessment Sheet
Lab - 8: Plotting Root Loci with MATLAB................................................................................................ 108
Exercises
Assessment Sheet
Lab - 9: Root Locus Design and SISO Design Tools.............................................................................. 117
Exercises
Assessment Sheet
Lab - 10: Stability Analysis on Bode / Nyquist Plots.......................................................................... 147
Exercises
Assessment Sheet
Lab - 11: To study DC Servo trainer and its uses...................................................................................160
Exercises
Assessment Sheet
Lab - 12: Testing the Motor direction in easy motion studio............................................................164
Exercises
Assessment Sheet
Lab - 13: Testing the voltage applied and current control in EMS.................................................167
Exercises
Assessment Sheet
Lab - 14: Open Ended Lab.............................................................................................................................170
Exercises
Assessment Sheet

2
Instructions for Students
1. Attendance is mandatory for students in all the labs. If a student is absent
from a lab due to any reason, he/she will have to get written permission of
the Chairman to perform that lab. The Chairman may allow students to
perform lab if he finds that the student has a genuine excuse.
2. Students should bring their text books to the lab, so that they can refer to
theory and diagrams whenever required.
3. Labs will be graded in double entry fashion; one entry in the assessment
sheet given at the end of every lab and another entry in the instructor’s
record. This system of keeping records will keep students aware of their
performance throughout the lab.
4. The tentative marks distribution for final grade is as follows:

 Lab Performance – 30 %
 Mid (Practical + Simulation) – 20%
 Lab Project– 20%
 Lab Final (Practical + Simulation) – 30 %

3
Control System
Course learning Outcomes:
Upon successful completion of the course Lab, the student will be able to:

S. No CLO Domain Taxonomy PLO


level
1. Practice basic knowledge to Psychomotor 3 1
mathematically Model the
behavior of different physical
systems
2. Analyze the behavior of system Psychomotor 4 2
using mathematical techniques
3. Design controllers to meet the Psychomotor 5 3
specified control design
objectives such as faster
transient response and smaller
steady state errors while
ensuring system stability.
4. Use Modern Tools for system Psychomotor 5 5
modeling, analysis, design
validation and performance
comparison of different types of
controllers.

4
Lab No. _____________

The Rubric assessment sheet at the end of every lab looks like this: Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge of physical systems behavior of Model the
knowledge to Model but have no physical systems behavior of
the behavior of supporting materials in bit and pieces physical systems
physical systems with with no
supporting materials supporting
(mathematically , material
block diagram,
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

5
Lab – 1: Modeling – Transfer Function
1.1 Introduction
MATLAB provide “Control System Toolbox” for the analysis and design of different
control system. We will be using some of thes commands, because of limited
nature of course profile. Description of these commands will be distributed in
different modules. In this section, we will present commands related to Transfer
Functions. To see all the commands in the control system toolbox and their
functionalities, type help control in the MATLAB window.
>> help control

Control System Toolbox

Version 9.9 (R2015a) 09-Feb-2015

General.
ctrlpref - Set Control System Toolbox preferences.
InputOutputModel - Overview of input/output model objects.
DynamicSystem - Overview of dynamic system objects.
lti - Overview of linear time-invariant system
objects.

Graphical User Interfaces.


ltiview - LTI Viewer(time and frequency response analysis).
sisotool - SISO Design Tool(interactive compensator tuning).
pidtool - PID Design Tool(interactive PID controller
tuning).
sisoinit - Configure the SISO Design Tool at startup.

Linear models.
tf - Create transfer function (TF) models.
zpk - Create zero/pole/gain (ZPK) models.
ss - Create state-space (SS) models.
dss - Create descriptor state-space models.
delayss - Create state-space models with delayed terms.
frd - Create frequency response data (FRD) models.
pid - Create PID controller in parallel form.
pidstd - Create PID controller in standard form.
tf/exp - Create pure continuous-time delays(TF and ZPK )
filt - Specify digital filters.
InputOutputModel/set - Set/modify properties of model object.
setDelayModel - Specify internal delay model (state space only).

6
Data extraction.
tfdata - Extract numerators and denominators.
zpkdata - Extract zero/pole/gain data.
ssdata - Extract state-space matrices.
dssdata - Descriptor version of SSDATA.
frdata - Extract frequency response data.
piddata - Extract PID parameters in parallel form.
pidstddata - Extract PID parameters in standard form.
InputOutputModel/get - Access properties of model object.
ss/getDelayModel - Access internal delay model (state space only).

Model conversion.
tf - Conversion to transfer function.
zpk - Conversion to zero/pole/gain.
ss - Conversion to state space.
frd - Conversion to frequency data.
pid - Conversion to PID controller in parallel form.
pidstd - Conversion to PID controller in standard form.
c2d - Continuous to discrete conversion.
d2c - Discrete to continuous conversion.
d2d - Resample discrete-time model.
upsample - Upsample discrete-time systems.
chgTimeUnit - Change time units.
imp2exp - Implicit to explicit conversion.

System interconnection.
append - Aggregate models by appending inputs and outputs.
parallel - Connect models in parallel (see overloaded +).
series - Connect models in series (see also overloaded *).
feedback - connect models with a feedback loop.
lft - Generalized feedback interconnection.
connect - Arbitrary block-diagram interconnection.
sumblk - Specify summing junction (for use with connect).
strseq - Builds sequence of indexed strings (for I/O
naming).

System dynamics.
dcgain - Steady-state (D.C.) gain.
pole - System poles.
zero - Zeros and gain of SISO system.
tzero - Invariant zeros of MIMO system.
order - System order (number of states).
pzmap - Pole-zero map.
iopzmap - Input/output pole-zero map.
damp - Natural frequency and damping of system poles.
esort - Sort continuous poles by real part.
dsort - Sort discrete poles by magnitude.
stabsep - Stable/unstable decomposition.
freqsep - Slow/fast decomposition.
modsep - Region-based modal decomposition.

Time-domain analysis.

7
step - Step response.
stepinfo - Step response characteristics (rise time, ...)
impulse - Impulse response.
initial - Free response with initial conditions.
lsim - Response to user-defined input signal.
lsiminfo - Linear response characteristics.
gensig - Generate input signal for LSIM.
covar - Covariance of response to white noise.

Frequency-domain analysis.
bode - Bode diagrams of the frequency response.
bodemag - Bode magnitude diagram only.
sigma - Singular value frequency plot.
nyquist - Nyquist plot.
nichols - Nichols plot.
freqresp - Frequency response over a frequency grid.
evalfr - Evaluate frequency response at given frequency.
margin - Gain and phase margins.
allmargin - All crossover frequencies and related gain/phase
margins.
bandwidth - System bandwidth.
getPeakGain - Peak gain of frequency response.
getGainCrossover - Gain crossover frequencies.
DynamicSystem/norm - H2 and Hinfinity norms of LTI models.

Model simplification.
minreal - Minimal realization and pole/zero cancellation.
sminreal - Structurally minimal realization (state space).
hsvd - Hankel singular values (state contributions)
balred - Reduced-order approximations of linear models.
modred - Model order reduction.

Compensator design.
pidtune - Tune PID controller based on linear plant model.
rlocus - Evans root locus.
place - Pole placement.
estim - Form estimator given estimator gain.
reg - Form regulator given state-feedback and estimator
gains.
ss/lqg - Single-step LQG design.
lqr, dlqr - Linear-Quadratic (LQ) state-feedback regulator.
lqry - LQ regulator with output weighting.
lqrd - Discrete LQ regulator for continuous plant.
lqi - Linear-Quadratic-Integral (LQI) controller.
kalman - Kalman state estimator.
kalmd - Discrete Kalman estimator for continuous plant.
lqgreg - Build LQG regulator from LQ gain and Kalman
estimator.
lqgtrack - Build LQG servo-controller.
augstate - Augment output by appending states.

Time delays.

8
hasdelay - True for models with time delays.
totaldelay - Total delay between each input/output pair.
absorbDelay - Replace delays by poles at z=0 or phase shift.
pade - Pade approximation of continuous-time delays.
thiran - Thiran approximation of fractional discrete-time
delays.

State-space (SS) models.


rss - Random stable continuous-time state-space models.
drss - Random stable discrete-time state-space models.
ss2ss - State coordinate transformation.
canon - Canonical forms of state-space models.
ctrb - Controllability matrix.
obsv - Observability matrix.
gram - Controllability and observability gramians.
prescale - Optimal scaling of state-space models.
balreal - Gramian-based input/output balancing.
xperm - Reorder states.

Frequency response data (FRD) models.


chgFreqUnit - Change frequency vector units.
fcat - Merge frequency responses.
fselect - Select frequency range or subgrid.
fnorm - Peak gain as a function of frequency.
frd/abs - Entrywise magnitude of the frequency response.
frd/real - Real part of the frequency response.
frd/imag - Imaginary part of the frequency response.
frd/interp - Interpolate frequency response data.
mag2db - Convert magnitude to decibels (dB).
db2mag - Convert decibels (dB) to magnitude.

Generalized linear models.


realp - Tunable real parameter.
ltiblock.gain - Tunable static gain.
ltiblock.pid - Tunable 1-DOF PID controller.
ltiblock.pid2 - Tunable 2-DOF PID controller.
ltiblock.tf - Tunable SISO transfer function.
ltiblock.ss - Tunable state-space model.
AnalysisPoint - Point of interest for analysis and tuning.
genmat - Generalized matrix.
genss - Generalized state-space model.
genfrd - Generalized FRD model.
getValue - Evaluate generalized model.
getBlockValue - Get block value.
setBlockValue - Update block value.
showBlockValue - Display block values.
showTunable - Display values of tunable blocks.
getPoints - Get analysis point locations.
getLoopTransfer - Compute open-loop transfer function.
getIOTransfer - Compute closed-loop transfer function.
getSensitivity - Compute loop sensitivity function.
getCompSensitivity - Compute complementary sensitivity function.

9
replaceBlock - Replace block by value or by another block.

Model characteristics and model arrays.


isct - True for continuous-time models.
isdt - True for discrete-time models.
isproper - True for proper models.
issiso - True for single-input/single-output models.
isstable - True for models with stable dynamics.
InputOutputModel/size - Size of model or model array.
InputOutputModel/ndims - Number of dimensions.
InputOutputModel/nmodels - Number of models in model array.
InputOutputModel/isempty - True for empty models.
InputOutputModel/reshape - Reshape model array.
InputOutputModel/permute - Permute model array dimensions.

Overloaded arithmetic operations.


+, - - Add and subtract systems (parallel connection).
* - Multiply systems (series connection).
/ - Left divide -- sys1\sys2 means inv(sys1)*sys2.
/ - Right divide -- sys1/sys2 means sys1*inv(sys2).
^ - Powers of a given system.
' - Pertransposition.
.' - Transposition of input/output map.
.* - Element-by-element multiplication.
[..] - Concatenate models along inputs or outputs.
stack - Stack models/arrays along some array dimension.
InputOutputModel/inv - Inverse of input/output model.
InputOutputModel/conj - Complex conjugation of model coefficients.

Matrix equation solvers and linear algebra.


lyap, dlyap - Solve Lyapunov equations.
lyapchol, dlyapchol - Square-root Lyapunov solvers.
care, dare - Solve algebraic Riccati equations.
gcare, gdare - Generalized Riccati solvers.
bdschur - Block diagonalization of a square matrix.

Visualization and plot manipulation.


Type "help ctrlguis" for details on how to customize plots.

Demonstrations.
Type "demo toolbox control" for a list of available demos.

1.2 Model Development for Control System in MATLAB


In this module, we will learn how to represent transfer functions in the MATLAB,
partial fraction expansion of rational expressions, representation of transfer
functions as LTI objects, and to obtain time domain responses of LTI systems.
Important commands for this module are:

10
roots – Find polynomial roots
poly – Convert roots to polynomial
polyval – Evaluate polynomial value
conv – Convolution and polynomial multiplication
deconv – Deconvolution and polynomial division
residue – Partial-fraction expansion (residues)
tf – Creation of transfer functions or conversion to transfer functions
pole – Compute the poles of LTI models
zero – Transmission zeros of LTI systems
tfdada – Quick access to transfer function data
zpkdata – Quick access to zero-pole-gain data
pzmap – Pole-zero map of LTI models
zpk – Create zero-pole-gain models or convert to zero-pole-gain format
step – Step response of LTI models
impulse – Impulse response of LTI models
lsim – Simulate time response of LTI models to arbitrary inputs
gensig – Periodic signal generator for time response simulations with lsim

1.3 Polynomials
3 2
Consider a polynomial . MATLAB can interpret a vector of
length as the coefficients of an th -order polynomial. Coefficients of the
polynomial are interpreted in descending powers. Thus, if the polynomial is
missing any coefficient, we must enter zeros in the appropriate places in the
vector. For example, polynomial can be represented by the vector in
MATLAB. For example:

>> p=[1 3 0 4]
p =
1 3 0 4

Roots of the polynomial can be obtained by roots command.


>> r=roots(p)

r =
-3.3553
0.1777 + 1.0773i
0.1777 - 1.0773i

11
Given roots of a polynomial in a vector, a vector of polynomial coefficients can be
obtained by the command poly.

Use the command polyval(p, s) to evaluate the polynomial represented by


vector p at arbitrary value of s. For example, to evaluate the polynomial
s3 2
at √ type

>> polyval(p,sqrt(2))

The product of two polynomials is found by taking the convolution of their


coefficients. The function conv will do this for us. Consider an example of
multiplying polynomial ‘ ' with ‘ :

>> p1=[1 3 4];

>> p2=[1 2];

>> p3=conv(p1,p2)

p3 =

1 5 6 4 8

The function deconv divides two polynomials and returns quotient as well as the
remainder polynomial.
>> [q,r]=deconv(p1,p2)

q =

1 1

r =

0 0 2

where q is the quotient and r is the remainder polynomial.

12
Consider the rational fractions of the form:

Where the coefficients and are real constants, and and are integers.
A fraction of the form can be expanded into partial fractions. To do this, first
of all we factorize the denominator polynomial into first-order factors.
The roots of can be real or complex; distinct or repeated.

Let, vectors N and D specify the coefficients of numerator and denominator


polynomials and respectively.

The command [A,p,K]=residue(N,D) returns residues in column vector A, the


roots of the denominator in column vector p, and the direct term in scalar K. If

there are no multiple roots, the fraction can be represented as:

If , K is empty (zero).

Supplying 3 arguments A, p, and K to residue convert the partial fraction


expansion back to the polynomial with coefficients in N and D.

Example 1:

Consider the rational fraction:

MATLAB solution to partial fraction problem can be given by:

>> N=[10 40];


>> D=[1 4 3 0];
>> [A,p,K]=residue(N,D)

13
A =
1.6667
-15.0000
13.3333
p =
-3
-1
0
K =
[ ]

Example 2:

Consider the function

The following MATLAB session evaluates the residues.

>> N = 13;
>> D = [1 6 22 30 13 0];
>> [A,p,K]=residue(N,D)
A =
0.0200 - 0.0567i
0.0200 + 0.0567i
-1.0400
-1.3000
1.0000
p =
-2.0000 + 3.0000i
-2.0000 - 3.0000i
-1.0000
-1.0000
0
K =
[ ]

1.4 Transfer Functions


Transfer functions can be represented in MATLAB as LTI (Linear Time Invariant)
objects using numerator and denominator polynomials.
14
Example 3: Consider the transfer function given by It can be
represented in MATLAB as:

>> num = [1 1];


>> den = [1 3 1];
>> G = tf(num,den)
Transfer function:
s + 1
----------------
s^2 + 3 s + 1

Transfer functions can also be entered directly in polynomial form as we enter


them in the notebook using LTI objects.

Example 4: For example, observe the following MATLAB session.


>> s=tf('s') % Define 's' as an LTI object in polynomial form
Transfer function:
>> G1=150*(s^2+2*s+7)/[s*(s^2+5*s+4)] % Form G1(s) as an LTI
transfer function in polynomial form.

Transfer function:
150 s^2 + 300 s + 1050
----------------------------
s^3 + 5 s^2 + 4s

>> G2=20*(s+2)*(s+4)/[(s+7)*(s+8)*(s+9)] % Form G2(s) as an LTI


transfer function in polynomial form.

Transfer function:
20 s^2 +120 s + 160
------------------------------------
s^3 + 24 s^2 + 191s + 504

The command poly([-1 -2 -4]) creates a polynomial with roots at -1,-2 and -4 and
hence (s+1)(s+2)(s+4)=s^3+7s^2+14s+8

Example 5:
G= tf (2,poly([-1 -2 -4]))

G =

15
2
----------------------
s^3 + 7 s^2 + 14 s + 8

The commands pole and zero calculate the poles and zeros of LTI models.
>> pole(G1)
ans =
0
-4
-1
>> zero(G1)
ans =
-1.0000 + 2.4495i
-1.0000 - 2.4495i

To extract numerator and denominator polynomials, use the function tfdata .

For a single SISO model SYS, the syntax

>> [num,den]=tfdata(G,'v')
num =
0 1 1
den =
1 3 1

To extract zeros and poles of transfer function simultaneously, use the


function zpkdata.

>> [z,p]=zpkdata(G,'v')
z =
-1
p =
-2.6180
-0.3820

If we know zeros and poles of the system with gain constant, the transfer function
of LTI system can be constructed by zpk command. For example, to create a unity
gain transfer function G3(s) with zero at -1 and two poles at -2.618 and -0.382,
follow the MATLAB session given below.
>> G3=zpk(-1,[-2.618 -0.382],1)

Zero/pole/gain:

16
(s+1)
---------------------------
(s+2.618)(s+0.382)

To observe the polynomial form of the transfer function , enter


>> tf(G3)

Transfer function:

s+1
---------------------
s^2 + 3s +1

The function pzmap(G3) plots the poles and zeros of the transfer function G(s) on
complex plane. When used with two left hand side arguments, [p,z] = pzmap(G),
the function returns the poles and zeros of the system in two column
vectors p and z. For example:

>> [p,z]=pzmap(G3)
p =
-2.6180
-0.3820
z =
-1

Solving ODE:
This note will consider only ODEs with constant coefficients and also only
demonstrates 1st and 2nd order. This is best illustrated by a number of examples.

Example 6:

xt=dsolve('4*Dy+3*y=1','y(0)=3')

Example 7:

17
, ̇

xt2=dsolve('2*D2y+6*Dy+4*y=sin(t)','y(0)=1','Dy(0)=0')

Lab Task 1:

Create a transfer function object in MATLAB of system:

Lab Task 2:

Consider the rational fraction: Identify the poles and zero of system.

Comment on unit step response.

Lab Task 3:

Solve below differential equation using MATLAB

, ̇

18
Assessment Sheet

Name:___________________________

Regd. No._________________________

Date of Lab:_________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

19
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge to Model of physical systems behavior of Model the
the behavior of but have no physical systems behavior of
physical systems with supporting materials in bit and pieces physical systems
supporting materials with no
(mathematically , supporting
block diagram, material
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

20
Lab – 02: Transfer Function block in Simulink
1 Introduction:
The MATLAB Control System Toolbox offers functions for finding the transfer
functions from a given block diagram. However, as we shall shortly see, the
simulation environment provided by MATLAB’s Simulink Toolkit obviates the need
for block diagram reduction. The Simulink model mimics the block diagram of a
feedback control system and is used to evaluate the response of controlled
variable to any test input. It also provides the response of any internal variable of
the control system (output variable of a subsystem block) without the need for
block diagram reduction.

Let us reiterate the fact we have emphasized earlier: a good plant/process model
is the backbone of any realistic control design. A Simulink model based on the
structure and parameters of the system model is constructed. The responses of
the actual system and its Simulink model are obtained using a set of test inputs. If
the actual responses to the test inputs were significantly different from the
Simulink responses, certain model parameters would have to be revised, and/or
the model structure would have to be refined to better reflect the actual system
behavior. Once satisfactory model performance has been achieved, various
control schemes can be designed and implemented.

In practice, it is best to test a control scheme off-line by evaluating the system


performance in the “safety” of the Simulink environment. The key components of
a control system include actuators, sensors, and the plant/process itself. A
decision to include all aspects such as amplifier saturation, friction in the motor,
backlash in gears, dynamics of all the devices, etc., may improve the model, but
the complexity of the model may result in a more complicated controller design,
which will ultimately increase the cost and sophistication of the system. The
design is usually carried out using an approximated model; the evaluation of the
design is done on the “true” model, which includes nonlinearities, and other

21
aspects neglected in the approximate model. Simulink is an excellent tool for this
evaluation.

SIMULINK (SIMUlation LINK) is an extension of MATLAB for modeling, simulating,


and analyzing dynamic, linear/nonlinear, complex control systems. Graphical User
Interface (GUI) and visual representation of simulation process by simulation
block diagrams are two key features which make SIMULINK one of the most
successful software packages, particularly suitable for control system design and
analysis.

Simulation block diagrams are nothing but the same block diagrams we are using
to describe control system structures and signal flow graphs. SIMULINK offers a
large variety of ready-touse building blocks to build the mathematical models and
system structures in terms of block diagrams. Block parameters should be
supplied by the user. Once the system structure is defined, some additional
simulation parameters must also be set to govern how the numerical
computation will be carried out and how the output data will be displayed.

Because SIMULINK is graphical and interactive, we encourage you to jump right in


and try it. To help you start using SIMULINK quickly, we describe here the
simulation process through a demonstration example with MATLAB version 7.0,
SIMULINK version 6.0.

To start SIMULINK, enter Simulink command at the MATLAB prompt. Alternatively


one can also click on SIMULINK icon shown in Fig. 6.1.

22
Figure 1 MATLAB Desktop main menu and SIMULINK icon

A SIMULINK Library Browser (Figure 2) appears which displays tree-structured


view of the SIMULINK block libraries. It contains several nodes; each of these
nodes represents a library of subsystem blocks that is used to construct
simulation block diagrams. You can expand/collapse the tree by clicking on the +/-
boxes beside each node and block in the block set pan.

23
Figure 2 SIMULINK Library Browser

Expand the node labeled Simulink. Sub nodes of this node (Commonly Used
Blocks, Continuous, Discontinuities, Discrete, Logic and Bit Operations, etc) are
displayed. Now for example, expanding the Sources sub node displays a long list
of Sources library blocks. Simply click on any block to learn about its functionality
in the description box (see Fig .3a).

(a)Blocks in Sources sub node (b)Blocks in Sinks sub node


Figure 3: Simulink Library Blocks

You may now collapse the Sources sub node, and expand the Sinks sub node. A
list of Sinks library block appears (Fig.6.3b). Learn the purpose of various blocks in
Sinks sub node by clicking on the blocks.

We have described some of the subsystem libraries available that contain the
basic building blocks of simulation diagrams. The reader is encouraged to explore

24
the other libraries as well. You can also customize and create your own blocks. For
information on creating your own blocks, see the MATLAB documentation on
‘Writing S- Functions’.

We are now ready to proceed to the next step, which is the construction of a
simulation diagram. In the SIMULINK library browser, follow File  New  Model
or press Ctrl+N to open an ‘untitled' workspace (Fig. 4) to build up an
interconnection of SIMULINK blocks from the subsystem libraries.

Figure 4 Untitled workspace

25
Example 1 Let us take a simple example. The block diagram of a dc motor
(armature-controlled) system is shown in Fig. 5

Figure 5 Block diagram of a dc motor (armature-controlled) system

where

is the resistance of the motor armature (ohms) = 1.75


is the inductance of the motor armature (H) =
is the torque constant (Nm/A) = 0.0924
is the back emf constant (V sec/rad) = 0.0924
is the inertia seen by the motor (includes inertia of the load) (kg-m2 )
=
is the mechanical damping coefficient associated with rotation
(Nm/(rad/sec))= 5.0
is the applied voltage (volts) = 5 volts

We will implement the model shown in Fig. 5 in the untitled work space (Fig. 4).
Let us first identify the SIMULINK blocks required to implement the block diagram
of Fig. 5. This is given in Fig. 6.

Figure 6 SIMULINK blocks required for implementation

26
Identifying the block(s) required for simulation purpose is in fact the first step of
the construction of simulation diagram in SIMULINK. The next step is to ‘drag and
drop ‘the required blocks from SIMULINK block libraries to untitled workspace.
Let us put the very first block for applied voltage (Ea) to workspace.

Expand the Sources sub node, move the pointer and click the block labeled
Constant, and while keeping the mouse button pressed down, drag the block and
drop it inside the Simulation Window; then release the mouse button (Fig. 6.7).
Right clicking on the block will provide various options to users from which one
can cut, copy, delete, format (submenu provides facilities for rotation of the
block, flipping, changing the font of block name,...), etc...

Figure 7 Drag and drop blocks to Workspace from Library Browser

27
Figure 8 Unconnected blocks in Workspace

It is visible that all the block parameters are in their default settings. For example,
the default transfer function of Transfer Fcn block is ⁄ and default signs
of Sum block are + +. We need to configure these block parameters to meet our
modeling requirements. It is straightforward. Double click the block to set up its
parameters. For example, double clicking the Transfer Fcn block opens the
window titled Block Parameters: Transfer Fcn, shown in Fig. 8.

For armature circuit transfer function, no need to change the numerator


parameter. For denominator parameters, enter [ ] for [ ],
which will be interpreted by SIMULINK as . To enhance the interpretability of
simulation diagram, we can also change the block identification name. Simply
click on the text Transfer Fcn to activate the small window around the text to
change the block name. For our simulation block diagram, the suitable text for
Transfer Fcn block may be Armature circuit.

Note that the Decimation parameter value by default is 1. Increasing this value
reduces the number of data samples taken over the simulation time. We have
used the default value of 1.

28
Figure 9 Transfer function block parameters window

Lines are drawn to interconnect these blocks as per the desired structure. A line
can connect output port of one block to the input port of another block. A line can
also connect the output port of one block with input ports of many blocks by
using branch lines. We suggest readers to perform the following line/block
operations on blocks dragged in workspace to get hands on practice. To connect
the output port of one block to the input port of another block:

1. Position the pointer on the first block's output port; note that the cursor
shape changes to cross hair.
2. Press and hold down the left mouse button.
3. Drag the pointer to second block's input port.
4. Position the pointer on or near the port; the pointer changes to a double
cross hair.
5. Release the mouse button. SIMULINK replaces the port symbol by a
connecting line with an arrow showing the direction of signal flow.

29
Another simple methodology doesn't require dragging the line. Block1 output
port is required to be connected to Block2 input port.

Figure 10: Finished block diagram

To connect the output port of one block with the input ports of several blocks,
we can use branch lines. Both the existing line and the branch line carry the
same signal. To add a branch line, do the following:

1. Position the pointer on the line where you want the branch line to start.
2. While holding down the Ctrl key, left click on the line segment; note that
the cursor shape changes to cross hair.
3. Release the control key, while pressing down the left mouse button; drag
the pointer to the input port of the target block.
4. Release the mouse button; target block will be connected to the line
segment.

30
Some of the important line-segment and block operations are as follows:

1. To move a line segment, position the pointer on the segment you want to
move. Press and hold down the left mouse button. Drag the pointer to the
desired location and release. Note that this operation is valid with line
segments only, not with the dedicated connecting lines between two
blocks.
2. To disconnect a block from its connecting lines, hold down the shift key,
then drag the block to a new location. Incoming and outgoing lines will be
converted to red colored dotted lines. One can insert a different block
between these lines.

Now let us give a name to the untitled workspace. Hit Ctrl + S to save the
developed simulation diagram to the disk with an appropriate name. The file will
be saved with the extension .mdl , an abbreviation for the ‘model'.

Finally, we need to set the parameters for the simulation run. Press Ctrl + E to
open the simulation parameter configuration window. Left panel of the window
displays a tree structured view of parameter submenu. In the Solver submenu,
enter the start and stop time of the simulation (Fig. 11).

Figure 11 Enter simulation time

31
Now we are ready to simulate our block diagram of armature-controlled dc
motor. Press icon to start the simulation. Note that the icon changes to ;
pressing this icon, one can stop the simulation before stop time. After simulation
is done, double click the Scope block to display the angular velocity variation with
time. Click the auto scale icon in the display window to scale the axes as per
the variable ranges. Auto scaled scope display is shown in Fig. 12a. With zoom
facility, try to zoom the portion of graph between 0.5 to 1 sec, and 20 to 25
unit angular velocity to identify the numerical value of angular velocity at 0.8
seconds.

(a)Scope display of angular velocity (b)Scope axis properties editor


Figure 12: Scope Display and property editor

Set y-axis limits by right-clicking the axis and choosing Axes Properties. In Y-min,
enter the minimum value for the y-axis. In Y-max, enter the maximum value for
the y-axis. In Title, enter the title of the plot. See Fig. 12b.

Click the icon shown on the icon bar to open scope parameter editor (Fig. 13).
General parameters include Number of axes, Time range, Tick labels, and
Sampling.

32
Click on the Data history button. If you want input-output data from this scope to
be available to MATLAB workspace for further analysis, check the button Save
data to workspace. In the box Variable name, enter the variable name for saving
the data. By default it will save the data with variable name ScopeData. With the
pop-down menu Format, select the format in which you want to save the data.
Three specific formats for saving the data are as follows:
1. Structure with time: Data will be saved in structured format with time steps.
Type the following commands in your MATLAB prompt and observe the outputs.

Figure 13 Scope parameter setting window

Structures are used in MATLAB to store mixed mode data types, and individual
fields of the structure can be accessed by dot ' (.) operator. To see the
information stored in the field signals, type:
>> ScopeData.signals
ans =
values: [4663x1 double]
dimensions: 1

33
label: ''
title: ''
plotStyle: 0

It indicates that the field signals contains subfield values, which is of 4663 x 1 size
vector containing the values of angular velocity. Try accessing the field time of
ScopeData.
2. Structure: This is the same as Structure with time; the only difference is that
the time steps will not be saved.
3. Array: Array format is simply a two column matrix with number of data points
being equal to number of rows. The maximum number of data points limits to the
number entered in the box Limit data points to last.

We have used an example to show how to build the Simulink diagram, how to
enter data and carry out a simulation in the SIMULINK environment. The reader
will agree that this is a very simple process. Solving the following exercises will
make the readers more confident in solving the control system design and
analysis problems through SIMULINK.

2 Transfer Function Manipulation


Suppose we have developed mathematical models in the form of transfer
functions for the plant, represented by G(s), and the controller, represented by
D(s), and possibly many other system components such as sensors and actuators.
Our objective is to interconnect these components to form block diagram
representation of a feedback control system. MATLAB offers several functions to
carry out block diagram manipulations.

Three methods are available:


34
2.1. Solution via series, parallel, and feedback commands:

series(G,D) for a cascade connection of G(s) and D(s); parallel(G1,G2) for a parallel
connection of G1(s) and G2(s); feedback(G,H, sign) for a closed-loop connection
with G(s) in the forward path and H(s) in the feedback path; and sign is -1 for
negative feedback or +1 for positive feedback (the sign is optional for negative
feedback); and cloop(G,sign) for a unity feedback system with G(s) in the forward
path, and sign is -1 for negative feedback or +1 for positive feedback (the sign is
optional for negative feedback).

2.2. Solution via algebraic operations:


G*D for a cascade connection of G(s) and D(s); G1+G2 for a parallel connection of
G1(s) and G2(s); G/(1+G*H) for a closed-loop negative feedback connection with
G(s) in the forward path and H(s) in the feedback path; and G/(1-G*H) for positive
feedback systems.

2.3. Solution via Simulink:


A simple open-loop control system can be obtained by interconnecting a
process and a controller in series, parallel and feedback using Simulink library.

Example 2: Series connection

Let the process represented by the transfer function G(s) be

and let the controller represented by the transfer function Gc(s) be

The transfer function Gc(s)G(s) is computed using the series function as shown In
Figure 14 .The resulting transfer function is

35
where sys is the transfer function name

Figure 14: Application of the series function via (a) Simulink (b) series command

Example 3 The feedback function with unity feedback

Let the process, G(s), and the controller, Gc(s), be as shown in Figure 15. To apply
the feedback function, we first use the series function to compute Gc(s)G(s),
followed by the feedback function to close the loop. The command sequence is
shown in Figure 15(b). The closed-loop transfer function is

36
Figure 15: Application of the feedback function via (a) Simulink (b) feedback
command

3 Solving differential equations using Simulink

There are several computer packages for finding solutions of differential


equations, such as Maple, Mathematica, Maxima, MATLAB, etc. These systems
provide both symbolic and numeric approaches to finding solutions. They often
require a bit of coding. However, there are graphical environments for solving
problems, including differential equations. One such environment is Simulink,
which is closely connected to MATLAB.

As an example, we will use Simulink to solve the first order differential equation
(ODE)

37
We can solve Equation (1) by integrating to formally obtain

∫( )

We will view this as a system in which the input, is fed into


an integrator and the output will be This is shown schematically in Figure 16.

Figure 16. Schematic for solving . The terms and


are fed into the integrator and x is output.

Figure 17 . System for solving first order ODE as a Simulink


simulation

For this example, we implement the following steps:


• Drag needed blocks into the model region [Figure 17]:
– Integrator block from the Continuous group;
– Sum block from the Math Operations group,
– Gain block from the Math Operations group,
– Sine Wave block from the Math Operations group; and,
– Scope block from the Sink group.

38
Lab Task 01. Simulate the control system shown in Figure 16 (a) and (b) using
SIMULINK

(a)

(b)

Figure 16: Feedback system

Lab Task 02: A multiloop feedback system is shown in Figure 17. Simulate the
control system using SIMULINK

39
Figure 17: Multiloop feedback system

Lab Task 03:

This problem is to study the effects of Proportional (P), Proportional + Integral


(PI), and Proportional + Derivative (PD) control schemes on the temperature
control system. A temperature control system has the block diagram given in
Figure 18. The input signal is a voltage and represents the desired temperature.
Simulate the control system using SIMULINK and find the steady-state error of the
system when is a unit-step function and

(i)

(ii)

(iii)

Figure 18: Block diagram for Lab Task 3


Hint: Use PID Controller block from Simulink Extras Additional Linear to implement the PID controller.

40
Assessment Sheet

Name:___________________________

Regd. No._________________________

Date of Lab:________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

41
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge of physical systems behavior of Model the
knowledge to Model but have no physical systems behavior of
the behavior of supporting materials in bit and pieces physical systems
physical systems with with no
supporting materials supporting
(mathematically , material
block diagram,
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

42
Lab – 3: The Representation of a State Space Expression in MATLAB

1 Introduction
The representation of a state space expression in MATLAB is simple and
straightforward. One can simply enter the coefficient matrices A, B, C, and D into
the MATLAB environment, and the state space object can be entered as
G=ss(A,B,C,D).

Example 1. A two input–two output system in state space form given by

can be entered into the MATLAB workspace using the following MATLAB
statements:

>> A=[2.25, -5, -1.25, -0.5; 2.25, -4.25, -1.25, -0.25;


0.25, -0.5, -1.25,-1; 1.25, -1.75, -0.25, -0.75];
B=[4, 6; 2, 4; 2, 2; 0, 2];
C=[0, 0, 0, 1; 0, 2, 0, 2];
D=zeros(2,2);
G=ss(A,B,C,D)

2 Transformation of Mathematical Models with Matlab

MATLAB is quite useful to transform the system model from transfer function to
state space, and vice versa.

2.1 Transformation from Transfer Function to State Space


Representation.
Let us write the closed-loop transfer function as:

43
Once we have this transfer-function expression, the MATLAB command
[A,B,C,D] = tf2ss(num,den) will give a state-space representation. It is
important to note that the state-space representation for any system is not
unique. There are many (infinitely many) state-space representations for the
same system. The MATLAB command gives one possible such state-space
representation.

Example 2. Consider the transfer-function system

There are many (infinitely many) possible state-space representations for this
system. One possible state-space representation is

Another possible state-space representation (among infinitely many alternatives)


is

44
MATLAB transforms the transfer function into the state-space representation. For
the example system considered here, MATLAB Program will produce matrices A,
B, C, and D as:

num = [1 0];
den = [1 14 56 160];
[A,B,C,D] = tf2ss(num,den)
A =
-14 -56 -160
1 0 0
0 1 0
B =
100
C =
0 1 0
D =
0

2.2 Transformation from State Space Representation to Transfer


Function.
To obtain the transfer function from state-space equations, use the following
command: [num,den] = ss2tf(A,B,C,D,iu) iu must be specified for systems with
more than one input. For example, if the system has three inputs (u1, u2, u3),
then iu must be either 1, 2, or 3, where 1 implies u1, 2 implies u2, and 3 implies
u3. If the system has only one input, then either [num,den] = ss2tf(A,B,C,D) or
[num,den] = ss2tf(A,B,C,D,1) may be used.

Example 3. Obtain the transfer function of the system defined by the following
state-space equations:

45
MATLAB Program will produce the transfer function for the given system.

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 =
0 0.0000 25.0000 5.0000
den
1.0000 5.0000 25.0000 5.0000
% ***** The same result can be obtained by entering the
following command: *****
[num,den] = ss2tf(A,B,C,D,1)
num =
0 0.0000 25.0000 5.0000
den =
1.0000 5.0000 25.0000 5.0000

The transfer function obtained is given by

Example 4. Consider a system with multiple inputs and multiple outputs.When


the system has more than one output, the MATLAB command [NUM,den] =
ss2tf(A,B,C,D,iu) produces transfer functions for all outputs to each input. (The
numerator coefficients are returned to matrix NUM with as many rows as there
are outputs.) Consider the system defined by

46
This system involves two inputs and two outputs. Four transfer functions are
involved: Y2(s)/U1(s), Y1(s)/U2(s), Y2(s)/U2(s), Y1(s)/U1(s), and (When considering
input u1, we assume that input u2 is zero and vice versa.)
Solution. MATLAB Program produces four transfer functions. This is the MATLAB
representation of the following four transfer functions:

A = [0 1;-25 -4];
B = [1 1;0 1];
C = [1 0;0 1];
D = [0 0;0 0];
[NUM,den] = ss2tf(A,B,C,D,1)
NUM =
0 1 4
0 0 –25
den =
1 4 25
[NUM,den] = ss2tf(A,B,C,D,2)
NUM =
0 1.0000 5.0000
0 1.0000 -25.0000
den =
1 4 25

3. State Space Modeling in Simulink

47
Example 4: Consider the mechanical system shown in Figure 1. We assume that
the system is linear. The external force u(t) is the input to the system, and the
displacement y(t) of the mass is the output. The displacement y(t) is measured
from the equilibrium position in the absence of the external force. This system is a
single-input, single-output system.

Figure 1: Mechanical systems.


METHOD 1: 2nd Order Ordinary Differential Equation

Let’s use Simulink to simulate the response of the Mass/Spring/Damper system as


shown in Fig. 1. Recall that the second order differential equation which governs
the system is given by

̈ ̇
This system is of second order. This means that the system involves two
integrators. Let us define state variables and as:

̇
Then we obtain

48
The output equation is

Block diagram of the mechanical system shown in Figure 2.

Figure 2: Block diagram of the mechanical system

We will implement the model shown in Fig. 2 in the untitled work space. Let us
first identify the SIMULINK blocks required to implement the block diagram
of Fig. 2. This is given in Fig. 3.

Identifying the block(s) required for simulation purpose is in fact the first step of
the construction of simulation diagram in SIMULINK. The next step is to ‘drag and
drop ‘the required blocks from SIMULINK block libraries to untitled workspace.

49
Figure 3: Simulink Model with signals connected.

For this problem, let , and , We would like to look at the


response of the system using the scope. Double click on the scope block to open it
up.

Figure 4: Step response of the system

50
METHOD 2: State Space Representation.

Recall that in addition to using a second order ODE to model the


system, we can use a state space representation of this system of

Once again, let , , and

Start a new, blank model. Click on the “State-Space” block and drag this
into your blank model. Your model should now look like Figure 5.

We now need to define the parameters of this block. Double click on


the block to enter the parameters. Enter in the A, B, C, and D matrices.
Leave the initial conditions as 0. (Note that this is the initial state
vector, x(0) and since there are 2 states, 0 actually implies x(0) = (0 0)T )

51
Figure 5: Simulink model with source and sink

We would like to look at the response of the system using the scope.
Double click on the scope block to open it up. Auto scale the plot so
that you can see the response. You should see something similar to
Figure 4.

Figure 6: Simulated response of system from scope block

52
Lab Task 1: Use the feedback function to obtain the closed-loop transfer
function and then function to obtain the closed-loop state space model of
the system in Figure 7.

Figure 7: Block diagram in the frequency domain for the system.

Lab Task 2:

The above equation describes the motion of the simple pendulum.


Using the Simulink block diagram, plot the angular displacement
for the following values:


 ̇

Lab Task 3: Obtain state-space model Matrix of the mechanical system


shown in Figure 8, where u1 and u2 are the inputs and y1 and y2 are
the outputs.
 Plot all four states of system in Simulink
 Analyze the step responses y1 and y2 by changing system
components in A matrix.

53
Figure 8: Mechanical system.

54
Assessment Sheet

Name:___________________________

Regd. No._________________________

Date of Lab:_________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

55
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge of physical systems behavior of Model the
knowledge to Model but have no physical systems behavior of
the behavior of supporting materials in bit and pieces physical systems
physical systems with with no
supporting materials supporting
(mathematically , material
block diagram,
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

56
Lab – 4: Transient Response Analysis with MATLAB
Introduction
Once a system is described by a certain model—be it in state space, by a transfer
function, or otherwise—it is often important to perform some form of analysis on
it. How does it respond to different system component ? Which inputs
correspond to which outputs? Is this thing stable or can we make it stable? These
are all questions we may ask of a system that comes presented to us as
a “black box.”

In this section we present the computational approach to the transient-response


analysis with MATLAB. In particular, we discuss step response, impulse response,
ramp response, and responses to other simple inputs.

The MATLAB Control System Toolbox contains the functions in Table 1 for analysis
of time-domain response.

S.No Command Description


1 step Step response
2 impulse Impulse response
3 initial Response of a state space system to the
given initial
state
4 lsim Response to arbitrary inputs
5 gensig Generates input signal for lsim
6 damp Natural frequency and damping of system
poles
7 ltiview Response analysis GUI (LTI System Viewer)
Table 1: Analysis of time-domain response.

2 MATLAB Representations of Linear Systems.


The transfer function of a system is represented by two arrays of numbers.
Consider the system

57
This system can be represented as two arrays, each containing the coefficients of
the polynomials in decreasing powers of s as follows:
num = [2 25]
den = [1 4 25]
An alternative representation is
num = [0 2 25]
den = [1 4 25]

MATLAB define the transfer function by

G = tf(num,den)

For a control system defined in a state-space form, where state matrix A, control
matrix B, output matrix C, and direct transmission matrix D of state-space
equations are known, One can simply enter the coefficient matrices A, B, C, and D
into the MATLAB environment, and the state space object can be entered as
G=ss(A,B,C,D).

3 System Response
Step and impulse responses of LTI objects can be obtained by the
commands step and impulse . For example, to obtain the step response of the
system represented in LTI object G, enter

>> step(G)

To obtain the impulse response, enter

>> impulse(G)

Example 1: For illustration purposes, create the following third-order transfer


function:

sys = tf([8 18 32],[1 6 14 24])


sys =
58
8 s^2 + 18 s + 32
-----------------------
s^3 + 6 s^2 + 14 s + 24

Continuous-time transfer function.

subplot(2,1,1)
step(sys)
subplot(2,1,2)
impulse(sys)

Figure 1: Unit step and impulse Response

4. Response Characteristics
Right-clicking on response plots gives access to a variety of options and
annotations. In particular, the Characteristics menu lets you display standard

59
metrics such as rise time and settling time for step responses, or peak gain and
stability margins for frequency response plots.

Using the example 1 from the previous section, plot the step response:

>>step(sys)

Now, right-click on the plot to display the Peak Response and Settling Time
Characteristics, and click on the blue dots to read the corresponding overshoot
and settling time values:

Figure 2: Response Characteristics

If num and den (the numerator and denominator of the closed-loop transfer
function) are known, commands such as

step(num,den), step(num,den,t)

will generate plots of unit-step responses (t in the step command is the user-
specified time.)

60
Example 2:

Obtain the unit step response of the system with the closed-loop transfer
function above. Also, use the damp function to obtain the roots of the
characteristic equation, the corresponding damping factors, and the natural
frequencies.
Solution:
The following code produces the response seen in Figure 1.
>> num = 25*[0.4 1];
>> den = conv([0.16 1], [1 6 25]) % Multiplies two
polynomials.
>> T = tf(num,den) % Create TF object.
>> step(T), grid % Produces step response plot.
>> damp(T) % Produces data below:
Eigenvalue Damping Freq. (rad/s)
-3 + 4i 6.00e-001 5.00
-3 - 4i 6.00e-001 5.00
-6.25 1.00e+000 6.25
The damping factors and natural frequencies are displayed in the right two
columns. The eigenvalues are the roots of the characteristic equation.

Figure 1: Unit step response for system in Example 2

61
Example 3:

The closed-loop transfer function of a control system is described by the third


order transfer function . Do the following:

1. Find the dominant poles of the system.


2. Find a reduced-order model.
3. Obtain the step response of the third-order system and the reduced-order
system on the same figure plot.

Solution:

1. The poles are the roots of the denominator polynomial. To find this, we use
roots([1 36 205 750]). This gives us roots at −30 and −3 ± 4. To determine
dominance, we look at the time constants (negative inverse of real part)
associated with these poles. We see the pole at −30 has time constant 1 = 1/30
where as the other two have time constant 2 = 1/3. The order of magnitude
difference tells us that the poles at 3±4 are dominant.

2. To reduce the model, we factor out the negligible pole and divide the
numerator by its magnitude:

3. The following script produces the desired plot


\begin{verbatim}
num1 = 750;
den1 = [1 36 205 750];
T = tf(num1,den1); % Third-order system tf object.
num2 = 25;
den2 = [1 6 25];
Ttilde = tf(num2,den2); % Reduced system tf object.
[y1 t] = step(T); % Response and time vectors of T.
y2 = step(Ttilde,t); % Response using the same time
62
% vector of the reduced system.
plot(t,y1,’r-’,t,y2,’b:’) % Put responses on the same
plot.
grid;
xlabel(’Time (s)’);
ylabel(’Displacement’);
legend(’Third-order’,’Reduced-order’);
\end{verbatim}

Figure 2: Step responses of the original and reduced systems in Example 3

For a control system defined in a state-space form, where state matrix A, control
matrix B, output matrix C, and direct transmission matrix D of state-space
equations are known, the command

step(A,B,C,D), step(A,B,C,D,t)

will generate plots of unit-step responses. When t is not explicitly included in the
step commands, the time vector is automatically determined.

63
Step and impulse response data can be collected into MATLAB variables by using
two left hand arguments. For example, the following commands will collect step
response amplitudes in y and time samples in t. (y has as many columns as
outputs and one row for each element in t.

[y,t] = step(G)
[y,t] = step(num,den,t)
[y,t] = step(A,B,C,D,iu)
[y,t] = step(A,B,C,D,iu,t)
Note in above equation that the scalar iu is an index into the inputs of the system
and specifies which input is to be used for the response, and t is the user specified
time. If the system involves multiple inputs and multiple outputs, the step
command produces a series of step-response plots, one for each input and output
combination

5. Analyzing MIMO Systems

All commands mentioned so far fully support multi-input multi-output (MIMO)


systems. In the MIMO case, these commands produce arrays of plots. For
example, the step response of the two-input, two-output system

Example 4. Consider the following system:

Obtain the unit-step response curves.

Although it is not necessary to obtain the transfer-matrix expression for the


system to obtain the unit-step response curves with MATLAB, we shall derive

64
such an expression for reference. The transfer matrix G(s) for the given system
becomes

Hence,

Since this system involves two inputs and two outputs, four transfer functions
may be defined, depending on which signals are considered as input and output.
Note that, when considering the signal u1 as the input, we assume that signal u2
is zero, and vice versa.The four transfer functions are

65
Assume that u1 and u2 are unit-step functions. The four individual step-response
curves can then be plotted by use of the command

A = [–1 –1;6.5 0];


B = [1 1;1 0];
C = [1 0;0 1];
D = [0 0;0 0];
step(A,B,C,D)

To plot two step-response curves for the input u1 in one diagram and two step-
response curves for the input u2 in another diagram, we may use the commands
step(A,B,C,D,1)
and
step(A,B,C,D,2)
respectively.

Example 5: MATLAB Program to plot two step-response curves for the input u1
in one diagram and two step-response curves for the input u2 in another diagram
Solution:
% ***** In this program we plot step-response curves of a system
% having two inputs (u1 and u2) and two outputs (y1 and y2)
*****
% ***** We shall first plot step-response curves when the input
is
% u1. Then we shall plot step-response curves when the input is
% u2 *****
% ***** Enter matrices A, B, C, and D *****
A = [-1 -1;6.5 0];
B = [1 1;1 0];
C = [1 0;0 1];
D = [0 0;0 0];
% ***** To plot step-response curves when the input is % u1,
enter the command 'step(A,B,C,D,1)' *****
figure (1) %creates a new figure window
step(A,B,C,D,1)
grid
title ('Step-Response Plots: Input = u1 (u2 = 0)')
gtext('Y1')
gtext('Y2')

66
% ***** Next, we shall plot step-response curves when the input
is u2. Enter the command 'step(A,B,C,D,2)'
figure (2) %creates a new figure window
step(A,B,C,D,2)
grid
title ('Step-Response Plots: Input = u2 (u1 = 0)')
gtext('Y1')
gtext('Y2')

6 Writing Text on the Graphics Screen.


To write a text or texts in the plot is to use the gtext command. The syntax is

gtext('text')

When gtext is executed, the computer waits until the cursor is positioned (using a
mouse) at the desired position in the screen. When the left mouse button is
pressed, the text enclosed in simple quotes is written on the plot at the cursor’s
position. Any number of gtext commands can be used in a plot.

7 MATLAB Description of Standard Second-Order System.

As noted earlier, the second-order system

is called the standard second-order system. Given and , the command

printsys(num,den) or printsys(num,den,s)

prints num/den as a ratio of polynomials in s.

Consider, for example, the case where =5 rad/sec and =0.4. MATLAB
Program generates the standard second-order system, where =5 rad/sec
and =0.4. Note that in MATLAB Program “num 0” is 1.

wn = 5;
damping_ratio = 0.4;
[num0,den] = ord2(wn,damping_ratio);
67
num = 5^2*num0;
printsys(num,den,'s');

8 Obtaining Rise Time, Peak Time, Maximum Overshoot, Damping


ratio, and Settling Time with MATLAB.

MATLAB can conveniently be used to obtain the rise time, peak time, maximum
overshoot, and settling time.
S = stepinfo(sys)computes the step-response characteristics for a dynamic system
model sys. The function returns the characteristics in a structure containing the
fields:
 RiseTime — Time it takes for the response to rise from 10% to 90% of the
steady-state response.
 SettlingTime — Time it takes for the error |y(t) - yfinal| between the
response y(t) and the steady-state response yfinal to fall to within 2% of yfinal.
 SettlingMin — Minimum value of y(t) once the response has risen.
 SettlingMax — Maximum value of y(t) once the response has risen.
 Overshoot — Percentage overshoot, relative to yfinal).
 Undershoot — Percentage undershoot.
 Peak — Peak absolute value of y(t)
 PeakTime — Time at which the peak value occurs.

Example: Consider the system defined by

MATLAB Program yields the rise time, peak time, maximum overshoot, and
settling time.

num = [25];
den = [1 6 25];
G=tf(num,den)
S = stepinfo(G)

9 Response to an arbitrary signal

68
You can also simulate the response to an arbitrary signal, for example, a sine
wave, using the lsim command. The input signal appears in gray and the
system's response in blue.
t = 0:0.01:4;
u = sin(10*t);

G = tf([8 18 32],[1 6 14 24])

lsim(G,u,t) % u,t define the input signal

Figure 3: Response to sine signal

For state-space models, you can also plot the unforced response from some given
initial state, for example:

A = [-0.8 3.6 -2.1;-3 -1.2 4.8;3 -4.3 -1.1];


B = [0; -1.1; -0.2];

69
C = [1.2 0 0.6];
D = -0.6;
G = ss(A,B,C,D);
x0 = [-1;0;2]; % initial state
initial(G,x0)
grid

Figure 4: Response to Initial Condition

10. Close Loop Response

The poles and zeros of a system contain valuable information about its dynamics, stability, and limits of
performance. For example, consider the feedback loop in Figure 1 where

70
Figure 1: SISO Feedback Loop.
For the gain value k = 0.7, you can plot the closed-loop poles and zeros
using pzmap:

s = tf('s');
G = (2*s+1)/(s^2+3*s+2);
k = 0.7;
T = feedback(G*k,1);
pzmap(T)
grid, axis([-2 0 -1 1])

71
The closed-loop poles (marked by blue x's) lie in the left half-plane so the
feedback loop is stable for this choice of gain k. You can read the damping ratio of
the closed-loop poles from this chart (see labels on the radial lines). Here the
damping ratio is about 0.7, suggesting a well-damped closed-loop response as
confirmed by:

clf
step(T)

To further understand how the loop gain k affects closed-loop stability, you can
plot the locus of the closed-loop poles as a function of k:

11 Comparing Systems
You can plot multiple systems at once using any of the response plot commands.
You can assign a specific color, marker, or line style to each system for easy
comparison. Using the feedback example above, plot the closed-loop step
response for three values of the loop gain k in three different colors:

72
s = tf('s');
G = (s+9)/(s^2+3*s+2);
k=0.7;
T = feedback(G*k,1);
k1 = 0.4;
T1 = feedback(G*k1,1);
k2 = 1;
T2 = feedback(G*k2,1);
step(T,'b',T1,'r',T2,'g')
legend('k = 0.7','k = 0.4','k = 1')

73
Lab Task 1: For the system represented by closed loop differential
equation, determine natural frequency, damping ratio, peak time, %
overshoot and settling time with 2 % tolerance band.

Lab Task. 2: For the system with open loop transfer function,

Determine natural frequency, damping ratio, peak time, % overshoot


and settling time with 2 % tolerance band.

74
Assessment Sheet

Name:___________________________

Regd. No._________________________

Date of Lab:_________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

75
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge to Model of physical systems behavior of Model the
the behavior of but have no physical systems behavior of
physical systems with supporting materials in bit and pieces physical systems
supporting materials with no
(mathematically , supporting
block diagram, material
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

76
Lab – 05: System Stability Analysis using MATLAB
1 Introduction.
This section begins with a discussion of the Routh-Hurwitz stability method. We
will see how the computer can assist us in the stability analysis by providing an
easy and accurate method for computing the poles of the characteristic equation.
For the case of the characteristic equation as a function of a single parameter, it
will be possible to generate a plot displaying the movement of the poles as the
parameter varies.

2 Routh Stability Analysis.


As stated earlier, the Routh criterion is a necessary and sufficient criterion for
stability. Given a characteristic equation with fixed coefficients, we can use Routh-
Hurwitz to determine the number of roots in the right half-plane.

Example 1: Consider the Closed-loop control system shown in Figure 1 with


Transfer function

Figure 1: Closed-loop control system

associated with the closed-loop control system. The corresponding Routh-Hurwitz


array is shown in Figure 2.

77
Figure 2: Routh-Hurwitz array

The two sign changes in the first column indicate that there are two roots of the
characteristic polynomial in the right half-plane; hence, the closed-loop system is
unstable. We can verify the Routh-Hurwitz result by directly computing the roots
of the characteristic equation, using the pole function. Recall that the pole
function computes the system poles.

num=[1];
den=[1 1 2 23];
sysg=tf(num,den);
sys=feedback(sysg,[1]);
pole(sys)

ans =
-3.0000
1.0000+ 2.6458i
1.0000-2.6458i

Two poles lies in the right half-plane, confirming system is unstable.

3 Stability Design Via Routh Criteria.


Whenever the characteristic equation is a function of a single parameter, the
Routh-Hurwitz method can be utilized to determine the range of values that the
parameter may take while maintaining stability.

78
Example 3: Consider the closed-loop feedback system shown in Figure 3 with
Transfer function associated with the closed-loop control system.

Figure 3: Closed-loop control system

Using a Routh-Hurwitz approach, we find that we require 0 < K < 8 for stability.
We can verify this result graphically. As shown in Figure 4, we establish a vector of
values for K at which we wish to compute the roots of the characteristic equation.
Then using the roots function, we calculate and plot the roots of the characteristic
equation, as shown in Figure 4. It can be seen that as K increases, the roots of the
characteristic equation move toward the right half-plane as the gain tends toward
K — 8, and eventually into the right half-plane when K > 8.

Figure 4: Plot of root locations of for

79
The MATLAB script contains the for function. This function provides a
mechanism for repeatedly executing a series of statements a given number of
times. The for function connected to an end statement sets up a repeating
calculation loop

% This script computes the roots of the characteristic


% equation D(s) = s^3 + 2 s^2 + 4 s + K for 0 < K < 20

K=[0:0.5:20]; % 0 < K < 20


for i=1:length(K); % for loop
q=[1 2 4 K(i)];
p(:,i)=roots(q);
end
figure(1)
plot(real(p),imag(p),'x'),
grid
xlabel('Real axis')
ylabel('lmaginary axis')
gtext('K < 8') % Writing text on graphic
gtext('K = 8')
gtext('K > 8')
num=[1];
den=[1 2 4 9];
sysg=tf(num,den);
sys=feedback(sysg,[1]);
pole(sys) % poles of closed loop system
figure(2)
step(sys);

Example 4: Consider the closed-loop feedback system shown in Figure 4.


Using a Routh-Hurwitz approach, We find that the closed-loop system is stable
for K < 1360; and unstable for K > 1360.

80
Figure 4: Closed-loop control system

The following MATLAB script plots the step response for k = 846 and k=
1460, as shown in Figure 5.

s = tf('s');
G = 1/(s*(s+7)*(s+11));
K1 = 860;
step(feedback(K1*G,1),5);
hold; % Current plot held
K2 = 1460;
step(feedback(K2*G,1),5)

K = 860 K = 1460

Figure 5: step responses for two values of K


81
Lab Task 1 Consider the following closed loop Transfer Function:

Using Routh stability criterion, determine the range of K f or stability.

Lab Task 2 Consider the following closed loop of below figure, find the range of
gain K that will cause system to be stable , unstable and marginally stable. Plot
step response for three value of K

Figure 6: Closed-loop control system

Lab Task 3: Consider the following feedback system, find the range of gain K1 and
k2 that will cause system to be stable. Plot step response for value of K1 and k2

Figure 7: A feedback system with proportional control

Let

82
Assessment Sheet

Name:___________________________
Regd. No._________________________
Date of Lab:_________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

83
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge of physical systems behavior of Model the
knowledge to Model but have no physical systems behavior of
the behavior of supporting materials in bit and pieces physical systems
physical systems with with no
supporting materials supporting
(mathematically , material
block diagram,
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

84
Lab – 6: Steady State Analysis with MATLAB
Objective:
1. Calculating steady-state errors
2. System type and steady-state error
3. Example: Meeting steady-state error requirements

Introduction:

Steady-state error is defined as the difference between the input (command) and
the output of a system in the limit as time goes to infinity (i.e. when the response
has reached steady state). The steady-state error will depend on the type of input
(step, ramp, etc.) as well as the system type (0, I, or II).
Note: Steady-state error analysis is only useful for stable systems. You should
always check the system for stability before performing a steady-state error
analysis. Many of the techniques that we present will give an answer even if the
error does not reach a finite steady-state value.

Calculating steady-state errors

Before talking about the relationships between steady-state error and system
type, we will show how to calculate error regardless of system type or input.
Then, we will start deriving formulas we can apply when the system has a specific
structure and the input is one of our standard functions. Steady-state error can be
calculated from the open- or closed-loop transfer function for unity feedback
systems. For example, let's say that we have the system given below.

85
This is equivalent to the following system, where T(s) is the closed-loop transfer
function.

We can calculate the steady-state error for this system from either the open- or
closed-loop transfer function using the Final Value Theorem. Recall that this
theorem can only be applied if the subject of the limit (sE(s) in this case) has poles
with negative real part.

Now, let's plug in the Laplace transforms for some standard inputs and determine
equations to calculate steady-state error from the open-loop transfer function in
each case.

 Step Input (R(s) = 1 / s):

 Ramp Input (R(s) = 1 / s^2):

 Parabolic Input (R(s) = 1 / s^3):

86
When we design a controller, we usually also want to compensate for
disturbances to a system. Let's say that we have a system with a disturbance that
enters in the manner shown below.

We can find the steady-state error due to a step disturbance input again
employing the Final Value Theorem (treat R(s) = 0).

When we have a non-unity feedback system we need to be careful since the


signal entering G(s) is no longer the actual error E(s). Error is the difference
between the commanded reference and the actual output, E(s) = R(s) - Y(s). When
there is a transfer function H(s) in the feedback path, the signal being subtracted
from R(s) is no longer the true output Y(s), it has been distorted by H(s). This
situation is depicted below.

87
Manipulating the blocks, we can transform the system into an equivalent unity-
feedback structure as shown below.

Then we can apply the equations we derived above.

System type and steady-state error

If you refer back to the equations for calculating steady-state errors for unity
feedback systems, you will find that we have defined certain constants (known as
the static error constants). These constants are the position constant (Kp), the
velocity constant (Kv), and the acceleration constant (Ka). Knowing the value of
these constants, as well as the system type, we can predict if our system is going
to have a finite steady-state error.

First, let's talk about system type. The system type is defined as the number of
pure integrators in the forward path of a unity-feedback system. That is, the
system type is equal to the value of n when the system is represented as in the
following figure. It does not matter if the integrators are part of the controller or
the plant.

88
Therefore, a system can be type 0, type 1, etc. The following tables summarize
how steady-state error varies with system type.

Type 0 system Step Input Ramp Input Parabolic Input


Steady-State Error Formula 1/(1+Kp) 1/Kv 1/Ka
Static Error Constant Kp = constant Kv = 0 Ka = 0
Error 1/(1+Kp) infinity infinity
Type 1 system Step Input Ramp Input Parabolic Input
Steady-State Error Formula 1/(1+Kp) 1/Kv 1/Ka
Static Error Constant Kp = infinity Kv = constant Ka = 0
Error 0 1/Kv infinity
Type 2 system Step Input Ramp Input Parabolic Input
Steady-State Error Formula 1/(1+Kp) 1/Kv 1/Ka
Static Error Constant Kp = infinity Kv = infinity Ka = constant
Error 0 0 1/Ka

Example: Meeting steady-state error requirements

Consider a system of the form shown below.

For this example, let G(s) equal the following.

89
Since this system is type 1, there will be no steady-state error for a step input and
there will be infinite error for a parabolic input. The only input that will yield a
finite steady-state error in this system is a ramp input. We wish to choose K such
that the closed-loop system has a steady-state error of 0.1 in response to a ramp
reference. Let's first examine the ramp input response for a gain of K = 1.

s = tf('s');
G = ((s+3)*(s+5))/(s*(s+7)*(s+8));
T = feedback (G,1);
t = 0:0.1:25;
u = t;
[y,t,x] = lsim(T,u,t);
plot(t,y,'y',t,u,'m')
xlabel('Time (sec)')
ylabel('Amplitude')
title('Input-purple, Output-yellow')

The steady-state error for this system is quite large, since we can see that at time
20 seconds the output is approximately 16 as compared to an input of 20 (steady-
state error is approximately equal to 4). Let's examine this in further detail.

90
We know from our problem statement that the steady-state error must be 0.1.
Therefore, we can solve the problem following these steps:

Let's see the ramp input response for K = 37.33 by entering the following code in
the MATLAB command window.

K = 37.33 ;

s = tf('s');
G = (K*(s+3)*(s+5))/(s*(s+7)*(s+8));
sysCL = feedback(G,1);
t = 0:0.1:50;
u = t;
[y,t,x] = lsim(sysCL,u,t);
plot(t,y,'y',t,u,'m')
xlabel('Time (sec)')
ylabel('Amplitude')
title('Input-purple, Output-yellow')

91
In order to get a better view, we must zoom in on the response. We choose to
zoom in between time equals 39.9 and 40.1 seconds because that will ensure that
the system has reached steady state.

axis([39.9,40.1,39.9,40.1])

Examination of the above shows that the steady-state error is indeed 0.1 as
desired.

92
Now let's modify the problem a little bit and say that our system has the form
shown below.

In essence we are not distinguishing between the controller and the plant in our
feedback system. Now we want to achieve zero steady-state error for a ramp
input.

From our tables, we know that a system of type 2 gives us zero steady-state error
for a ramp input. Therefore, we can get zero steady-state error by simply adding
an integrator (a pole at the origin). Let's view the ramp input response for a step
input if we add an integrator and employ a gain K = 1.

s = tf('s');
P = ((s+3)*(s+5))/(s*(s+7)*(s+8));
C = 1/s;
sysCL = feedback(C*P,1);
t = 0:0.1:250;
u = t;
[y,t,x] = lsim(sysCL,u,t);
plot(t,y,'y',t,u,'m')
xlabel('Time (sec)')
ylabel('Amplitude')
title('Input-purple, Output-yellow')

93
As you can see, there is initially some oscillation (you may need to zoom in).
However, at steady state we do have zero steady-state error as desired. Let's
zoom in around 240 seconds.

axis([239.9,240.1,239.9,240.1])

94
As you can see, the steady-state error is zero. Feel free to zoom in on different
areas of the graph to observe how the response approaches steady state.

Lab Task 1: Determine the steady state errors for unit step, unit ramp, and unit
parabolic inputs of a unity feedback control system having the plant transfer
function.

Lab Task 2: Obtain the response of the system shown in Figure when the input r(t)
is given by

Lab Task 3: Consider a unity-feedback control system whose open-loop transfer


function is:

Discuss the effects that varying the values of K and B has on the steady-state error
in unit-ramp response. Sketch typical unit-ramp response curves for a small value,
medium value, and large value of K, assuming that B is constant.

95
Assessment Sheet

Name:___________________________

Regd. No._________________________

Date of Lab:_________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

96
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________

OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge to Model of physical systems behavior of Model the
the behavior of but have no physical systems behavior of
physical systems with supporting materials in bit and pieces physical systems
supporting materials with no
(mathematically , supporting
block diagram, material
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

97
Lab – 07: Time Response Characteristics and LTI Viewer

Objectives:
1. Analysis of the system behavior to changes in input reference signals or
disturbances using steady-state and transient performance indices.

2. Brief introduction to LTI Viewer, and time response analysis using this
GUI tool.

7.1 Introduction:
Time response characteristics of interest to us in analysis and design of control
systems are: rise time (tr), settling time (ts), peak time (tp) , and peak overshoot
(Mp) of step response of a system. These parameters can directly be obtained
from the plot generated by the command step. Right-clicking away from the curve
generated by step brings up a menu. From this menu, various time-response
characteristics can be selected.

MATLAB has a powerful GUI tool, called LTI Viewer, for obtaining both the time
and frequency response characteristics of a given Linear Time Invariant system. In
this module, we give the basic features of this GUI tool and use it for time
response analysis.

7.2 LTI Viewer:


The LTI ( Linear Time Invariant) Viewer is an interactive graphical user interface
(GUI) for analyzing the time and frequency responses of linear systems and
comparing such systems. In particular, some of the graphs the LTI Viewer can
create are step and impulse responses, Bode, Nyquist, Nichols, pole-zero plots,
and responses with arbitrary inputs. In addition, the values of critical
measurements on these plots can be displayed with a click of the mouse. Table
7.1 shows the critical measurements that are available for each plot.

98
Here we provide steps you may follow to use the LTI Viewer to plot time and
frequency responses.

1. Access the LTI Viewer: The LTI Viewer window, shown in Figure 1, can be
accessed by typing ltiview in the MATLAB Command Window or by executing this
command in an M-file.

Figure 1: LTI Viewer Window

99
2.Create LTI transfer functions: Create LTI transfer functions for which you want
to obtain responses. The transfer functions can be created in an M-file or in the
MATLAB Command Window. Run the M-file or MATLAB Command Window
statements to place the transfer function in the MATLAB workspace. All LTI
objects in the MATLAB workspace can be exported to the LTI Viewer.

The following MATLAB commands create the transfer function .

>> s = tf('s');

>> G = 1/(s+1);

Select LTI transfer functions for the LTI Viewer: Choose Import…under the File
menu in the LTI Viewer window and select all LTI objects whose responses you
wish to display in the LTI Viewer sometime during your current session. Selecting
G (s) results in Figure 2.

Figure 2: Import System Data Window

3.Select the LTI objects for the next response plot: Right-click anywhere in the LTI
Viewer plot area to produce a pop-up menu. Under Systems, select or deselect
the objects whose plots you want or do not want to show in the LTI Viewer. More
than one LTI transfer function may be selected.

100
4.Select the plot type: Right-click anywhere in the LTI Viewer plot area to produce
a pop-up menu. Under Plot Types, select the type of plot you want to show in the
LTI Viewer

Figure 3: LTI Viewer plot area

Example 1: Take a typical underdamped second-order transfer function and


import it to the LTI viewer window.

5. Select the characteristics: Right-click anywhere in the LTI Viewer plot area to
produce a pop-up menu. Under Characteristics, select the characteristics of the
plot you want displayed. More than one characteristic may be selected. For each
characteristic selected, a point will be placed on the plot at the appropriate
location.

The characteristics menu and the submenu are displayed in Fig. 4 obtained by
importing a typical second-order transfer function.

Note the difference in the definition of rise time employed in the LTI Viewer with
respect to the one used in the text.

101
Figure. 4 LTI Viewer with step response plot and characteristics

Interact with the plot:

 Zoom In (Zoom Out): Select the Zoom In (Zoom Out) button (with the + ( )
sign) on the tool bar. Hold the mouse button down and drag a rectangle on
the plot over the area you want to enlarge (deluge), and release the mouse
button.

 Original View: Select Reset to Original View in the menu popped up by


right-click to return to original view of your plot after zooming.

 Grid: Select Grid in the right-click menu to on or off the grid. The right click
menu will not work if any zoom button on the tool bar is selected.

 Normalize: Select Normalize in the right-click menu to normalize all curves


in view.

 Characteristics: Read the values of the characteristics by placing the mouse


on the characteristics point on the plot. Left-click the mouse to keep the
values displayed (Fig. 5).

102
 Properties: Select Properties in the right-click menu or double-click
anywhere (except the curve) on the graph sheet to change the appearance
of the graph. You can change the title, axes labels, x and y limits, font sizes
and styles, colors, and response characteristics definitions.

 Coordinates and curve: Left-click the mouse at any point on the plot to read
the system identification and the coordinates (Fig. 5, shown by square
block).

 Add text and graphics: Under the File menu, choose Print to Figure. An
additional figure with toolbar will open (Fig. 6).The toolbar of this figure has
additional tools for adding text, arrows, lines, legends, and to rotate the
figure.

 Additional plot-edit capabilities: The Edit menu of the LTI Viewer and the
figures created by selecting Print to Figure, offer a wide variety of controls
over the plot presentation.
 Viewer preferences: Choose Viewer Preferences… in the Edit menu. LTI
Viewer Preferences window (Fig. 7) will open. This allows users to set
parameters such as units (Units), style of labels (Style), response
characteristics definitions (Characteristics), and also provide a control over
the time and frequency vector generation (Parameters).

Fig. 5 Coordinate values in step response curve

103
Fig. 6 LTI response with text and graphics editor toolbar

Fig. 7 LTI Viewer Preferences window

104
Lab Task 1: For the system with closed loop transfer function ,
determine natural frequency, damping ratio, peak time, % overshoot and settling
time with 2 % tolerance band.

Lab Task 2: For the system represented by closed loop differential equation,
determine natural frequency, damping ratio, peak time, % overshoot and settling
time with 2 % tolerance band.

Lab Task 3: Consider the following closed loop of below figure:

Figure 6: Closed-loop control system

Find the range of gain K that will cause system to be stable , unstable and
marginally stable. Plot step response for three value of K

Lab Task 4: Using LTI GUI, obtain the unit-step response, unit-ramp response, and
unit-impulse response of the following system:

where u is the input and y is the output.

105
Assessment Sheet

Name:___________________________

Regd. No._________________________

Date of Lab:_________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

106
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge to Model of physical systems behavior of Model the
the behavior of but have no physical systems behavior of
physical systems with supporting materials in bit and pieces physical systems
supporting materials with no
(mathematically , supporting
block diagram, material
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

107
Lab – 08: Plotting Root Loci with MATLAB
8.1 Introduction:
In the following, we provide brief description of powerful MATLAB commands for
root locus analysis. The reader may wonder why the instructors emphasize
learning of hand calculations when powerful MATLAB commands are available.
For a given set of open-loop poles and zeros, MATLAB immediately plots the root
loci. Any changes made in the poles and zeros, immediately result in new root loci
and so on.

Depending on our background and aptitude, we may, after a while, begin to make
some sense of the patterns. May be we finally begin to formulate a set of rules
that enables us to quickly make a mental sketch of the root locus the moment the
poles and zeros appear. In other words, by trial-and-error, we find the rules of the
root locus.

Through the systematic formulation of set of rules of the root locus, we look for
the clearest, and simplest explanation of the dynamic phenomena of the system.
The rules of the root locus give us a clear and precise understanding of the
endless patterns that can be created by an infinite set of characteristic equations.
We could eventually learn to design without these rules, but our level of skill
would never be as high or our understanding as great. This is true of
other analysis techniques also such as Bode plots, Nyquist plots, Nichols charts,
and so on, covered later in the course.

8.2 Plotting Root Loci with MATLAB.


MATLAB allows root locus for the characteristic equation

to be plotted with the rlocus(GH) command. Points on the root loci can be
selected interactively (placing the cross-hair at the appropriate place) using the
[K,p] = rlocfind(GH) command. MATLAB then yields the gain K at that point as
well as all the poles p that have that gain. The root locus can be drawn over a grid

108
generated using the sgrid (zeta, wn) command, that allows constant damping
ratio zeta and constant natural frequency wn curves. The command rlocus (GH, K)
allows us to specify the range of gain K for plotting the root locus. Also study the
commands [p,K]=rlocus(GH) and [p]=rlocus(GH,K) using MATLAB online help.

Example 1: Consider the system shown in the block diagram of Fig. 1

Figure 1: Close Loop system for Example 1

The characteristic equation of the system is

With

The following MATLAB script plots the root loci for

s = tf('s');
G = 1/(s*(s+7)*(s+11));
rlocus(G);
axis equal;

Clicking at the point of intersection of the root locus with the imaginary axis gives
the data shown in Fig. 2. We find that the closed-loop system is stable for K <
1360; and unstable for K > 1360.

109
Figure 2: Root Locus plot for example 1.

Figure 3 shows step responses for two values of K.


>> K = 860;
>> step(feedback(K*G,1),’b’,5)
>> hold; % Current plot held
>> K = 1460;
>> step(feedback(K*G,1),’g’,5)

Figure 3: Step responses for two values of K.

110
Example 2: Consider the system shown in Figure 4.

Figure 4: Close Loop system for Example 2

The plant transfer function G(s) is given as

The following MATLAB script plots the root locus for the closed-loop system.

clear all;
close all;
s = tf('s');
G = (s+1)/(s*(0.1*s-1));
rlocus(G);
axis equal;
sgrid;
title('Root locus for (s+1)/s(0.1s-1)');
[K,p]=rlocfind(G)

111
Figure 5: Root Locus plot for example 2.

selected_point =

-2.2204 + 3.0099i

K =

1.4494

p =

-2.2468 + 3.0734i

-2.2468 - 3.0734i

Example 3

For a unity feedback system with open-loop transfer function

112
a root locus plot shown in Fig. 6 has been generated using the following MATLAB
code.

s = tf('s');
G = (s^2-4*s+20)/ ((s+2)*(s+4));
rlocus(G);
zeta = 0.45;
wn = 0;
sgrid(zeta,wn);

Properly redefine the axes of the root locus using Right click --> Properties -->
Limits.

Figure 6: Root Locus plot for example 3.

Clicking on the intersection of the root locus with zeta=0.45 line gives the system
gain K = 0.415 that corresponds to closed-loop poles with Clicking on the
intersection of the root locus with the real axis gives the breakaway point and the
gain at that point.

113
Lab Task 01: Sketch the root loci for the system shown in Figure 7. (The gain K is
assumed to be positive.) Observe that for small or large values of K the system is
overdamped and for medium values of K it is underdamped.

Figure 7: Close loop Control System

Lab Task 02: Consider the system shown in Figure 8. Plot the root loci with
MATLAB. Locate the closed-loop poles when the gain K is set equal to 2.

Figure 8: Close loop Control System

Lab Task 03:Plot the root loci for the system shown in Figure 9. Determine the
range of gain K for stability.

Figure 9: Close loop Control System


114
Assessment Sheet

Name:___________________________

Regd. No._________________________

Date of Lab:_________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

115
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge to Model of physical systems behavior of Model the
the behavior of but have no physical systems behavior of
physical systems with supporting materials in bit and pieces physical systems
supporting materials with no
(mathematically , supporting
block diagram, material
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

116
Lab – 9: Root Locus Design and SISO Design Tools

Objectives:
1. Design using root locus plots.
2. Brief introduction to SISO Design Tool, and root locus design using this GUI
tool.

1 Introduction:
We will carry out Control system design using MATLAB dialogues. MATLAB is an
interpreted language. That is, it runs along executing each instruction as it comes
to it. This interactive feature of MATLAB will be exploited in our design exercise.
The designer will be in the loop.

The MATLAB SISO Design Tool, developed on the MATLAB dialogue pattern, is a
powerful GUI tool wherein the designer is always in the design loop. We will
outline this tool, with an example, at the end of this module.

a. Design using Matlab Dialogues


b. MATLAB's SISO Design tool

2 Design using MATLAB dialogues:


Example 1: A unity feedback system has forward path transfer function

Our goal is to design a cascade Lag Lead compensator that improves the transient
as well as steady state performance of the closed-loop system (refer Nise(2004)).
We want to achieve a transient response that has no more than 20% overshoot.
This, as we know, can be achieved by simple gain adjustment. We therefore first
evaluate the uncompensated system operating at 20% overshoot. The following
MATLAB dialogue is helpful for this evaluation.

117
s = tf('s');
G1 = (s+8)/((s+3)*(s+6)*(s+10));
zeta = 0.456;
rlocus(G1);
sgrid(zeta,0);

Figure 1: Root locus

Selecting the point of intersection of the root locus with 20% overshoot line ( ) in
Fig. 1 using rlocfind(G) command, MATLAB yields the gain at that point, as well as
all the poles that have that gain . The MATLAB session follows:

>> [K, p] = rlocfind(G1)


Select a point in the graphics window
selected_point =
-5.4171 +10.4814i
K =
119.6589
p =
-5.4142 +10.4814i
118
-5.4142 -10.4814i
-8.1716

The unit step response of the uncompensated system with K =119.6589, is given
by the following dialogue:

>> M = feedback(K*G1,1)

Transfer function:

119.7 s + 957.3
---------------------------------------
s^3 + 19 s^2 + 227.7 s + 1137

>> step(M)

Figure 2: step response

The step response is shown in Fig.2; the peak time t p =0.296 sec.
The position error constant is

119
Therefore,

Let us now fix specifications for design. Say, we want to design a Lag-Lead
controller so that the closed-loop system operates with a peak time that is two-
thirds that of the uncompensated system at 20% overshoot, with zero steady-
state error for a step input.

To compensate the system to reduce the peak time to two-thirds of the


uncompensated system, we must first find the compensated system's desired
dominant pole location. The imaginary part of the compensated dominant pole is

And the real part is

Next we design a Lead compensator. We search for compensator's zero location


so that the root locus of the compensator system passes through the desired
dominant pole location. If we are using SISO Design Tool (described later in this
module), the trial-and-error search for the compensator zero is straightforward.
Otherwise, we may proceed as follows.

Evaluate the angle contributed by all the poles and zeros of G(s) at
using the following MATLAB command:

>> Sd = -8.1571+15.9202i

Sd =

120
-8.1571 +15.9202i

angle_at_dominant_pole=(180/pi)*(angle(polyval([1,8],Sd
))-(angle(polyval([1,3],Sd))...
+angle(polyval([1,6],Sd))+angle(polyval([1,10],Sd))))

angle_at_dominant_pole =

-198.4967

We find the sum of angles from uncompensated system's poles and zero to the
desired compensated dominant pole to be -198.4967o. Thus the contribution
required from the compensator zero is 198.4967 180 = 18.4967o. Assuming that
compensator zero is located at as shown in Fig.3, we obtain

This gives

Figure 3: Zero Location


Thus the Lead controller is Location

121
The complete root locus for the Lead-compensated system is sketched in Fig.4.
Using rlocfind command, the gain at the design point is 5.2410. Complete analysis
of Lead-compensated system is as follows:

>> D1 = s+55.7467;
>> rlocus(D1*G1);
>> sgrid(zeta,0);
>> [K,p]=rlocfind(D1*G1)
Select a point in the graphics window
selected_point =
-8.1043 +15.6832i
K =
5.2410
p =
-8.0799 +15.6914i
-8.0799 -15.6914i
-8.0812

The zeros are at -8,-55.7467. The effect of third closed-loop pole is nearly
cancelled by a zero.

Figure 4: Root Locus of Lead Compensated

122
The Lead-compensated system has settling time 0.454 sec., peak time 0.178 sec.,
and steady-state error 0.072, as seen in simulation shown in Fig.5.

>> M=feedback(K*D1*G1,1);

>> step(M)

We see the reduction in peak time and improvement in steady-state error over
the uncompensated system.

Figure 5: Unit step response of Lead-compensated system

We now design a Lag compensator to reduce the steady-state error to zero for a
step input. Any Lag compensator will work as long as the zero is placed close to
the origin. This ensures that Lag compensator will not change the transient
response obtained with the Lead compensator (The placement of the zero of the
PI compensator is not entirely arbitrary. The location of the zero influences the
magnitude of the relevant error constants. In the case of example under
consideration, the placement of the zero influences the magnitude of Kv ).

Choosing

123
We sketch the root locus for the Lead Lag compensated system.
The following session generates the root locus and simulates the Lead Lag
compensated system.

>> D2 = (s+0.5)/s
Transfer function:
s + 0.5
----------
.....s
>> D = D1*D2;
>> rlocus(D*G1)
>> sgrid(zeta,0)
>> [K,p]=rlocfind(D*G1)
Select a point in the graphics window
selected_point =
-7.2512 +14.3478i

K =
4.3928

p =
-7.4116 +14.3004i
-7.4116 -14.3004i
-8.1037
-0.4660
>> step(feedback(K*D*G1,1))

The zeros are at -0.5,-8,-55.7467. The effects of third and fourth closed-loop poles
are nearly cancelled by zeros.
Searching the 0.456 damping ratio line (Fig. 6), we find the dominant second-
order poles to be with an associated gain of 4.3928.
Simulation in Fig. 7 gives settling time 2.67 sec, peak time 0.184 sec, and zero
steady state error.

124
Figure 6: root locus for the Lead Lag compensated system.

Figure 7: Unit Step response of Lead Lag Compensated System

125
Lead compensator improved the transient response by decreasing the time
required to reach the first peak as well as yielding some improvement in the
steady-state error. The complete Lead Lag controller further improved the steady-
state error without appreciably changing the transient response designed with
the Lead controller.

3 MATLAB's SISO Design Tool.


The SISO (Single- Input/ Single- Output) Design Tool is a graphical user interface
which allows one to design single-input/single-output compensators by
interacting with the root locus plots and Bode plots of the closed-loop/open-loop
systems. The tool also has the option of using a Nichols chart, which can be
selected under the View menu. After the tool produces these plots, one can
adjust the closed-loop poles along the root locus and read gain, damping ratio,
natural frequency, and pole locations. These changes immediately get reflected to
Bode plots and immediate changes in the system's closed-loop response can be
viewed in the LTI Viewer for SISO Design Tool window.

One can add poles, zeros, and compensators, which can be interactively changed
to see the immediate effects on the root locus, Bode plots, and time response.

With Bode plots, one can affect the gain change by shifting the Bode magnitude
curve up and down; and gain, gain margin, gain crossover frequency, phase
margin, phase crossover frequency, and whether the loop is stable or unstable
can be checked. These changes immediately get reflected to root locus plots and
immediate changes in the system's closed-loop response can be viewed in the LTI
Viewer for SISO Design Tool window.

The following steps are required to use the SISO Design Tool.

1. Access the SISO Design Tool: The SISO Design Tool window, shown in Fig. 8,
can be accessed by typing sisotool in the MATLAB Command Window or by
executing this command in an M-file. In the block diagram given in the top-right
corner of SISO Design Tool window, C represents the compensator.

An interactive tutorial on SISO Design Tool can be invoked by selecting SISO


Design Tool Help under the SISO Design Tool window Help menu.

126
Fig. 8 SISO Design Tool window

2. Create LTI transfer functions: Create open-loop LTI transfer functions for which
you want to analyze closed-loop characteristics or design compensators. The
transfer functions can be created in an M-file or in the MATLAB Command
Window. Run the M-file or MATLAB Command Window statements to place the
transfer function in the MATLAB workspace. All LTI objects in the MATLAB
workspace can be exported to the SISO Design Tool .

The following MATLAB commands create the transfer function

127
num=4500;
den=[1 361.2 0];
G=tf(num,den)

3.Create the closed-loop model for the SISO Design Tool: Choose Import, under
the File menu in the SISO Design Tool window to display the window shown in
Fig. 9.

LTI objects can be selected from the SISO Models list and can be exported to
one of the blocks of the system by pressing the right-facing arrow next to the
selected block ( G, H, F, or C ) located in the section of the window
labeled System Data. Press the Other, button to rotate through a selection of
feedback structures and select the desired configuration. Alternatively, this
can also be done by pressing the FS button on the bottom right corner of
closed-loop block diagram in the SISO Design Tool window (Fig. 10). Root locus
and Bode diagrams will change immediately to reflect the changes in the
feedback structure (Fig. 10).

4. Interact with the SISO Design Tool: After the Import System Data window
closes, the SISO Design Tool window now contains the root locus and Bode
plots for the system as shown in Fig. 10. In this example, we have considered
the open-loop system given by

Under the Analysis menu, select the desired response to open the LTI Viewer for
SISO Design Tool window (Fig. 11). Right-click on the LTI Viewer for SISO Design
Tool and choose desired Plot Types, Systems, and Characteristics.

128
Fig. 9 Import System Data Window

Loop gain can be changed in three different ways:

i. In Root Locus Editor: Keep the mouse pointer on a closed-loop pole (squares) on
the root locus. The arrow cursor changes to a hand. Hold down the left mouse
button and drag the closed-loop pole along the root locus. Bode plot and the
closed-loop response in the LTI Viewer will immediately change to reflect the
gain change. The value of the gain will be displayed in the Current
Compensator section of the SISO Design Tool window.

ii. In Open-Loop Bode Editor: Keep the mouse pointer anywhere on the Bode
magnitude curve. The arrow cursor changes to a hand. Hold down the left mouse
button and shift the curve up or down. Root locus and closed-loop response in
the LTI Viewer will immediately change to reflect the gain change.

iii. In the Current Compensator Window: Type the desired gain value in
the C(s)= box in the SISO Design Tool window.

With gain changes, you can read the gain and phase margins and gain
crossover and phase crossover frequencies at the bottom of the Bode

129
magnitude and phase plots. Also, at the bottom of the Bode magnitude
plot, you are told whether or not the closed-loop system is stable.

Fig. 10 Root locus and Bode plots of G in SISO Design Tool window

130
Fig. 11 LTI Viewer for SISO Design Tool window

5. Design constraints: Design constraints may be added to your plots. These


constraints may be selected by right-clicking a respective plot and
selecting Design Constraints. To put new constraints, choose New… and to
edit existing constraints, choose Edit… . For example, Fig. 12 shows the
selection of design constraint: damping ratio=0.5. On pressing OK,
indicators appear identifying portions of the root locus where the damping
ratio is less than 0.5(shaded gray), equal to 0.5(damping line), and greater
than 0.5( Fig. 13 ). Note the change made in axes limits in this figure with
respect to Fig. 13 using the Property Editor (the description of the Property
Editor is given in the next step).

Constraints may also be edited on the plots. Two black squares appear on

131
the constraint. You can drag these with your mouse anywhere in the plot
region. Point the mouse at the boundary of the constraint. When it changes
to four-pointed arrow, you can drag the boundary to a new position. The
values of the constraints are displayed in the Status Bar at the bottom of
the plots.

Fig. 12 Adding design constraints

Fig. 13 Adding design constraints

132
6. Properties: Right-clicking in a plot's window and
selecting Properties… displays the Property Editor window. From this
window, some of the properties of the plot such as axes labels and limits
can be controlled. Try exploring various options available with root locus
and Bode plot properties editor.

7. Add poles, zeros, and compensators: Poles and zeros may be added
from the SISO Design Tool window toolbar shown in Fig. 13. Let your
mouse pointer rest on the button for a few seconds to see the functionality
of the button in the form of screen tips. Add real pole; Add real zero; Add
complex pole; Add complex zero; Delete pole/zero; ..... functions are
available.

Use the SISO Design Tool toolbar and select the desired real/complex
pole/zero compensator. Move the mouse on the plots; your cursor shows
that a compensator was selected.. Place the cursor arrow to the point on
the root locus or Bode plot where you want to add the compensator, and
click. The compensator will be updated in the Current Compensator section
of the SISO Design Tool window. Compensator addition will be reflected
immediately in the root locus, Bode plots, and LTI Viewer for SISO Design
Tool window.

Go to SISO Tool Preferences… --> Options under the Edit menu to change
the way the compensator is represented.

8. Editing compensators and prefilters: The pole and zero values of the
compensators and prefilters can be edited in several ways. The most
convenient is to click on C or F blocks in the block diagram representation in
top-right corner of the SISO Design Tool window (Fig. M7.23).This
operation will open prefilter or compensator editor window shown in Fig.
M7.24. Desired real/complex zero/pole locations can be edited here. The
same windows can also be opened by following Compensators Edit
C or F from the SISO Design Tool window.

In control systems design, we use compensators of the form

133
That alters the roots of the characteristic equation of the closed-loop system.
However, the closed-loop transfer function, M(s), will contain the zero of D(s) as a
zero of M(s).This zero may significantly affect the response of the system M(s).
We may use a pre-filter F(s) to reduce the effect of this zero on M(s). For example,
if we select

We cancel the effect of the zero without changing the dc gain. Pre-filters may
be employed with lead/PD compensation.

Fig. 14 Editing compensators and prefilters

Example 7.4: Consider a plant with the following transfer function:

134
We will design a cascade controller using SISO Design Tool in interactive
mode, so that the unity feedback closed-loop system meets the following
criteria (refer Kuo and Golnaraghi(2003)):

Steady-state error due to unit-ramp input = 0.000443

Maximum overshoot = 5 percent

Rise time = 0.002 sec

Settling time sec

The first step is to import the model into SISO Design Tool. System transfer
functions can be imported in SISO Design Tool by clicking on File and then
going to Import… Before executing this sequence, create transfer
function G in MATLAB Command Window:

num=4500;

den=[1 361.2 0];

G=tf(num,den)

In order to examine the system performance, we start by using a


proportional controller. The system root locus can be obtained by clicking
on View in the main menu and then selecting Root Locus only. Fig. 15
shows the root locus of the system. The plot is for K =1(by default).

135
Fig. 15: Root locus of the system.

In order to see the poles and zeros of G and H , go to the View menu and
select System Data, or alternatively, double click the block G or H in the
top-right corner of the block diagram in the SISO Design Tool window.
The System Data window is shown in Fig. 16.

Fig. 16.The System Data window


136
You may obtain the closed-loop system poles by selecting Closed-Loop
Poles from the View menu. Closed-loop poles are given in Fig. 17.

Fig. 17: Closed-loop poles

In order to see the closed-loop system time response to a unit-step input, select
the Response to Step Command in the Analysis main menu. With specific
selections made in Systems and Characteristics submenus, we generate Fig. 18,
which shows the unit step response of the closed-loop system with unity gain
controller, i.e. , K= 1.

Fig. 18: which shows the unit step response of the closed-loop system
with unity gain controller

137
As a first step to design a controller, we use the built-in design criteria
option within the SISO Design Tool to establish the desired closed-loop
poles regions on the root locus. To add the design constraints, use
the Edit menu and choose the Root Locus option. Select New to enter the
design constraints. The Design Constraints option allows the user to
investigate the effect of the following:

o Settling time
o Percent overshoot
o Damping ratio
o Natural frequency

We will use the settling time and the percent overshoot as primary
constraints. After designing a controller based on these constraints, we will
determine whether the system complies with the rise time constraint or
not. Figure 19 shows the addition of settling time constraint. Peak
overshoot constraint is added on similar lines.

Fig. 19 shows the addition of settling time constraint.

Figure 20 shows the desired closed-loop system pole locations on the root
locus after inclusion of the design constraints (Note that the scale has been
modified by following Right click --> Properties --> Limits. Left-clicking
anywhere inside plot will remove the black squares on the zeta lines).
Obviously, closed-loop poles of the system for K = 1 are not in the desired
area. Note the definition of the desired area: the vertical gray bar signifies
the boundary for that portion of the root locus where the settling time
requirement is not met; and the gray bars on damping lines signify the
boundary for that portion of the root locus where the peak overshoot
requirement is not met.

138
Changing K will affect the pole locations. In the Root Locus window, C(s)
represents the controller transfer function. Fig. 20 corresponds
to C(s) = K = 1 . Hence, if C(s) is increased, the effective value of K increases,
forcing the closed-loop poles to move together on the real axis, and then
ultimately to move apart to become complex. See Fig. 21 wherein K= 16.8
gives closed-loop poles on the damping lines. However, the settling time
requirement is not met.

Fig: 20 shows the desired closed-loop system pole locations on the root
locus after inclusion of the design constraints

139
Fig 21: The closed-loop poles of the system must lie to the left of the
boundary imposed by the settling time

The closed-loop poles of the system must lie to the left of the boundary
imposed by the settling time (Fig. 21). Obviously, it is impossible to use the
proportional controller (for any value of K ) to move the poles of the closed-
loop system farther to the left-hand plane. However, a PD
controller C(s)= K (1+ sTD ) may be used to accomplish this task. The zero s =
- 1/ TD of the compensator has to be placed far into the left half plane to
move the root-locus plot to the left. We have tried various values:

s = - 1/0.0005; - 1/0.001; - 1/0.0015; - 1/0.002,...

The value s = -1/0.00095 gives satisfactory results.

To add a zero to the controller, click the C block in the block diagram in top-
right corner of Fig. 21. Fig. 22 shows the Edit Compensator window and
how the PD controller is added:

140
Fig. 22: the Edit Compensator window

Figure 23 shows the plot for s= - 1/0.00095. Note that the closed-loop poles
have been dragged to the desired locations. The value of K that achieves
the desired dominent closed-loop poles is 282. This value of K forces the
closed-loop poles to the desired region. The system closed-loop poles are
shown in Fig. 24.

Fig 23: The plot for s= - 1/0.00095.

141
Fig 24: The system closed-loop poles

The step response of the controlled system in Fig. 25 shows that the system
has now complied with all design criteria.

Fig. 25: The step response of the controlled system

142
Lab Task
Question No. 1: Consider the system shown in Figure 1. Design a compensator
such that the dominant closed-loop poles are located at .

Figure 1: Close loop Control System

Question No. 02: Consider the control system shown in Figure 9. Design a lag
compensator Gc(s) such that the static velocity error constant Kv is 50 sec–1
without appreciably changing the location of the original closed-loop poles, which
are at

Figure 2: Close loop Control System

Question No. 03: A unity feedback control system has the following forward
transfer function:

a. Design a lead compensator to yield a closed-loop step response with 20.5%


overshoot and a settling time of 3 seconds.

143
b. Is your second-order approximation valid ?

Question 4: Given the uncompensated unity feedback system with

do the following:
a. Design a lead lag compensator to yield the following specifications: settling
time = 2.86 seconds; percent overshoot = 4.32%; the steady-state error is to be
improved by a factor of 2 over the uncompensated system.
b. Compare the transient and steady-state error specifications of the
uncompensated and compensated systems.
c. Compare the gains of the uncompensated and compensated systems.
d. Discuss the validity of your second-order approximation.

Question 5: For the unity feedback system given in with

do the following:
a. Find the gain, K, for the uncompensated system to operate with 30%
overshoot.
b. Find the peak time and Kv for the uncompensated system.
c. Design a lag-lead compensator to decrease the peak time by a factor of 2,
decrease the percent overshoot by a factor of 2, and improve the steady-state
error by a factor of 30. Specify all poles, zeros, and gains.

144
Assessment Sheet

Name:___________________________

Regd. No._________________________

Date of Lab:_________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

145
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge to Model of physical systems behavior of Model the
the behavior of but have no physical systems behavior of
physical systems with supporting materials in bit and pieces physical systems
supporting materials with no
(mathematically , supporting
block diagram, material
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

146
Lab – 10: Stability Analysis on Bode / Nyquist Plots
Objectives:
 Introducing MATLAB commands for Bode and Nyquist plots.
 Stability analysis using these plots

1.Introduction:

As with the root locus plots, it will be tempting to rely exclusively on MATLAB to
obtain Bode, Nyquist, and other frequency-response plots. We strongly
recommend that MATLAB should be treated as one tool in the tool kit that can be
used to design and analyze control systems. There is no substitute for a clear
understanding of the underlying theory.

MATLAB font does not permit the frequency symbol , which will appear as w in
our MATLAB codes. Also note that the default unit for frequency is rad/sec. This
can be altered, if required, to hertz by editing the plot axes; but we will continue
to use rad/sec

2.Bode Plots:
For a given transfer function G(s), Bode plot can be produced in different ways:

1. By simply using the command

bode (G)

We will get the Bode plot of G(s) in the current window for a default frequency
range set by the MATLAB package. MATLAB will automatically choose the
frequency values by placing more points in regions where the frequency response
is changing rapidly. Fig. 1 shows the Bode diagram for the transfer function

generated by the following code.

147
s = tf('s');

G = (s+1)/(0.1*s+1);

bode(G);

Fig. 1: Bode diagram for the transfer function

2. To produce a Bode plot over a specified frequency range wmin to wmax, we


use the command

bode (G, {wmin, wmax})

For example, bode(G,{0.1,10}) will produce a Bode plot in the range 0.1 to 10
rad/sec, shown in Fig. 2.

148
Fig. 2: Bode plot over a specified frequency range wmin to wmax.

If we supply the vector


w = [0.1; 0.3; 0.5; 0.7; 0.9; 1.0; 3.0; 5.0; 7.0; 9.0; 10];

and type

bode (G,w)

MATLAB will compute the magnitude and phase at the frequency points supplied
in the frequency vector.

If you choose to specify the frequencies explicitly, it is desirable to generate the


vector w using the logspace function. logspace (d1,d2) generates a vector of 50
points logarithmically equally spaced between decades 10d1 and 10d2. (50 points
include both endpoints. There are 48 points between the endpoints). To generate
50 points between 0.1 rad/sec and 100 rad/sec, enter the command
w = logspace (-1,2)

149
logspace(d1,d2,n) generates n points logarithmically equally spaced
between decades 10d1 and 10d2 ( n points include both endpoints). For example,
to generate 100 points between 1 rad/sec and 1000 rad/sec, enter the command

w = logspace (0,3,100)

3. When invoked with left-hand arguments, such as

[mag,phase,w] = bode (G)

bode returns the frequency response of the system in variables mag,


phase and w. No plot is drawn on the screen. The magnitude and phase
characteristics are placed in the workspace through the matrices mag and phase.
The vector w contains the values of the frequency in rad/sec at which the
magnitude and phase will be calculated.

If we supply the vector w and type

[mag, phase, w] = bode (G,w)

MATLAB will use the frequency vector supplied and compute the magnitude and
phase at those frequency points. This is clear from the following MATLAB session.

>> w = logspace(-1, 1, 5)
w =
0.1000 0.3162 1.0000 3.1623 10.0000
>> [mag,phase,w]=bode(G,w)
mag(:,:,1) =
1.0049
mag(:,:,2) =
1.0483
mag(:,:,3) =
1.4072
mag(:,:,4) =
3.1623
mag(:,:,5) =
7.1063
phase(:,:,1) =
5.1377
phase(:,:,2) =

150
15.7372
phase(:,:,3) =
39.2894
phase(:,:,4) =
54.9032
phase(:,:,5) =
39.2894
w =
0.1000
0.3162
1.0000
3.1623
10.0000

MATLAB does not assume that the system is a SISO system, but allows greater
flexibility for dealing with more complex systems. MATLAB
stores mag and phase variables as matrices of dimension p x q x n, where p is the
number of inputs, q is the number of outputs, and n is the number of frequency
points. For SISO systems, the dimension of mag and phase will be To
th th
access the magnitude and phase points for p input and q output, we have to
write mag(p, q, :) orphase(p, q, :). For example,

>> mag(1,1,3)
ans =
1.4072
>> phase(1,1,3)
ans =
39.2894

For SISO systems, mag(:,:,3) and phase(:,:,3) will also give the same answer.

We use mag(:,:)', phase(:,:)' to convert arrays to column vectors, where the


apostrophe signifies matrix transpose. For example, the following command
stores points of the Bode plot in matrix form with magnitude in dB, phase in
degrees, and frequency in rad/sec.

bode_points = [w, 20*log10( mag(:,:)' ), phase(:,:)' ]

Information about the plots obtained with bode can be found by left-clicking the
mouse on the curve. You can find the curve's label, as well as the coordinates of

151
the point on which you clicked. Right-clicking away from a curve brings up a
menu. Form this menu, you can select (i) system responses to be displayed
(magnitude plot, phase plot, or both), and (ii) characteristics, such as peak
response and stability margins. When selected, a dot appears on the curve at the
appropriate point. Let your mouse rest on the point to read the value of the
characteristic. You may also (iii) select the frequency units in Hz., magnitude in
absolute, phase in radians, (iv) set axis limits, and (v) grid etc.

A Bode plot with grid selected is shown in Fig. 3.

Fig. 3: A Bode plot with grid selected

3. Nyquist Plots
We can use MATLAB to make Nyquist plots using the command nyquist(G).
Information about the plots obtained with this command can be found by left-
clicking the mouse on the curve. You can find the curve's label, as well as the
coordinates of the point on which you have clicked and the frequency. Right-
clicking away from a curve brings up a menu. From this menu, you can select (i)
system responses to be displayed (with and without negative frequencies), and (ii)
characteristics, such as peak response and stability margins. When selected, a dot

152
appears on the curve at the appropriate point. Let your mouse rest on the point
to read the value of the characteristic. You may also (iii) select the frequency units
in Hz., (iv) set axis limits, and (v) grid etc.

We can obtain points on the plot by using [re im w] = nyquist(G), where the real
part, imaginary part, and frequency are stored in re, im, and w,
respectively. re and im are 3-dimensional arrays. We use re(:,:)' and im(:,:)' to
convert the arrays to column vectors. We can specify the range of wby
using [re,im] = nyquist(G,w).

A sample Nyquist plot generation is illustrated below.

s = tf('s');
G = 1/(s^2+0.8*s+1);
nyquist(G);
axis equal;

Fig. 4: Nyquist plot for transfer function

Axis used should be ' equal ', otherwise circles appear squashed.

153
Note that when a MATLAB operation involves ' Divide by zero ', the resulting
Nyquist plot may be erroneous. For example, Nyquist plot of

is shown in Fig. 5.

G=1/((s)*(s+1));
nyquist(G)

Fig. 5: Nyquist plot for transfer function

If such an erroneous Nyquist plot appears, then it can be corrected by


manipulating the axes. For example, manipulating the x-axis to [-2,2] and y-axis to
[-5,5] in Fig .5, results in the Nyquist plot shown in Fig. 6.

154
Fig. 6: Nyquist plot for transfer function

Sometimes in the course of using the nyquist function, we may find that a Nyquist
plot looks nontraditional or that some information appears to be missing. It may
be necessary in these cases to adjust the axes and override the automatic scaling,
and/or to use the nyquist function with left-hand arguments with specified
frequency range in conjunction with the plot function. In this way we can focus on
the critical region for our stability analysis.

3. Stability Margins
We use [GM, PM] = margin(G) to find gain margin (GM) and phase margin (PM).

We use [GM, PM, wg, wphi] = margin(G) to find gain margin (GM), phase margin
(PM), gain crossover frequency (wg), and phase crossover frequency (wphi).

The margin function is invoked in conjunction with the bode function to compute
gain and phase margins. If the margin(G) is invoked without left-hand arguments,
the Bode plot is automatically generated with gain margin, phase margin, gain
crossover frequency, and phase crossover frequency labeled on the plot. This is
illustrated in Fig. 7.

155
s = tf('s');
G = 1/(s^2+0.8*s+1);
margin(G);

Fig. 7: Bode plot to compute gain and phase margins.

Stability margins, and gain and phase crossover frequencies are also given by the
right-clicking feature on the plots generated using the MATLAB
functions nyquist and bode.

156
Lab Task
Question No 1: Find analytical expressions for the magnitude and phase response
for each G(s) below.

Question No 2: Sketch the Nyquist diagram for each of the systems in Fig. 8.

Figure 8: System for Lab Task 2

Question No 3: Using the Nyquist criterion, find out whether each system of Lab
Task 2 is stable.

157
Assessment Sheet

Name:___________________________

Regd. No._________________________

Date of Lab:_________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

158
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge to Model of physical systems behavior of Model the
the behavior of but have no physical systems behavior of
physical systems with supporting materials in bit and pieces physical systems
supporting materials with no
(mathematically , supporting
block diagram, material
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

159
160
161
Assessment Sheet

Name:___________________________

Regd. No._________________________

Date of Lab:_________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

162
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge to Model of physical systems behavior of Model the
the behavior of but have no physical systems behavior of
physical systems with supporting materials in bit and pieces physical systems
supporting materials with no
(mathematically , supporting
block diagram, material
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

163
164
Assessment Sheet

Name:___________________________

Regd. No._________________________

Date of Lab:_________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

165
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge to Model of physical systems behavior of Model the
the behavior of but have no physical systems behavior of
physical systems with supporting materials in bit and pieces physical systems
supporting materials with no
(mathematically , supporting
block diagram, material
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

166
167
Assessment Sheet

Name:___________________________

Regd. No._________________________

Date of Lab:_________________________

Performance Parameter Marks

Example
Lab Section
Lab Task

Working
Lab Performance
Viva

Total Score in Lab

Instructor’s Verification

168
Lab No. _____________

Name:_______________

Rubrics for Assessment of Lab Date:_________________


OBE System
Level of Proficiency
Criteria PLO Below Basic Marks
Excellent (4) Very Good (3) Basic (2)
(1)
Model 1 Perfectly apply basic Model the behavior Model the Could not
knowledge to Model of physical systems behavior of Model the
the behavior of but have no physical systems behavior of
physical systems with supporting materials in bit and pieces physical systems
supporting materials with no
(mathematically , supporting
block diagram, material
formula)

Data Analyzes and Analyzes and Analyzes a data Unable to


Interpreta interprets data interprets data correctly Analyzes and
tion 2 correctly for all tasks correctly for few however unable interprets data
/ experiments in the tasks / experiments to interprets it for any tasks /
lab in the lab for tasks / experiments in
experiments in the lab
the lab
Design 3 Specifications, Specifications, Some No
parameters, parameters, Specifications, specifications,
constraints of design constraints of design parameters, parameters,
are present. Detailed are present. constraints of constraints of
calculations and / or Sufficient design are design are
procedures to obtain calculations and / or present. present. No
the designs are procedures to obtain Insufficient sufficient
provided. the designs are calculations and calculations
provided. / or procedures and / or
to obtain the procedures to
designs are obtain the
provided. designs are
provided.
Apparatus 5 Can independently Can setup, operate Cannot setup Cannot setup
Usage setup, operate and and handle the apparatus or handle the
handle the apparatus apparatus with according to apparatus
minimal help. design but know
how to handle
apparatus

169
Lab – 14: Open Ended Lab
Introduction
To make a joint project within lab addressing a real life task/problem using all the
available apparatus in the lab.

This is Open Ended (OE) in the sense that the problem can be solved using more
than one solution and students are free to choose using their own initiative and
creativity.

Students are encouraged to get extensive information from the library, journals
and reports to research methods.

Pre-Lab Reading
All the Labs that has been done.

Exercise
To be announced by Instructor in the last lab of manual.

Methodology
The students are divided into groups of four/five and each group is given 3 hours
duration of in-lab sessions and one week of out-lab session. An in-lab session
means students carry out work during laboratory class, while an out-lab session is
the discussion handled outside class time with the group members once the
project is underway.

OBE System:
The OE project is designed so that students will achieve the course Lab outcomes.

Assesment:
Assessments will be carrying out using the rating given in the rubrics.

170
Rubrics for Assessment of Open Ended Lab

1. Accuracy (Marks = 4)

How much a student identifies and clearly addresses both the main question and subsidiary,
embedded, or implicit aspects of the problem.

Unsatisfactory Good (2) Very Good (3) Excellent (4) Marks


(1)
The student shows The student The student The student
an undeveloped shows a demonstrates shows an
knowledge and developing knowledge and advanced
application of knowledge of application of knowledge and
objectives. Shows radial balance radial balance application of
little or no and shows and shows the objectives
creativity in open some creativity creativity in and shows
ended task (no in open ended open ended excellent
additional details). task. task. creativity in
open ended
task.

2. Completeness (Marks = 4)

How much a student explains, accurately and thoroughly, multiple solutions, positions, or
perspectives that balance opposing points of view?

Unsatisfactory (1) Good (2) Very Good (3) Excellent (4) Marks
The open ended task The open ended The open ended The open ended
was complete but did task was task was task was 100%
not work as required; complete but complete and complete and
needed several major did not work as worked, but worked
modifications. required; needed few according to the
needed some minor task
minor modifications. description.
modifications.

171
3. Teamwork (Marks = 4)

How much a student is able to work collaboratively, if the student is giving his/her best in any
circumstances? If the student is able to cooperate, using his/her individual skills and providing
constructive feedback, despite any personal conflict between individuals.

Unsatisfactory (1) Good (2) Very Good (3) Excellent (4) Marks
Shares ideas but does Offers new Offers alternative Helps the team
not advance the work suggestions solutions or move forward by
of the group. to advance courses of action articulating the
the work of that build on the merits of alternative
the group. ideas of others. ideas or proposals.

4. Time Management (Marks = 4)

It is key to efficient working. How much a student is able to use his/her time effectively or
productively towards achieving the goal?

Unsatisfactory (1) Good (2) Very Good (3) Excellent (4) Marks
Original Timeline Original Original timeline
is not followed; timeline is not is not followed
Project lagging followed exactly due to Original
behind. exactly; unforeseen timeline is
exceptions circumstances. followed and
were not met.
properly
handled.

5. Presentation (Marks = 4)

How much a student clearly states and discusses conclusions. Does he /she considers
implications and consequences of the conclusion in context, relative to assumptions, and
supporting evidence? Does he provide reflective thought with regards to the assertions?

Unsatisfactory (1) Good (2) Very Good (3) Excellent (4) Marks
Contents Contents Contents Contents
unorganized, organized in organized in organized in
inability to answer order, inability order and with detail and in
any questions. to answer some proper details, order, able to
questions able to answer answer all
accurately. most questions questions with
adequately. precision.

172
173

You might also like