exercise 4: 2.order systems (solutions) - telemark...
TRANSCRIPT
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 4: 2.order Systems (Solutions)
A second order transfer function is given on the form:
( )
( )
Where
is the gain
zeta is the relative damping factor
[rad/s] is the undamped resonance frequency.
The value of is critical for stability of the system:
2
EE4107 - Cybernetics Advanced
The overshoot factor (“oversvingsfaktoren”) of the step response is defined as:
√
MathScript: We can easily implement and analyze 2.order systems in MathScript using built-in
functions.
Example:
We have the following 2.order system:
( )
i.e.,
We can use the tf function or the sys_order2 function in MathScript:
num=[1];
den=[1, 1, 1];
H = tf(num, den)
step(H)
or:
dr = 1
wn = 1
[num, den] = sys_order2(wn, dr)
H = tf(num, den)
step(H)
This should give the same results.
[End of Example]
Task 1: Basic 2.order properties
Given the following transfer function:
( ) ( )
( )
Task 1.1
Find the following parameters (pen and paper):
The gain
The relative damping factor
The undamped resonance frequency [rad/s]
3
EE4107 - Cybernetics Advanced
Solution:
Based on the general case:
( )
We get:
The undamped resonance frequency [rad/s]:
√
The relative damping factor :
√
The gain
Task 2: Response Time
Given the following transfer function:
( ) ( )
( )
( )( )
Task 2.1
Find the total response time for the given system.
Note! The response time for a 2.order system is approximately:
Solution:
We do the following:
( ) ( )
( )
( )( )
The total response time for the given system is:
Where
4
EE4107 - Cybernetics Advanced
We need to find :
We have:
( )
This means:
Then we get:
Task 3: Transfer function to Differential equation
Given the following transfer function:
( ) ( )
( )
Task 3.1
Find the differential equation for the system.
Solution:
We do as follows:
( )[ ] ( )[ ]
This gives:
( ) ( ) ( ) ( ) ( )
This gives the following differential equation:
Task 4: 2.order transfer functions
Task 4.1
Define the transfer function below using the tf and the sys_order2 functions (2 different methods
that should give the same results).
5
EE4107 - Cybernetics Advanced
( )
( )
Set
Do you get the same results using tf() and sys_order2()?
Solution:
clear
clc
K = 1;
w = 1;
z = 1;
num = [K];
den = [(1/w)^2, 2*z*(1/w), 1];
H = tf(num, den)
step(H)
or:
clear
clc
dr = 1
wn = 1
H = sys_order2(wn, dr)
step(H)
Task 4.2
Plot the step response (use the step function in MathScript) for different values of . Select as
follows:
Explain the results.
Solution:
6
EE4107 - Cybernetics Advanced
We see the results are as expected.
gives a “underdamped” system
gives a “critically damped” system
gives a “overdamped” system
Task 5: More 2.order transfer functions
For the transfer functions given below, find the following parameters:
The gain
The relative damping factor
The undamped resonance frequency [rad/s]
You may also try to implement the systems in MathScript and perform a step response.
Task 5.1
( )
Solution:
Based on the general case:
( )
We get:
7
EE4107 - Cybernetics Advanced
1. The undamped resonance frequency [rad/s]:
( has no relevance)
2. The relative damping factor :
3. The gain
4. The overshoot factor :
√
Task 5.2
( )
Solution:
Based on the general case:
( )
We transform our transfer function as follows:
( )
Then we get:
1. The undamped resonance frequency [rad/s]:
√
√
( √
has no relevance)
2. The relative damping factor :
8
EE4107 - Cybernetics Advanced
√
√
√
3. The gain
4. The overshoot factor :
√
MathScript Code:
clear
clc
% System 1
num1 = [5];
den1 = [1, 4, 1]
H1 = tf(num1, den1)
figure(1)
step(H1)
% System 1
num2 = [9];
den2 = [3, 4, 2]
H2 = tf(num2, den2)
figure(2)
step(H2)
Task 6: Differential equation to Transfer function
Given the following differential equation:
Task 6.1
Find the transfer function:
( ) ( )
( )
Solution:
We get:
9
EE4107 - Cybernetics Advanced
( ) ( ) ( ) ( )
Further:
( )[ ] ( )
This gives the following transfer function:
( )
( )
Task 7: Stability
Given the following system:
( ) ( )
( )( )
Task 7.1
Find poles and zeroes for the system (check your answer using MathScript) and draw them in the
complex plane.
Tip! In MathScript you can use the built-in functions poles(), zero() and pzgraph().
Solutions:
Zeros:
Poles:
10
EE4107 - Cybernetics Advanced
MathScript:
MathScript code:
clear
clc
% Transfer function
num = 5*[10, -1];
den1 = [2, 1];
den2 = [5, 1];
den = conv(den1,den2);
H = tf(num, den)
p = poles(H)
z = zero(H)
pzmap(H)
We get the same answer in MathScript.
Task 7.2
Is the system stable or not? Why/Why not?
Solution:
The system is stable because both the poles are in the left half plane.
Task 8: 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 8.1
Draw a block diagram for the system using pen and paper.
11
EE4107 - Cybernetics Advanced
Solution:
The block diagram becomes:
You may also use this notation:
Task 8.2
Based on the block diagram, find the transfer function for the system ( ) ( )
( ).
Where the force may be denoted as the control signal .
Set the transfer function on the on the following standard form:
( )
Find , and as functions of , and .
Solution:
In order to find the transfer function for the system, we need to use the serial and feedback rules.
12
EE4107 - Cybernetics Advanced
We start by using the serial rule:
( )
Next, we use the feedback rule:
( )
Next, we use the serial rule:
( )
( )
Finally, we use the feedback rule:
( ) ( )
( )
( )
( )
( )
Or if we want it on the standard 2.order form:
( )
( )
We get:
( ) ( )
( )
This means:
√
√
Task 8.3
Simulate the system in MathScript (step response).
Try with different values for , and .
13
EE4107 - Cybernetics Advanced
Solution:
MathScript code:
% Mass-spring-damper system
clear
clc
% Define variables
m = 1;
d = 1;
k = 1;
% Define Transfer function
num = 1/m ;
den = [1, (d/m), (k/m)];
H = tf(num, den);
% Step Response
step(H)
This gives the following results:
Additional Resources
http://home.hit.no/~hansha/?lab=mathscript
Here you will find tutorials, additional exercises, etc.