comm 1 nataliya mulyar laci posta coupling of multidisciplinary models

40
1 COMM Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

Post on 19-Dec-2015

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

1

COMM

Nataliya Mulyar

Laci Posta

Coupling Of Multidisciplinary Models

Page 2: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

2 2

COMM

Outline

• Introduction: COMM within Bode-RC• Rose-RT• Simulink• Rose-RT and Matlab/Simulink: how to

couple?• State-of-affairs in COMM

Page 3: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

3 3

COMM

Boderc Project

• Consequences of design decisions can be predicted as early as possible

• System-level decisions can be analyzed

• Trade-offs can be made between functions, price, performance, etc.

Universiteit Twente

Goal: improve multi-disciplinary system design, i.e. combining mechanics, electronics and informatics, such that

Page 4: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

4 4

COMM

The COMM project

• COMM = Coupling of Multidisciplinary Models• 9- month duo OOTI final project• Started on 1st of December 2003

Page 5: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

5 5

COMM

Problem Description

Sequential development long development cycle

Parallel development lack of communication btw.disciplines

incorrect assumptions problems during

integration late time-to-market

Possible solution: simulate an embedded system in its intended environment

Page 6: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

6 6

COMM

COMM Project

The problem of

Coupling of models from different disciplines (M, E, I)

Affects The development of real-time embedded systems

The MCT Is a tool that couples two tools widely used for modeling of software and physical components respectively

That • Helps to detect potential problems earlier• Shortens development time (if used properly)• Provides communication means between multiple disciplines

Focuses on design of Multidisciplinary Coupling Tool (MCT)

Business Case

Page 7: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

7 7

COMM

Concrete Goals

• Explore possibilities of coupling of tools used in MD modeling – Use Rose-RT and Matlab/Simulink as a concrete case

for coupling

• Get better understanding of coupling: – relation simulation-reality– the notion of time in multidisciplinary modeling

Page 8: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

8 8

COMM

Simulation

Simulation contains a set of models of one or more dynamical systems and the interaction between those systems and their environment (Jim Ledin).

Simulation advances through time and solves the equations for all models at each point in time.

Model is a physical, mathematical, or other logical

representation of a system/process.

Page 9: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

9 9

COMM

Simulation

Two basic representation methods of simulation models: The discrete event simulation, where time

is moving forward from one change of state to the next

The time step simulation, where time is divided into intervals

Time step

t1 t2 t3 t4 …

event 3event 2event 1

t1 t2 t3

Page 10: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

10 10

COMM

Real vs. Simulated

Target system

Simulated system environment

HW

Rose-RT SW

model

Matlab/Simulink physical model

MCT

SW

Discrete Discrete and/or

continuous

Hybrid

Simulate the real-time behavior of the embedded system

Page 11: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

11 11

COMM

Case Study

Motor Control Loop Model

Set-point generator

Controller Motor Encoder

+

Criteria for case-study selection:

1) Low level of model complexity

2) Multidisciplinary aspect: SW + HW components

3) Interaction btw. SW and HW components

Page 12: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

12 12

COMM

Mapping on Tools

Motor Control Loop Model

Matlab/ Simulink

Set-point generator

Controller Motor Encoder

+

Rose-RT

Centralized Software Control

Page 13: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

13 13

COMM

Mapping on Tools

Motor Control Loop Model

Matlab/ Simulink

Set-point generator

Controller Motor Encoder+

Rose-RT

Distributed Software Control

Decision 1: select Distributed Software Control

Page 14: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

14 14

COMM

Computing resources

1 PC or 2 PC’s?

Rose-RT and Matlab/Simulink

Rose-RT Matlab/Simulink

Decision 2: use a single PC for simulation

Page 15: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

15 15

COMM

Outline

• Introduction: COMM within Bode-RC• Rose-RT• Simulink• Rose-RT and Matlab/Simulink: how to

couple?• State-of-affairs in COMM

Page 16: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

16 16

COMM

What is Rose-RT?

Software development environment for: • Creating UML models using the elements and diagrams

defined in the UML • Generating complete code implementations for those models • Executing, testing and debugging models

Uses the extensibility features of the UML for real-time

reactive system development

Page 17: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

17 17

COMM

Rose-RT from inside

• Stereotypes (special form) of class – Capsules • Template of active objects – Protocols • Template of ports

Environment

Capsule

portS1

S2

Ports: created and destroyed along with their capsule

Page 18: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

18 18

COMM

Active objects

Encapsulationshell

Ports

Page 19: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

19 19

COMM

Capsule: Behavior• Optional hierarchical state machine (signal handler with

run-to-completion semantics)

S1

S2 S3

S1

S2

S1

transitionS1toS2: {int x; x = 0; p2.send(s1); p3.send(s2); … };

Page 20: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

20 20

COMM

Traffic Lights example

Page 21: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

21 21

COMM

Timing in Rose-RTGoal: Understand the notion of time in multidisciplinary modeling

initialize

InitialInitial

worktimeouttimeout timeout2timeout2

Page 22: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

22 22

COMM

Timing in Rose-RT

• Time in Rose-RT is strongly connected with the system clock

• Precision is dependent on the granularity of the OS

• Accuracy is not guaranteed

• Timing in Rose-RT is unpredictable

• Simulation in Rose-RT can be achieved only by step-by-step execution

Goal: Understand the notion of time in multidisciplinary modeling

Page 23: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

23 23

COMM

Outline

• Introduction: COMM within Bode-RC• Rose-RT• Simulink• Rose-RT and Matlab/Simulink: how to

couple?• State-of-affairs in COMM

Page 24: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

24 24

COMM

What is Simulink?

Simulink is a software package for modeling and simulating dynamic systems

process of computing a system’s states and outputs over a span of time, using

information provided by the system’s model

x(states)

u (input)

y (output)

Page 25: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

25 25

COMM

Components of a Simulink model

Continuous blocks respond continuously to changing input. Discrete blocks respond to changes in input only at

integer multiples of a fixed interval called the block’s

sample time.

y2 (output)x1

(states)u1 (input)

y1 (output) x2

(states)u2 (input)

Page 26: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

26 26

COMM

Structure of a Simulink model

• A typical Simulink model includes sources, systems and sinks.

Simulink provides:•graphical block diagram capability•drag-and-drop blocks facility

Page 27: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

27 27

COMM

Simulink Environment

The Library Browser displays a tree-structured view of the Simulink block libraries installed on your system.

Page 28: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

28 28

COMM

Motor model

Page 29: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

29 29

COMM

Components of a Simulink model

• Solvers

You can specify the solver to use in the model or when running a simulation.

A program, called ordinary differential equation (ODE) solver, updates block inputs and computes block outputs and states at intervals from the simulation start time to the simulation end time.

Page 30: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

30 30

COMM

Timing in Matlab/Simulink• The simulation time in Matlab/Simulink and real clock are not

the same

The amount of time it takes to run a simulation depends on

- model complexity, computer’s speed, solver’s type, etc.

• Simulation time and real time are not proportional

Simulation time can run faster time acceleration

slower time stretching

• Facilities for scheduling and dealing with concurrency are not offered

is not suitable for simulation of SW

Goal: Understand the notion of time in multidisciplinary modeling

Page 31: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

31 31

COMM

TrueTimeReal-time kernels and network transmissions can be

simulated• Different processing times, priorities, and arbitrary scheduling

policies in the computer nodes can be specified• Various network protocols may be evaluated• By introducing disturbing traffic on the network, the effects of

unpredictability in the network communication can be studied

Limitations• Code generated by other applications cannot be directly used in TrueTime framework

Goal: Understand the notion of time in multidisciplinary modeling

Page 32: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

32 32

COMM

Outline

• Introduction: COMM within Bode-RC• Rose-RT• Simulink• Rose-RT and Matlab/Simulink: how to

couple?• State-of-affairs in COMM

Page 33: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

33 33

COMM

Rose-RT and Matlab/Simulink: How to couple?

Goal: Explore ways of coupling of tools used in MD modeling

Approach 1 Approach 2

MCT

MATLAB/SIMULINK

ROSE-RTMATLAB/SIMULINK

ROSE-RT

Decision 3: select loosely-coupled architecture

Page 34: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

34 34

COMM

Rose-RT and Matlab/Simulink:Where to place timing?

Goal: Explore ways of coupling of tools used in MD modeling

• Not feasible due to the timing service of Rose-RT

Provide timing

MATLAB/SIMULINK

Timing request

Provide timing

Timing request

Data Data

ROSE-RT

MCT

Page 35: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

35 35

COMM

Rose-RT and Matlab/Simulink: Where to place timing?

Goal: Explore ways of coupling of tools used in MD modeling

Provide timing

MATLAB/SIMULINK

Timing request

ROSE-RT

Provide timing

Timing request

Data DataMCT

• Timing is enforced to both modeling toolsets• No advantage of Matlab/Simulink timing is taken

Page 36: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

36 36

COMM

Rose-RT and Matlab/Simulink: Where to place timing?

Goal: Explore ways of coupling of tools used in MD modeling

• Rose-RT timing is not used

• Matlab/Simulink provides a well-defined notion of simulation time

MCT

Provide timing

MATLAB/SIMULINK

Timing request

ROSE-RT

Provide timing

Timing request

Data Data

Decision 4: use Matlab/Simulink as a timing provider

Page 37: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

37 37

COMM

Outline

• Introduction: COMM within Bode-RC• Rose-RT• Simulink• Rose-RT and Matlab/Simulink: how to

couple?• State-of-affairs in COMM

Page 38: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

38 38

COMM MCT Design

Page 39: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

39 39

COMM

ToDo• Rose-RT automated step-by-step execution

changes in RTController needed (complex!)

• Rose-RT timing compatibility with Simulink replacement of Windows NT Timing Services

• Simulation in intended target environment

durations of execution of Rose-RT functions on a target OS should be available

State1 State2

InitialInitial

operation_durationoperation_duration

Page 40: COMM 1 Nataliya Mulyar Laci Posta Coupling Of Multidisciplinary Models

40 40

COMM

Questions