Professional Documents
Culture Documents
Creation of LTI-Models
Creation of linear
time-invariant Models
(LTI-Models)
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 1
MATLAB Control System Toolbox
Linear, time-invariant modes (LTI–models)
Parametric Model
• Zero–Pole–Gain (ZPK)
• State–Space (SS)
Non-parametric models
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 2
MATLAB Control System Toolbox
Transfer Function (TF)
• Transfer behaviour
2. Rational expression of s
a) Define s as TF–Model
>> s = tf(’s’)
• N y rows =
c outputs, N u columns =
c inputs
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 5
MATLAB Control System Toolbox
Create TF–MIMO–modell
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 6
MATLAB Control System Toolbox
Zero–Pole–Gain Model (ZPK)
• Transfer behaviour
k Gain (scalar)
2. Rational expression in s
a) Define s as ZPK–model
>> s = zpk(’s’)
• N y rows =
c outputs, N u columns =
c inputs
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 9
MATLAB Control System Toolbox
Create ZPK–MIMO–modell
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 10
MATLAB Control System Toolbox
State–Space–model (SS)
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 11
MATLAB Control System Toolbox
Create SS–Model
• Command 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
• Feedthrough often 0: D = 0
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 12
MATLAB Control System Toolbox
Frequency response data model (FRD)
r
Abs. value: | F (jω) | = Re{F (jω)}2 + Im{F (jω)}2
Im{F (jω)}
Phase : ϕ(ω) = arctan
Re{F (jω)}
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 13
MATLAB Control System Toolbox
Create Frequency response data model
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 14
MATLAB Control System Toolbox
Discrete-time Models
tf(num,den,Ts) zpk(z,p,k,Ts)
ss(a,b,c,d,Ts) frd(ant,freq,Ts)
Continuous-time:
Discrete-time:
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 16
MATLAB Control System Toolbox
Converting and Working with LTI–Models
with LTI–Models
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 17
MATLAB Control System Toolbox
LTI–Objects
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 19
MATLAB Control System Toolbox
Precedence and Property Inheritance
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 21
MATLAB Control System Toolbox
Arithmetic operations
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 22
MATLAB Control System Toolbox
Extracting and modifying LTI models
• Inputs/Outputs:
– deletion: systf(:,1) = []
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 23
MATLAB Control System Toolbox
Concatenation of LTI models
sys = parallel(sys1,sys2,in1,in2,out1,out2)
sys = series(sys1,sys2,outputs1,inputs2)
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 24
MATLAB Control System Toolbox
Continuous-time and discret-time models
• Discretization method:
– Zero order hold: zoh
– First order hold: foh
– Tustin–Approximation: tustin
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 25
MATLAB Control System Toolbox
Analysis of Models
Model
analysis
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 26
MATLAB Control System Toolbox
Overview
• General properties
• Model dynamics
• Time Response
• Frequency Response
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 27
MATLAB Control System Toolbox
General properties
– Evaluation routines
– Create complex plots
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 28
MATLAB Control System Toolbox
Model types, time dates, structures, size
• Size: size(sys)
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 29
MATLAB Control System Toolbox
Model dynamics
– Frequency is s = 0 or z = 1
– Integrators: gain ∞
– Pole: pi = α ± j β
q
– Frequency: ωn = α2 + β 2
α
– Damping: D = − q
α2 + β 2
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 30
MATLAB Control System Toolbox
Zeros and Poles of LTI models
• Zeros: zero(sys)
• Response continuous-time/discret-time:
Zt µ ¶
y(t) = CeAtx0 + CeA(t−τ )B + D u(τ ) dτ
τ =0
k−1
X µ ¶
y[k] = CAk x0 + CAk−i−1B + D u[i]
i=0
Im{F (jω)}
Phase : ϕ(ω) = arctan
Re{F (jω)}
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 35
MATLAB Control System Toolbox
Frequency response and Bode plot
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 36
MATLAB Control System Toolbox
Gain and phase margin
Z0(jω) −jωTt
−F0(jω) = ·e ; n0 > m 0 , T t ≥ 0
N0(jω)
ω=+∞
• Stability: ∆ φsoll = nr · π + na · π2
ω=+0
• Critical point: −1 + j 0
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 38
MATLAB Control System Toolbox
LTI viewer
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 39
MATLAB Control System Toolbox
Observability
Designing
Compensators
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 42
MATLAB Control System Toolbox
Overview
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 43
MATLAB Control System Toolbox
Root locus design
d 0 + k · n0 = d R d S d M + k · nR nS nM = 0
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 44
MATLAB Control System Toolbox
Root locus design commands
−
6
[r,k] = rlocus(sys)
k ¾
GM ¾
r = rlocus(sys,k)
[k,r] = rlocfind(sys)
[k,r] = rlocfind(sys,p)
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 45
MATLAB Control System Toolbox
SISO Design Tool
Compensator design:
• Bode diagramm
• Root locus
Start by:
sisotool (sys)
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 46
MATLAB Control System Toolbox
State-feedback control
ẋ = Ax + Bu
6
− 6
A ¾ s
y = Cx + Du K ¾
Closed loop: ẋ = (A − B K ) · x
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 47
MATLAB Control System Toolbox
State estimation - Luenberger estimator
x̂˙ = A x̂ + B u + L e
A ¾
ŷ = C x̂ + D u e ?
L ¾ h
6
−
?
˙
x̂ Z
x̂s ŷ
Output error: s -
B - h -
6
-
C - h -
6
e = y − ŷ = C (x − x̂) A
-
D
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 48
MATLAB Control System Toolbox
Polplazierung
-
ud (known)- est x̂ - u-
−K t
y (sensors) - ( L)
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 50
MATLAB Control System Toolbox
Linear quadratic Gaussian (LQG) methods
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 51
MATLAB Control System Toolbox
LQG optimized compensator gain matrix K
• Command lqry:
Z∞ µ ¶
J ( y , u) = yT Q y + uT R u + 2 yT N u dt
t=0
Matlab/Simulink
Dipl.-Ing. U. Wohlfarth 52