Simulink & Physical Modeling PDF
Simulink & Physical Modeling PDF
R2013b
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
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
Configurable software
with single code base
12
MATLAB System Block
Author Simulink blocks using MATLAB System objects
13
Hardware support packages
Seamless connectivity for educational hardware allows rapid
prototyping and quick feasibility testing No Code Generation
tools required
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
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
19
Results from Polyspace Code Prover
static void pointer_arithmetic (void) {
int array[100];
Green: reliable int *p = array;
safe pointer access int i;
i = get_bus_status();
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
ARM FPGA
Processor Interface HDL Code
C-Code Hardware
Software
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
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
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
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
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