Docsity

Simulation and Model Based Designs Using Simulunk-Digital Signal Processing-Lab Manual, Exercises of Digital Signal Processing

Partial preview of the text

Download Simulation and Model Based Designs Using Simulunk-Digital Signal Processing-Lab Manual and more Exercises Digital Signal Processing in PDF only on Docsity!

LAB # 06LAB # 06

COMSATS INSTITUE OF INFORMATION TECHNOLOGYCOMSATS INSTITUE OF INFORMATION TECHNOLOGY

Simulation and Model Based

Designs using MATLAB SIMULINK

Simulation and Model Based

Designs using MATLAB SIMULINK

What is Simulink good for? -Modeling/designing dynamic systems(including nonlinear dynamics)-Modeling/designing control systems(including nonlinear controllers andplants)-Signal processing design/simulation

The first window thatpops up is the

Library

Browser

.

This is a library ofblocks that areavailable for puttinginto the Simulink blockdiagram.

Simulink Help

Select “SimulinkHelp” from thehelp menu in thelibrary browser.Here you canfind tutorials,demos,information onavailable blocks,and so on.

Sources: Produce Signals

Select “sources” from the library.Drag any block you want to useinto the model.

Sinks: Terminate Signals

Select “sinks” from the library.Drag any block you want to useinto the model.

Running the Simulation

Change parameters underSimulation | ConfigurationParameters.

Running the Simulation

Set start andstop time for thesimulation here.

I often changefrom variable-stepto fixed-step to geta smoother-lookingsolution.

Note: numericalsolution usingode45!

Viewing Results: Scope

Double click on the scope icon toopen up the viewer. You oftenhave to zoom out using thebinocular icon if the curve doesn’tfit in the default axes.

You can save data from the scope tothe workspace using the “Parameters”,

“Data History” tab.

Modifying Block Properties

Double click on any block tobring up a properties box.Here are the “sine wave”properties. If you don’t knowwhat something is… leave italone!!!

Signal Routing

You can create a branch point ina signal line by holding down theCTRL key, and clicking on theline. A summer block can be found inthe “commonly used blocks”library, and in the “math” library.To change the shape of thesummer to rectangular, or to addadditional inputs or change thesign, double click on the summer.

You can flip a block over by right clickingand looking under “Format”, or by selectingit and typing CTRL-i

Signal Routing

Under the “signal routing” library,

the MUX block can be used tobundle a group of signalstogether into a single line. The DEMUX block does the

reverse. This can be useful to:1.

Clear up clutter in acomplicated block diagram.

Send multiple signals to thesame scope; then bothsignals will be displayed onthe same plot.

Transfer Functions^ U(s) = 1/sX(s)=1/(s(s+1))=1/s-1/(s+1)^ So

x(t)=1-exp(-t)

Do In-Class Problem #2. It should be 2:20 by the end of the problem.

Closed Loop Control System:

Here is an example of a closed-loop system

with an on-off controller. Notice the

oscillations in the response.