0% found this document useful (0 votes)
230 views

Simulink & Physical Modeling PDF

Uploaded by

Thiago Nunes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
230 views

Simulink & Physical Modeling PDF

Uploaded by

Thiago Nunes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Whats new in Simulink 2013

R2013b

Roni Peer, M.E.


Senior Applications Engineer
Systematics, Ltd.
[email protected]
http://www.linkedin .com/in/ronipeer 1
WHY is MathWorks investing heavily in
product updates?

Reduce the amount of time it takes


to run simulations, test designs, and Increase the scope of the Simulink
generate code modeling language to expand what
problems it can be used to solve
Improve iteration, verification, and
configuration management Improve the efficiency of the
Simulink modeling language and
Facilitate collaboration, especially for generated code
modeling large systems
Increase control over design
tradeoffs and look of generated code
2
R2012a/b was a big release

3
So is R2013a/b!
 Simulink & Stateflow  Control Design
Managing design variants Automated tuning of gain-
Authoring MATLAB IP scheduled controllers
Hardware support  V&V
The new editors New Polyspace products
Native Single Precision Linking requirements to
MATLAB code
 Physical modeling
Next generation of Power  Code Generation
Systems modeling Xilinx Zynq (C and HDL)
New thermal liquids ARM Cortex-M
library Safety-critical
Size actuators using
SimMechanics

CO NFI DE NT I A L | 44
Simulink
The New Editors
Managing design variants
Authoring MATLAB IP
Hardware support
LCC 64-bit

5
Simulink Editor
Ability to add rich controls, links, and images to
customized block interfaces using the Mask Editor
Content preview for subsystems and Stateflow
charts
Comment-through capability to temporarily delete
blocks and connect input signals to output signals
Visual cues for signal lines that cross
UTF-16 character support for block names, signal
labels, and annotations in local languages

6
The New Editors

7
Component Based Modeling
MATLAB System block for including System objects in
Simulink models
Variant Manager that manages all the variants in a
model in one place
Improved componentization capabilities for modeling
scheduling diagrams with root-level function-call inports
Array of buses signal logging in model reference
accelerator mode
Ability to add, delete, and move input signals within Bus
Creator block
Streamlined approach to migrating from Classic to
Simplified initialization mode

8
System objects
Work in MATLAB and Simulink
Foundation for System Toolboxes
Generate code

classdef RemoveMean < matlab.System


% Remove estimated running mean.

properties
% Memory weighting
Weight = 0.8
end

properties (DiscreteState)
Mean = 0 % Initial value
end

methods (Access=protected)
function out = stepImpl(obj,in)
out = in - obj.Mean;
obj.Mean = in - out*obj.Weight;
end
end

9
Consider this example:
Same vehicle available in different countries

Different regional
emission regulations
Different engine
options
How do you design software for all
Different power/
these different alternatives?
efficiency tunings
Different transmission
options
Different chassis
mounts

10
Problem: Switching and Configuring
81 possible combinations!
Chassis Transmission Engine Software
Model 1

Model 2

Model 3
Model 4
Model 5
Model 6

11
Solution: Manage different design
variations in the same model

Model Variants, Variant Fewer models


Subsystems and Easy switching between variants
Variant Manager Less errors

Configurable software
with single code base

12
MATLAB System Block
Author Simulink blocks using MATLAB System objects

What are System Objects?


Enabled Simulink Blocksets in MATLAB (R2010a)
Create your own System Objects (R2011b)
Generate C Code (R2012a)

What are their benefits?


Structured programming - Object Oriented
Ideal for streaming applications and modeling discrete-time
dynamic systems in MATLAB

Enable bringing MATLAB back to Simulink (R2013b)

13
Hardware support packages
Seamless connectivity for educational hardware allows rapid
prototyping and quick feasibility testing No Code Generation
tools required

Available in Student Version! BeagleBoard PandaBoard

New Support for:


Arduino Nano, and Ethernet Shield
Mac OSX (Arduino)

Arduino LEGO MINDSTORMS NXT


Why is this important?
40% adoption of Mac at top universities
Arduino is a popular target

Is this just for edu? Gumstix Overo Raspberry Pi

No, it intrigues all engineers accessibility,


teaching, learning MBD

14
Hardware Connectivity

15
Modeling Concurrency
Core
F3 Task Task Task Scheduler
F1 F2 F5 F6 Core

F4
Simulink Model Target Specification
Existing concurrency
Available
within the design
Map blocks to tasks
concurrency on
(target-agnostic)
the hardware
(target-specific)

Explore
several
mappings
between
blocks and
tasks

16
V&V
New Polyspace products
Linking requirements to MATLAB code

17
Polyspace
New products
Polyspace Bug Finder
Polyspace Code Prover

MATLAB is required for Polyspace in R2013b

18
Polyspace Bug Finder
Quickly find bugs in C/C++
Check code compliance to MISRA or JSF
Works with Embedded Coder to trace results to models

Polyspace Code Prover


Get insight about your software
Prove that your software will not fail
Certify your software to DO-178 or ISO 26262

19
Results from Polyspace Code Prover
static void pointer_arithmetic (void) {
int array[100];
Green: reliable int *p = array;
safe pointer access int i;

for (i = 0; i < 100; i++) {


Red: faulty *p = 0;
out of bounds error p++;
variable I (int32): [0 .. 99]
}
assignment of I (int32): [1 .. 100]

Gray: dead if (get_bus_status() > 0) {


unreachable code if (get_oil_pressure() > 0) {
*p = 5;
} else {
Orange: unproven i++;
may be unsafe for some }
conditions }

i = get_bus_status();

Purple: violation if (i >= 0) {


MISRA-C/C++ or JSF++ *(p - i) = 10;
code rules }
}
Range data
tool tip
20
Bug Finder and Code Prover on integrated code

21
Simulink Verification and Validation
Linking requirements to MATLAB code

Used by:
Systems engineers tracking design or requirement
changes
Design engineers who rely heavily on MATLAB code
DO-178 mandates traceability to ALL parts of the design

Used How?
Link requirements to MATLAB code for
Parameter definition
Algorithms Highly requested ability
Test cases
etc. 22
Simulink Verification and Validation
Linking requirements to MATLAB code

23
Code Generation
Xilinx Zynq (C and HDL)
ARM Cortex-M

24
Zynq Design Challenges

ARM FPGA
Processor Interface HDL Code
C-Code Hardware
Software

FPGA Designers not familiar with programming processors


DSP/Processor programmers not familiar with FPGAs
What should run on the FPGA vs. what should run on the
ARM?
No established rules for hooking up the interface
between FPGA and ARM processor 25
How do we make Zynq programming
easier?

ARM FPGA
Processor Interface HDL Code
C-Code Hardware
Software

Established workflow with Embedded Coder


Established workflow with HDL Coder
Guided Workflow for HDL code generation
Automatic Interface Generation

26
ARM Cortex-M support
Embedded Coder and DSP System Toolbox
ARM devices are becoming ubiquitous in embedded systems and Cortex-
M is focused on controls and low-end signal processing
ST, TI, Freescale, ADI, etc.. are all building processors with ARM Cortex-M
cores for motor control, audio, and related applications
TODAY:
You can generate ARM optimized code from Simulink blocks and DSP
System Toolbox filters using Embedded Coder

27

28

30 ...

29
Whats new in Simulink 2013

Roni Peer, M.E.


Senior Applications Engineer
Systematics, Ltd.
[email protected]
http://www.linkedin .com/in/ronipeer 30
Controls

31
Controls and Identification
Simulink Control
Design
Model Predictive Robust Control
Control Toolbox
Control
Design
Control System
Plant Toolbox
System Identification
Toolbox Modeling
Fuzzy Logic
Toolbox

Simulink Design
Optimization

32
Simulink Control Design
Improved performance of batch linearization
For example, batch linearization with N varying parameters

R2013a: R2013b:
for ct1 = 1:numel(P1) [P1val,..,PNval] = ndgrid(P1,..,PN);
params(1).Name = 'P1'
for ctN = 1:numel(PN) params(1).Value = P1val;
...
T() = linearize(mdl,io_T); params(N).Name = 'PN';
params(N).Value = PNval;
end
T = linearize(mdl,io_T,params);
end

P1 x.x PN model compilations 1 model compilation!


33
Simulink Control Design
New slLinearizer API to extract multiple responses
One Model compliation!

lin = slLinearizer(mdl,{'r','u','y'},params)

T = getIOTransfer(lin,'r','y')

L = getLoopTransfer(lin,'u')

S = getSensitivity(lin,'y')

34
Robust Control Toolbox
Simple systune/looptune workflow to tune any control
architecture
Added design requirements for overshoot, min/max loop
gains and sensitivity

Loop Shape
Gain limits (H) 35
Robust Control Toolbox
Use systune/looptune to tune gain-scheduled controllers!
Airframe model whose dynamics vary by velocity, V, and angle of attack, alpha
Use linearize to create an array of linear models for different V and alpha combinations
Characterize controller gains as functions of V and alpha,
e.g. Kp = a0+a1*V+a2*alpha+a3*V*alpha
Use systune to tune a0, a1, a2, a3 etc.

36
System Identification Toolbox
Added estimation
regularization
Improves reliability of
models with many
parameters (limits over
fitting)
Added Subspace
Identification Algorithm for
State-Space models (ssarx)

37
Simulink Design Optimization
Redesigned commands for
estimation
Custom cost functions,
parameter constraints, and
estimation of parameters
per experiment
More power and flexibility
for setting up and running
parameter estimation tasks
Estimate
parameters

38
Physical Modeling

Next generation of power systems modeling


New thermal liquids library
Size actuators using SimMechanics

39
SimDriveline

SimMechanics
Simscape
SimElectronics

SimHydraulics
SimRF
SimPowerSystems 40
Scope: Simscape Language

Torque = - k 2 d
Angular Velocity =
dt

41
SimPowerSystems
Third Generation Technology
Simscape-based libraries
added to SimPowerSystems
Integrate other domains or
electrical
effects into your power
systems models
Customize with Simscape
language

42
Simscape
Thermal Liquid Library

New domain and library


for thermal liquid systems
Single-phase liquids
Fluid properties vary
with temperature
Uses MathWorks patented
robust modeling approach

43
SimMechanics
Prescribed Motion, Actuation Forces

Use SimMechanics
to size actuators
Prescribe motion for joints
via an input signal
Calculate the force required
to produce motion at any
selected joint

New

44

www.systematics.co.il/mathworks/

"

www.mathworks.com
Solution database
Information & downloads Documentation File exchange
Training schedule MATLAB based books Newsgroup
Webinars
Newsletters

45

46

You might also like