SIMULINK Tutorial. Select File-New-Model from the menu bar of this window. The following window should now appear.

Similar documents
Simulink Basics Tutorial

Introduction to Simulink

Example: Modeling a Cruise Control System in Simulink

Simulink Basics Tutorial

SIMULINK FOR BEGINNERS:

[ MATLAB ] [ Resources ] PART TWO: SIMULINK

Experiment 6 SIMULINK

Introduction to Matlab Simulink. Control Systems

Experiment 8 SIMULINK

2 Lab 2: LabVIEW and Control System Building Blocks

Introduction to Simulink

BME 5742 Bio-Systems Modeling and Control

SIMULINK A Tutorial by Tom Nguyen

SIGNALS AND LINEAR SYSTEMS LABORATORY EELE

ME422 Mechanical Control Systems Matlab/Simulink Hints and Tips

Introduction to the MATLAB SIMULINK Program

Lecture 10: Simulink. What is Simulink?

Modeling Mechanical System using SIMULINK

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX

Process Automation CHEM-E7140

Introduction to Simulink. The Use of Mathematic Simulations in Electrical Engineering

Introduction to Simulink

Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS

2 SIMULATING A MODEL Simulink Tutorial

16.06/16.07 Matlab/Simulink Tutorial

ELEC ENG 4CL4 CONTROL SYSTEM DESIGN

Session 3 Introduction to SIMULINK

MapleSim User's Guide

Pre-Lab Excel Problem

Small rectangles (and sometimes squares like this

What is Simulink. >>simulink

John's Tutorial on Everyday Mathcad (Version 9/2/09) Mathcad is not the specialist's ultimate mathematical simulator

ES205 Analysis and Design of Engineering Systems: Lab 1: An Introductory Tutorial: Getting Started with SIMULINK

Introduction to Simulink

Excel. Spreadsheet functions

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

Models for Nurses: Quadratic Model ( ) Linear Model Dx ( ) x Models for Doctors:

EXCEL SPREADSHEET TUTORIAL

2. Introduction to Matlab Control System Toolbox

Closed Loop Step Response

MATLAB Project: Getting Started with MATLAB

EXCEL BASICS: MICROSOFT OFFICE 2010

MODELING IN SCILAB: PAY ATTENTION TO THE RIGHT

F1 in Schools Car Design Simulation Tutorial

Let s start by examining an Excel worksheet for the linear programming. Maximize P 70x 120y. subject to

EXCEL BASICS: MICROSOFT OFFICE 2007

MATLAB Project: Getting Started with MATLAB

Using Excel This is only a brief overview that highlights some of the useful points in a spreadsheet program.

Business Data Analysis MA0123. Dr Gavin Shaddick Department of Mathematical Sciences 4W 5.7

Alibre Design Tutorial - Simple Revolve Translucent Glass Lamp Globe

Note 10 Introduction to MATLAB & SIMULINK

Quick Start Training Guide

Microsoft Excel Microsoft Excel

PHYC 500: Introduction to LabView. Exercise 1 (v 1.3) M.P. Hasselbeck, University of New Mexico

Tutorial: Getting Started with the LabVIEW Simulation Module

Computer Project: Getting Started with MATLAB

Session One: MINITAB Basics

How to Open Excel. Introduction to Excel TIP: Right click Excel on list and select PIN to Start Menu. When you open Excel, a new worksheet opens

A TUTORIAL ON WORD. Katie Gregory

Getting Started with DADiSP

0 Graphical Analysis Use of Excel

QUEEN MARY, UNIVERSITY OF LONDON. Introduction to Statistics

STAT 311 (3 CREDITS) VARIANCE AND REGRESSION ANALYSIS ELECTIVE: ALL STUDENTS. CONTENT Introduction to Computer application of variance and regression

InDesign Tutorial: Working with InDesign panels. InDesign Tutorial: Working with InDesign panels. The InDesign Tools panel

EDIT202 Spreadsheet Lab Prep Sheet

LEARNING TO PROGRAM WITH MATLAB. Building GUI Tools. Wiley. University of Notre Dame. Craig S. Lent Department of Electrical Engineering

Excel Formulas & Functions I CS101

MATLAB Programming for Numerical Computation Dr. Niket Kaisare Department Of Chemical Engineering Indian Institute of Technology, Madras

= 3 + (5*4) + (1/2)*(4/2)^2.

The Mathcad Workspace 7

Lab 7: PID Control with Trajectory Following

Department of Chemical Engineering ChE-101: Approaches to Chemical Engineering Problem Solving Excel Tutorial VIII

Lesson 6: Manipulating Equations

Watkins Mill High School. Algebra 2. Math Challenge

addition + =5+C2 adds 5 to the value in cell C2 multiplication * =F6*0.12 multiplies the value in cell F6 by 0.12

Microsoft Excel 2010 Handout

Module 2, Add on lesson Introduction to the NXT and Mindstorms software. Student. 45 minutes

Introduction To Finite Element Analysis

WEEK NO. 12 MICROSOFT EXCEL 2007

Experiment 3. Getting Start with Simulink

Working Model Tutorial for Slider Crank

What we will learn in Introduction to Excel. How to Open Excel. Introduction to Excel 2010 Lodi Memorial Library NJ Developed by Barb Hauck-Mah

Grade: 7 Lesson name: Creating a School News Letter Microsoft Word 2007

Beginner s Guide to Microsoft Excel 2002

EXCEL BASICS: PROJECTS

A BEGINNERS GUIDE TO USING ADOBE PREMIERE PRO

Introduction to Excel

Math 227 EXCEL / MEGASTAT Guide

Maple Quick Start. Maplesoft, a division of Waterloo Maple Inc.

Lab # 3 Time Response Design. State Space and Transfer Functions

Lecture 3 - Template and Vectors

Open Loop Step Response

Excel tutorial Introduction

Dreamweaver 101. Here s the desktop icon for Dreamweaver CS5: Click it open. From the top menu options, choose Site and New Site

How to set up an Amazon Work Profile for Windows 8

CAMPG. Computer Aided Modeling Program with Graphical Input. Windows XP

the Simulation of Dynamics Using Simulink

Lab. Manual. Practical Special Topics (Matlab Programming) (EngE416) Prepared By Dr. Emad Saeid

GeoGebra. 10 Lessons. maths.com. Gerrit Stols. For more info and downloads go to:

Transcription:

SIMULINK Tutorial Simulink is a block-orientated program that allows the simulation of dynamic systems in a block diagram format whether they are linear or nonlinear, in continuous or discrete forms. To invoke the Simulink programme, follow these steps: Start the School of Engineering s version of Matlab [note that the Faculty version of Matlab does not support Simulink]. In the MATLAB command window, type simulink <CR> [<CR> means press the enter key] The following window should now appear Select File-New-Model from the menu bar of this window. The following window should now appear. This window represents a blank worksheet where systems can be simulated. Simulink Basics There are two major classes of items in Simulink: blocks and lines. Blocks are used to generate, modify, combine, output, and display signals. Lines are used to transfer signals from one block to another. 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, etc.) Linear: Linear, continuous-time system elements and connections (summing junctions, gains, 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 small triangular point. The block shown below has an unused input terminal on the left and an unused output terminal on the right. Lines Lines transmit signals in the direction indicated by the arrow. Lines must always transmit signals from the output terminal of one block to the input terminal of another block. Example 1 In this example we will demonstrate what Simulink is capable of by simulating the motion of a car. The forces acting on a car are illustrated below: bv (friction) f (force) m (mas v (velocity) In this example we are interested in analysing the relationship between the force applied to the car, f, and the resultant velocity, v, of the car. The relationship between force and velocity is given below: dv m = f bv (1) dt where m = 1000 kg and b = 50 Ns/m Although it is possible to model the above system in Simulink directly, it is simpler if we convert the system into the Laplace domain. Transforming equation (1) gives the following: dv m + bv = f dt msv ( + bv ( = F( 1000sV ( + 50V ( = F( V ( 1 = F( 1000s + 50 To provide a simpler analysis we tend to write 1 st order dynamic equations in the general form of: OUTPUT INPUT Therefore: K = Ts +1

V ( F( = 1 50 20s + 1 We will now find out what happens when we increase the force applied to the car from 0 N to 500 N. To do this we will simulate the system in Simulink. To do this follow these steps: 1. From the SIMULINK window, click on the Sources folder and use the mouse to drag the Step block to the new workspace window. The step will represent the force that is applied to the car. Double clicking on the Step block in the new workspace allows the initial and final values of the step change and the time of the step change to be specified. Select a Select a step time of 10, an initial value of 0 and a final value of 500. Ignore the sample time. This will introduce a step change in the force at a time of 10 seconds. 2. Click on the Linear folder, in the SIMULINK window, and use the mouse to drag the Transfer Fcn block to the workspace window. Double click on this block and enter the numerator and denominator coefficients which represent the system defined above, i.e. the numerator should be equal to [1/50] and the denominator should be [20 1]. The coefficients are entered in descending powers of s (make sure that you leave in the square bracket. Click on OK when the coefficients have been entered. 3. Click on the Sinks folder and drag a scope into the workspace. Your workspace should now look like this: 4. To represent the signal flow, the mouse is used to draw a line from the output of any block to the input of any other block. Simply click the left mouse button on the output of any block (i.e. the > sign on the right-hand side of the block), keep the mouse button pressed and move the cursor to the input of the required block (i.e. the > sign on the left-hand side of the block). An arrow will appear to show the direction of the signal flow. Position the blocks in the workspace and connect up the required blocks so that the following system is formed: Note that if your arrows do not appear with the pointy end in bold, i.e. you get a, rather than a then they have not connected to the block correctly. Click on the line to select it again and then press the delete key on the keyboard and try again. 5. Select Simulation-Simulation Parameters in the workspace menu bar. A new window should now appear. This window allows you to change some of the mathematical options within Simulink (its best to ignore most of it). In the stop time, enter a value of 100 and then click on OK. 6. In the workspace window double click on the scope block (a new graph window, the scope window, should appear). Now click on the play button ( ) in the workspace window. You will notice that a line has been plotted on the scope window. Go to this window and click on the binocular icon. This graph shows how the velocity of the car will change with time as the force is applied and should be the same as the graph below. Does it look reasonable, i.e. does the velocity change as you would expect?

7. The simulink model can be saved by selecting file-save as from the workspace menu bar. Optional Section It was stated earlier that the simulink model could have been developed directly from the differential equation in the time domain. The figure below illustrates the simulink model for such a system. In this diagram, the inertia and damping are gain blocks (located in the math folder). The damping block has been flipped around. To flip a block, right click on it and then select format-flip block from the pull down menu. The text for each of the blocks can be edited by simply clicking on the text and entering whatever you like. Exercise 1 In this exercise we will develop a simple control system that will regulate the velocity of the car. To do this construct the following system: This time labels have been placed on the worksheet you do not need to put these on yourself. The set-point is a step block which represents the required velocity of the car. In this example the step block should be configured as follows: Step Time: 10, Initial Value: 0, Final Value: 10. This implies that between time 0 and 10 seconds, we want the velocity of the car to be 0 m/s. After 10 seconds we want the velocity of the car to be 10 m/s. The summation block can be found in the math folder. This block should be configured so that the list of signs is +-. The controller is simply a gain block this means that its output is equal to the input multiplied by the value of the gain. The gain block is also available in the math folder. For this block, set the gain to be equal to 1. To draw the feedback loop, right click the line that links the Dynamics of the car block to the velocity block and drag the mouse to link with the input to the summation block. Double click the velocity block and start the simulation (click the play button). You should get the following graph:

The controller in this example is what is known as a proportional controller. This is because the output of the controller is proportional to its input, i.e. output = K *input, where K is the gain of the controller. The controller clearly isn t very good since we want the velocity to increase to 10m/s and the controller has caused the velocity to increase, but only to 0.2 m/s. Problem 1 Increase the value of the gain and analyse the response of the system. What observations can you make?