View
233
Download
2
Category
Preview:
Citation preview
EE4107 - Cybernetics Advanced
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
Exercise 3b: Block Diagrams (Solutions)
Block diagrams are much in use in control theory, and we can have block diagrams in the time plane
(differential equations) and in the s plane (transfer functions).
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:
2
EE4107 - Cybernetics Advanced
…
H = series(h1,h2)
Parallel:
…
H = parallel(h1,h2)
Feedback:
…
H = feedback(h1,h2)
Task 1: Transfer functions
Task 1.1
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:
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
EE4107 - Cybernetics Advanced
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:
The total transfer function becomes (pen and paper):
MathScript:
…
H_parallel = parallel(H1,H2)
figure(2)
4
EE4107 - Cybernetics Advanced
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:
The total transfer function becomes (pen and paper):
MathScript:
5
EE4107 - Cybernetics Advanced
…
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:
Task 2: Mass-spring-damper system
Given the following system:
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.
6
EE4107 - Cybernetics Advanced
Solution:
The block diagram becomes:
You may also use this notation:
Task 2.2
Based on the block diagram, find the transfer function for the system
.
Where the force may be denoted as the control signal .
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:
Next, we use the feedback rule:
7
EE4107 - Cybernetics Advanced
Next, we use the serial rule:
Finally, we use the feedback rule:
Task 3: Differential Equations
Given the following system:
Task 3.1
Draw a block diagram for the system using pen and paper
Solution:
The block diagram becomes:
1
sa2
1
s
b
a1
c
y
u - --
x1x2
8
EE4107 - Cybernetics Advanced
Task 4: More Block Diagrams
Task 4.1
Given the following block diagram:
Find the transfer function (“pen and paper”):
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
EE4107 - Cybernetics Advanced
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
EE4107 - Cybernetics Advanced
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];
11
EE4107 - Cybernetics Advanced
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)
12
EE4107 - Cybernetics Advanced
c)
Solutions:
MathScript:
Similar as previous tasks
Additional Resources
http://home.hit.no/~hansha/?lab=mathscript
Here you will find tutorials, additional exercises, etc.
Recommended