Beruflich Dokumente
Kultur Dokumente
Folien Control
Folien Control
MATLAB
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 1
MATLAB Control System Toolbox
Umfang
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
• Nullstellen–Polstellen–Darstellung/Zero–Pole–Gain (ZPK)
• Zustandsdarstellung/State–Space (SS)
Nichtparametrische Beschreibung
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 4
MATLAB Control System Toolbox
Übertragungsfunktion/Transfer Function (TF)
• Übertragungsverhalten im Laplace–Bereich
• Rationale Funktion in s:
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 5
MATLAB Control System Toolbox
TF–SISO–Übertragungsfunktion erstellen
2. Rationale Funktion in s
• N y Zeilen =
c Ausgänge, N u Spalten =
c Eingänge
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 7
MATLAB Control System Toolbox
TF–MIMO–Übertragungsfunktion erstellen
num11 num12 den11 den12
NUM = DEN =
num21 num22 den21 den22
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 8
MATLAB Control System Toolbox
Null-/Polstellen–Darstellung/Zero–Pole–Gain (ZPK)
• Übertragungsverhalten im Laplace–Bereich
k Verstärkungsfaktor (reell)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 9
MATLAB Control System Toolbox
ZPK–SISO–Übertragungsfunktion erstellen
2. Rationale Funktion in s
• N y Zeilen =
c Ausgänge, N u Spalten =
c Eingänge
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 11
MATLAB Control System Toolbox
ZPK–MIMO–Übertragungsfunktion erstellen
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 12
MATLAB Control System Toolbox
Zustandsdarstellung/State–Space (SS)
A: Zustandsmatrix (N x×N x)
Ausgangsgleichung: B: Eingangsmatrix (N x×N u)
C: Ausgangsmatrix (N y×N x)
y = Cx + Du D: Durchschaltmatrix (N y×N u)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 13
MATLAB Control System Toolbox
SS–Modell erstellen
• Befehl ss(A,B,C,D):
" # " # 0 1 0 0
1 2 1 1
A= B= C = 1 2
D = 0 0
3 4 0 1
3 1 0 0
• Durchschaltanteil oft 0: D = 0
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 14
MATLAB Control System Toolbox
Frequenzgang–Daten–Modelle (FRD)
r
Betrag: | F (jω) | = Re{F (jω)}2 + Im{F (jω)}2
Im{F (jω)}
Phase : ϕ(ω) = arctan
Re{F (jω)}
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 15
MATLAB Control System Toolbox
Frequenzgang–Daten–Modelle erstellen
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 16
MATLAB Control System Toolbox
Zeitdiskrete Modelle
tf(num,den,Ts) zpk(z,p,k,Ts)
ss(a,b,c,d,Ts) frd(ant,freq,Ts)
• Abtastzeit unspezifiziert: Ts = -1
Zeitkontinuierlich:
Zeitdiskret:
• Pade-Approximation: pade(sys,n)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 18
MATLAB Control System Toolbox
Umwandeln und Bearbeiten von LTI–Modellen
von LTI–Modellen
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 19
MATLAB Control System Toolbox
LTI–Objekte
• Allgemeine Modell–Eigenschaften:
Ts, InputDelay, OutputDelay, ioDelayMatrix, InputName,
OutputName, InputGroup, OutputGroup, Notes, Userdata
• Modellspezifische Modell–Eigenschaften:
TF: num, den, Variable (s, p; z, q, z^-1)
ZPK: z, p, k, Variable (s, p; z, q, z^-1)
SS: a, b, c, d, StateName
FRD: Frequency, ResponseData, Units
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 20
MATLAB Control System Toolbox
Modell–Eigenschaften setzen, ändern und abrufen
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 21
MATLAB Control System Toolbox
Rangfolge und Vererbung von Modell–Eigenschaften
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 23
MATLAB Control System Toolbox
Arithmetische Operatoren
• Multiplikation: Reihenschaltung
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 24
MATLAB Control System Toolbox
Extrahieren und Ändern von LTI–Modellen
• Ein-/Ausgänge:
– löschen: systf(:,1) = []
sys = parallel(sys1,sys2,in1,in2,out1,out2)
sys = series(sys1,sys2,outputs1,inputs2)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 26
MATLAB Control System Toolbox
Zeitkontinuierliche und zeitdiskrete Systeme
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 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
– Auswerteroutinen
– Komplexe Plots erstellen
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 30
MATLAB Control System Toolbox
Modelltyp, Zeitdaten, Struktur, Größe
• Größe: size(sys)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 31
MATLAB Control System Toolbox
Modell–Dynamik
– Pole: pi = α ± j β
q
– Frequenzen: ωn = α2 + β 2
α
– Dämpfungen: D = − q
α2 + β 2
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 32
MATLAB Control System Toolbox
Nullstellen und Pole eines LTI–Modells
• Nullstellen: zero(sys)
• Systemantwort kontinuierlich/diskret:
Zt µ ¶
y(t) = CeAtx0 + CeA(t−τ )B + D u(τ ) dτ
τ =0
X µ
k−1 ¶
y[k] = CAk x0 + CAk−i−1B + D u[i]
i=0
• Zeitvektor: t = 0:dt:Tf
– beliebiger Eingangssignalvektor u
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 36
MATLAB Control System Toolbox
Systemantwort im Frequenzbereich
Im{F (jω)}
Phase : ϕ(ω) = arctan
Re{F (jω)}
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 37
MATLAB Control System Toolbox
Frequenzantwort und Bode–Diagramm
• Frequenzantwort berechnen:
– Frequenzvektor w: H = freqresp(sys,w)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 38
MATLAB Control System Toolbox
Amplituden- und Phasenrand
Bode Diagram
Gm = 6.0218 dB (at 1.7322 rad/sec), Pm = 27.142 deg (at 1.2328 rad/sec)
20
Magnitude (dB)
−20
−40
−60
0
Phase (deg)
−90
−180
−270
−1 0 1
10 10 10
Frequency (rad/sec)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 40
MATLAB Control System Toolbox
Nyquist–Diagramm
Z0(jω) −jωTt
−F0(jω) = ·e ; n0 > m0 , Tt ≥ 0
N0(jω)
ω=+∞
• Stabilität: ∆ φsoll = nr · π + na · π2
ω=+0
• Kritischer Punkt: −1 + j 0
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 41
MATLAB Control System Toolbox
Plot des Nyquist–Diagramms
Nyquist Diagram
2
Imaginary Axis
−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
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 43
MATLAB Control System Toolbox
Beobachtbarkeit
• Beobachtbarkeitsmatrix: obsv(A,C)
· ¸T
– Ob = CT AT CT (AT )2CT . . . (AT )n−1CT
– Rang(Ob) =
c Anzahl der beobachtbaren Zustände
• Beobachtbarkeitsform: obsvf(A,B,C,[tol])
• Steuerbarkeitsmatrix: ctrb(A,B)
· ¸
– Co = B AB A2 B . . . An−1B
– Rang(Co) =
c Anzahl der steuerbaren Zustände
• Steuerbarkeitsform: ctrbf(A,B,C,[tol])
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 46
MATLAB Control System Toolbox
Übersicht
• Wurzelortskurvenverfahren
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 47
MATLAB Control System Toolbox
Reglerentwurf mit Wurzelortskurvenverfahren
d0 + k · n 0 = d R dS dM + k · n R nS nM = 0
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 48
MATLAB Control System Toolbox
Befehle zum Wurzelortskurvenverfahren
• Wurzelortskurve:
u y
rlocus(sys[,k]) - i
6
-
GR -
GS t -
−
[r,k] = rlocus(sys)
k ¾
GM ¾
r = rlocus(sys,k)
[k,r] = rlocfind(sys)
[k,r] = rlocfind(sys,p)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 49
MATLAB Control System Toolbox
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
y = Cx + Du K ¾
Geschlossener Regelkreis: ẋ = (A − B K) · x
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 51
MATLAB Control System Toolbox
Zustandsbeobachtung - Luenberger–Beobachter
e = y − ŷ = C (x − x̂) A
-
D
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 52
MATLAB Control System Toolbox
Polplazierung
• 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)
-
ud (known)- est x̂ - u-
−K t
y (sensors) - (L)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 54
MATLAB Control System Toolbox
Linear–quadratisch optimale Regelung
Z∞ µ ¶
J (x, u) = xT Q x + uT R u + 2 xT N u dt
t=0
0 = AT S + S A − ( S B + N ) R−1 ( BT S + NT ) + Q
• Rückführmatrix: K = R−1 ( BT S + NT )
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 55
MATLAB Control System Toolbox
LQ–optimierte Regler–Rückführmatrix K
• LQ–optimierte Regler–Rückführmatrix K
[K,S,e] = lqr(A,B,Q,R[,N ])
[K,S,e] = dlqr(A,B,Q,R[,N ])
[Kd,S,e] = lqrd(A,B,Q,R[,N ],T s)
[K,S,e] = lqry(sys,Q,R[,N ])
• Befehl lqry:
Z∞ µ ¶
J (y, u) = yT Q y + uT R u + 2 yT N u dt
t=0
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 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
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
xk − x̃k
εk = xk − x̃k δk =
xk
• 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
Wichtigste Ingenieuraufgabe!
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 63