# Physical Modelling with Simscape™ Rick Hyde Control Electrical

```Physical Modelling with Simscape™
Control
Electrical
Embedded
Software
Mechanical
Rick Hyde
1
Presentation overview

Modelling physical systems
– Why model a physical system?
– Network approach & Simscape™

Example: Aileron actuation system
– Using modelling to support system-level design

Modelling brushless motors
– Matching model fidelity to the design task

What’s new in
and
2

Example: humanoid robot arm
– What are the actuation requirements?






Space and weight constraints
Torque/force, speed & power
Compliance
Precision
System-level
model of
complete system
Dynamic tracking bandwidth
Failure behaviour
– Which actuation technology?
– What is the impact on the rest of the system?



Power supply requirements
Heat
Electromagnetic interference
Behavioural model
of actuation system
System model with
selectable detailed &
behavioural sub-models
Why model a physical system?
3

Equation set
Simscape extension

  f e ( x, u,  )
– x
– E ( x,  ) x
  f ( x, u,  )
– Explicit equation

Relevance
– Single body motion
– Multiple-body motion when
there is compliance
– Most algorithms (control)
s1
Equation set
– Implicit equation

Relevance
– 1-D multi-body systems e.g.
drivelines
– Electrical networks
– Hydraulic/pneumatic networks
s2
s3
4
What does this model represent?
5
What does this model represent?
6
Modelling an electrical circuit in Simulink
Step 1: figure out the equations
Step 2: build the model
Step 3: fix algebraic loops
7
Modelling an electrical circuit in Simscape
Single step: Build the model
Network approach:
1. Node defines potential for
connected components
2. Flows sum to zero at
nodes
3. Each component has an
equation
network topology
8
Simscape
Mechanical Hydraulic
Thermal
Liquid
Electrical
Thermal
Pneumatic Magnetic Mechanical
N
Electrical power systems
S
Custom Domains (Simscape Language)
SimHydraulics
SimPowerSystems
Simscape
Fluid power and control
SimElectronics
SimDriveline
SimMechanics
Multidomain physical systems
Multibody mechanics (3-D)
Powertrain systems (1-D)
Electromechanical and
electronic systems
9
Simscape Language




use foundation ones
Use foundation library
components as templates
libraries with others
10
Presentation overview

Modelling physical systems
– Why model a physical system?
– Network approach & Simscape™

Example: Aileron actuation system
– Using modelling to support system-level design

Modelling brushless motors
– Matching model fidelity to the design task

What’s new in 15a and 15b
11
Example: Aileron Actuation System

System
Desired
Angle
Control
Actuator
Force
Extension

Simulation goals
1. Determine requirements for actuation system
2. Compare actuation technologies
3. Run simulation on real-time hardware for HIL tests
12
Model-Based Design Process
Simulation Model
Control
Embedded
Software
Requirements
and
Specifications
Save time by developing
in a single simulation
environment
Electrical
Mechanical
Produce better designs by
continuously comparing
design and specification
Lower costs by using HIL
tests and fewer hardware
prototypes
21
Key Points

Testing different actuator designs
in one environment saves time
and encourages innovation

Optimising systems with respect
optimal design choices

Aileron Angle
Actuator Force
Simulating at different levels of
fidelity is required to see effects
of design implementation
22
Presentation overview

Modelling physical systems
– Why model a physical system?
– Network approach & Simscape™

Example: Aileron actuation system
– Using modelling to support system-level design

Modelling brushless motors
– Matching model fidelity to the design task

What’s new in 15a and 15b
23
Modelling use cases and modelling level (1 to 3) classification
System-level simulation
–
–
2.
Component validation
–
–
3.
Torque-speed behaviour
Model motor losses as part of overall
efficiency & thermal calculations
Ensure motor stays within manufacturer
operating limits
Detailed analysis of impact on other
components e.g. power harmonics
Mechanical/control
engineer
Modelling detail
1.
Component design
–
–
Motor and/or drive circuitry
Determine overall actuation losses
Motor designer and
electronics
engineer
24
Level 1: System-level simulation

Designer’s objectives
–
–
–
–

Validate power requirements
Thermal modelling/design
Real-time simulator
Modelling solution
– Energy-based approach (no switching, fast,
HIL-compatible)
Resources
SimElectronics block: Servomotor (8a), tabulated losses (15b)
SimElectronics examples: elec_hybrid_electrical_network.slx &
elec_servomotor_efficiency.slx (15b)
25
Level 2: Component validation

User’s objectives
– Check motor and drive electronics stay
within permitted temperature limits.
– Quantify impact on DC supply (harmonics).

Modelling solution
– Model power switching with ideal switch
assumption
– Parks transform plus constant inductances
sufficient for motor
Resources
SimPowerSystems blocks:

PMSM and BLDC motor models

Semiconductor switching devices
SimPowerSystems examples:

pe_pmsm_drive.slx
26
Level 3: Component design

User’s objectives
– Motor design or specification
– Build a dynamic simulation model to
support controller design and efficiency
predictions.

Modelling solution
– Model motor using finite-element
magnetic data
– Model drive electronics using device-level
IGBT models
Resources
SimElectronics blocks:

N-Channel IGBT

FEM-Parameterized PMSM (15b)
SimElectronics examples:

elec_pmsm.slx (15b)
27
Presentation overview

Modelling physical systems
– Why model a physical system?
– Network approach & Simscape™

Example: Aileron actuation system
– Using modelling to support system-level design

Modelling brushless motors
– Matching model fidelity to the design task

What’s new in
and
28
Two-Phase Fluids
In Simscape
MathWorks Investment in
Physical Modelling


Thermal Liquid
In Simscape
Magnetics
In Simscape
More than 15 years
of acausal modelling
Pace increased rapidly
with introduction of Simscape
Pneumatics
In Simscape
Simscape Language
Thermal effects
optional ports
SimElectronics
Simscape
Local
Solver
Simscape
Logging
Zero
Crossing
Statistics
SimHydraulics
Simscape-Based
Library (2G)
SimDriveline
SimMechanics
SolidWorks
Translator
1998
2000
ProEngineer
Translator
Electric Drives
Library Introduced
SimPowerSystems
2002
2004
Model
Statistics
Viewer Variable
Viewer
2006
3-D Vis. Improvements
AutodeskTranslator
Ideal Switching
Algorithm Introduced
2008
2010
Simscape-Based
Library (2G)
Intf. Elements
Editing Mode
2012
Simscape-Based
Libraries
2014
2016
29

Simscape

– elec_getPowerLossSummary fcn
– Variable Viewer link to block diagram​
– Improved efficiency for initialization
– Sparkline plots for logged data​​


SimHydraulics
– Variable-Displacement Hydraulic
Machine (External Efficiencies) block
– Valve opening dynamics
– Accumulator with improved hard stops

–
–
–
–
SimDriveline
– Thermal variants for Gears library
– Transmission templates
– Shift linkage position vrnt. Dog Clutch
SimMechanics
– Show/Hide in Mechanics Explorer
– Constant Velocity Joint block
SimElectronics

Nonlinear magnetization inductance
Schmitt Trigger, Current Limiter block
Droop param. for DC-DC Converter
Thermal port for H-Bridge block
SimPowerSystems SC, ST
 Asynch. machines with SI param
 Synch: Machine Model 2.1 blocks
 Zigzag-Delta1-Wye, Zigzag-Delta11Wye, Average-Value Inverter
 New powergui dialog box and tools
 Interpolate option for Tustin solver
 Annotation, export for Load Flow Tool
 >> power_customize function
 Three-limb core for 3-phase xformer
 PV Array and examples
30
SimMechanics
New Joints


Constant Velocity Joint
– Angular velocity about z-axes for B and F is same
CV Joint
Universal
Joint
>> sm_pto_shaft
31
SimDriveline
Transmission Templates

Incorporate transmissions
into vehicle models
– Structure includes gearing,
inertias, and clutch schedule
– Modify them to create other
transmission types
32
SimDriveline
Thermal Variants for Gears Library

Incorporate thermal effects
into geared systems
– Efficiency dependent on temperature
– Account for heat generated due to meshing

Right-click on block
to select thermal variant
– Thermal port exposed
– Variants for all blocks in Gears Library
33

Simscape
–
–
–
–

Two-Phase Fluid Domain & Library
Domain-specific colors on block icons
Periodic Operators library
Variable priority “None” for initialization
SimDriveline
– Variable Mass, Variable Inertia blocks
– Variable-friction tire model

SimHydraulics
– Pneu-Hydr. actuator with 2 mech ports

SimMechanics
–
–
–
–
Point On Curve Constraint block
Spline block for curved paths
Frame creation via Solid block UI
block diagram

SimElectronics
–
–
–
–

Limits, tolerances, faults in Resistor
Tabulated efficiency in Servomotor
Fault block for open-, short-circuit faults
FEM-Parameterized PMSM block
SimPowerSystems SC, ST






Nonlin. Transformer, Nonlin. Inductor
Single-Phase Circuit Breaker with arc
Back EMF profile param. (DC Motor)
Fundamental Drive Blocks library
Power Converter blocks
Load flow for systems with unbalanced
currents, single-phase connections
 External temperature input for Battery
 Powergui interpolation option
34
SimElectronics
Limits, Tolerances, Faults in Resistor


Apply tolerances to
resistance parameter
Specify fault behavior
– Resistance after failure
– Time, behavioral fault

Specify operating limits
35
SimMechanics
Point On Curve Constraint, Spline Block

Constrain frame to 2D or 3D curve
– Define curve relative to frame (Spline Block)
– Constrain frame to curve using
Point on Curve Constraint
– Measure force required
to keep frame
on curve
Try:
>> sm_cam_flapping_wing
36
Simscape
Colors on Block Icons, Rounded Connections



R2015b
Block icons have
domain-specific colors
Physical connections
have rounded corners
Domain colors
on icon
Rounded Corners
Without Styling
multidomain schematic
37
Simscape
Two-Phase Domain and Library

Foundation Library for
systems with working fluid
part liquid, part vapor
Use when phase changes
are critical effect in system
– Vaporization
– Condensation
– Cavitation
Try:
>> ssc_refrigeration
>> ssc_cavitation_two_phase_fluid
>> ssc_fluid_vaporization_in_pipe
Pressure, p

Isothermal
Liquid
Thermal
Liquid
Gas
Two-Phase Fluid
Liquid-Vapor
Dome
Specific Enthalpy, h
38
Summary

Modelling physical systems
– Why model a physical system?
– Network approach & Simscape™

Simscape
Example: Aileron actuation system
– Using modelling to support system-level
design

Modelling brushless motors
– Matching model fidelity to the design task

Level 1:
energybased
Level 2:
ideal
switching
Level 3:
FEM +
nonlinear
What’s new in 15a and 15b
39
```