Matlab & Control System Toolbox
Matlab & Control System Toolbox
2/8/2021
Automatic Control Systems 1
MATLAB & CONTROL SYSTEM TOOLBOX
INTRODUCTION
MATLAB (matrix laboratory) is developed
by MathWorks.
Il allows matrix manipulations, plotting of functions
and data, creation of user interfaces.
It interface with programs written in C, C++, Java,
and Fortran.
Many toobox: Control System, Finacial, Fuzzy Logic,
Signal Processing, Statistics, Symbolic, System
Identification, …
Website http://www.mathworks.com
2/8/2021
Automatic Control Systems 2
MATLAB & CONTROL SYSTEM TOOLBOX
Example
s2
G1 ( s ) 3 num1=3*[1 2];den1=[1 2 4];G1=tf(num1,den1);
s 2 2s 4
z 0.6 num2=2.1*[1 -0.6];den2=[1 -0.56]; T=0.5;
G2 ( z ) 2.1
z 2 0.56 z 0.4 G2=tf(num2,den2,T)
2/8/2021
Automatic Control Systems 3
MATLAB & CONTROL SYSTEM TOOLBOX
Un G Yn
...
G p1 ( s ) G p 2 ( s ) G pn ( s )
2/8/2021
Automatic Control Systems 4
MATLAB & CONTROL SYSTEM TOOLBOX
State space
Syntax
SYS=ss(A,B,C,D,Ts)
Example
̇ −2 0 1 0.0025
= +
̇ 2 −4 2 0.0025
2/8/2021
Automatic Control Systems 6
MATLAB & CONTROL SYSTEM TOOLBOX
2/8/2021
Automatic Control Systems 8
MATLAB & CONTROL SYSTEM TOOLBOX
2/8/2021
Automatic Control Systems 9
MATLAB & CONTROL SYSTEM TOOLBOX
BLOCK DIAGRAM
Series
Syntax: SYS=series(SYS1,SYS2)
Parallel
Syntax: SYS=parallel(SYS1,SYS2)
Feedback
Syntax: SYS=feedback(SYS1,SYS2,sign)
2/8/2021
Automatic Control Systems 10
MATLAB & CONTROL SYSTEM TOOLBOX
TIME RESPONSE
Step response
Syntax
step(sys)
step(sys,t_end)
step(sys,T)
With T=Tinitial:dt:Tfinal
step(sys1,sys2,sys3,…)
2/8/2021
Automatic Control Systems 11
MATLAB & CONTROL SYSTEM TOOLBOX
TIME RESPONSE
Impulse response
• Syntax: impulse(sys)
2/8/2021
Automatic Control Systems 12
MATLAB & CONTROL SYSTEM TOOLBOX
FREQUENCY RESPONSE
Bode plot
Syntax
bode(sys)
bode(sys,{w_min,w_max}):
bode(sys,w)
w: user-supplied vector of frequencies
bode(sys1,sys2,sys3,…)
2/8/2021
Automatic Control Systems 13
MATLAB & CONTROL SYSTEM TOOLBOX
FREQUENCY RESPONSE
Nyquist plot
Syntax: nyquist(sys)
Nichols plot
Syntax: nichols(sys)
2/8/2021
Automatic Control Systems 14
MATLAB & CONTROL SYSTEM TOOLBOX
2/8/2021
Automatic Control Systems 15
MATLAB & CONTROL SYSTEM TOOLBOX
2/8/2021
Automatic Control Systems 16
MATLAB & CONTROL SYSTEM TOOLBOX
SIMULINK
2/8/2021
Automatic Control Systems 17
MATLAB & CONTROL SYSTEM TOOLBOX
SIMULINK
2/8/2021
Automatic Control Systems 18
MATLAB & CONTROL SYSTEM TOOLBOX
SIMULINK
SIMULINK
Examples
2/8/2021
Automatic Control Systems 20