matlab control system toolbox - hs-augsburg.dewohlfart/download/folien_control.pdf · bode diagram...
Post on 10-Feb-2018
246 Views
Preview:
TRANSCRIPT
-
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
SingleInput/SingleOutput (SISO) und
MultipleInput/MultipleOutput (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 (LTIModelle)
Parametrische Beschreibung
Ubertragungsfunktion/Transfer Function (TF)
NullstellenPolstellenDarstellung/ZeroPoleGain (ZPK)
Zustandsdarstellung/StateSpace (SS)
Nichtparametrische Beschreibung
FrequenzgangDatenModelle/Frequency Response Data (FRD)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 4
-
MATLAB Control System Toolbox
Ubertragungsfunktion/Transfer Function (TF)
Ubertragungsverhalten im LaplaceBereich
Rationale Funktion in s:
h(s) =num(s)
den(s)=
am sm + am1 s
m1 + . . . + a1 s + a0
bn sn + bn1 sn1 + . . . + b1 s + b0
Zahlerpolynom num und Nennerpolynom den
Zahlerordnung m und Nennerordnung n
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 5
-
MATLAB Control System Toolbox
TFSISOUbertragungsfunktion 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 TFSystem
>> s = tf(s)
b) Ubertragungsfunktion 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
TFMIMOUbertragungsfunktion
zweidimensionale NyNuMatrix H von SISOTF:
H =
h11 h12
h21 h22
=
num11
den11
num12
den12
num21
den21
num22
den22
Matrixelement hij: Ubertragungsfunktion vom
Eingang j zum Ausgang i
Ny Zeilen = Ausgange, Nu Spalten = Eingange
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 7
-
MATLAB Control System Toolbox
TFMIMOUbertragungsfunktion erstellen
1. Definieren der einzelnen SISOTF:
a) Befehl tf(num, den) / rationale Funktion in s
b) Matrix H definieren
2. Befehl tf(NUM,DEN): Cell Array NUM fur Zahler-
polynome und DEN fur Nennerpolynome (NyNu)
NUM =
num11 num12
num21 num22
DEN =
den11 den12
den21 den22
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 8
-
MATLAB Control System Toolbox
Null-/PolstellenDarstellung/ZeroPoleGain (ZPK)
Ubertragungsverhalten im LaplaceBereich
Rationale Funktion in s mit Nullstellen und Polstellen:
h (s) = k (s z1) . . . (s zm1) (s zm)
(s p1) . . . (s pn1) (s pn)
k Verstarkungsfaktor (reell)
z1, . . . , zm ZahlerNullstellen (reell/konj. komplex)
p1, . . . , pm NennerNullstellen (reell/konj. komplex)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 9
-
MATLAB Control System Toolbox
ZPKSISOUbertragungsfunktion erstellen
1. Befehl zpk (z,p,k): Nullstellenvektor z, Polstel-
lenvektor p und Verstarkungsfaktor k.
>> h = zpk([-6 1 1],[-5 1],3)
2. Rationale Funktion in s
a) Definieren von s als ZPKSystem
>> s = zpk(s)
b) Ubertragungsfunktion als rationale Funktion in s
>> h = 2 * 1 / ((s-1)*(s+2))
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 10
-
MATLAB Control System Toolbox
ZPKMIMOUbertragungsfunktion
zweidimensionale NyNuMatrix H von SISOZPK:
H =
h11 h12
h21 h22
=
k11 z11
p11k12
z12
p12
k21 z21
p21k22
z22
p22
Matrixelement hij: Ubertragungsfunktion vom
Eingang j zum Ausgang i
Ny Zeilen = Ausgange, Nu Spalten = Eingange
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 11
-
MATLAB Control System Toolbox
ZPKMIMOUbertragungsfunktion erstellen
1. Definieren der einzelnen SISOZPK:
a) Befehl zpk(z,p,k) / rationale Funktion in s
b) Matrix H definieren
2. Befehl zpk (Z,P,K): Cell Array Z fur Nullstellen-
polynome und P fur Polstellenpolynome (NyNu),
NyNuMatrix K der Verstarkungsfaktoren
Z =
z11 z12
z21 z22
P =
p11 p12
p21 p22
K =
k11 k12
k21 k22
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 12
-
MATLAB Control System Toolbox
Zustandsdarstellung/StateSpace (SS)
DGL 1. Ordnung fur jedes Speicherelement (Integrator)
n DGLs 1. Ordnung statt eine DGL nter Ordnung
ZustandsDGL:
x = A x + B u
Ausgangsgleichung:
y = C x + D u
x: Zustandsvektor (Nx1)
u: Eingangsvektor (Nu1)
y: Ausgangsvektor (Ny1)
A: Zustandsmatrix (NxNx)
B: Eingangsmatrix (NxNu)
C: Ausgangsmatrix (NyNx)
D: Durchschaltmatrix (NyNu)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 13
-
MATLAB Control System Toolbox
SSModell erstellen
Befehl ss(A,B,C,D):
A =
[1 2
3 4
]B =
[1 1
0 1
]C =
0 1
1 2
3 1
D =
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: D = 0
SISOSysteme: u u y y B b C cT
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 14
-
MATLAB Control System Toolbox
FrequenzgangDatenModelle (FRD)
FrequenzDaten aus Messung oder Simulation
SinusAnregung: y(t) = |G() | sin (t+ ())
y(t) phasenverschoben und amplitudenmoduliert
Frequenzgangfunktion: F (j) = |F (j) | e j ()
Betrag: |F (j) | =
Re{F (j)}2+ Im{F (j)}2
Phase : () = arctanIm{F (j)}
Re{F (j)}Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 15
-
MATLAB Control System Toolbox
FrequenzgangDatenModelle erstellen
Befehl frd(ant, freq, eh):
ant Vektor mit den komplexen Frequenzantworten
freq 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)
MIMOSystem: ant ist Tensor (NyNuNf)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 16
-
MATLAB Control System Toolbox
Zeitdiskrete Modelle
Zusatzlicher Parameter: Abtastzeit Ts
tf(num,den,Ts)
ss(a,b,c,d,Ts)
zpk(z,p,k,Ts)
frd(ant,freq,Ts)
Abtastzeit unspezifiziert: Ts = -1
DSPFormat: h = filt ([1 -0.5],[1 1 -2],0.01)
Zustandsdarstellung: x(k+1) = Ax(k) + Bu(k)
y(k) = Cx(k) + Du(k)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 17
-
MATLAB Control System Toolbox
Zeitverzogerungen
Zeitkontinuierlich:
Zwischen Ein- und Ausgangen (TF, ZPK, FRD):
set(sys,IODelay,Td)
Am Ein- oder Ausgang (SS):
set(sys,InputDelay,Tde)
set(sys,OutputDelay,Tda)
Zeitdiskret:
Pade-Approximation: pade(sys,n)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 18
-
MATLAB Control System Toolbox
Umwandeln und Bearbeiten von LTIModellen
Umwandeln und Bearbeiten
von LTIModellen
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 19
-
MATLAB Control System Toolbox
LTIObjekte
LTIModelle gespeichert als Cell Arrays mit vordefi-
nierten ModellEigenschaften und ihren Werten
Allgemeine ModellEigenschaften:
Ts, InputDelay, OutputDelay, ioDelayMatrix, InputName,
OutputName, InputGroup, OutputGroup, Notes, Userdata
Modellspezifische ModellEigenschaften:
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
ModellEigenschaften setzen, andern und abrufen
Setzen und Andern von ModellEigenschaften:
direkt: sys = tf(. . .,EigName,EigWert)
Befehl set: set(sys,EigName,EigWert,. . .)
.Befehl: sys.EigName = EigWert
Abrufen von ModellEigenschaften:
Befehl get: get(sys,EigName)
.Befehl: sys.EigName
Schnellabfrage: tfdata, zpkdata, ssdata, frddata
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 21
-
MATLAB Control System Toolbox
Rangfolge und Vererbung von ModellEigenschaften
Vorrangliste: FRD > SS > ZPK > TF
Umwandeln: vorher: sys = systf + tf(sysss)
nachher: sys = tf(systf + sysss)
Vererbung von ModellEigenschaften
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 ModellTypen
Explizite Umwandlung: Ubergabe des Systems an
Befehle tf(sys), ss(sys), zpk(sys) oder frd(sys,freq)
Umwandlung mit MATLABBefehlen:
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 benotigten Modelltyp um
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 23
-
MATLAB Control System Toolbox
Arithmetische Operatoren
Addition und Subtraktion: Parallelschaltung
y = G1 u+G2 u sys = sys1 + sys2
Multiplikation: Reihenschaltung
y = G1 v = G1 (G2 u) sys = sys1 * sys2
Matrix-Inversion: u = G1y sys = inv(sys)
links- und rechtsseitige MatrixDivision:
G11G2 sys1 \ sys2 G1G2
1 sys1 / sys2
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 24
-
MATLAB Control System Toolbox
Extrahieren und Andern von LTIModellen
Ansprechen der Ein- und Ausgange mit sys(i,j)
Teilsystem: extrahieren: subsys = systf(1,2)
andern: systf(2,1) = subsys
Ein-/Ausgange:
loschen: systf(:,1) = []
hinzufugen: systf = [systf,sys] (Typ nach Rang)
systf(:,2) = sys (Typ systf)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 25
-
MATLAB Control System Toolbox
Verknupfen von LTIModellen
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)
Ruckkopplung: sys = feedback(sys1,sys2)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 26
-
MATLAB Control System Toolbox
Zeitkontinuierliche und zeitdiskrete Systeme
Kontinuierlich diskret: sysd = c2d(sysc,Ts)
Diskret kontinuierlich: sysc = d2c(sysd,methode)
Diskretisierung: Halteglied 0. Ordnung: zoh
Halteglied 1. Ordnung: foh
TustinApproximation: tustin
Diskretisierung verzogerter Systeme
Geanderte Abtastzeit: sys = d2d(sys,Ts)
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
Ubersicht
Allgemeine Eigenschaften
ModellDynamik
Systemantwort im Zeitbereich
Systemantwort im Frequenzbereich
Ordnungsreduktion
Zustandsbeschreibungen
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 29
-
MATLAB Control System Toolbox
Allgemeine Eigenschaften
Uberprufung und Abfrage von durch MATLAB
bestimmte Systemeigenschaften
Nutzlich fur die Programmierung komplexer Skripts
und Funktionen:
Auswerteroutinen
Komplexe Plots erstellen
Systemeigenschaften oder Boolsche Werte (ja/nein)
als Ruckgabewerte
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 30
-
MATLAB Control System Toolbox
Modelltyp, Zeitdaten, Struktur, Groe
Modelltyp: ausgeben: class(sys)
prufen: isa(sys,classname)
Zeitdaten: zeitkontinuierlich: isct(sys)
zeitdiskret: isdt(sys)
Verzogerungen: hasdelay(sys)
Struktur: Ein- & Ausgange: isempty(sys)
Ordnung: isproper(sys)
SISOModell: issiso(sys)
Groe: size(sys)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 31
-
MATLAB Control System Toolbox
ModellDynamik
Stationare (Gleich)Verstarkung: dcgain(sys)
Frequenz ist s = 0 bzw. z = 1
Reine Integratoren: Verstarkung
Naturliche Frequenzen und Dampfungen: damp(sys)
Pole: pi = j
Frequenzen: n =2+ 2
Dampfungen: D =
2+ 2
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 32
-
MATLAB Control System Toolbox
Nullstellen und Pole eines LTIModells
Nullstellen: zero(sys)
Polstellen: Eigenwerte der Matrix A: pole(sys)
Wurzeln des Polynoms c: roots(c)
Sortieren: zeitkontinuierlich: [s,ndx] = esort(p)
zeitdiskret: [s,ndx] = dsort(p)
NullPolstellenVerteilung: [p,z] = pzmap(sys)
Linien gleicher Dampfung und naturlicher Frequenz:
kontinuierlich: sgrid
zeitdiskret: zgrid
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 33
-
MATLAB Control System Toolbox
Systemantwort im Zeitbereich
Systemantwort kontinuierlich/diskret:
y(t) = CeAtx0 +t
=0
(CeA(t)B+D
)u() d
y[k] = CAkx0 +k1
i=0
(CAki1B+D
)u[i]
Befehlsaufruf: [y,t,x] = befehl(sys,par)
Zeitvektor: t = 0:dt:Tf
Ausgang y: SIMO: length(t)Ny
MIMO: length(t)Ny Nu
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])
Eingange zu Null gesetzt
Anfangswerte des Zustandsvektors x0
Impulsantwort: [y,t,x] = impulse(sys[,t])
zeitkontinuierlich: DiracImpuls (t)
zeitdiskret: Einheitsimpuls [k]
Sprungantwort: [y,t,x] = step(sys[,t])
zeitkontinuierlich: Einheitssprung (t)
zeitdiskret: Folge von [k]Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 35
-
MATLAB Control System Toolbox
Systemantwort auf Testsignal
Systemantwort: [y,t,x] = lsim(sys,u,t,[,x0])
beliebiger Eingangssignalvektor u
lsim wahlt automatisch passende Abtastzeit dt
Testsignal: [u,t] = gensig(typ,tau[,Tf,Ts])
typ : sin Sinus
pulse Pulse
square Rechteck
tau : Periodendauer
Tf : Gesamtdauer
Ts : Abtastzeit
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 36
-
MATLAB Control System Toolbox
Systemantwort im Frequenzbereich
Frequenzgang: Komplexe Antwort auf sinusformige An-
regung im eingeschwungenen Zustand
Voraussetzung: System asymptotisch stabil, d.h. Real-
teile aller Eigenwerte kleiner null
FrequenzgangUF: F (j) = |F (j) | e j ()
Betrag: |F (j) | =
Re{F (j)}2+ Im{F (j)}2
Phase : () = arctanIm{F (j)}
Re{F (j)}
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 37
-
MATLAB Control System Toolbox
Frequenzantwort und BodeDiagramm
Frequenzantwort berechnen:
Einzelne Frequenz f : frsp = evalfr(sys,f)
Frequenzvektor w: H = freqresp(sys,w)
BodeDiagramm: [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,Pm,Wcg,Wcp] = margin(sys)
Amplitudenrand Gm, PhasenDurchtrittsfrequenz Wcg
Phasenrand Pm, AmplitudenDurchtrittsfrequenz Wcp
Stabilitat fur: A < FR > 1 R > 0
Struktur stabil = allmargin(sys)
Amplitudenrand: GainMargin und GMFrequency
Phasenrand: PhaseMargin und PMFrequency
Totzeitrand: DelayMargin und DMFrequency
Stabilitat: Stable, 1 bei Stabilitat, 0 sonst.
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 39
-
MATLAB Control System Toolbox
Plot des BodeDiagramms
Bode Diagram
Frequency (rad/sec)
Pha
se (
deg)
Mag
nitu
de (
dB)
60
40
20
0
20Gm = 6.0218 dB (at 1.7322 rad/sec), Pm = 27.142 deg (at 1.2328 rad/sec)
101
100
101
270
180
90
0
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 40
-
MATLAB Control System Toolbox
NyquistDiagramm
NyquistDiagramm: [re,im,w] = nyquist(sys)
Real- und Imaginarteil der Ubertragungsfunktion des
offenen Regelkreises von = 0 bis (Ortskurve):
F0(j) =Z0(j)
N0(j) ejTt ; n0 > m0 , Tt 0
Stabilitat:=+
=+0
soll = nr + na 2
nr, na: Anzahl in- bzw. grenzstabiler Pole
Kritischer Punkt: 1+ j 0
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 41
-
MATLAB Control System Toolbox
Plot des NyquistDiagramms
Nyquist Diagram
Real Axis
Imag
inar
y A
xis
2 1 0 1 2 3 4
3
2
1
0
1
2
3
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 42
-
MATLAB Control System Toolbox
LTIView
GUI fur LTISysteme
Import und Export von
Systemen
Start mit: >> ltiview
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 43
-
MATLAB Control System Toolbox
Beobachtbarkeit
Beobachtbarkeitsmatrix: obsv(A,C)
Ob =[CT ATCT (AT)2CT . . . (AT)n1CT
]T
Rang(Ob) = Anzahl der beobachtbaren Zustande
Beobachtbarkeitsform: obsvf(A,B,C,[tol])
Transformation: A = TATT , B = TB , C = CTT
Transformiertes System:
A =
Ano A12
0 Ao
B =
Bno
Bo
C =
[0 Co
]
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 44
-
MATLAB Control System Toolbox
Steuerbarkeit
Steuerbarkeitsmatrix: ctrb(A,B)
Co =[B AB A2B . . . An1B
]
Rang(Co) = Anzahl der steuerbaren Zustande
Steuerbarkeitsform: ctrbf(A,B,C,[tol])
Transformation: A = TATT , B = TB , C = CTT
Transformiertes System:
A =
Anc 0
A21 Ac
B =
0
Bc
C =
[Cnc Cc
]
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 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
Ubersicht
Wurzelortskurvenverfahren
Interaktiver Reglerentwurf mit dem SISO Design Tool
Polplazierung in Verbindung mit
Zustandsruckfuhrung und Zustandsbeobachtung
Linearquadratisch optimale Regelung
KalmanFilter als Zustandsbeobachter
fur 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 Abhangigkeit des Ruckfuhrverstar-
kungsfaktors k in der komplexen NullPolstellenEbene
Ubertragungsfunktion offener Regelkreis
G0 = k GR GS GM = k nR nS nM
dR dS dM
Pole von G0 = Wurzeln des Nennerpolynoms von G
d0 + k n0 = dR dS dM + k nR nS nM = 0
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 48
-
MATLAB Control System Toolbox
Befehle zum Wurzelortskurvenverfahren
Wurzelortskurve:
rlocus(sys[,k])
[r,k] = rlocus(sys)
r = rlocus(sys,k)k GM
GR GSi t- - - -6
u y
Verstarkungsfaktoren 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
WOKVerfahren
Start mit:
sisotool (sys)
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 50
-
MATLAB Control System Toolbox
Zustandsregelung
Vollstandige Zustandsruckfuhrung mit Ruckfuhrmatrix K
Strecke:
x = A x + B u
y = C x + D u
h h hs s
s
- -
-
- - - - -
6
?
6B
K
A
C
D
w u
x x y
Regelgesetz (w = o): u = K x
Geschlossener Regelkreis: x = (A B K) x
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 51
-
MATLAB Control System Toolbox
Zustandsbeobachtung - LuenbergerBeobachter
Ruckfuhrung des Ausgangsfehlers uber L
Beobachter:
x=A x+B u + L e
y=C x +D u
Ausgangsfehler:
e = y y =C (x x)
h hs s-
-
- - - - -
?
6B
A
C
D
u x x y
?
Le
?h
6
h hs s-
-
- - - - -66B
A
C
D
x x y
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 52
-
MATLAB Control System Toolbox
Polplazierung
Polplazierung: Ruckfuhrmatrix K so berechnen, da
Pole des geschlossenen Regelkreis den Polen eines vor-
gegebenen Wunschpolynoms entsprechen.
ZustandsreglerRuckfuhrvektor k/Ruckfuhrmatrix K
k = acker(A,b,p)
K = place(A,B,p)
[K,prec,message] = place(A,B,p)
ZustandsbeobachterRuckfuhrmatrix 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)-
-
-
est
(L)-
xK -
ut
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 54
-
MATLAB Control System Toolbox
Linearquadratisch optimale Regelung
Minimierung eines quadratischen Gutekriteriums:
(Q gewichtet Zustande, R gewichtet Eingange)
J (x,u) =
t=0
(xT Qx+ uT Ru+2xT Nu
)dt
Algebraische MatrixRiccatiGleichung losen
0 = AT S + SA (SB+N ) R1 (BT S+NT ) + Q
Ruckfuhrmatrix: K = R1 (BT S+NT )
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 55
-
MATLAB Control System Toolbox
LQoptimierte ReglerRuckfuhrmatrix K
LQoptimierte ReglerRuckfuhrmatrix 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 ],Ts)
[K,S,e] = lqry(sys,Q,R[,N ])
Befehl lqrd: Abtastzeit Ts
Befehl lqry:
J (y,u) =
t=0
(yT Qy+ uT Ru+2yT Nu
)dt
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
Algorithmen zur naherungsweisen Losung mathemati-
scher Probleme, z.B. aus Mathematik, Naturwissen-
schaft, Technik, ...
Bewertung der Losungsverfahren 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 unvollstandige Modellierung
3. Rundungsfehler numerische Instabilitat
Absoluter Fehler k und relativer Fehler k:
k = xk xk k =xk xkxk
Exakte Werte xk und Naherungswerte xk mit 1 k n
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 59
-
MATLAB Control System Toolbox
Kondition eines Problems Naturliche Instabilitat
Auswirkung von Datenfehlern auf Ergebnisse:
AnderungenKondition
Eingangsdaten Ergebnisse
gut geringe geringe
schlecht geringe groe
Konditionszahlen: MatrixInversion: 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 Instabilitat
Auswirkungen des Losungsalgorithmus auf Ergebnis
Stellen fur GleitkommaZahlen begrenzt
Rundung der Ergebnisse
Ausloschung von Stellen bei Berechnung
Fehlerfortpflanzung
Multiplikation und Division: gutartig
Addition und Subtraktion:
gutartig, bei gleichem/entgegengesetztem Vorzeichen
boartig, bei entgegengesetztem/gleichem Vorzeichen
und ungefahr gleich groen Zahlenwerten
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 61
-
MATLAB Control System Toolbox
Bewertung der LTIModelle
Zustandsdarstellung (SS)
Grundsatzlich am Besten geeignet!
Algorithmen oft fur SSLTIModelle implementiert
Ubertragungsfunktion (TF)
Nur fur Systeme niedriger Ordnung (< 10)
Oft schlecht konditioniert
NullstellenPolstellenDarstellung (ZPK)
Meist besser als TFLTIModell
Probleme: mehrfache Polstellen/Polstellen bei Null
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 62
-
MATLAB Control System Toolbox
Empfehlung zur Programmierung
Modelle moglichst als SSLTIModell beschreiben.
Hierbei moglichst eine normierte bzw. austarierte Be-
schreibung bei verwenden.
Konvertierungen zwischen Modelltypen vermeiden.
Ergebnisse auf ihre Verlalichkeit und Realitatsnahe
uberprufen.
Wichtigste Ingenieuraufgabe!
Vorlesung Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 63
top related