WORKSHOP 1 CO-SIMULATION.

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,
Getting started with Simulink An introductory tutorial ES205 Analysis and Design of Engineering Systems Rose-Hulman Institute of Technology © R. Layton.
System Dynamics, Third Edition
1 A Tool for System Simulation: SIMULINK Can be used for simulation of various systems: – Linear, nonlinear; Input signals can be arbitrarily generated:
SIMULINK Dr. Samir Al-Amer. SIMULINK SIMULINK is a power simulation program that comes with MATLAB Used to simulate wide range of dynamical systems To.
Simulink ® From Simulink® 7 Getting Started Guide.
Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions.
EPSII 59:006 Spring Topics Using TextPad If Statements Relational Operators Nested If Statements Else and Elseif Clauses Logical Functions For Loops.
LAB 1 MATLAB, dSPACE and Simulink
Simulink ® Interface Course 13 Active-HDL Interfaces.
Simulink SubSystems and Masking April 22, Copyright , Andy Packard. This work is licensed under the.
ADAMS Assignment 5 ME451:Kinematics and Dynamics of Machine Systems.
Active-HDL Interfaces Debugging C Code Course 10.
WS6-1 ADM703, Workshop 6, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 6 OVER-RUNNING PULLEY.
ME451:Kinematics and Dynamics of Machine Systems (Spring 09)
ADAMS Assignment 1 ME451:Kinematics and Dynamics of Machine Systems (Fall 2013) Assigned: September 18, 2013 Due: September 25, 2013.
Infinity-project.org The Institute for Engineering Education Engineering Education for today’s classroom. 1 The Infinity VAB TM for INFINITY Tutorial Introduction.
WS8-1 ADM740, Workshop 8, June 2007 Copyright  2007 MSC.Software Corporation WORKSHOP 8 Creating Event Files.
Introduction to Matlab Module #9 Page 1 Introduction to Matlab Module #9 – Simulink Topics 1.Simulink Textbook Reading Assignments Practice Problems.
Introduction to MATLAB for Engineers Third Edition William J. Palm III Chapter 10 Simulink PowerPoint to accompany Copyright © The McGraw-Hill Companies,
DC Motor Speed Modeling in Simulink
EE3417 – Introduction to Simulink
Modeling of Power Converters using Matlab and Simulink
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.
ADAMS Assignment 6 ME451:Kinematics and Dynamics of Machine Systems (Fall 2013) Assigned: November 13, 2013 Due: November 20, 2013.
Simulink  ? 1 Simulink  ( Simu lation and Link ) is an extension of Matlab Offers modeling, simulation, and analysis of dynamical systems; i.e., a system.
WS1-1 ADM730, Workshop 1, September 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 1 INTRODUCTION Open Retracted - Bad Retracted - Good.
WS8-1 ADM730, Workshop 8, September 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 8 MSC.EASY5 & ADAMS/Insight.
ADAMS Assignment 1 ME451:Kinematics and Dynamics of Machine Systems (Spring 09)
WS 9-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. February 27, 2009 Inventory # Workshop 9 Taylor Impact Test – “What if” Study.
WS2-1 ADM703, Workshop 2, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 2 SPRING-DAMPER SYSTEM.
WS7-1 ADM , Workshop 7, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 7 DESIGN OF EXPERIMENTS.
Editing and Debugging Mumps with VistA and the Eclipse IDE Joel L. Ivey, Ph.D. Dept. of Veteran Affairs OI&T, Veterans Health IT Infrastructure & Security.
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.
SECTION 3 FUNCTION EVALUATION, CO-SIMULATION PERFORMANCE.
ADM711, Workshop 5, January 2013 Copyright  2013 MSC.Software Corporation WORKSHOP 5 CO-SIMULATION MODIFIERS FOR EASY 5.
WORKSHOP 3 Belt Modeling – Lawn Mower
Workshop 12 atv – lower control arm
WORKSHOP 18 HATCHBACK II.
WORKSHOP 1 introduction
WORKSHOP 12 SUSPENSION SYSTEM II
VAB™ for INFINITY Tutorial
WORKSHOP 21 CAM-ROCKER-VALVE
Single Tank System FV Desired liquid level: 5 cm (0.05 m)
SECTION 4 GSE IMPORT METHOD.
SECTION 4 WASHING MACHINE.
SECTION 1 ADAMS/Solver subroutines overview
WORKSHOP 1 CUSTOM TIRE SUBROUTINE
WORKSHOP 19 HATCHBACK III
WORKSHOP 2 VALVETRAIN MECHANISM
WORKSHOP 2 VALVETRAIN MECHANISM
WORKSHOP 7 PID TUNING.
WORKSHOP 6 USING THE ASCII CONDUIT
WORKSHOP 9 BRAKE SYSTEM II
Uploading Files to the Remote Server Using Win_SCP Portable
Damped Forced Vibrations Analysis Using CAMP-G® and Simulink® Modeled Solutions to Problem (
WORKSHOP 1 STAMPING MECHANISM
ECEN/MAE 3723 – Systems I MATLAB Lecture 2.
WORKSHOP 7 OVER-RUNNING PULLEY.
WORKSHOP 3 GSE IMPORT.
Simulink Basics Reijo Vuohelainen
OptiSystem-MATLAB data interchange model and features
Getting Started With Simulink
Matlab.
Control Systems Prof Swanson MECH 3550.
Presentation transcript:

WORKSHOP 1 CO-SIMULATION

Getting started a c d e b f Start Adams/View: Click on Existing model Click on browser for specifying working directory . Select folder containing mod1_cosim relative to Adams/Controls training files on your computer. Click OK. Click on the browser for specifying the file name. In file name select spring_damper.cmd and Click OK. b e f

Investigate the Model a c b e d f Investigate the current model by simulating for a short time: Run a dynamic simulation for 2 seconds, 100 steps. Note that the Adams-only spring-damper system oscillates. The other spring damper system in the model simply falls down. Right-click on the spring-damper element named ‘adams_spring_force’ and note the K and C values for the spring element in Adams: K = _________ C = _________ d e f

Create State VARIABLE, Integrate with Model To build a State Variable to be passed in from MATLAB: Create a new Variable using the menu picks: Click on Elements. Create State Variable defined by algebraic equation. Enter force_matlab for the Name. Specify 0.0 as the function value (this will be over-written during co-simulation). Click OK. Modify the model so that the Variable is used by the SFORCE element: Modify the SFORCE named ‘SFORCE_1’. Use the VARVAL() function to reference the new state VARIABLE, for example: VARVAL(force_matlab) Adams/Controls requires State Variables for communication with MATLAB or EASY5. The model currently lacks a State Variable representing the spring force that is to be calculated by MATLAB. a d c b e f g

Export the Plant a b c d e f Simulate the model again, verify that the ball simply drops since the Variable (and hence the SFORCE) has a zero-value. During co-simulation, the Variable (and hence the SFORCE) will be constantly updated, so the behavior will be different. Create files required by MATLAB for co-simulation by selecting the menu picks: Controls: Plant Export In the resulting dialog box, specify the following: File Prefix: cosim Input Signal(s): force_matlab Output Signal(s): (use Browse and select in the exact order as shown): displ_part_2 displ_part_3 vel_part_2 vel_part_3 Target Software: MATLAB Leave all other settings as default Click OK. a b c d f e Verify that files named: -cosim.m -cosim.adm -cosim.cmd have been created in the working directory of Adams/View.

Setup in MATLAB Start MATLAB and: Change the working directory of MATLAB to be where your cosim.m file exists. Enter cosim in the MATLAB shell to execute the cosim.m file. Create a Simulink block that represents the Adams component by : Enter the command, adams_sys into the MATLAB shell. The steps above create a blank ‘adams_sub’ Simulink block which represents your Adams model. At this point, a Simulink model can be built around the adams_sub block using the inputs and outputs that have been defined for the adams_sub block. Note that the inputs and outputs correspond to what was specified during the plant export process in Adams.

Load an Existing Simulink Model Rather than create a new Simulink model to interact with the Adams block, an existing model can be loaded that will make use of the adams_sub block created earlier. Load an existing Simulink model containing the spring-damper modeled in MATLAB: Enter the following command in the MATLAB command line: matlab_spring_start This command will open the file ‘matlab_spring_start.mdl’ from the working directory. The adams_sub block can now be dragged from the initial Simulink model into the model above.

Setup and Co-simulation Before simulation, ensure that the adams_sub block has the appropriate parameters. Double-click the adams_sub block, then the Adams plant block to view the block parameters. In the Adams plant mask settings, modify the following parameters: Communication Interval = 0.005 (default) Output files prefix = ‘cosim_005’ (include single-quotation marks) Leave all other settings as default, then save the Simulink model. Specify an end-time of 2 seconds for the simulation by using the menu picks: Simulation: Configuration Parameters Click the ‘play’ button in the MATLAB to simulate the Simulink Model.

Inspect Simulation Results Inspect the results: Double-click the scope blocks in MATLAB and inspect the displacement and velocity values. The displacement scope will plot the position of the ball for the Adams-calculated force in the model (the upper trace) and the MATLAB-calculated force in the model (the lower trace). Note how the MATLAB-calculated force does not have the same damping behavior as the Adams-calculated force.

Repeat Simulation Repeat the co-simulation with a finer sampling interval: Communication Interval = 0.001 Output files prefix = ‘cosim_001’ Inspect the displacement and velocity plots. Repeat with smaller sampling rates and investigate the effect on displacement and velocity. The effect of sampling rate is shown for two co-simulations with rates of 0.001 and 0.0001 seconds. These plots use the scope value ‘Displacement Difference’ found in the model.

Algebraic Loops, Artificial Dynamics The current model contains an ‘Artificial Lag’ block (a Transfer Function that acts as a filter) in order to break any algebraic loops in MATLAB. MATLAB attempts to resolve algebraic loops through an iterative process; this can be seen when the inputs to Adams, as shown in the .msg file, are repeated several times. Algebraic loops in the MATLAB model will slow simulations down and possibly cause wrong answers. Inserting a simple dynamic element (such as a filter block) into the loop will resolve the problem. Note that very few dynamic systems can be modeled as not having dynamics such as lag, so this is likely a realistic feature to build into a model.