M ATLAB T UTORIAL Simulink & Control System Design ToolBox and GUIs 1
C ONTENTS Simulink What’s Simulink? Constructing and running a simple model Working with MATLAB Creating subsystems Block help Control System ToolBox CST Basic Commands CST design GUIs 2
3
C ONSTRUCTING AND R UNNING A SIMPLE M ODEL Starting Simulink Creating a new model Constructing a simple system Running a simulation Step-size of simulation Saving / opening a model 4
5
C REATING A NEW MODEL 6
C ONSTRUCTING A SIMPLE SYSTEM Adding blocks to your model Connecting blocks Defining block parameters Changing Simulink parameters and Defining in Matlab Labeling blocks and signals 7
R UNNING A SIMULATION Time is built-in during Simulink simulation. 8
C HANGING THE STEP SIZE 9
S AVING A MODEL 10
W ORKING WITH M ATLAB Importing from and exporting to MATLAB 11
C REATING A SUBSYSTEMS 12
B LOCK HELP 13
M ODELING 14
M ODELING A SYSTEM OF TRANSFER FUNCTIONS 15
M ODELING A SYSTEM OF DIFFERENTIAL EQUATIONS This representation is more general and can be used for nonlinear systems as well 16
F EEDBACK CONTROL 17
EXAMPLE Train System [1] 18 - Free Body Diagram and Newton’s Law
EXAMPLE 19 State variable and output equation Transfer Function
EXAMPLE State-Space 20
EXAMPLE Simulink Model 21
Running the model: 22 - Defining the input: EXAMPLE
23 - Simulating the model for 1000 seconds EXAMPLE
Obtaining the MATLAB Model 24
M ATLAB CONTROL SYSTEM TOOLBOX AND DESIGN GUI S - Control System ToolBox Basic commands - Sisotool GUI - Rltool GUI 25
C ONTROL S YSTEM T OOL B OX B ASIC COMMANDS Implementation of a Control Strategy using MATLAB Control System ToolBox Modeling 2- PID Control 3- Root Locus 4- Frequency 5- State-Space
C ONTROL S YSTEM T OOL B OX B ASIC COMMANDS Modeling: a Pitch Controller [1] 27 -The state equations and transfer function of the system: Angle of attack Pitch rate Pitch angle
M ODELING : A P ITCH C ONTROLLER 28 - State-Space Representation - MATLAB representation and open-loop response or
PID D ESIGN METHOD FOR THE P ITCH C ONTROLLER The design requirements : 29
PID D ESIGN METHOD FOR THE P ITCH C ONTROLLER 30
R OOT -L OCUS D ESIGN METHOD FOR THE P ITCH C ONTROLLER The acceptable region of the locus 31 - Original root-locus plot
R OOT -L OCUS D ESIGN METHOD FOR THE P ITCH C ONTROLLER Adding Lead compensator 32
F REQUENCY R ESPONSE D ESIGN METHOD FOR THE P ITCH C ONTROLLER Closed Loop System Bode plot 33 bandwidth frequency and the phase margin must be greater than 0.9 and 52 degrees we have a bandwidth frequency of 1 rad/sec and a phase margin of 80 degrees!
F REQUENCY R ESPONSE D ESIGN METHOD FOR THE P ITCH C ONTROLLER 34 Adding Lead-Lag compensator
D ESIGNING P ITCH C ONTROLLER USING S TATE -S PACE METHOD Discrete state-space 35
D ESIGNING P ITCH C ONTROLLER USING S TATE -S PACE METHOD Controllability and observability 36
D ESIGNING P ITCH C ONTROLLER USING S TATE -S PACE METHOD Control design via pole placement 37
DESIGN GUI S sisotool opens the SISO design toll with Root Locus view and Bode diagram. rltool opens the SISO design tool with only Root Locus view on. 38
S ISO TOOL DESIGN MATLAB GUI Example: 39
L OAD A M ODEL FROM M ATLAB W ORK S PACE >>sisotool 40
I MPORT SYSTEM DATA 41
H OW TO DESIGN A CONTROLLER 42
H OW TO DESIGN A CONTROLLER Auto tuning 43
R OOT L OCUS AND B ODE DIAGRAMS 44
S TEP RESPONSE AND OTHER TIME SPECIFICATIONS 45
R OOT L OCUS DESIGN MATLAB GUI >>rltool 46 A Single Input Single Output (SISO) Design window will appear This GUI is exactly like “sisotool” but without frequency response design facilities!
R OOT L OCUS DESIGN MATLAB GUI import a pre-defined open-loop transfer function 47
R OOT L OCUS DESIGN MATLAB GUI Enter design parameters 48
R EFERENCE 49 [1] es
T HANK Y OU 50