You are on page 1of 16

Sir Syed Center for Advanced Studies in Engineering

Institute of Technology, Islamabad

CONTROL SYSTEMS LAB

Experiment # 02: Developing Transfer Function, Block Diagram


Reduction & Pole Zeros Map of Transfer Function
Name of Student: …………………………………………………….

Roll No.: ……………………………………………………………….

Date of Experiment: ………………………………………………….

Report submitted on: ………………………………………………..

Marks obtained: ……………………………………

Remarks: ……………………………………………

Instructor’s Signature: ……………………………...


Fall 2018-Semester V
SSCASEIT

Experiment # 02
Developing Transfer Function, Block Diagram Reduction & Pole
Zeros Map of Transfer Functions

Objectives:
1. We will learn commands in MATLAB that would be used to represent such systems in
terms of transfer function or pole-zero gain representations and also find laplace
transform using MATLAB.
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.

1.1 LTI System in MATLAB


Control System Toolbox in MATLAB offers extensive tools to manipulate and analyze
linear time-invariant (LTI) models. It uses custom data structures called LTI objects to store
model-related data, for each type of mode TF, ZPK, and FRD objects for transfer function,
zero/pole/gain, and frequency data response models respectively. These LTI model
objects encapsulate the model data. They allow you to manipulate LTI systems as single
entities rather than collections of data vectors or matrices.
Depending on the type of model you use, the data for your model can include:
• One or more numerator/denominator pairs for transfer functions
• Zeros and poles for zero-pole-gain models.

1.2 Transfer Function


The transfer function provides a basis for determining important system response
characteristics without solving the complete differential equation. As defined, the transfer
function is a rational function in the complex variable s. The transfer function is the ratio
of the output Laplace Transform to the input Laplace Transform
G(s) = N(s)
D(s)
The roots of the equation for which N(s)=0, are defined to be the system zeros.
The roots of the equation for which D(s)=0, are defined to be the system poles.

1.3 Method of Creating LTI Models


1. Vector Method, Polynomial Form
2. Vector Method, Factored Form
3. Rational Expression in s Method

Control Systems Lab 2


SSCASEIT

1. Vector Method, Polynomial Form


Create a transfer function model in polynomial form using MATLAB and simulink.
>>G = tf(num,den)

Create the transfer function G(s) = s/(s2 + 2s + 1), using: >> G = tf([1 0],[1 2 1])
>> pole(G)
>> zero(G)

2. Vector Method, Factored Form


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

Create transfer functions in factorized (zpk) form using:


>>G = zpk(z, p, k)
For example, the transfer function G(s) = s/(s + 1)^2 in factorized form is given by:
>> sys = zpk([0],[-1 -1],[1])
Zero/pole/gain:
s
-------
(s+1)^2

3. Rational Expression in s Method


This method allows you to type transfer function as you normally write it. The transfer
function can be typed in any form regardless of whether s=tf(‘s’) or s=zpk(‘s’) is used.
>> s=tf('s');
>> F=150*(s^2+2*s+7)/(s*(s^2+5*s+4))
Transfer function:
150 s^2 + 300 s + 1050
----------------------
s^3 + 5 s^2 + 4 s

1.4 Conversion from zeros, poles to transfer function


The MATLAB function zp2tf(z,p,k) convert the numerator and denominator from roots to
coefficient.
>> z=[-3];
>> p=[-1 -2];
>> k=[1];

Control Systems Lab 3


SSCASEIT

>> [num,den]=zp2tf(z,p,k)

1.5 Conversion from transfer function to zeros, poles


The MATLAB function tf2zp(num,denum) convert the numerator and denominator from
coefficient to roots.
Transfer function:
s+3
-------------
s^2 + 3 s + 2

>> [z,p,k] = tf2zp(num,den)

1.7 Plotting zeros and poles of a system


Pzmap
pzmap(sys) plots the pole zero map of the continuous- or discrete-time LTI model.
pzmap(sys1,sys2,...,sysN) plots the pole-zero map of several LTI models on a single figure.
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.

Figure-1: Stable and Unstable Region in pzmap


Consider a transfer function 10/s2+3s+10.
>> num=[0 10];
>> den=[1 3 10];
>> pzmap(num,den)
>> TF=tf(num,den) ;
>> roots(num);
>> roots(den);

Control Systems Lab 4


SSCASEIT

Figure-2: Pzmap

2.1 Standard Test Inputs


In most cases, the input to the control system is not known prior to the design of control
system. Hence to analyze the performance of a system, we have to test it with some
standard test signals. In general, control system design specification is also based on the
response of system to these standard signals. The standard test signals include,
1. Unit Impulse Signal
2. Unit Step Signal (sudden change)
3. Ramp Signal (constant velocity)
4. Parabolic Signal (constant acceleration)
5. Sinusoidal Signal
These inputs are chosen because they can capture many of possible variation that can
occur in an arbitrary input.

2.2 First Order System


System with one pole is called first order system. First order systems contain a single
energy storage element. In general, the order of the input-output differential equation
will be the same as the number of independent energy storage elements in the system.

Figure-3: 1st Order System

Control Systems Lab 5


SSCASEIT

K: Dc gain of system which is the relation between the input signal and the steady state
value of output.
T: It characterize the speed of response of system to an input. Higher the time constant
slower is the response and vice versa.

2.3 Impulse Response of 1st Order System


An impulse response means the output or behavior of a system, when we provide it with
an impulse signal. Consider the system as shown in fig 4.

Figure-4: Impulse Response

In order to represent the response of the system in time domain we need to compute the
inverse Laplace transform of the above equation, we have

MATLAB Code
The impulse response of system with K=1 and T=1, T=2 is shown in fig 5.
>> a=1/(s+1)
>> b=1/(2*s+1)
>> impulse(a,b)
>> legend('T=1','T=2')

Control Systems Lab 6


SSCASEIT

Figure-5: Impulse Response

Observation
As you can see in the impulse response that increasing the value of time constant T slower
the response and vice versa.

2.4 Step Response of 1st Order System


The response of a system (with all initial conditions equal to zero at t=0 -, i.e., a zero
state response) to the unit step input is called the unit step response.

In order to represent the response of the system in time domain we need to compute the
inverse Laplace transform of the above equation, we have

MATLAB Code
The step response of system with K=1 and T=1, T=2 is shown in fig 6.
>> a=1/(s+1);
>> b=1/(2*s+1);
>> step(a,b)
>> legend('T=1','T=2')

Control Systems Lab 7


SSCASEIT

Figure-6: Step Response

Observation
Initially the output c(t) is zero and finally it becomes unity. One important characteristic
of such an exponential response curve c(t) is that at t=T the value of c(t) is 0.632, or the
response c(t) has reached 63.2% of its total change. It will reached to almost reached to 1
at t=5T. As seen from Equation, the steady state is reached mathematically only after an
infinite time.

2.5 Ramp Response of 1st Order System


The response of a system (with all initial conditions equal to zero at t=0 -, i.e., a zero
state response) to the ramp input is called the ramp response. Since the Laplace transform
of the unit-ramp function is 1/s2, we obtain the output of the system

Expanding C(s) into partial fractions gives

There is no ramp command in MATLAB. Therefore, we need to use the step command or
the lsim command (presented later) to obtain the ramp response. Specifically, to obtain
the ramp response of the transfer-function system G(s), divide G(s) by s and use the step-
response command.

Control Systems Lab 8


SSCASEIT

MATLAB Code
>> t=0:0.1:10;
>> a=1/(s*(s+1));
>> b=1/(s*(2*s+1));
>> c=step(a,t); , d=step(b,t);
>> plot(t,t,t,c,t,d)
>> legend('input','T=1','T=2'), grid
>>title('Ramp Response')
>>xlabel('t Sec'), ylabel('Input and Output')

Figure-7: Ramp Response

Observation
The error signal e(t) is given by,

As t approaches infinity, e–t/T approaches zero, and thus the error signal e(t) approaches T
or

The error in following the unit-ramp input is equal to T for sufficiently large t. The smaller
the time constant T, the smaller the steady-state error in following the ramp input.

2.6 Parabolic Response of 1st Order System


The response of a system (with all initial conditions equal to zero at t=0 -, i.e., a zero
state response) to the parabolic input is called the parabolic response. Consider a
parabolic input,

Control Systems Lab 9


SSCASEIT

Apply Laplace transform on both the sides.

The output of the system is given as,

After partial fraction, we get

MATLAB Code
t=0:0.1:10;
t1=(t.^2)/2;
a=1/(s^2*(s+1));
b=1/(s^2*(2*s+1));
c=step(a,t);
d=step(b,t);
plot(t,t1,t,c,t,d)

Figure-8: Parabolic Response

Conclusion

Control Systems Lab 10


SSCASEIT

From these responses, we can conclude that the first order control systems are not stable
with the ramp and parabolic inputs because these responses go on increasing even at
infinite amount of time. The first order control systems are stable with impulse and step
inputs because these responses have bounded output. But, the impulse response doesn’t
have steady state term. So, the step signal is widely used in the time domain for analyzing
the control systems from their responses.

2.7 Simulation to Arbitrary Inputs:


To simulates the (time) response of continuous or discrete linear systems to arbitrary
inputs use ‘lsim’. lsim(sys,u,t) plots the time response of the LTI model SYS to the input
signal described by u and t. Consider a transfer function 10/s2+3s+10.
>> num=[0 10];
>> den=[1 3 10];
>> y=tf(num,den) ;
>> t=0:1:10;
>> u=t;
>> lsim(y,u,t);

2.8 Ramp Response Using Simulink


When the ramp is given as an input to the transfer function, then it is called ramp
response.

Figure-9: Ramp Response in Simulink

3.1 Operation on LTI models


The operations that can be performed on the LTI models are,
1. Addition (Parallel) of LTI Models.
1. Multiplication (Series) of LTI Models.
2. Feedback of LTI Models.

Specify transfer functions or convert LTI models to transfer function form ,we use the
command of (tf ). To create TFS we specify, Sys=tf (num,den) .i.e numerator and
denominator.

1. Adding (Parallel) LTI Models

Control Systems Lab 11


SSCASEIT

Adding LTI models is equivalent to connecting them in parallel.


Specifically the LTI model sys = sys1 + sys2 Represents the parallel interconnection shown
below. Consider a transfer function 10/s2+s+5 & 6/s2+4s+7.
>> num=[0 10];
>> den=[1 1 5];
>> sys1=tf(num,den)
>> num2=[0 6];
>> den2=[1 4 7];
>> sys2=tf(num2,den2)
>> sys=sys1+sys2;
OR
>> sys=parallel(sys1,sys2)

2. Multiplication (Series) of LTI Models


Multiplication of two LTI models connects
them in series.
Specifically,
sys = sys1*sys2.
Define transfer function as above for addition.
>> sys=sys1*sys2;
OR
>> sys=series(sys1,sys2)

3. Feedback in LTI Models


The closed-loop model sys has u as input vector and y as
output vector. The LTI models sys1 and sys2 must be both continuous or both discrete
with identical. If the feedback opposes the original signal, then it is negative feedback and
if it increases the signal then it is positive feedback. Negative feedback is normally used
to stabilize the gain of the system and remove the distortion. Negative feedback is
assumed in MATLAB and the resulting system sys maps input to output. Consider a
transfer function 10/s2+s+5.
>> num=[0 10];
>> den=[1 1 5];
>> sys1=tf(num,den)
>> num2=[0 6];
>> den2=[1 4 7];
>> sys2=tf(num2,den2)
>>sys = feedback(sys1,sys2)

To apply positive feedback, use the syntax

Control Systems Lab 12


SSCASEIT

>>sys = feedback(sys1,sys2,+1)

Figure-10

>> num=[0 10];


>> den=[1 1 5];
>> G=tf(num,den);
>> sys=feedback(sys1,1);
>> sys=feedback(1,sys1);

Develop transfer function of given system as shown below.

Figure-11

Control Systems Lab 13


SSCASEIT

Exercise
Q.1 Create single-input, single-output (SISO) transfer functions in factored form using zpk
and transfer function method.

Q.2 Find Step response of transfer function using MATLAB and Simulink, both for open
loop and closed loop.
C(s) = 2s+1
R(s) s2+s+1

Q.3 Find ramp and parabolic response of transfer function using MATLAB and Simulink,
both for open loop and closed loop.
C(s) = s+1
R(s) 3s2+3s+1

Q.4 Develop transfer function of the following using MATLAB command.

Q.5 Find poles and zeros of transfer function.


(s+1)(s+2)
(s2+4s+17)
Also draw pzmap.

Control Systems Lab 14


SSCASEIT

Labs Rubrics
Control System
Lab # 2
LTI Systems, Laplace Transform & Pole Zeros Map of
Transfer Function
Name of Student: ……………………………………………… Roll No: ………………

Lab #02: Marks distribution


ER1 ER4 ER9 RR1 RR2
Task

Lab #02: Marks obtained


ER1 ER4 ER9 RR1 RR2 Total
Task

Lab Evaluation Rubrics


# Qualities & Criteria 0 < Poor <=40 40< Satisfactory <= 70 70 < Good <= 90 90< Excellent <=100
No Tasks were Some tasks were Few tasks were left All tasks completed in
completed/ completed. Could not to be completed. due time. All goals
minimal effort justify the reasons for Provided achieved.
ER1 Task Completion
shown uncompleted tasks and acceptable
goals. justification for the
uncompleted tasks
and goals.

Control Systems Lab 15


SSCASEIT

ER4 System model/ None of the Incomplete diagrams and Diagrams without Correct Diagrams,
Mathematical model/ requirements are partially correct labels and few properly labeled
Network model/ Block fulfilled/ labels/Circuit doesn’t details. showing all the
diagram/ Circuit Demonstrates incorporate required Construction is necessary details and
Diagram/ Simulation minimal or no components/ Blocks not fairly good / Input/Outputs/
Diagram understanding of connected correctly/ Chooses a Chooses an optimal
the connection Chooses a mathematical mathematical mathematical model
between model that applies to an model that applies that applies to an
mathematical engineering problem, but to an engineering engineering problem,
models and requires assistance in problem, and has and develops new
engineering model development. some success in models.
problems/ model
minimal effort development.
shown
ER9 Results and Plots Unable to Inaccurate plots and Correct plots Good presentation of
produce any plots results without any the correct plots with
or results necessary proper labels,
/minimal efforts identifying features captions & visibility
shown such as labels,
captions & visibility

Format/Layout & Follows poorly the Follows, for some part, all Follows, for most Closely follows all the
RR1 Organization requirement the requirements related part, all the requirements related
related to format to format and layout. The requirements to format and layout.
and layout. The organization is unclear related to format Written work is well
report is and layout. The organized and easy to
disorganized to organization is understand
the extent that it generally good, but
prevents some parts seem
understanding of out of place
he content

RR2 Content/Information The report is not The report is objective The report is The report is objective
objective based based and for some part objective based and based and addresses
and addresses the addresses the issues for most part the issues referred in
issues referred in referred in the proposed addresses the issues the proposed topic
the proposed topic with an acceptable referred in the with in depth analysis
topic poorly. The engineering/theoretical proposed topic with and reasoning. The
provided analysis. The provided an acceptable provided information
information & information & results for engineering/theore & results is necessary,
results is not some parts is necessary tical analysis and relevant and sufficient
coherent rather and sufficient to discuss reasoning. The to discuss these
irrelevant. Little these issues provided issues. The details are
engineering/theor information & easily understood at
etical analysis is results for most part peer level.
presented is necessary and
sufficient to discuss
these issues

Control Systems Lab 16

You might also like