Beruflich Dokumente
Kultur Dokumente
2.orden
Dataverktøy
Analyse/Design
Stabilitets-
MathScript Det komplekse plan
analyse 2. Frekvensrespons
LabVIEW 1. Systemets poler Bodediagram
Det komplekse plan
Realisering/
Implementering
Diskretisering
Reguleringssystem
Asymptotisk stabilt system
Bode Diagram
Stability Analysis
T = 1 year
T = 24 hours
Inside Temperature
frequency 1 (year)
Assume the outdoor temperature is
varying like a sine function during a year
(frequency 1) or during 24 hours
(frequency 2).
frequency 2 (24 hours)
Then the indoor temperature will be a
sine as well, but with different gain. In
addition it will have a phase lag.
Frequency Response Example
Air Heater
Dynamic
System
Amplitude Frequency
Gain Phase Lag
(“forsterkning”) (“faseforskyvning”)
The frequency response of a system expresses how a sinusoidal signal of a given frequency on
the system input is transferred through the system.
Frequency Response - Definition
t
The phase lag is given by:
The gain is given by:
(“faseforskyvning”)
(“forsterkning”)
Exercise
Students:
Pen and paper: Find the gain (A) and the phase lag (ϕ) for this example
Solutions
From the Plot we get:
(“faseforskyvning”)
Bode Diagram
Bode Diagram
You can find the Bode diagram from experiments on the physical prosess or from the
transfer function (the model of the system).
A simple sketch of the Bode diagram for a given system:
𝜔𝑐
𝐿𝑜𝑔 𝜔 ω [rad/s]
∆𝐾
𝜑 𝜔180
𝐿𝑜𝑔 𝜔 ω [rad/s]
The Bode diagram gives a simple Graphical overview of the Frequency Response for a given system.
A Tool for Analyzing the Stability properties of the Control System
Find Data Bode Diagram
We find A and ϕ for each of the frequencies,
e.g.:
Based on that we can plot the Frequency Response in a so-called Bode Diagram:
Gain (“Forsterkningen”)
The y-scale is in [dB]
Instead of Plotting the Bode Diagram we can also use the bode function for
calculation and showing the data as well:
...
wlist = [0.01, 0.1, 1, 2 ,3 ,5 ,10,
100];[mag, phase, w] = bode(H, wlist);
magdB = 20*log10(mag); % Convert to dB
freq_data = [w, magdB, phase]
Students: Plot the Bode Diagram for the given transfer function using MathScript
Bode Diagram – MathScript Example - Solutions
or:
clear, clc
% Transfer function
num=[1];
den1=[1,0];
den2=[1,1]
den3=[1,1]
den = conv(den1,conv(den2,den3));
H = tf(num, den)
% Bode Diagram
bode(H) clear, clc
subplot(2,1,1) % Transfer function
grid on num=[1];
den=[1,2,1,0];
subplot(2,1,2) H = tf(num, den)
grid on
% Bode Diagram
bode(H)
or: subplot(2,1,1)
grid on
subplot(2,1,2)
grid on
How-To Manually find the
Frequency Response from the
Transfer Function
Frequency Response from the Transfer function
A and ϕ is a function of the frequency ω so we may write A = A(ω), ϕ = ϕ(ω)
We want to manually find mathematical expressions for A(ω) and ϕ(ω) (assuming the
bode function does not exist, actually, this is how the bode function does it.)
s=jω
Where H(jω) is the frequency response of the system, i.e., we may find the frequency
response by setting s=jω in the transfer function. This mean we have to deal with complex
numbers!
Angle
The Phase function is defined as:
Angle (“Phase”)
Complex Numbers
Rectangular form of a complex number Exponential/polar form of a complex number
Length (“Gain”):
Angle (“Phase”):
Mathematical expressions
for A(ω) and ϕ(ω)
We find the Mathematical expressions for A(ω) and ϕ(ω) by setting s=jω in the transfer function
Students: Find the Mathematical expressions for A(ω) and ϕ(ω) (Pen & Paper)
Mathematical expressions
for A(ω) and ϕ(ω) - Solutions
We find the Mathematical expressions for A(ω) and ϕ(ω) by setting s=jω in the transfer function
Gain: [dB]
Phase: [rad]
MathScript functions needed:
• atan
Students: Implement these equations in MathScript and find • log10
the Frequency Response for different frequencies, i.e find • sqrt
values for A(ω) and ϕ(ω) for different frequencies (e.g, • pi
w=0.01, 0.1, 1, 2, 5 ,10, 100). Plot the Frequency Response as • subplot
well based on the calculated values for A(ω) and ϕ(ω). • semilogx
MathScript Solutions
Method 1:
We find A(ω) and ϕ(ω) for w=0.01, 0.1, 1, 2, 5 ,10, 100, etc.
w=1;
for i=1:N
gain(i) = 20*log10(1) - 20*log10(sqrt(w(i)^2+1));
phase(i) = -atan(w(i)) * 180/pi;
end %Gain Plot
subplot(2,1,1)
semilogx(w, gain), grid
%Phase Plot
Plotting: subplot(2,1,2)
semilogx(w, phasedeg), grid
MathScript Solutions
The bode function is used
directly on the transfer function
H(s)
and
Multiplikasjon:
Divisjon:
<- cont. from previous page
Mathematical expressions for A(ω) and ϕ(ω) - Example
Students: Find the Mathematical expressions for A(ω) and ϕ(ω) for the different
transfer functions below using pen and paper
Mathematical expressions for A(ω) and ϕ(ω) - Examples
Solutions: Students: Implment them in MathScript and plot the Bode
diagram. Compare with the built-in bode function.
Hans-Petter Halvorsen, M.Sc.
Telemark University College
Faculty of Technology
Department of Electrical Engineering, Information Technology and Cybernetics
E-mail: hans.p.halvorsen@hit.no
Blog: http://home.hit.no/~hansha/
38