L4 Transfer Function Block Diagram
L4 Transfer Function Block Diagram
L4 Transfer Function Block Diagram
1. Introduction
2. Transfer Function of Linear Time-Invariant (LTI) Systems
3. Block Diagrams
4. Multiple Inputs
5. Transfer Functions with MATLAB
6. Time Response Analysis with MATLAB
1. Introduction
An important step in the analysis and design of control systems is the mathematical modelling of
the controlled process. There are a number of mathematical representations to describe a controlled
process:
Transfer function: It is defined as the ratio of the Laplace transform of the output variable to the
Laplace transform of the input variable, with all zero initial conditions.
Block diagram: It is used to represent all types of systems. It can be used, together with transfer
functions, to describe the cause and effect relationships throughout the system.
Systems that are represented by differential equations whose coefficients are functions of time are
called time-varying systems. An example of a time-varying control system is a spacecraft control
system which the mass of spacecraft changes due to fuel consumption.
1
________________________________________________________________________________
where the coefficients m and b are constants, is time-invariant since the equation
depends only implicitly on t through the dependent variables y and u and their
derivatives.
Dynamic systems that are described by linear, constant-coefficient, differential equations are called
linear time-invariant (LTI) systems.
The transfer function of a linear, time-invariant system is defined as the ratio of the Laplace
transform of the output (response function), Y(s) = ?{y(t)}, to the Laplace transform of the input
(driving function) U(s) = ?{u(t)}, under the assumption that all initial conditions are zero.
Y (s)
Transfer function: G (s ) =
U (s )
an
d n y( t )
dt n
+ a n −1
d n −1 y( t )
dt n −1
+ "+ a 1
dy( t )
dt
+ a 0 y( t )
= bm
d m u(t)
dt m
+ b m−1
d m −1u (t )
dt m−1
+ " + b dudt(t) + b u(t)
1 0
Taking the Laplace transform and considering zero initial conditions we have:
"
Y(s) b m s m + b m −1s m−1 + + b1s + b 0 M (s )
G (s ) =
U (s)
=
"
a n s n + a n −1s n −1 + + a 1s + a 0
=
N (s )
where G(s) = M(s)/N(s) is the transfer function of the system; the roots of N(s) are called poles of
the system and the roots of M(s) are called zeros of the system. By setting the denominator
function to zero, we obtain what is referred to as the characteristic equation:
2
________________________________________________________________________________
We shall see later that the stability of linear, SISO systems is completely governed by the roots of
the characteristic equation.
Solution:
1) From Kirchhoff’s voltage law, the equations for this circuit are:
Vo (s) 1 1 1/ τ
Solving the above equations with vo(0) = 0, G (s ) = = = =
Vi (s) RCs + 1 τs + 1 s + 1 / τ
2) Writing the Laplace transform of the output voltage in terms of the transfer function and the
input voltage transform
1/ τ
Vo (s ) = Vi (s)G (s ) = Vi (s)
s + 1/ τ
Substituting Vi(s) = 1/s for the Laplace transform of the unit-step input voltage and using partial
fraction expansion of the output voltage transform, we have:
3
________________________________________________________________________________
1 1/ τ 1 1
Vo (s ) = ⋅ = −
s s + 1/ τ s s + 1/ τ
Taking the inverse Laplace transform from the table of transforms, the output voltage response to
unit-step input is:
vo(t) = 1 – e-t/τ
Example: Consider the LCR electrical network shown in the figure below. Find the transfer
function G(s) = Vo(s)/Vi(s).
R L
i(t)
vi (t) vo(t)
C
di (t ) dv o (t )
v o ( t ) = i( t )R + L + v o (t) where i( t ) = C
dt dt
Considering i(0) = 0 and vo(0) = 0 and solving the above equations, we have:
Vo (s ) 1
G (s ) = =
Vi (s) LCs + RCs + 1
2
Exercise: Find the time response of vo(t) of the above system for R = 2.5Ω, C = 0.5F, L=0.5H and
0 t<0
v i (t) = .
2 t≥ 0
4
________________________________________________________________________________
Exercise: In the mechanical system shown in the figure, m is the mass, k is the spring constant, b is
the friction constant, u(t) is an external force and y(t) is the resulting displacement.
y(t)
k
m u(t)
b
5
________________________________________________________________________________
3. Block Diagrams
A block diagram of a system is a pictorial representation of the functions performed by each
component and of the flow of signals. The block diagram gives an overview of the system.
The above figure shows the way the various items in block diagrams are represented. Arrows are
used to represent the directions of signal flow. A summing point is where signals are algebraically
added together. The takeoff point is similar to the electrical circuit takeoff point. The block is
usually drawn with its transfer funciton written inside it.
We will use the following terminology for block diagrams throughout this course:
Single block:
U(s) Y(s)
G(s) Y(s) = G(s)U(s)
U(s) is the input to the block, Y(s) is the output of the block and G(s) is the transfer function of the
block.
Series connection:
6
________________________________________________________________________________
Parallel connection (feed forward):
G1(s)
U(s) + Y(s)
Y(s) = [G1(s) + G2(s)]U(s)
+
G2(s)
Y(s) G(s)
The closed loop transfer function: =
R(s) 1 + G(s)
Exercise: Find the closed-loop transfer function for the following block diagram:
H(s)
F(s)
7
________________________________________________________________________________
Exercise: A control system has a forward path of two elements with transfer functions K and
1/(s+1) as shown. If the feedback path has a transfer function s, what is the transfer function of the
closed loop system.
R(s) 1 Y(s)
K
+ _ s +1
Y(s)
Y(s) G(s)
Y(s) = G(s)R(s)
8
________________________________________________________________________________
Moving a takeoff point beyond a block:
R(s)
R(s) 1/G(s)
Y(s) = G(s)R(s)
R(s) Y(s)
R(s) Y(s)
+
±
+
± F(s)
±
+
R(s) F(s) R(s)
Y(s) = R(s) ± F(s)
Exercise: Reduce the following block diagram and determine the transfer function.
R(s) + Y(s)
G1(s) G2(s) G3(s)
+ +
_ _ +
H1(s) G4(s)
H2(s)
9
________________________________________________________________________________
Exercise: Reduce the following block diagram and determine the transfer function.
H1
+
R(s) + Y(s)
G
+_
H2
10
________________________________________________________________________________
4. Multiple Inputs
Often in control systems there are more than one input to the system. For example, there can be the
input signal indicating the required value of the controlled variable and also an input or inputs due
to disturbances which affect the system. The procedure to obtain the relationship between the
inputs and the output for such systems is:
Example: Find the output Y(s) of the block diagram in the figure below.
D(s)
R(s) + Y(s)
G1(s) + G2(s)
+_
H(s)
R(s) YR(s)
G1 (s) G2 (s)
+_
H(s)
G 1 (s)G 2 (s)
The output YR(s) due to input R(s) is: YR (s ) = R (s )
1 + G 1 (s)G 2 (s)H(s)
Then consider R(s) = 0. Put –1 into a block, representing the negative feedback effect:
D(s) + YD (s)
G2(s)
+
G1 (s) –1 H(s)
G 2 (s)
The output YD(s) due to D(s) is: YD (s ) = D(s)
1 + G 1 (s)G 2 (s )H(s)
11
________________________________________________________________________________
The total output of the system is:
G 1 (s)G 2 (s) G 2 (s )
Y(s ) = YR (s) + YD (s) = R (s ) + D(s )
1 + G 1 (s)G 2 (s)H (s ) 1 + G 1 (s)G 2 (s )H (s )
D1(s)
R(s) + Y(s)
G1(s) + G2(s)
+_
H1(s) + H2(s)
+
D2(s)
12
________________________________________________________________________________
Exercise: Determine the output Y(s) for the following system.
D(s) N(s)
H(s)
13
________________________________________________________________________________
3s + 1
G (s ) =
s + 3s + 2
2
can be entered into MATLAB by typing the following on the command line:
num = [3 1];
den = [1 3 2];
G = tf(num,den)
Transfer function:
3 s + 1
-------------
s^2 + 3 s + 2
Once the various transfer functions have been entered, you can combine them together using
arithmetic operations such as addition and multiplication to evaluate the transfer function of a
cascaded system. The following table lists the most common systems connections and the
corresponding MATLAB commands to implement them. In the following, SYS refers to the
transfer function of a system, i.e. SYS = Y(s)/R(s).
Parallel connection:
G1
+
± G2
SYS = G1 ±
R(s) Y(s)
or SYS = parallel(G1,±
±G2)
±
G2
H(s)
14
________________________________________________________________________________
R(s) Y(s)
G1 G2
+ _
Example: Evaluate the transfer function of the following feedback system (shown in the figure
above) using MATLAB:
Y (s ) G 1 (s )G 2 (s)
=
R (s ) 1 + G 1 (s)G 2 (s )H(s)
This produces the following output on the command window (check this result):
Transfer function:
4
--------
21 s + 2
15
________________________________________________________________________________
Y (s ) 2s + 10
= 2
R (s) s + 5s + 4
Solution:
Step Response
2.5
num = [0 2 10];
den = [1 5 4];
SYS = tf(num,den); 2
step(SYS)
1.5
Amplitude
or directly:
step(num,den) 1
For a step input of magnitude other than unity, for example K, simply multiply the transfer function
SYS by the constant K by typing step(K*SYS). For example, to plot the response due to a step
input of magnitude 5, we type step(5*SYS).
Notice in the previous example that that time axis was scaled automatically by MATLAB. You can
specify a different time range for evaluating the output response. This is done by first defining the
required time range by typing:
and then introducing this time range in the step function as follows:
step(SYS,t) % Plot the step response for the given time range, t
This produces the following plot for the same example above.
16
________________________________________________________________________________
Step Response
2.5
1.5
Amplitude
0.5
0
0 2 4 6 8 10
Time (sec.)
You can also use the step function to plot the step responses of multiple LTI systems SYS1, SYS2,
... etc. on a single figure in MATLAB by typing:
step(SYS1,SYS2,...)
Y (s ) 5
=
R (s ) 2s + 10
Solution:
Impulse Response
num = [0 5];
den = [2 10]; 2.5
SYS = tf(num,den);
impulse(SYS) 2
or directly
1.5
Amplitude
impulse(num,den)
1
This will produce the following output on the
screen. Is that what you would expect?
0.5
0
0 0.2 0.4 0.6 0.8 1 1.2
Time (sec.)
17
________________________________________________________________________________
The step command will further multiply the transfer function by 1/s to make the input 1/s2 i.e.
Laplace transform of a unit-ramp input. For example, consider the system:
Y (s ) 1
= 2
R (s ) s + s + 1
With a unit-ramp input, R(s) = 1/s2, the output can be written in the form:
1 1 1
Y(s ) = R (s ) = 2 ⋅
s + s +1
2
(s + s + 1)s s
1 1
= 3 ⋅
s + s + s s
2
which is equivalent to multiplying by 1/s and then working out the step response. To plot the unit-
ramp response of this system, we enter the numerator and denominator coefficients of the term in
square brackets into MATLAB:
num = [0 0 0 1];
den = [1 1 1 0];
step(num,den)
Step Response
12
10
8
Amplitude
0
0 2 4 6 8 10 12
Time (sec.)
18
________________________________________________________________________________
lsim(SYS,r,t) or lsim(num,den,r,t)
where num and den are the row vectors of the numerator and denominator coefficients of the
transfer function, r is the input time function, and t is the time range over which r is defined.
Example: Use MATLAB to obtain the output time response of the transfer function:
Y (s ) 2
=
R (s ) s + 3
when the input r is given by r = e-t.
Solution: Start by entering the row vectors of the numerator and denominator coefficients in
MATLAB:
num = [0 2];
den = [1 3];
Then specify the required time range and define the input function, r, over this time:
lsim(num,den,r,t)
0.35
0.3
0.25
Amplitude
0.2
0.15
0.1
0.05
0
0 1 2 3 4 5 6
Time (sec.)
19
________________________________________________________________________________
1. Find the transfer function between the input force u(t) and the output displacement y(t) for the
system shown below.
y(t)
b1
m u(t)
b2
where b1 and b2 are the frictional coefficients. For b1 = 0.5 N-s/m, b2 = 1.5 N-s/m, m = 10 kg and
u(t) is a unit-impulse function, what is the response y(t)? Check and plot the result with MATLAB.
2. For the following circuit, find the transfer function between the output voltage across the
inductor y(t), and the input voltage u(t).
u(t) L y(t)
For R = 1 Ω, L = 0.1 H, and u(t) is a unit-step function, what is the response y(t)? Check and plot
the result using MATLAB.
3. In the mechanical system shown in the figure below, m is the mass, k is the spring constant, b is
the friction constant, u(t) is the external force and y(t) is the corresponding displacement. Find
the transfer function of this system.
y(t)
k
m u(t)
b
For m = 1 kg, k = 4 kg/s2, b = 2.4 kg/s, and a step input u(t) = 2 N, compute the response y(t). Plot
y(t) with MATLAB.
20
________________________________________________________________________________
4. Find the transfer function of the electrical circuit shown below.
R L
u(t) y(t)
C
For R = 1 Ω, L = 0.5 H, C = 0.5 F, and a unit step input u(t) with zero initial conditions, compute
y(t). Sketch the time function y(t) and plot it with MATLAB.
5. Write down the transfer function Y(s)/R(s) of the following block diagram.
R(s) Y(s)
K G(s)
+ _
a) For G(s) = 1/(s + 10) and K = 10, determine the closed loop transfer function with MATLAB.
b) For K = 1, 5, 10, and 100, plot y(t) on the same window for a unit-step input r(t) with
MATLAB, respectively. Comment on the results.
c) Repeat (b) with a unit-impulse input r(t).
6. Find the closed loop transfer function for the following diagram.
H(s)
F(s)
a) For G(s) = 8/(s2 + 7s + 10) and H(s) = s+2, determine the closed loop transfer function with
MATLAB.
b) Plot y(t) for a unit-step input r(t) with MATLAB.
7. Determine the transfer function of the following diagram. Check your answer with MATLAB.
_
R(s) + Y(s)
s s 1/s
+_
+
1/s
21
________________________________________________________________________________
8. Determine the transfer function of the following diagram.
R(s) 50 Y(s)
1/s2 s
+_ +_ s +1 +_
2/s 2
22