Simulink SubSystems and Masking April 22, 2008 Copyright 2005-8, Andy Packard. This work is licensed under the.

Slides:



Advertisements
Similar presentations
1 Application Software Course Simulink By: Mahdi Akbari 2010.
Advertisements

1 1 Mechanical Design and Production Dept, Faculty of Engineering, Zagazig University, Egypt. Mechanical Design and Production Dept, Faculty of Engineering,
JustinMind: Dynamic Panels
Using Macros and Visual Basic for Applications (VBA) with Excel
Getting started with Simulink An introductory tutorial ES205 Analysis and Design of Engineering Systems Rose-Hulman Institute of Technology © R. Layton.
Annotation & Nomenclature By Corey Fortezzo for PG&G GIS Workshop, 2010.
CS320n –Visual Programming LabVIEW Foundations. Visual ProgrammingLabVIEW Foundations2 What We Will Do Today Hand back and review the midterm Look at.
HossamTalaat - MATLAB Course - KSU - 21/1/24 1 IEEE Student Branch - College of Engineering - KSU Getting started with Simulink By Prof. Hossam Talaat.
Using Microsoft Outlook: Basics. Objectives Guided Tour of Outlook –Identification –Views Basics –Contacts –Folders –Web Access Q&A.
Creating a Console Application with Visual Studio
Using Simscape™ for Modeling Vibration Problems:
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Lesson 8 Creating Forms with JavaScript
EPSII 59:006 Spring Topics Using TextPad If Statements Relational Operators Nested If Statements Else and Elseif Clauses Logical Functions For Loops.
From BlueJ to NetBeans SWC 2.semester.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
1 Pertemuan 03 Using Layers and Symbols Matakuliah: U0344 / DESKTOP 1 Tahun: 2006.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Chapter 17. Copyright 2003, Paradigm Publishing Inc. CHAPTER 17 BACKNEXTEND 17-2 LINKS TO OBJECTIVES Mail Merge Wizard Letters Envelopes Labels Directory.
Prepared by: Sanaz Helmi Hoda Akbari Zahra Ahmadi Sharif University of Tech. Summer 2006 An Introduction to.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Simulink ® Interface Course 13 Active-HDL Interfaces.
XP New Perspectives on Integrating Microsoft Office XP Tutorial 2 1 Integrating Microsoft Office XP Tutorial 2 – Integrating Word, Excel, and Access.
Chapter 10 Fireworks: Part II The Web Warrior Guide to Web Design Technologies.
Interaction Design Interaction Design - Joan Cahill - Visio Interaction Design: Visio.
Active-HDL Interfaces Debugging C Code Course 10.
1 Extend is a simulation tool to create models quickly, with all the blocks you need and without even having to type an equation. You can use a series.
ECEN/MAE 3723 – Systems I MATLAB Lecture 2. Lecture Overview What is Simulink? How to use Simulink  Getting Start with Simulink  Building a model Example.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
Click your mouse to continue. Creating a New Mail Merge Document When you need to create a form letter but do not have an existing main document, you can.
Using COMET with Visio Visio UML Modeling. Creating a Drawing After opening Visio, you will see a list of templates available.
Chapter 11: Block References and Attributes. After completing this Chapter, you will be able to use the following features: Create and insert block references.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Introduction to Matlab Module #9 Page 1 Introduction to Matlab Module #9 – Simulink Topics 1.Simulink Textbook Reading Assignments Practice Problems.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
SIMULINK-Tutorial 1 Class ECES-304 Presented by : Shubham Bhat.
DC Motor Speed Modeling in Simulink
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Slide 1 Using Menu Bar & Common Dialog Boxes. Slide 2 Setting Up the Main Items v First open the form on which you want the menu located v Then start.
EE3417 – Introduction to Simulink
Modeling of Power Converters using Matlab and Simulink
Intro to Simulink April 15, Copyright , Andy Packard. This work is licensed under the Creative Commons.
Simulink Simulink is a graphical extension to MATLAB for modeling and simulation of systems. In Simulink, systems are drawn on screen as block diagrams.
INTRODUCTION TO SIMULINK by Yasmin Hanum Md Thayoob & Aidil Azwin Zainul Abidin.
Unit 3: Text, Fields & Tables DT2510: Advanced CAD Methods.
Simulink  ? 1 Simulink  ( Simu lation and Link ) is an extension of Matlab Offers modeling, simulation, and analysis of dynamical systems; i.e., a system.
Get/Set Methods UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Intro to Simulink Modified by Gary Balas 20 Feb 2011 Copyright , Andy Packard. This work is licensed under.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
Integrating Components and Dynamic Text Boxes with the Animated Map– Lesson 101 Integrating Components and Dynamic Text Boxes with the Animated Map Lesson.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
Modeling First Order Systems in Simulink And Analyzing Step, Pulse and Ramp Responses SOEN385 Control Systems and Applications.
Getting started with Simulink
Simulink Modelling Tutorial In Simulink, it is very straightforward to represent a physical system or a model. In general, a dynamic system can be constructed.
Getting started with Simulink An introductory tutorial.
IBM Rational Rhapsody Advanced Systems Training v7.5
Weebly Elements, Continued
3.01 Apply Controls Associated With Visual Studio Form
ECEN/MAE 3723 – Systems I MATLAB Lecture 2.
For/Switch/While/Try UC Berkeley Fall 2004, E77 me
3.01 Apply Controls Associated With Visual Studio Form
WORKSHOP 3 GSE IMPORT.
Reusable Graphics Objects UC Berkeley Fall 2004, E77 me
Getting Started With Simulink
Using Templates and Library Items
Function Handles UC Berkeley Fall 2004, E Copyright 2005, Andy Packard
Planning a Group Policy Management and Implementation Strategy
CS334: Logisim program lab6
Presentation transcript:

Simulink SubSystems and Masking April 22, Copyright , Andy Packard. This work is licensed under the Creative Commons Attribution- ShareAlike License. To view a copy of this license, visit sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. sa/2.0/

A (very simplified) car model Consider a very simplified car model, modeling 1-dimensional motion on a straight (but perhaps hilly) road. Writing down Newton’s law, assuming a simple proportionality model for Engine force (from throttle angle) and resistance (from speed) would give the differential equation model as Throttle angle u Disturbance force d Simple model of car’s behavior Speed v Engine effectiveness Car mass Resistance factor acceleration throttle angle speed Disturbance force

Simple car model in Simulink For Simulink, we rewrite the original equation as and draw it using –Summing junctions –Gains –Integrator –InPorts, OutPorts

Simple car model in Simulink Goal: Treat this as one entity, a “car”, with 4 parameters –Initial speed (v(0)) –Engine Effectiveness (E) –Drag Coefficient (α) –Mass (m) but, as shown, it is really many blocks. And, the parameters are all in different blocks. Two features to alleviate this: –Subsystems Group blocks (the constituent elements) into a single block (the subsystem) –Masks Create a new dialog box (the Mask Dialog) for a subsystem Actual dialog entries of constituent elements are dependent on the dialog entries of the new dialog

Creating a subsystem Within a model… Click and drag to select the blocks that will constitute the subsystem… They become selected… Choose “Create Subsystem” from “Edit” menu… Mission Accomplished

Opening a subsystem You can drill back down into a subsystem by double-clicking… But, to enter any values (mass, drag, engine effectiveness, etc), you have to open each block, and individually enter. For example, double-click on the 1/Mass gain block… Another window opens, with all the details as before (now there are input and output ports too)… So, to the user, although the subsystem groups the blocks together, the 4 “properties” are still in separate places. Still need something else. Masks.

Component parameters from Mask Variables Open each block, and enter a descriptive variable name in the appropriate parameter dialog box

Creating and Editing the Mask Select the Subsystem (single click) Choose “Mask Subsystem” from “Edit” The Mask Editor opens. This pane is for customizing the appearance of the block’s icon. We will not cover this here. Click on the Parameters pane selector. That will be used to create the Dialog Box for the subsystem.

Mask Parameters This pane defines the dialog box that user’s will interact with after double-clicking the block. We need to create 4 parameters. We will use editable text (as opposed to popups, etc) Click Add button Enter a Prompt, and a Variable Name. The expression that the user types in the dialog box will be evaluated, and a variable (of the defined name) will be created with that value Add as many as you need Rearrange/Remove with tools

Mask Initialization Enter code that must be run to convert the Mask Dialog Variables into the variable names that are entered in the dialog boxes of the blocks that make up the subsystem (the gain blocks, and the integrator). Could also do a lot of error checking…

What happens during Mask Initialization When you start a simulation, initialization processes are carried out. For a Mask, this entails: –Evaluate expressions in the MaskDialog box expressions in Dialog Boxes are evaluated in Base Workspace, unless otherwise specified by SrcWorkspace option in simset –Assign the resulting values to the Mask Dialog Variables (which “live” in the Mask Workspace of the block) –Execute the Mask Initialization Code in the Mask Workspace, creating more variables in Mask Workspace. At this point, the Mask Workspace consists of –the Mask Dialog Variables, and –any variables defined by the Mask Initialization Code. Then, the dialog boxes of the underlying blocks in the masked subsystem are evaluated. These are evaluated in the Mask Workspace, so that all Mask Variables are visible.

Mask Documentation The Documentation pane is where descriptive narrative is entered, as well as HTML code for the block “help”. Let’s just enter some text, and see what effect it has…

Masked subsystem’s behavior After masking, it simply opens the Mask Dialog box, as we have designed it Before masking the subsystem, double- clicking on the subsubsystem revealed the internal structure of the subsystem.

Clean things up… Now close that, and things are starting to look pretty professional. Select the subsystem, and choose “Look Under Mask” from “edit” to get back to the actual underlying structure. Edit the names of the input and output ports.

Make a Library Choose “File->New->Library” from any Simulink window. Repeat. Add more blocks to Library.