MATLAB Control System Toolbox

Transcrição

MATLAB Control System Toolbox
MATLAB Control System Toolbox
MATLAB
Control System Toolbox
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
1
MATLAB Control System Toolbox
Umfang
• Beschreibung linearer, zeitinvarianter Systeme (LTI):
– zeitkontinuierlich und zeitdiskret
– Single–Input/Single–Output (SISO) und
Multiple–Input/Multiple–Output (MIMO)
• Umwandeln und Bearbeiten der Systeme
• Analysieren der Systemeigenschaften
• Entwurf und Optimierung von Reglern
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
2
MATLAB Control System Toolbox
Beschreibung von LTI-Systemen
Beschreibung
linearer, zeitinvarianter
Systeme (LTI-Systeme)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
3
MATLAB Control System Toolbox
Lineare, zeitinvarianter Systeme (LTI–Modelle)
Parametrische Beschreibung
• Übertragungsfunktion/Transfer Function (TF)
• Nullstellen–Polstellen–Darstellung/Zero–Pole–Gain (ZPK)
• Zustandsdarstellung/State–Space (SS)
Nichtparametrische Beschreibung
• Frequenzgang–Daten–Modelle/Frequency Response Data (FRD)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
4
MATLAB Control System Toolbox
Übertragungsfunktion/Transfer Function (TF)
• Übertragungsverhalten im Laplace–Bereich
• Rationale Funktion in s:
num(s)
am sm + am−1 sm−1 + . . . + a1 s + a0
h(s) =
=
den(s)
bn sn + bn−1 sn−1 + . . . + b1 s + b0
Zählerpolynom num und Nennerpolynom den
Zählerordnung m und Nennerordnung n
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
5
MATLAB Control System Toolbox
TF–SISO–Übertragungsfunktion erstellen
1. Befehl tf(num, den):
num und den als Vektoren
mit Koeffizienten von s in absteigender Reihenfolge.
>> h = tf([2 -3],[1 1])
2. Rationale Funktion in s
a) Definieren von s als TF–System
>> s = tf(’s’)
b) Übertragungsfunktion als rationale Funktion in s
>> h = (s+2) / (s^2 + 5*s + 4)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
6
MATLAB Control System Toolbox
TF–MIMO–Übertragungsfunktion
• zweidimensionale N y×N u–Matrix H von SISO–TF:
H =




h11 h12

h21 h22
• Matrixelement hij :

=
 num
11
 den11



 num21
den21
num12 
den12 



num22 
den22
Übertragungsfunktion vom
Eingang j zum Ausgang i
c Ausgänge, N u Spalten =
c Eingänge
• N y Zeilen =
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
7
MATLAB Control System Toolbox
TF–MIMO–Übertragungsfunktion erstellen
1. Definieren der einzelnen SISO–TF:
a) Befehl tf(num, den) / rationale Funktion in s
b) Matrix H definieren
2. Befehl tf(NUM,DEN): Cell Array NUM für Zählerpolynome und DEN für Nennerpolynome (N y×N u)
NUM


= 

num11 num12

num21 num22
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth

DEN


= 

den11 den12

den21 den22

8
MATLAB Control System Toolbox
Null-/Polstellen–Darstellung/Zero–Pole–Gain (ZPK)
• Übertragungsverhalten im Laplace–Bereich
• Rationale Funktion in s mit Nullstellen und Polstellen:
(s − z1) · . . . · (s − zm−1) · (s − zm)
h (s) = k ·
(s − p1) · . . . · (s − pn−1) · (s − pn)
k
Verstärkungsfaktor (reell)
z1 , . . . , z m
Zähler–Nullstellen (reell/konj. komplex)
p1 , . . . , p m
Nenner–Nullstellen (reell/konj. komplex)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
9
MATLAB Control System Toolbox
ZPK–SISO–Übertragungsfunktion erstellen
1. Befehl zpk (z,p,k):
Nullstellenvektor z , Polstel-
lenvektor p und Verstärkungsfaktor k .
>> h =
zpk([-6 1 1],[-5 1],3)
2. Rationale Funktion in s
a) Definieren von s als ZPK–System
>> s = zpk(’s’)
b) Übertragungsfunktion als rationale Funktion in s
>> h = 2 * 1 / ((s-1)*(s+2))
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
10
MATLAB Control System Toolbox
ZPK–MIMO–Übertragungsfunktion
• zweidimensionale N y×N u–Matrix H von SISO–ZPK:
H =




h11 h12

h21 h22
• Matrixelement hij :


z11
k ·
 11 p11




= 
z21
k21 ·
p21
z12 
k12 ·
p12 

k22 ·



z22 
p22
Übertragungsfunktion vom
Eingang j zum Ausgang i
c Ausgänge, N u Spalten =
c Eingänge
• N y Zeilen =
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
11
MATLAB Control System Toolbox
ZPK–MIMO–Übertragungsfunktion erstellen
1. Definieren der einzelnen SISO–ZPK:
a) Befehl zpk(z,p,k) / rationale Funktion in s
b) Matrix H definieren
2. Befehl zpk (Z,P,K):
Cell Array Z für Nullstellen-
polynome und P für Polstellenpolynome (N y × N u),
N y×N u–Matrix K der Verstärkungsfaktoren
Z =


z11 z12
z21 z22
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth


P =


p11 p12
p21 p22


K =


k11 k12
k21 k22


12
MATLAB Control System Toolbox
Zustandsdarstellung/State–Space (SS)
DGL 1. Ordnung für jedes Speicherelement (Integrator)
⇒ n DGLs 1. Ordnung statt eine DGL n–ter Ordnung
Zustands–DGL:
ẋ = A x + B u
Ausgangsgleichung:
y = Cx + Du
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
x:
Zustandsvektor
(N x×1)
u:
Eingangsvektor
(N u×1)
y:
Ausgangsvektor
(N y×1)
A: Zustandsmatrix
(N x×N x)
B:
Eingangsmatrix
(N x×N u)
C:
Ausgangsmatrix
(N y×N x)
D: Durchschaltmatrix (N y×N u)
13
MATLAB Control System Toolbox
SS–Modell erstellen
• Befehl ss(A,B,C,D):
A=
"
1 2
3 4
#
B=
"
1 1
0 1
#
C

0 1




= 1 2 

D
3 1

0 0




= 0 0 

0 0
>> ss([1 2 ; 3 4],[1 1 ; 0 1],[0 1 ; 1 2 ; 3 1],0)
• Durchschaltanteil oft 0:
• SISO–Systeme:
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
u→u
D = 0
y→y
B→b
C → cT
14
MATLAB Control System Toolbox
Frequenzgang–Daten–Modelle (FRD)
• Frequenz–Daten aus Messung oder Simulation
• Sinus–Anregung:
⇒
y(t) = | G(ω) | · sin (ωt + ϕ(ω))
y(t) phasenverschoben und amplitudenmoduliert
• Frequenzgangfunktion:
Betrag:
Phase :
| F (jω) | =
ϕ(ω)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
r
F (jω) = | F (jω) | · e j ϕ(ω)
Re{F (jω)}2 + Im{F (jω)}2
Im{F (jω)}
= arctan
Re{F (jω)}
15
MATLAB Control System Toolbox
Frequenzgang–Daten–Modelle erstellen
• Befehl frd(ant, f req, eh):
ant
Vektor mit den komplexen Frequenzantworten
f req
Vektor mit gespeicherten Frequenzen
eh
Einheit der Frequenz (’rad/s’ oder ’Hz’)
• Beispiel:
>> freq = [0.01 0.1 1 10 100 1000 10000] ;
>> ant
= (1-j*freq) ./(1+freq.^2)
>> sysfrd = frd(ant,freq,’Units’,’rad/s’)
• MIMO–System:
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
ant ist Tensor (N y×N u×Nf )
16
MATLAB Control System Toolbox
Zeitdiskrete Modelle
• Zusätzlicher Parameter:
Abtastzeit Ts
tf(num,den,Ts)
zpk(z,p,k,Ts)
ss(a,b,c,d,Ts)
frd(ant,freq,Ts)
• Abtastzeit unspezifiziert:
• DSP–Format:
Ts = -1
h = filt ([1 -0.5],[1 1 -2],0.01)
• Zustandsdarstellung:
x(k + 1) = A x(k) + B u(k)
y(k) = C x(k) + D u(k)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
17
MATLAB Control System Toolbox
Zeitverzögerungen
Zeitkontinuierlich:
• Zwischen Ein- und Ausgängen (TF, ZPK, FRD):
set(sys,’IODelay’,Td)
• Am Ein- oder Ausgang (SS):
set(sys,’InputDelay’,Tde)
set(sys,’OutputDelay’,Tda)
Zeitdiskret:
• Pade-Approximation:
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
pade(sys,n)
18
MATLAB Control System Toolbox
Umwandeln und Bearbeiten von LTI–Modellen
Umwandeln und Bearbeiten
von LTI–Modellen
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
19
MATLAB Control System Toolbox
LTI–Objekte
• LTI–Modelle gespeichert als Cell Arrays mit vordefinierten Modell–Eigenschaften und ihren Werten
• Allgemeine Modell–Eigenschaften:
Ts, InputDelay, OutputDelay, ioDelayMatrix, InputName,
OutputName, InputGroup, OutputGroup, Notes, Userdata
• Modellspezifische Modell–Eigenschaften:
TF:
ZPK:
SS:
FRD:
num, den, Variable (s, p; z, q, z^-1)
z, p, k, Variable (s, p; z, q, z^-1)
a, b, c, d, StateName
Frequency, ResponseData, Units
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
20
MATLAB Control System Toolbox
Modell–Eigenschaften setzen, ändern und abrufen
• Setzen und Ändern von Modell–Eigenschaften:
– direkt:
sys = tf(. . .,’EigN ame’,EigW ert)
– Befehl set:
set(sys,’EigN ame’,EigW ert,. . .)
– “.“–Befehl:
sys.EigN ame = EigW ert
• Abrufen von Modell–Eigenschaften:
– Befehl get:
get(sys,’EigN ame’)
– “.“–Befehl:
sys.EigN ame
• Schnellabfrage:
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
tfdata, zpkdata, ssdata, frddata
21
MATLAB Control System Toolbox
Rangfolge und Vererbung von Modell–Eigenschaften
• Vorrangliste:
FRD
SS
• Umwandeln:
– vorher:
sys = systf + tf(sysss)
– nachher:
sys = tf(systf + sysss)
>
>
ZPK
>
TF
• Vererbung von Modell–Eigenschaften
– Diskret: alle Abtastzeiten gleich bzw. unspezifiziert
– Variable Variable:
¦ kont.:
p >
s
¦ diskret: z^-1 > q > z
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
22
MATLAB Control System Toolbox
Umwandlung von Modell–Typen
• Explizite Umwandlung:
Übergabe des Systems an
Befehle tf(sys), ss(sys), zpk(sys) oder frd(sys,freq)
• Umwandlung mit MATLAB–Befehlen:
zp2tf(z,p,k)
tf2zp(num,den)
tf2ss(num,den)
ss2tf(A,B,C,D,iu)
ss2zp(A,B,C,D,i)
zp2ss(z,p,k)
• Automatische Umwandlung:
Operationen wandeln
Modelle automatisch in benötigten Modelltyp um
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
23
MATLAB Control System Toolbox
Arithmetische Operatoren
• Addition und Subtraktion:
y = G1 · u + G 2 · u
• Multiplikation:
⇔
sys = sys1 + sys2
Reihenschaltung
y = G1 · v = G1 · (G2 · u)
• Matrix-Inversion:
Parallelschaltung
⇔
u = G−1y
sys = sys1 * sys2
⇔
sys = inv(sys)
• links- und rechtsseitige Matrix–Division:
G1−1G2 ⇔ sys1 \ sys2
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
G1G2−1 ⇔ sys1 / sys2
24
MATLAB Control System Toolbox
Extrahieren und Ändern von LTI–Modellen
• Ansprechen der Ein- und Ausgänge mit sys(i,j)
• Teilsystem:
– extrahieren: subsys = systf(1,2)
– ändern:
systf(2,1) = subsys
• Ein-/Ausgänge:
– löschen:
systf(:,1) = []
– hinzufügen: systf = [systf,sys] (Typ nach Rang)
systf(:,2) = sys
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
(Typ systf)
25
MATLAB Control System Toolbox
Verknüpfen von LTI–Modellen
• Horizontal:
sys = [ sys1 , sys2 ]
• Vertikal:
sys = [ sys1 ; sys2 ]
• Diagonal:
sys = append(sys1,sys2)
• Parallel und seriell:
sys = parallel(sys1,sys2,in1,in2,out1,out2)
sys = series(sys1,sys2,outputs1,inputs2)
• Rückkopplung:
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
sys = feedback(sys1,sys2)
26
MATLAB Control System Toolbox
Zeitkontinuierliche und zeitdiskrete Systeme
• Kontinuierlich → diskret:
Diskret → kontinuierlich:
sysd = c2d(sysc,Ts)
sysc = d2c(sysd,methode)
• Diskretisierung: – Halteglied 0. Ordnung:
zoh
– Halteglied 1. Ordnung:
foh
– Tustin–Approximation:
tustin
• Diskretisierung verzögerter Systeme
• Geänderte Abtastzeit:
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
sys = d2d(sys,Ts)
27
MATLAB Control System Toolbox
Analyse der Systemeigenschaften
Analyse der
Systemeigenschaften
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
28
MATLAB Control System Toolbox
Übersicht
• Allgemeine Eigenschaften
• Modell–Dynamik
• Systemantwort im Zeitbereich
• Systemantwort im Frequenzbereich
• Ordnungsreduktion
• Zustandsbeschreibungen
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
29
MATLAB Control System Toolbox
Allgemeine Eigenschaften
• Überprüfung und Abfrage von durch MATLAB
bestimmte Systemeigenschaften
• Nützlich für die Programmierung komplexer Skripts
und Funktionen:
– Auswerteroutinen
– Komplexe Plots erstellen
• Systemeigenschaften oder Boolsche Werte (ja/nein)
als Rückgabewerte
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
30
MATLAB Control System Toolbox
Modelltyp, Zeitdaten, Struktur, Größe
• Modelltyp:
– ausgeben: class(sys)
– prüfen:
• Zeitdaten:
• Struktur:
• Größe:
isa(sys,’classname’)
– zeitkontinuierlich:
isct(sys)
– zeitdiskret:
isdt(sys)
– Verzögerungen:
hasdelay(sys)
– Ein- & Ausgänge:
isempty(sys)
– Ordnung:
isproper(sys)
– SISO–Modell:
issiso(sys)
size(sys)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
31
MATLAB Control System Toolbox
Modell–Dynamik
• Stationäre (Gleich–)Verstärkung:
dcgain(sys)
– Frequenz ist s = 0 bzw. z = 1
– Reine Integratoren:
Verstärkung ∞
• Natürliche Frequenzen und Dämpfungen:
– Pole:
– Frequenzen:
pi = α ± j β
ωn =
q
– Dämpfungen: D = −
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
damp(sys)
α2 + β 2
q
α
α2 + β 2
32
MATLAB Control System Toolbox
Nullstellen und Pole eines LTI–Modells
• Nullstellen:
• Polstellen:
zero(sys)
– Eigenwerte der Matrix A: pole(sys)
– Wurzeln des Polynoms c:
• Sortieren:
roots(c)
– zeitkontinuierlich: [s,ndx] = esort(p)
– zeitdiskret:
• Null–Polstellen–Verteilung:
[s,ndx] = dsort(p)
[p,z] = pzmap(sys)
Linien gleicher Dämpfung und natürlicher Frequenz:
– kontinuierlich: sgrid
– zeitdiskret:
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
zgrid
33
MATLAB Control System Toolbox
Systemantwort im Zeitbereich
• Systemantwort kontinuierlich/diskret:
Zt
y(t) = CeAtx0 +
y[k] = CAk x0 +
τ =0
k−1
X µ
µ
CeA(t−τ )B + D u(τ ) dτ
• Zeitvektor:
• Ausgang y:
¶
CAk−i−1B + D u[i]
i=0
• Befehlsaufruf:
¶
[y,t,x] = bef ehl(sys,par)
t = 0:dt:Tf
– SIMO:
length(t) × N y
– MIMO: length(t) × N y × N u
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
34
MATLAB Control System Toolbox
Freie Bewegung, Impuls- und Sprungantwort
• Freie Bewegung:
[y,t,x] = initial(sys,x0,[,t])
– Eingänge zu Null gesetzt
– Anfangswerte des Zustandsvektors x0
• Impulsantwort:
[y,t,x] = impulse(sys[,t])
– zeitkontinuierlich: Dirac–Impuls δ(t)
– zeitdiskret:
• Sprungantwort:
Einheitsimpuls δ[k]
[y,t,x] = step(sys[,t])
– zeitkontinuierlich: Einheitssprung σ(t)
– zeitdiskret:
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
Folge von δ[k]
35
MATLAB Control System Toolbox
Systemantwort auf Testsignal
• Systemantwort:
[y,t,x] = lsim(sys,u,t,[,x0])
– beliebiger Eingangssignalvektor u
– lsim wählt automatisch passende Abtastzeit dt
• Testsignal:
[u,t] = gensig(typ,tau[,Tf ,T s])
– typ : ’sin’
’pulse’
Sinus
– tau : Periodendauer
Pulse
– Tf :
Gesamtdauer
– Ts :
Abtastzeit
’square’ Rechteck
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
36
MATLAB Control System Toolbox
Systemantwort im Frequenzbereich
Frequenzgang:
Komplexe Antwort auf sinusförmige Anregung im eingeschwungenen Zustand
Voraussetzung: System asymptotisch stabil, d.h. Realteile aller Eigenwerte kleiner null
F (jω) = | F (jω) | · e j ϕ(ω)
Frequenzgang–ÜF:
Betrag:
Phase :
| F (jω) | =
ϕ(ω)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
r
Re{F (jω)}2 + Im{F (jω)}2
Im{F (jω)}
= arctan
Re{F (jω)}
37
MATLAB Control System Toolbox
Frequenzantwort und Bode–Diagramm
• Frequenzantwort berechnen:
– Einzelne Frequenz f :
f rsp = evalfr(sys,f )
– Frequenzvektor w:
H = freqresp(sys,w)
• Bode–Diagramm:
[mag,phase,w] = bode(sys)
– Frequenzvektor ω (w) als logarithmische x-Achse
– Amplitudengang |F (jω)| (mag) doppeltlogarithmisch
– Phasengang ϕ(ω) (phase) halblogarithmisch
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
38
MATLAB Control System Toolbox
Amplituden- und Phasenrand
• Befehl [Gm,P m,Wcg,Wcp] = margin(sys)
Amplitudenrand Gm, Phasen–Durchtrittsfrequenz Wcg
Phasenrand P m, Amplituden–Durchtrittsfrequenz Wcp
Stabilität für:
ω A < ωϕ
FR > 1
ϕR > 0
• Struktur stabil = allmargin(sys)
Amplitudenrand:
Phasenrand:
Totzeitrand:
Stabilität:
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
GainMargin und GMFrequency
PhaseMargin und PMFrequency
DelayMargin und DMFrequency
Stable, 1 bei Stabilität, 0 sonst.
39
MATLAB Control System Toolbox
Plot des Bode–Diagramms
Bode Diagram
Gm = 6.0218 dB (at 1.7322 rad/sec), Pm = 27.142 deg (at 1.2328 rad/sec)
Magnitude (dB)
20
0
−20
−40
−60
Phase (deg)
0
−90
−180
−270
−1
10
0
10
1
10
Frequency (rad/sec)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
40
MATLAB Control System Toolbox
Nyquist–Diagramm
• Nyquist–Diagramm:
[re,im,w] = nyquist(sys)
Real- und Imaginärteil der Übertragungsfunktion des
offenen Regelkreises von ω = 0 bis ∞ (Ortskurve):
Z0(jω) −jωTt
−F0(jω) =
·e
;
N0(jω)
n0 > m0 , Tt ≥ 0
ω=+∞
∆ φsoll = nr · π + na · π2
• Stabilität:
ω=+0
nr , na: Anzahl in- bzw. grenzstabiler Pole
• Kritischer Punkt:
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
−1 + j 0
41
MATLAB Control System Toolbox
Plot des Nyquist–Diagramms
Nyquist Diagram
3
Imaginary Axis
2
1
0
−1
−2
−3
−2
−1
0
1
2
3
4
Real Axis
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
42
MATLAB Control System Toolbox
LTI–View
GUI für LTI–Systeme
Import und Export von
Systemen
Start mit:
>> ltiview
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
43
MATLAB Control System Toolbox
Beobachtbarkeit
• Beobachtbarkeitsmatrix:
– Ob =
·
obsv(A,C)
CT AT CT (AT )2CT . . . (AT )n−1CT
¸T
c Anzahl der beobachtbaren Zustände
– Rang(Ob) =
• Beobachtbarkeitsform:
– Transformation:
obsvf(A,B,C,[tol])
A = TATT , B = TB , C = CTT
– Transformiertes System:
A =



Ano A12
0
Ao
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth



B =



Bno
Bo



C =
·
0 Co
¸
44
MATLAB Control System Toolbox
Steuerbarkeit
• Steuerbarkeitsmatrix:
– Co =
·
ctrb(A,B)
B AB A2 B . . . An−1B
¸
c Anzahl der steuerbaren Zustände
– Rang(Co) =
• Steuerbarkeitsform:
ctrbf(A,B,C,[tol])
A = TATT , B = TB , C = CTT
– Transformation:
– Transformiertes System:
A =



Anc 0
A21 Ac
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth



B =



0
Bc



C =
·
Cnc Cc
¸
45
MATLAB Control System Toolbox
Entwurf und Optimierung von Reglern
Entwurf und Optimierung
von Reglern
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
46
MATLAB Control System Toolbox
Übersicht
• Wurzelortskurvenverfahren
• Interaktiver Reglerentwurf mit dem SISO Design Tool
• Polplazierung in Verbindung mit
Zustandsrückführung und Zustandsbeobachtung
• Linear–quadratisch optimale Regelung
• Kalman–Filter als Zustandsbeobachter
für verrauschte Signale
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
47
MATLAB Control System Toolbox
Reglerentwurf mit Wurzelortskurvenverfahren
• Wurzelortskurve:
Verhalten der Pole des geschlosse-
nen Regelkreises in Abhängigkeit des Rückführverstärkungsfaktors k in der komplexen Null–Polstellen–Ebene
• Übertragungsfunktion offener Regelkreis
− G0 = k · G R · GS · GM
nR nS nM
= k·
dR dS dM
• Pole von G0 = Wurzeln des Nennerpolynoms von G
d0 + k · n 0 = d R dS dM + k · n R nS nM
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
= 0
48
MATLAB Control System Toolbox
Befehle zum Wurzelortskurvenverfahren
• Wurzelortskurve:
rlocus(sys[,k])
u
- i
6
−
-
GR
-
GS
y
t
-
[r,k] = rlocus(sys)
r = rlocus(sys,k)
k
¾
GM ¾
• Verstärkungsfaktoren interaktiv auslesen:
[k,r] = rlocfind(sys)
[k,r] = rlocfind(sys,p)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
49
MATLAB Control System Toolbox
SISO Design Tool
SISO Design Tool
Reglerentwurf mit:
•
Bode-Diagramm
•
WOK–Verfahren
Start mit:
sisotool (sys)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
50
MATLAB Control System Toolbox
Zustandsregelung
Vollständige Zustandsrückführung mit Rückführmatrix K
-
Strecke:
ẋ
= Ax + Bu
w- hu s B
6
−
ẋ
- h 6
Z
A
y
= Cx + Du
K
xs
¾
-
D
C
s
¾
Regelgesetz (w = o):
u
= −Kx
Geschlossener Regelkreis:
ẋ
= (A − B K) · x
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
y
? - h
51
MATLAB Control System Toolbox
Zustandsbeobachtung - Luenberger–Beobachter
Rückführung des Ausgangsfehlers über L
-
Beobachter:
u
s -
B
x̂˙ = A x̂ + B u + L e
ẋ
- h 6
Z
A
xs
e = y − ŷ = C (x − x̂)
L
s -
B
x̂˙
- ?
h 6
Z
x̂s
-
C
¾
C
e
?
h
6
−
ŷ
- h 6
A
-
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
y
? - h
¾
ŷ = C x̂ + D u
Ausgangsfehler:
-
D
D
52
MATLAB Control System Toolbox
Polplazierung
• Polplazierung:
Rückführmatrix K so berechnen, daß
Pole des geschlossenen Regelkreis den Polen eines vorgegebenen Wunschpolynoms entsprechen.
• Zustandsregler–Rückführvektor k/Rückführmatrix K
k = acker(A,b,p)
K = place(A,B,p)
[K,prec,message] = place(A,B,p)
• Zustandsbeobachter–Rückführmatrix L
L = acker(A’,c’,p) .’
L = place(A’,C’,p) .’
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
53
MATLAB Control System Toolbox
Zustandsregler und Zustandsbeobachter erstellen
• Zustandsbeobachter erstellen
est = estim(sys,L)
est = estim(sys,L,sensors,known)
• Zustandsregler mit Zustandsbeobachter erstellen
rsys = reg(sys,K,L)
rsys = reg(sys,K,L,sensors,known,controls)
-
ud (known)y (sensors) Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
est
(L)
x̂ -
−K
t
u-
54
MATLAB Control System Toolbox
Linear–quadratisch optimale Regelung
• Minimierung eines quadratischen Gütekriteriums:
(Q gewichtet Zustände, R gewichtet Eingänge)
J (x, u) =
Z∞ µ
¶
xT Q x + uT R u + 2 xT N u dt
t=0
• Algebraische Matrix–Riccati–Gleichung lösen
0 = AT S + S A − ( S B + N ) R−1 ( BT S + NT ) + Q
• Rückführmatrix:
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
K = R−1 ( BT S + NT )
55
MATLAB Control System Toolbox
LQ–optimierte Regler–Rückführmatrix K
• LQ–optimierte Regler–Rückführmatrix K
[K,S,e]
[K,S,e]
[Kd,S,e]
[K,S,e]
• Befehl lqrd:
=
=
=
=
lqr(A,B,Q,R[,N ])
dlqr(A,B,Q,R[,N ])
lqrd(A,B,Q,R[,N ],T s)
lqry(sys,Q,R[,N ])
Abtastzeit T s
• Befehl lqry:
J (y, u) =
Z∞ µ
t=0
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
¶
yT Q y + uT R u + 2 yT N u dt
56
MATLAB Control System Toolbox
Probleme der numerischen Darstellung
Probleme der
numerischen Darstellung
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
57
MATLAB Control System Toolbox
Numerische Mathematik
• Algorithmen zur näherungsweisen Lösung mathematischer Probleme, z.B. aus Mathematik, Naturwissenschaft, Technik, ...
• Bewertung der Lösungsverfahren nach verschiedenen
Kriterien, z.B.
– Rechenaufwand und -geschwindigkeit
– Speicherplatzbedarf
– Fehleranalyse
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
58
MATLAB Control System Toolbox
Fehlerbegriffe in der numerischen Mathmatik
• Fehlerklassen:
1. Datenfehler/Eingangsfehler → Konditionierung
2. Verfahrensfehler → unvollständige Modellierung
3. Rundungsfehler → numerische Instabilität
• Absoluter Fehler εk und relativer Fehler δk :
εk = xk − x̃k
xk − x̃k
δk =
xk
Exakte Werte xk und Näherungswerte x̃k mit 1 ≤ k ≤ n
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
59
MATLAB Control System Toolbox
Kondition eines Problems — Natürliche Instabilität
• Auswirkung von Datenfehlern auf Ergebnisse:
Änderungen
Kondition
Eingangsdaten → Ergebnisse
gut
geringe
→ geringe
schlecht
geringe
→ große
• Konditionszahlen:
– Matrix–Inversion: cond(A[,p])
condest(A)
– Eigenwerte:
condeig(A)
• Faustregeln:
– Verlorene Dezimalstellen log10(cond (A))
– schlecht konditioniert
cond(A) >> 1/sqrt(eps)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
60
MATLAB Control System Toolbox
Numerische Instabilität
• Auswirkungen des Lösungsalgorithmus auf Ergebnis
• Stellen für Gleitkomma–Zahlen begrenzt
→ Rundung der Ergebnisse
,→ Auslöschung von Stellen bei Berechnung
,→ Fehlerfortpflanzung
• Multiplikation und Division:
gutartig
• Addition und Subtraktion:
gutartig, bei gleichem/entgegengesetztem Vorzeichen
bößartig, bei entgegengesetztem/gleichem Vorzeichen
und ungefähr gleich großen Zahlenwerten
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
61
MATLAB Control System Toolbox
Bewertung der LTI–Modelle
• Zustandsdarstellung (SS)
– Grundsätzlich am Besten geeignet!
– Algorithmen oft für SS–LTI–Modelle implementiert
• Übertragungsfunktion (TF)
– Nur für Systeme niedriger Ordnung (< 10)
– Oft schlecht konditioniert
• Nullstellen–Polstellen–Darstellung (ZPK)
– Meist besser als TF–LTI–Modell
– Probleme: mehrfache Polstellen/Polstellen bei Null
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
62
MATLAB Control System Toolbox
Empfehlung zur Programmierung
• Modelle möglichst als SS–LTI–Modell beschreiben.
Hierbei möglichst eine normierte bzw. austarierte Beschreibung bei verwenden.
• Konvertierungen zwischen Modelltypen vermeiden.
• Ergebnisse auf ihre Verläßlichkeit und Realitätsnähe
überprüfen.
Wichtigste Ingenieuraufgabe!
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth
63

Documentos relacionados