Sie sind auf Seite 1von 15

AutomaticControl

Prof.Giulio Panzani A.Y.2011/2012 /

I t d ti t Introduction toSimulink Si li k

Trento,762012

Generalinformation
SIMULINK is a MATLAB toolbox for the simulation of dynamic systems It has a graphical editing interface that allows system modeling in a bl k diagrams block di fashion. f hi It is capable of dealing with linear, linear nonlinear, nonlinear continuous time, time discrete time, multivariable and multirate (different sampling time) systems. Blocks are included in general/specialized libraries, e.g. signal and control system ones.

Basicblocklibraries

Simulationofadynamicsystem
1. Model definition

2. Model codification

Simulationofadynamicsystem
Simulation:
Define model parameters p Compute theinitial state Define inputtime history Compute time behaviour Analyze results Modeling C difi i Codification

Iterative process

Modify/extend model Simulation

Modify parameters Modify initial state New input

Simulationofadynamicsystem
Matlab andsimulink areintgrated onewiththeother
Writearrays Vout,t MATLAB WORKSPACE Inthe simulation instants SIMULINK MODEL

Parameter definition R=1 C=1

Simulate model Compute Vout

Pl tresults Plot lt Plot(t,Vout)

R dR,C Read RC

Simulationofadynamicsystem
Simulation parameters/settings

Example Modeldefinition
Simplemechanicalsystem

Equationofmotion Computethe h constantinputtoreach hd desired df final lvalue l

Example codification inSimulink


METHODN 1 Equation of motion integration It isanhighlygeneralmethod,suitedforlinearANDnonlinear systems Fromequationofmotiontheaccelerationisderivedandthan speedandposition,thankstosubsequentintegrations

InSimulink theblockintegrator isdevotedtothisoperation

Example codification inSimulink


METHODN 1 Equation of motion integration

ACCELERATION

SPEED

DISPLACEMENT

Example codificationinSimulink
METHODN 2 Transferfunction Canbeapplied pp only ytolinearsystems: y transferfunctioncanbe definedaspolynomialratio FromequationofmotionsusingtheLaplacetransformthetransfer functionisderived
Time domain Laplace domain

TF T.F

InSimulink theblockTransferFcn isdevotedtothisoperation

Example codificationinSimulink
METHODN 2 Transferfunction

Todefineatransferfunction,numeratoranddenominatorpolynomial coefficientsareneeded

Example codificationinSimulink
METHODN 3 Statespacerepresentation Canbeapplied pp only ytolinearsystems y Statespacematricesareneeded

State equation

Output equation

I Simulink In Si li k the th bl block kState St t Space S i devoted is d t dto t this thi operation ti

Example codificationinSimulink
METHODN 3 Statespace representation

Example proportionalcontrol
Onthepreviousexampleaproportionalcontrollerisapplied:thecontrol actionisproportionaltothepositionerror

Usingthe h first f method, h d the h systemisb built l inSimulink l k


REFERENCE force DISPLACEMENT Mechanical system displacement

force ACCELERAT. SPEED DISPLACEMENT displacement

Das könnte Ihnen auch gefallen