0% found this document useful (0 votes)
185 views14 pages

Linear Control System Lab: Familiarization With Transfer Function and Time Response

This lab document discusses linear time-invariant (LTI) systems in MATLAB. It covers: 1. Representing LTI systems using transfer functions and plotting pole-zero maps 2. Simulating responses to impulse, step, and arbitrary inputs using commands like impulse, step, and lsim 3. Four exercises involving analyzing transfer functions, plotting pole-zero maps and step/impulse responses
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
185 views14 pages

Linear Control System Lab: Familiarization With Transfer Function and Time Response

This lab document discusses linear time-invariant (LTI) systems in MATLAB. It covers: 1. Representing LTI systems using transfer functions and plotting pole-zero maps 2. Simulating responses to impulse, step, and arbitrary inputs using commands like impulse, step, and lsim 3. Four exercises involving analyzing transfer functions, plotting pole-zero maps and step/impulse responses
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Linear Control System Lab Lab 3

Familiarization with Transfer Function and Time Response

Objectives

This experiment has following two objectives:


1. We will learn commands in MATLAB that would be used to represent LTI systems in
terms of transfer function or pole-zero gain representations.
2. We will also learn how to make preliminary analysis of such systems using plots of poles
and zeros locations as well as time response due to impulse, step and arbitrary inputs.

List of equipment/Software

1) MATLAB
2) Computer

Transfer Function

Then the transfer function representation of the system is given by


Output F a ( s) 1
TF= = = (1)
Input X ( s) ( M S + Bs+ K )
2

Linear Time-Invariant Systems in MATLAB:


Control System Toolbox in MATLAB offers extensive tools to manipulate and analyse linear
time-invariant (LTI) models. It supports both continuous- and discrete-time systems. Systems
can be single-input/single-output (SISO) or multiple-input/multiple-output (MIMO). You can
specify LTI models as:
Transfer functions (TF), for example,
s+2
P ( s )= 2
s + s +10 (2)

Note: All LTI models are represented as a ratio of polynomial functions.


Examples of Creating LTI Models:
Building LTI models with Control System Toolbox is straightforward. The following sections
show simple examples. Note that all LTI models, i.e. TF, ZPK and SS are also MATLAB
objects.
Example of Creating Transfer Function Models:
You can create transfer function (TF) models by specifying numerator and denominator
coefficients. For example,

Page | 1
Linear Control System Lab Lab 3
>>num = [1 0];
>>den = [1 2 1];
>>sys = tf(num,den)

Transfer function:

Example of Creating Zero-Pole-Gain Models:


To create zero-pole-gain (ZPK) models, you must specify each of the three components in vector
format. For example,

>>sys = zpk([0],[-1 -1],[1])

Zero/pole/gain:

Produces the same transfer function built in


the TF example, but the representation is now
ZPK. This example shows a more complicated
ZPK model.

>>sys=zpk([1 0], [-1 -3 -.28],[.776])

Zero/pole/gain:

Plotting poles and zeros of a system:


pzmap:
Compute pole-zero map of LTI models
pzmap(sys)
pzmap(sys1,sys2,...,sysN)
[p,z] = pzmap(sys)
Figure 3.2: pole zero plot

Description:
pzmap(sys) plots the pole-zero map of the
continuous- or discrete-time LTI system. For SISO systems, pzmap plots the transfer function

Page | 2
Linear Control System Lab Lab 3
poles and zeros. The poles are plotted as x's and the zeros are plotted as o's.
pzmap(sys1,sys2,...,sysN) plots the pole-zero map of several LTI models on a single figure 3.3.
The LTI models can have different numbers of inputs and outputs. When invoked with left-hand
arguments,
[p,z] = pzmap(sys) returns the system poles and zeros in the column vectors p and z. No plot is
drawn on the screen. You can use the functions sgrid or zgrid to plot lines of constant damping
ratio and natural frequency in the s- or z- plane.
Example:
Plot the poles and zeros of the continuous-time system.
2 s2 +5 s+1
H ( s )= 2 (3)
s +2 s+3

n=[2 5 1];
d=[1 2 3];
s=tf(n,d)
2 s^2 + 5 s + 1
y1: ---------------
s^2 + 2 s + 3
pzmap (s)

Simulation of linear systems to different inputs

Impulse, step and lsim:

You can simulate the LTI systems to inputs like


impulse, step and other standard inputs and see the plot of the response in the figure 3.3 window.

MATLAB command ‘impulse’ calculates the unit


impulse response of the system, ‘step’ calculates
the unit step response of the system and ‘lsim’
simulates the (time) response of continuous or
discrete linear systems to arbitrary inputs. When
invoked without left-hand arguments, all three
commands plots the response on the screen. For
example:
To obtain an impulse response

>>H=tf([2 5 1],[1 2 3])


>>impulse(H)

Page | 3
Linear Control System Lab Lab 3
To obtain a step response type
>>step(H) Figure 3.3: Impulse Response
Time-interval specification:
To contain the response of the system you can also specify the time interval, as shown in figure
3.5,

For example,

>>t=0:0.01:10;
>>impulse(H,t)
Or
>>step(H,t)

Figure 3.4: Step Response Figure 3.5: Response to an arbitrary input

Simulation to Arbitrary Inputs:


To simulates the (time) response of continuous or discrete linear systems to arbitrary inputs use
‘lsim’. When invoked without left-hand arguments, ‘lsim’ plots the response on the screen.
lsim(sys,u,t) produces a plot of the time response of the LTI system to the input time
history ‘t’,’u’. The vector‘t’ specifies the time samples for the simulation and consists of
regularly spaced time samples.

T = 0:dt:Tfinal

The matrix u must have as many rows as time samples (length(t)) and as many columns as
system inputs. Each row u(I,:) specifies the input value(s) at the time sample t(i).

Simulate and plot the response of the system in equation (2) to a square wave with period of four
seconds.

First generate the square wave with gensig.

Sample every 0.1 second during 10 seconds:

Page | 4
Linear Control System Lab Lab 3
>>[u,t] = gensig(‘square’,4,10,0.1);

Then simulate with lsim.

>> H = tf([2 5 1],[1 2 3])

Transfer function:

2 s2 +5 s+1
s 2+2 s+3

>> lsim(H,u,t)

Exercise 01

Consider the transfer function


6 s2 +1
G s= 3
( )
s +3 s 2+3 s+7

Using MATLAB plot the pole zero map of the above system.

Exercise 02

Obtain the unit impulse response for the following system

B( s) 1
= 2
A (s) s +0.2 s+1
Obtain the unit step response for the following system

B( s) s
=
A (s) s2 +0.2 s+1

Explain why the results in a. and b. are same?

Exercise 03

A system has a transfer function


X (s) (15/ z)(s+ z )
= 2
R( s) s +3 s +15

Plot the response of the system when R(s) is a unit impulse and unit step for the
parameter z=3, 6 and 13.

Page | 5
Linear Control System Lab Lab 3

Exercise 04

Consider the differential equation ÿ + 4 ẏ +4 y =u where y(0)= ẏ ( 0 )=0 and u(t) is a unit step.
Determine the solution analytically and verify by co-plotting the analytical solution and the step
response obtained with ‘step’ function.

Please submit the exercise in the next lab.

Task1:

n=[6 0 1];
d=[1 3 3 7];
s=tf(n,d)

Transfer function 's' from input 'u1' to output ...

6 s^2 + 1
y1: ---------------------
s^3 + 3 s^2 + 3 s + 7

Page | 6
Linear Control System Lab Lab 3
Continuous-time model.
pzmap (s)

TASK2.1:
n=[0 0 1];
d=[1 .2 1];
s=tf(n,d)

Transfer function 's' from input 'u1' to output ...

1
y1: ---------------
s^2 + 0.2 s + 1

Continuous-time model.
figure (1)

Page | 7
Linear Control System Lab Lab 3
impulse (s)

TASK 2.2:
n=[0 1 0];
d=[1 .2 1];
s=tf(n,d)

Transfer function 's' from input 'u1' to output ...

s
y1: ---------------
s^2 + 0.2 s + 1

Continuous-time model.
figure (2)

Page | 8
Linear Control System Lab Lab 3

TASK 3:
When z=3,
n=[5 15];
d=[1 3 15];
s=tf(n,d)

Transfer function 's' from input 'u1' to output ...

5 s + 15
y1: --------------
s^2 + 3 s + 15

Continuous-time model.
subplot (321)
step (s)

Page | 9
Linear Control System Lab Lab 3
subplot (322)
impulse (s)

When z=6,

n=[2.5 15];
d=[1 3 15];
s=tf(n,d)

Transfer function 's' from input 'u1' to output ...

2.5 s + 15
y1: --------------
s^2 + 3 s + 15

Continuous-time model.
subplot(323)
step (s)
subplot (324)
impulse (s)

Page | 10
Linear Control System Lab Lab 3

When Z=13,
n=[1.154 15];
d=[1 3 15];
s=tf(n,d)

Transfer function 's' from input 'u1' to output ...

1.154 s + 15
y1: --------------
s^2 + 3 s + 15

Continuous-time model.
s=tf(n,d)

Transfer function 's' from input 'u1' to output ...

1.154 s + 15
y1: --------------
s^2 + 3 s + 15

Page | 11
Linear Control System Lab Lab 3
Continuous-time model.
subplot(325)
step (s)
subplot (326)
impulse (s)

TASK 4:
n=[1];
d=[1 4 4];
s=tf(n,d)

Transfer function 's' from input 'u1' to output ...

1
y1: -------------
s^2 + 4 s + 4

Page | 12
Linear Control System Lab Lab 3
Continuous-time model.
step (s)

Laboratory Rubrics
Sr. Performance Exemplary Satisfactory Developing Unsatisfactory (0 Marks)
# Indicator (5 Marks) (4-3 Marks) (2-1 Marks)
Individual and Respectful to one another Collaborative effort Need training and Unsupportive attitude
teamwork while providing timely of a group with support to work with no interest towards
1 and helpful feedback and delayed feedback to effectively in a team individual or common
(PLO-09, allow healthy conflict. achieve a common and individually. goal.
Affective goal in a less efficient
Domain) way.

Scale

Page | 13
Linear Control System Lab Lab 3
Data Analyse and interprets Analyse and Analyse and Analyse and interprets
exploration and data correctly and interprets data interprets data incorrect data with wrong
2 analysis precisely, draws correct correctly most of the correctly conclusions.
and useful conclusions time with correct and occasionally with
(PLO-04, by keenly observing useful conclusion. some incorrect
Cognitive theoretical and conclusion.
Domain) experimental results.

Scale
Skill to Quite able to conduct the Able to conduct Able to conduct Unable to conduct
perform test entire experiment with experiment with experiment with a experiment on his own
3 experiment negligible help from the some help from the lot of help from the and lab instructor
(PLO-04, lab instructor. lab instructor. lab instructor. provides help in almost
Psychomotor every step of the
Domain) experiment.

Scale
Table 1: Lab Performance

Sr.# Performance Exemplary Satisfactory Developing Unsatisfactory (0 Marks)


Indicator (5 Marks) (4-3 Marks) (2-1 Marks)
1 Depth of Demonstration of full At ease with content Only basic concepts Clearly no knowledge of
relevant knowledge of the and able to elaborate are demonstrated and subject matter, no
Information subject with and explain to some interpreted. questions are answered,
(PLO-04, explanations and degree. and no interpretation
Cognitive elaboration. made.
Domain)
Scale
Table 2: Viva Voce

Instructor Signature: ___________________________

Page | 14

You might also like