What’s “New” in Simulink? 5/26/17 - MathWorks€™s “New” in Simulink? 5/26/17 ... –...

34
1 © 2017 The MathWorks, Inc. What’s “New” in Simulink? 5/26/17 Jeremy Ross Senior Application Engineer

Transcript of What’s “New” in Simulink? 5/26/17 - MathWorks€™s “New” in Simulink? 5/26/17 ... –...

1© 2017 The MathWorks, Inc.

What’s “New” in Simulink?

5/26/17

Jeremy Ross

Senior Application Engineer

2

Agenda Modeling

– Smart Editing Cues

– Edit-Time Checks

– Simulink Units

Visualization

– Simulation Data Inspector

– Dashboard Block Library

– New Scope Block Functionality

Data Handling and Language Enhancements

– Data Dictionaries

– Simulink Functions and Scoping

– Initialize & Terminate Function Blocks

Performance and Speed

– Fast Restart

– Parallel Simulations Made Easy

– Input File Streaming

Project Management

– Simulink Projects w/ Source Control

– Model Differencing & 3-Way Model Merge

– Referenced Projects

New Application-Specific Enhancement Areas

– Controls Analysis

– State Machines

– Verification & Validation

– Test Automation

– Interfacing with ROS

3

Modeling

Smart Editing Cues

Edit-Time Checks

Simulink Units

4

Smart Editing Cues

Smart prompts for

inserting blocks upon

typing the block name

Suggests marquee

actions when a group of

blocks are selected

Ex: Create Subsystem

Easily insert blocks that

occur in pairs Ex:

Goto/From pair

Accelerate model building with just-

in-time contextual promptsQuick Insert

Persistent Guides

Marquee Actions

Tear-Off Cues

Auto Port Creation

5

Smart Editing Cues (continued)

Reduced Bus Wiring

Quickly group signals as buses and automatically

create bus element ports for fewer signal lines

between and within subsystems

Access a bus port closer to where they are

being used.

Easily change the interface over time as you

are designing it

Easily create buses between and within

subsystems

Bus element ports make models easier to

create, but also easier to read and share.

6

Edit-Time Checks

Provides early visual cues for warnings

and violations

Alerts users to issues while designing a

model

Hover cursor over a highlighted block

for information about the

warning/violation

Identify compatibility issues earlier

in the model design process using

edit-time checking

7

Simulink Units

Specify physical units for Simulink signals

and bus elements at the interfaces of

components such as subsystems, model

references, Stateflow charts and MATLAB

function blocks

Identify unit mismatches at the component

interfaces

Enforce consistency is by restricting the unit

systems for certain components using the

configuration parameter, ‘Allowed unit

systems’

Specify, visualize, and check consistency

of units on interfaces

» Sldemo_fuelsys

8

9

Visualization

Simulation Data Inspector

Dashboard Block Library

New Scope Block Functionality

10

Simulation Data Inspector

Run simulation comparisons with a new UI,

time tolerance support, and faster

performance

Improved workflow for organizing and

comparing simulation data

Global tolerance settings both for the signal

and time value

Save the session to an MLDATX file, a

compressed file format especially useful

when analyzing large amounts of data

11

Dashboard Block Library

New library of controls and displays,

including knobs, switches, and gauges

Place blocks directly within the Simulink

Editor

Provide a front-end user interface to the

entire model

Tune and test your simulations with

graphical controls and displays

» Sldemo_fuelsys

12

Dashboard Block Connection Indicators

Easily determine which block in your model

is associated with a given Dashboard block

Click on a Dashboard block to highlight the

connected block or signal and vice versa

Navigate directly to a connected element

from the Dashboard block

13

New Interface for Scopes

Scope, Floating Scope, and Viewers all

upgraded with new UI

Includes simulation data analysis and

debugging tools

– Cursors

– Measurements

– Triggers

View and debug signals with cursors and

measurements

14

Data Handling & Language Enhancements

Data Dictionaries

Simulink Functions and Scoping

Initialize & Terminate Function Blocks

15

Data Dictionary (New Feature, R2014a)

Change Tracking and Differencing

Defined Relationship with SLDD Files

Componentization

Scalability and Performance

Integration with Simulink Projects

Demo: Using a Data Dictionary to

Manage the Data for a Fuel Control

System

Tip: Determine where to store data

Store, edit and access global

design data using a data dictionary Simulink

SLX

FileSLX

File

Model 1

Model 2

Model 3

SLX

File

SLDD

FileSLDD

FileSLDD

FileGlobal Data

16

Simulink Functions

Simulink users can define and access

functions that are reused throughout the

model

Simulink function block is paired with

function caller block to define and call a

function respectively

Simulink function can be directly accessed

from Stateflow as well

Create and call functions across Simulink

and StateflowSimulink Function Block

Function caller block

17

Scoping Simulink Functions

Encapsulate components using Simulink

Functions within a subsystem hierarchy

Use the Functions Connectors display option

to show graphical connections between

Simulink Functions and their callers

Use a dot notation within the Function Caller

block to call a Simulink Function within a

subsystem

Allows copying of subsystems and library

blocks containing Simulink Functions

Call Simulink Function blocks within a

subsystem hierarchy

18

Initialize and Terminate Function Blocks

Model functions that embedded systems use

to start up and initialize themselves, as well as

those functions to terminate and shut down

Initialize and terminate functions are allowed

to be customized and aggregated in

generated code

Important new modeling workflow enabled by

two features:

– Initialize, Reset and Terminate Functions

– State Reader and Writer Blocks

Respond to events to model dynamic

startup and shutdown behavior

19

State Reader and Writer Blocks

Support explicit state reading, resetting and

initialization behavior tied to ECU events

Make state read/write much easier (can now

be done via merge blocks and/or data store

memory blocks, but it is cumbersome)

Important new modeling workflow enabled by

two features:

– Initialize, Reset and Terminate Functions

– State Reader and Writer Blocks

Reset and record states during model

execution

20

Performance & Speed

Fast Restart

Parallel Simulations Made Easy

Input File Streaming

21

Fast Restart

Efficiently run multiple interactive

simulations

Saves simulation time

eliminating recompilation

between simulation runs

Improves calibration workflows

where the user is tuning block

parameters between runs

Run consecutive simulations

fast!

22

Parallel Simulations

An enhanced workflow to run multiple Simulink

simulations in parallel

Enables customers to easily use Simulink with

Parallel Computing Toolbox (PCT)

and MATLAB Distributed Computing Server

(MDCS)

Simplifies customers’ large simulation runs and

improves their productivity

Directly run multiple parallel simulations

from the ‘parsim’ command

23

Inport File Streaming

Stream large input signals from MAT-files

without loading the data into memory

Provides a big data workflow for Simulink

simulations

Only a small chunk of data are loaded into

system memory during simulations

24

Project Management

Simulink Projects w/ Source Control

Model Differencing & 3-Way Model Merge

Referenced Projects

25

Simulink Projects

Collaborate: Enforce companywide

standards such as company tools,

libraries, and standard startup and

shutdown scripts. Share your work with

rich sharing options including

MATLAB® toolboxes, email, and

archives.

Automate: Set up your project

environment correctly every time by

automating steps such as loading the

data, managing the path, and opening

the models.

Integrate with Source Control: Enable

easy integration with source control and

configuration management tools.

Demo: Using a Simulink Project

26

Model Differencing & Three-Way Merge

Simulink Report Generator lets you compare

and merge Simulink models by identifying

differences between model

elements, Stateflow® charts, and MATLAB

Function blocks. The tool uses XML text file

representations of the Simulink models for the

analysis.

Several times faster model comparison

analysis

In addition to the standard comparison, a

three-way merge tool is also available to

resolve source control file conflicts. Both

comparisons are integrated into Simulink

Projects, an interactive tool in Simulink for

managing your design files.

Demo: Resolve Conflicts with Simulink Three-

Way Merge

27

Referenced Projects

Create reusable components for large

modeling projects

» sldemo_slproject_airframe_references

Develop reusable components using

projects

Flexible referencing:

– Relative

– Absolute

Extract folders to referenced projects

Deep hierarchies are supported

28

New Application-Specific Enhancement Areas

Controls Analysis

State Machines

Verification & Validation

Test Automation

Interfacing with ROS

29

Controls Analysis

Key Features

– Automatic tuning of PID, gain-scheduled,

and arbitrary SISO and MIMO control

systems

– Operating-point calculation (trimming) and

linearization of models

– Frequency response estimation from

simulation data

– Batch linearization for varying parameters

and operating points

– Numerical optimization of compensators to

meet time-domain and frequency-domain

requirements (with Simulink Design

Optimization™)

30

State Machines

Key Features

– Modeling environment, graphical components, and

simulation engine for modeling and simulating complex

logic

– State diagrams, state transition tables, and state

transition matrices representing finite state machines

– Flow charts, MATLAB functions, and truth tables for

representing algorithms

– State diagram animation, state activity logging, data

logging, and integrated debugging for analyzing the

design and detecting run-time errors

31

Verification & Validation

Using MATLAB&Simulink products, you refine

your design through rapid iterations and

verification cycles in an interactive test

environment:

– Detect design errors such as integer overflow,

division by zero, and dead logic in models

using formal verification methods

– Automatically generate reusable unit tests that

satisfy model coverage and meet specific user-

defined design verification objectives with Simulink

Design Verifier

– Expose design flaws and inconsistencies in

requirements using the model coverage

capabilities in Simulink Verification and Validation

32

Test Automation - Simulink Test

New product launched in

Main Model

Test Harness

Component

under test

1. Test Harness 2. Test Sequence Block 3. Test Manager

33

Interfacing with ROS

Communicate with a ROS network, interactively explore robot

capabilities, and visualize sensor data

Create ROS nodes, publishers, and subscribers directly from

MATLAB and Simulink

Create and send ROS messages from MATLAB and Simulink

Create and send ROS Custom Messages from MATLAB and

Simulink

Call and provide ROS services

Import ROS log files (rosbags) to visualize, analyze, and post-

process logged data

Use ROS functionality on any platform (Windows®, Linux,

Mac)

Use MATLAB as an ROS master

Test and verify applications on ROS-enabled robots and robot

simulators such as Gazebo and V-REP

Create Simulink models that work with a ROS network

Generate a standalone ROS C++ node from a Simulink model

New product launched in

34

Questions?