Block Diagrams - Solutions
Block Diagrams - Solutions
Block Diagrams - Solutions
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, Kjlnes ring 56, N-3901 Porsgrunn, Norway. Tel: +47 35 57 50 00 Fax: +47 35 57 54 01
H = series(h1,h2)
Parallel:
H = parallel(h1,h2)
Feedback:
H = feedback(h1,h2)
Define the transfer function in MathScript and find the step response for the total system.
Solution:
The total transfer function becomes (pen and paper):
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)
3
We get the same transfer function in MathScript as we get with pen and paper.
Step Response:
Task 1.2
Find the transfer function
Define the transfer function in MathScript and find the step response for the total system.
Solution:
The total transfer function becomes (pen and paper):
MathScript:
H_parallel = parallel(H1,H2)
figure(2)
EE4107 - Cybernetics Advanced
4
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
Define the transfer function in MathScript and find the step response for the total system.
Solution:
The total transfer function becomes (pen and paper):
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
F is the Force (control signal, u)
d and k are constants
Task 2.1
Draw a block diagram for the system using pen and paper.
EE4107 - Cybernetics Advanced
6
Solution:
The block diagram becomes:
Task 2.2
Based on the block diagram, find the transfer function for the system
Where the force
Solution:
In order to find the transfer function for the system, we need to use the serial and feedback rules.
We start by using the serial rule:
Task 3.1
Draw a block diagram for the system using pen and paper
Solution:
The block diagram becomes:
b
1
s
x2
a2
1
s
a1
x1
See if you get the same answer using MathScript. Plot the step response as well.
You may also use MathScript to find poles and zeroes.
Discuss the results.
Solutions:
We use the parallel rule:
This gives:
Then we get:
9
Numerator:
Denominator:
[
Finally we get:
MathScript:
clear
clc
num = 2;
den = [3, 1];
H1 = tf(num, den)
num = [1, 2];
den1 = [1, 0];
den2 = [-3, 1];
den = conv(den1, den2);
H2 = tf(num, den)
H = parallel(H1, H2)
poles(H)
zero(H)
figure(1)
step(H)
figure(2)
pzmap(H)
We get the following results:
-3,000s^2+9,000s+2,000
----------------------9,000s^3+1,000s
This should be the same as we found using pen and paper.
Step Response:
10
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];
EE4107 - Cybernetics Advanced
11
den = [10, 1];
H1 = tf(num, den)
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)
EE4107 - Cybernetics Advanced
12
c)
Solutions:
MathScript:
Similar as previous tasks
Additional Resources
http://home.hit.no/~hansha/?lab=mathscript