integrating a simulink system target file with mosaic for

17
March 28 th , 2017 SESP 2017 Conference ESTEC, The Netherlands Integrating a Simulink System Target File with MOSAIC for Efficient Model Transfer to SMP and EuroSim Contributors: Quirien Wijnands (ESTEC) Jeroen Moelands (NLR) Presenters: Wim Lammen (NLR), David Jaffry (MathWorks)

Upload: others

Post on 05-Nov-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Integrating a Simulink System Target File with MOSAIC for

March 28th, 2017SESP 2017 Conference

ESTEC, The Netherlands

Integrating a Simulink System Target File with MOSAIC for Efficient Model Transfer to SMP and EuroSim

Contributors: • Quirien Wijnands (ESTEC)• Jeroen Moelands (NLR)

Presenters: • Wim Lammen (NLR),• David Jaffry (MathWorks)

Page 2: Integrating a Simulink System Target File with MOSAIC for

Overview

• Automatic model transfer: Introduction / Context

• Simulink System Target File (STF)

• Integration of STF with MOSAIC

• Status / Follow-on steps

• Concluding remarks

2SESP 2017, 28/03/17

Page 3: Integrating a Simulink System Target File with MOSAIC for

3

Introduction: Automatic model transfer

• Purpose− Re-use of models during a complete project life-cycle to reduce cost,

time, effort

• Approach− Automate model transfer between COTS tools and model standards

• Product− MOSAIC

Modelling tools:•Simulink•EcosimPro•20-sim•Modelica•..

Model-Oriented Software Automatic Interface Converter

SESP 2017, 28/03/17

Page 4: Integrating a Simulink System Target File with MOSAIC for

MOSAIC Usage• Usage principles

– Model adaptation in originating environment

– MOSAIC treats model as black box– Analyses the model code / API and

adds interfacing code to it– End-to-end support

• Free-of-charge license in ESA member states

• Used in European space industry– For more than 15 years– In a large number of projects

• Latest external version: MOSAIC 10

4SESP 2017, 28/03/17

Page 5: Integrating a Simulink System Target File with MOSAIC for

Simulink

5

Alternative method: Simulink integration with MOSAIC

• Direct export of SMP compliant code from Simulink• Simulink System Target File (STF)• Analysed during MOSAIC 10 activity

SESP 2017, 28/03/17

Page 6: Integrating a Simulink System Target File with MOSAIC for

6

Embedded CoderGenerate custom C/C++ code with TLC

SESP 2017, 28/03/17

Simulinkmodel.slx

SimulinkCoder Build

Target Language Compiler

Make

model.exe

TLC program:• System target file• Block target files• Inlined S-function

target files• Target Language

Compiler function library

Run-time interface support files

Simulink/Embedded Coder

model.c

model.mk

SMP.TLC

Intermediate Representation

SMP Compliant model- C/C++- XML artefacts - MOSAIC compliant

MOSAIC 10

Page 7: Integrating a Simulink System Target File with MOSAIC for

7

From a Simulink User perspective

1. User selects the correct System Target File: “smp.tlc”

2. Next, the user selects the correct Target environment

3. Finally, user generates SMP filesSESP 2017, 28/03/17

Page 8: Integrating a Simulink System Target File with MOSAIC for

8

Benefits of the STF

+ User-friendly: Stronger link between Simulink and SMP2.

+ Efficiency: the meta-information of a Simulink model is accessed directly, rather than by parsing the exported C code.

+ Maintainability: Minimal development effort is expected during updates of STF to new MATLAB releases.

∆ Duplication/Reusability: In MOSAIC 10, the STF was in charge of custom SMP files generation as MOSAIC already does. To be merged in follow-on versions.

SESP 2017, 28/03/17

Page 9: Integrating a Simulink System Target File with MOSAIC for

SESP 2017, 28/03/17 9

Integration of the two methods

• One integrated tool• Take ‘best of both’• Avoid duplication of functionality• Ensure efficient maintainability

SMP.TLC

Approach• Move all Simulink specific functionality to STF• Use existing MOSAIC capability for

– Support of input formats (e.g. EcosimPro and 20-sim) – Support of specific features of target simulation platforms – Optimisation of specific SMP related issues - such as UUID - on a

generic level

STF

Page 10: Integrating a Simulink System Target File with MOSAIC for

SESP 2017, 28/03/17 10

Integrated transfer tool (1)

Porting scheme (same transfer cases as MOSAIC 10):

MOSAIC shared functionality

MOSAIC Generated Source Code & Specific Files

EcosimPro

Native EuroSim

MOSAIC API

SMP (Basiles, EuroSim, SimVis/SIMSAT)

Simulink

STF

20-sim

Generated Source Code

MOSAIC

Tool / GUI

SMP (Basiles, EuroSim, SimVis/SIMSAT)

MOSAIC Generated Source Code & Specific Files

MOSAIC integrated in STF as a dynamic library

Page 11: Integrating a Simulink System Target File with MOSAIC for

SESP 2017, 28/03/17 11

Integrated transfer tool (2)

• Architectural layers (‘side view’)• Right stack already covered by MOSAIC 10

Page 12: Integrating a Simulink System Target File with MOSAIC for

SESP 2017, 28/03/17 12

Integrated transfer tool (3)

One step execution from Simulink User Interface

Underlying workflow

Page 13: Integrating a Simulink System Target File with MOSAIC for

SESP 2017, 28/03/17 13

Current status

MOSAIC 11 :• First integrated version of STF and MOSAIC• Runs with Embedded Coder• Experimental version, not released externally

• Still with limitations (with respect to the Simulink use case), e.g: – Atomic model transfer only (treating one whole model as a black box)– Only transfer to SMP (no native-EuroSim yet)

• Base created for development of an external release : MOSAIC 12

MOSAIC 11

Page 14: Integrating a Simulink System Target File with MOSAIC for

SESP 2017, 28/03/17 14

MOSAIC 12 activity: On-going work

Enhancements:• Support of Simulink Coder • Model transfer from Simulink to native EuroSim• Multiple model transfer of Simulink submodels

– Building blocks to restore the data flows between the submodels

• Other Simulink specific items (see paper)

• Solution for SMP2 Universally Unique Identifier (UUID) issue (see paper)

MOSAIC 12

Page 15: Integrating a Simulink System Target File with MOSAIC for

SESP 2017, 28/03/17 15

Concluding remarks (1)• Integrated Simulink STF / MOSAIC tool:

– Tight integration between Simulink and SMP– Meta-information of a Simulink model is accessed directly (instead of parsing

the exported C code)– Easy alignment with new MATLAB releases

• Existing MOSAIC capability re-used for– Support of other input formats (e.g., EcosimPro and 20-sim)– Support of specific features of target simulation platforms – Optimisation of specific SMP related issues (e.g. UUID ) on a generic level

• Library approach: – No functionality is duplicated, which reduces maintenance cost– Other third-party tools can integrate MOSAIC functionality as well

Page 16: Integrating a Simulink System Target File with MOSAIC for

SESP 2017, 28/03/17 16

Concluding remarks (2)

• MOSAIC availability:– Free-of-charge in ESA member states – License request: [email protected]– MathWorks Connections Program

• New external version planned for July 2017 : MOSAIC 12

• Effective collaboration between ESA/NLR/MathWorks

• Contribute to high-level objectives:– Cost reduction of space system development– Efficient harmonization of System Modelling & Simulation (SM&S)

Page 17: Integrating a Simulink System Target File with MOSAIC for

NLR AmsterdamAnthony Fokkerweg 21059 CM Amsterdam

p ) +31 88 511 31 13 f ) +31 88 511 32 10e ) [email protected] i ) www.nlr.nl

NLR MarknesseVoorsterweg 318316 PR Marknesse

p ) +31 88 511 44 44 f ) +31 88 511 42 10e ) [email protected] i ) www.nlr.nl

Fully engagedNetherlands Aerospace Centre