CMU  Simulink Basics Tutorial
19 pages
English

CMU Simulink Basics Tutorial

-

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
19 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

CTMS: Simulink Basics Tutorial http://www.library.cmu.edu/ctms/ctms/simulink/basic/bas...Simulink Basics TutorialStarting SimulinkModel FilesBasic ElementsRunning SimulationsBuilding SystemsSimulink is a graphical extension to MATLAB for modeling and simulation of systems. In Simulink,systems are drawn on screen as block diagrams. Many elements of block diagrams are available, such astransfer functions, summing junctions, etc., as well as virtual input and output devices such as functiongenerators and oscilloscopes. Simulink is integrated with MATLAB and data can be easily transferedbetween the programs. In these tutorials, we will apply Simulink to the examples from the MATLABtutorials to model the systems, build controllers, and simulate the systems. Simulink is supported onUnix, Macintosh, and Windows environments; and is included in the student version of MATLAB forpersonal computers. For more information on Simulink, contact the MathWorks.The idea behind these tutorials is that you can view them in one window whilerunning Simulink in another window. System model files can be downloaded fromthe tutorials and opened in Simulink. You will modify and extend these systemwhile learning to use Simulink for system modeling, control, and simulation. Donot confuse the windows, icons, and menus in the tutorials for your actualSimulink windows. Most images in these tutorials are not live - they simply displaywhat you should see in your own Simulink windows. ...

Informations

Publié par
Nombre de lectures 23
Langue English

Extrait

 such asonticnn odromoypsalM
CTMS: Simulink Basics Tutorial http://www.library.cmu.edu/ctms/ctms/simulink/b Simulink Basics Tutorial Starting Simulink Model Files Basic Elements Running Simulations Building Systems S imulink is a graphical extension A t T o L  A M B for modeling and simulation of systems. In Simulink, systems are drawn on screen as block diagrams. Many elements of block diagrams are available, transfer functions, summing junctions, etc., as well as virtual input and output devices such as fu generators and oscilloscopes. Simulink is integrate A d T  L w A i B t ha nMd data can be easily transfered between the programs. In these tutorials, we will apply Simulink to the example A s T  L f A r B om the M tutorials to model the systems, build controllers, and simulate the systems. Simulink is supporte Unix, Macintosh, and Windows environments; and is included in the student A v T e L r A s B i foonr of M personal computers. For more information on Simulink, con M t a t c h t W th o e r  k . s The idea behind these tutorials is that you can view them in one window while running Simulink in another window. System model files can be downloaded f the tutorials and opened in Simulink. You will modify and extend these system while learning to use Simulink for system modeling, control, and simulation. D not confuse the windows, icons, and menus in the tutorials for your actual Simulink windows. Most images in these tutorials are not live - they simply di what you should see in your own Simulink windows. All Simulink operations should be done in your Simulink windows. Starting Simulink Simulink is started from th A e T  L M AB command prompt by entering the following command: simulink Alternatively, you can hit the New Simulink Model button at the to AT p L o A f B  cthoem Mmand window as shown below: 1 of 19 1/1/2009 11:00 P
asic/bas...
esarot theomac lnysacib/saM
CTMS: Simulink Basics Tutorial http://www.library.cmu.edu/ctms/ctms/simulink/b When it starts, Simulink brings up two windows. The first is the main Simulink window, which app as: The second window is a blank, untitled, model window. This is the window into which a new mode be drawn. Model Files In Simulink, a model is a collection of blocks which, in general, represents a system. In addition, drawing a model into a blank model window, previously saved model files can be loaded either fr File menu or from the AT M LAB command prompt. As an example, download the following model file b clicking on the following link and saving the file in the directory you are A  T r L u A n B  nfirnogm .M simple.mdl Open this file in Simulink by entering the following command A  T in L  A t B  hceo Mmmand window. (Alternatively, you can load this file usin O g p t e h n  eo ption in the Fi  le menu in Simulink, or by hitting Ctrl+O in Simulink.) simple The following model window should appear. 2 of 19 1/1/2009 11:00 P
...
uptut fromll
CTMS: Simulink Basics Tutorial http://www.library.cmu.edu/ctms/ctms/simulink/b A new model can be created by sele N c e ti w ngfrom the F  ile menu in any Simulink window (or by hitting Ctrl+N). Basic Elements There are two major classes of items in Sim b u l l o i c n k k s :and l  ines . Blocks are used to generate, modify, combine, output, and display signals. Lines are used to transfer signals from one block to anothe Blocks There are several general classes of blocks: Sources: Used to generate various signals Sinks: Used to output or display signals Discrete: Linear, discrete-time system elements (transfer functions, state-space models, et Linear: Linear, continuous-time system elements and connections (summing junctions, gain etc.) Nonlinear: Nonlinear operators (arbitrary functions, saturation, delay, etc.) Connections: Multiplex, Demultiplex, System Macros, etc. Blocks have zero to several input terminals and zero to several output terminals. Unused input terminals are indicated by a small open triangle. Unused output terminals are indicated by a sma triangular point. The block shown below has an unused input terminal on the left and an unused o terminal on the right. Lines Lines transmit signals in the direction indicated by the arrow. Lines must always transmit signals the output terminal of one block to the input terminal of another block. On exception to this is a l can tap off of another line, splitting the signal to each of two destination blocks, as shown below the figure to download the model file called split.mdl). 3 of 19 1/1/2009 11:00 P
M...sabien li(ccka/cis.r,s).c
M
CTMS: Simulink Basics Tutorial http://www.library.cmu.edu/ctms/ctms/simulink/b Lines can never inject a sig in n t a o  la nother line; lines must be combined through the use of a block su as a summing junction. A signal can be either a scalar signal or a vector signal. For Single-Input, Single-Output systems, signals are generally used. For Multi-Input, Multi-Output systems, vector signals are often used, consisting of two or more scalar signals. The lines used to transmit scalar and vector signals are identical. The type of signal carried by a line is determined by the blocks on either end of the line Simple Example The simpl  e model (from th m e odel fil  e section) consists of three blocks: Step, Transfer Fcn, and Scope The Step is s a o  urce bloc  k from which a step input signal originates. This signal is transfered throug the line in the direction indicated by the arrow to the Transfer l F i u n n e c a t r i  o b n l  oc . k The Transfer Function modifies its input signal and outputs a new signal on a line to the Scope. T s h in e k Scope is a block used to display a signal much like an oscilloscope. There are many more types of blocks available in Simulink, some of which will be discussed later now, we will examine just the three we have use s d i  m in p  l t e hme odel. Modifying Blocks A block can be modified by double-clicking on it. For example, if you double-click on the "Transfe Fcn" block in th si e mpl  e model, you will see the following dialog box. 4 of 19 1/1/2009 11:00 P
..s.siabac/rig Rht..hcarscal .h
lypor tonaminoderised eht,laimonfuncfer ransed tneetb  ec naitnoxa elempd.reor F egn ehtot ,ahc tor to sdenominaneet rht2^2++s,1ed eht dotanimonhe tofr 'scklo bsneft arcnit rufy enon.Bng atericev  rottnocinia tng cheffoeieictn sfot ehd seried numerator or ob xoctnd aiol gThisotarna r ehtemuns ldr fonsaiie f. Clngedthisose ol gd aierc ebofthf  ochrapae esc sretemahceb nar words, a unit tspea  t=t)1 .aEzef  troa o velefo l .1  ni(ehtomoa  ,rfs ceem1=el o levtialnininoitcnuf pets a tit  angriurcc ohtsid aietsri  ngeneratelog box hTpat meradee ulfag,inowllof eht ot egnal ch wilndowl wiomedht eno ,ubttcle e oshid tht  2 1na]1eif [:dlominator the denni gniot eofllwo2/00 9110: 0MP
which reflects the change in the denominator of the transfer function. The "step" block can also be double-clicked, bringing up the following dialog box.
bas...5 of 191/1wwl./:w/yrc.biarTutoics httprialnilumis//cisab/k/cdu.emumscts/tmng on the clicki.kD uolbep "lbconklias B: MSmuSipu sTCa b signired oicatomplst c eom.ghTunninoitco"Se ths  iksoclb eerht eseht f
CTMS: Simulink Basics Tutorial http://www.library.cmu.edu/ctms/ctms/simulink/b blank oscilloscope screen. When a simulation is performed, the signal which feeds into the scope will be displayed in this wi Detailed operation of the scope will not be covered in this tutorial. The only function we will use autoscale button, which appears as a pair of binoculars in the upper portion of the window. Running Simulations To run a simulation, we will work with the following model file: simple2.mdl Download and open this file in Simulink followi p n r g e t vi h o e us instructio f n o s r this file. You should see the following model window. Before running a simulation of this system, first open the scope window by double-clicking on the scope block. Then, to start the simulation, eithe S r t s a e r l t fercot m the S  imulatio  n menu (as shown below) or hit Ctrl-T in the model window. The simulation should run very quickly and the scope window will appear as shown below. 6 of 19 1/1/2009 11:00 P
M.sa..cib/saiht sewo.dn
scope. bas...M
CTMS: Simulink Basics Tutorial http://www.library.cmu.edu/ctms/ctms/simulink/b Note that the simulation output (shown in yellow) is at a very low level relative to the axes of the To fix this, hit the autoscale button (binoculars), which will rescale the axes as shown below. Note that the step response does not begin until t=1. This can be changed by double-clicking on "step" block. Now, we will change the parameters of the system and simulate the system again. Double-click on the "Transfer Fcn" block in the model window and change the denominator to [1 20 400] Re-run the simulation (hit Ctrl-T) and you should see what appears as a flat line in the scope wind Hit the autoscale button, and you should see the following in the scope window. 7 of 19 1/1/2009 11:00 P
a/cishet.ow
orialhttsics Tutluni kaBMT:SS miel b.Cowss awnhopseresnos eh petof tlay dispter b teumhc e avodiprd ulho sowndwi epocs eht ,nottt ehuaotcsla eubn. After hittingt nus ehlumioitaogalox bnd aer rlCsose . eid ehtsystthe ettlem sltrohsyl retfa youshh icone  bld1/2009 11:00 PMlimusis/icas/bnk8...sab//191 fo www.p://ary.librde/umc.uc/mttcsmogaldig inowllfo eht ees lliw uoon platisimuany erm era T.ehb xoPactmera, owlese leddniwht nom e menu. Ymulation mht eiSetsrf orht egnahemarap e nou ys, ctod eenoi alit.fI stle of terssimuthe s ydetatohs yltrd haacred heeast.doTc roertct ih after one secon rnucouc'n todsehang0. Ct=1.til morf emit potS ewh, .0 2to0 0. 1taoi.nC ehs miluart timehange Stot 08.0 orf .0 m shep tein(s tcetimetop ich s,whS mietll kvolunit ha werer pmetip ot doit mrofrearameter options ;eww li lnoylb coe erncd nethwieht ats a trs dnice Not thethatehvreitac lxasi. Since the new tua acsob elottuonn  clyngha tesotni desserpmoc itt  ie,nspoes raftsre y sva nahctio funsfertran yllorpaton aer hi Tiss in ww.doehs ocepra tfot narrow p a very im Sf.elsik inulalumis esti noit butope,h th witw tilbme ecs hhtghouhe tys sm tecesnsdnoeve ht nem for a full teumalet dht eysts
sni'kM
CTMS: Simulink Basics Tutorial http://www.library.cmu.edu/ctms/ctms/simulink/b Building Systems In this section, you will learn how to build systems in Simulink using the building blocks in Simul Block Librari . e  s You will build the following system. If you would like to download the completed m he o r d e .el, First you will gather all the necessary blocks from the block libraries. Then you will modify the b so they correspond to the blocks in the desired model. Finally, you will connect the blocks with l form the complete system. After this, you will simulate the complete system to verify that it wor Gathering Blocks Follow the steps below to collect the necessary blocks: Create a new mode N l e ( w from the F  ile menu or Ctrl-N). You will get a blank model window. 9 of 19 1/1/2009 11:00 P
...cisasab/oclksines to.ks
of ereh i erom rtimaornfbln  oondet  es
Double-click on the Sources icon in the main Simulink window.
uretagonegnale silicks. Ca bs.csi.o.t0u1Tol a ifr9p1t/t1h1//w2:0/0.9l w1w1r:a0i0b .PcMryec.ou mkci/lurdb/rsametis.mstTcCiMmS/:s iSniumlublaikn/kc /BsaisThuoS eht snepo sickloib Lrcou Besecrura syraroS .dow whicrces winsnt ehS  hoctnia
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents