Professional Documents
Culture Documents
Exercise 3b - Block Diagrams - Solutions PDF
Exercise 3b - Block Diagrams - Solutions PDF
Often we need to find the total transfer function (from input to output) from a block diagram that
contains of several blocks. The most used rules are for serial, parallel and feedback blocks:
Serial:
Parallel:
Feedback:
For simple systems we can do this using pen and paper, but for more complex systems we need to
use a computer tool like e.g. MathScript.
MathScript have built-in functions for manipulating block diagrams and transfer functions, e.g.:
Serial:
Faculty of Technology, Postboks 203, Kjølnes ring 56, N-3901 Porsgrunn, Norway. Tel: +47 35 57 50 00 Fax: +47 35 57 54 01
2
…
H = series(h1,h2)
Parallel:
…
H = parallel(h1,h2)
Feedback:
…
H = feedback(h1,h2)
Find the transfer function from the following block diagram (pen and paper):
Define the transfer function in MathScript and find the step response for the total system.
Solution:
MathScript:
clear
clc
% H1
num=[1];
den=[1, 1];
H1= tf(num, den);
% H2
num=[1];
den=[1, 1, 1];
H2 = tf(num, den);
H_series = series(H1,H2)
figure(1)
step(H_series)
We get the same transfer function in MathScript as we get with pen and paper.
Step Response:
Task 1.2
Find the transfer function from the following block diagram (pen and paper):
Define the transfer function in MathScript and find the step response for the total system.
Solution:
MathScript:
…
H_parallel = parallel(H1,H2)
figure(2)
step(H_parallel)
We get the same transfer function in MathScript as we get with pen and paper.
Step Response:
Task 1.3
Find the transfer function from the following block diagram (pen and paper):
Define the transfer function in MathScript and find the step response for the total system.
Solution:
MathScript:
…
H_feedback = feedback(H2,H1)
figure(3)
step(H_feedback)
We get the same transfer function in MathScript as we get with pen and paper.
Step Response:
̈ ̇
is the position
̇ is the speed/velocity
̈ is the acceleration
Task 2.1
Draw a block diagram for the system using pen and paper.
Solution:
Task 2.2
Based on the block diagram, find the transfer function for the system .
Solution:
In order to find the transfer function for the system, we need to use the serial and feedback rules.
Task 3.1
Draw a block diagram for the system using pen and paper
Solution:
x2 x1
1 1 y
a2
u s - s
- -
a1
See if you get the same answer using MathScript. Plot the step response as well.
Solutions:
This gives:
Then we get:
Numerator:
Denominator:
[ ]
Finally we get:
MathScript:
clear
clc
num = 2;
den = [3, 1];
H1 = tf(num, den)
H = parallel(H1, H2)
poles(H)
zero(H)
figure(1)
step(H)
figure(2)
pzmap(H)
-3,000s^2+9,000s+2,000
----------------------
-9,000s^3+1,000s
Step Response:
We see both from the transfer function, poles and the step response that the system is unstable.
Task 4.2
Do the same for the following block diagrams as well:
a)
Solutions:
MathScript:
clear
clc
num = [1];
num = [1];
den = [1, 1];
H2 = tf(num, den)
H = feedback(H1, H2)
poles(H)
zero(H)
figure(1)
step(H)
figure(2)
pzmap(H)
b)
Solutions:
MathScript:
clear
clc
num = [1];
den = [10, 1];
H1 = tf(num, den)
H = feedback(H1, 1)
poles(H)
zero(H)
figure(1)
step(H)
figure(2)
pzmap(H)
c)
Solutions:
MathScript:
Additional Resources
http://home.hit.no/~hansha/?lab=mathscript