a simulink introduction
TRANSCRIPT
-
7/27/2019 A Simulink Introduction
1/15
Automatic ControlProf. Giulio Panzani
A.Y. 2011/2012
n ro uc on o mu n
Trento, 762012
-
7/27/2019 A Simulink Introduction
2/15
General information
SIMULINK is a MATLAB toolbox for the simulation of dynamicsystems
It has a graphical editing interface that allows system modeling in aoc agrams as on.
, , ,discrete time, multivariable and multirate (different sampling time)systems.
Blocks are included in general/specialized libraries, e.g. signal andcontrol system ones.
-
7/27/2019 A Simulink Introduction
3/15
Basic block libraries
-
7/27/2019 A Simulink Introduction
4/15
Simulation of a dynamic system
1. Model definition
2. Model codification
-
7/27/2019 A Simulink Introduction
5/15
Simulation of a dynamic system
Simulation:Define model parameters
Compute the initial state
Define input time historyCompute time behaviourAnalyze results
Modeling Codification
Iterative
processModify/extend
Modify initial stateNew input
-
7/27/2019 A Simulink Introduction
6/15
Simulation of a dynamic system
Matlab and simulink are intgrated one with the other
Parameter
Write arrays
Vout,t
R = 1C = 1
MATLAB SIMULINK MODEL
Simulate
In the simulation
instants
model
Compute o resu s
Plot(t,Vout)
Voutea ,
-
7/27/2019 A Simulink Introduction
7/15
Simulation of a dynamic system
Simulation parameters/settings
-
7/27/2019 A Simulink Introduction
8/15
Example Model definition
Simple mechanical system
Equation of motion
Compute t e constant input to reac esire ina va ue
-
7/27/2019 A Simulink Introduction
9/15
-
7/27/2019 A Simulink Introduction
10/15
Example codification in Simulink
METHOD N 1 Equation of motion integration
ACCELERATIONSPEED DISPLACEMENT
-
7/27/2019 A Simulink Introduction
11/15
Example codification in Simulink
METHOD N 2 Transfer functionCan be a lied onl to linear s stems: transfer function can be defined as polynomial ratio
From equation of motions using the Laplace transform the transfer function is derived
Time domain Laplace domain
.
In Simulink the block Transfer Fcn is devoted to this operation
-
7/27/2019 A Simulink Introduction
12/15
Example codification in Simulink
METHOD N 2 Transfer function
To define a transfer function, numerator and denominator polynomial
coefficients are
needed
-
7/27/2019 A Simulink Introduction
13/15
Example codification in Simulink
METHOD N 3 State space representationCan be a lied onl to linear s stemsState space matrices are needed
State equation Output equation
n mu n e oc a e pace s evo e o s opera on
-
7/27/2019 A Simulink Introduction
14/15
Example codification in Simulink
METHOD N 3 State space representation
-
7/27/2019 A Simulink Introduction
15/15
Example proportional control
On the previous example a proportional controller is applied: the control action is proportional to the position error
Using t e irst met o , t e system is ui t in Simu in
REFERENCE
Mechanical system
DISPLACEMENT
force
ACCELERAT. SPEED DISPLACEMENT
displacement