Professional Documents
Culture Documents
Modeling and Simulation of Multi-Domain Physical Systems: Shripad Chandrachood
Modeling and Simulation of Multi-Domain Physical Systems: Shripad Chandrachood
Requirements and
Modeling and simulation Control Electrical
Specifications
of multi-domain
physical systems Embedded Mechanic
Software al
PLC HIL
Shripad Chandrachood
Sr. Application Engineer
MathWorks – Natick, MA
Blades
Nacelle
Geartrain
Hub
Generator
Rotor
Speed
Tower Grid
Pitch
Wind Lift, Drag
Blades
Nacelle
Hub Geartrain Generator
Rotor
Speed
Generator
Speed
Yaw
Tower Grid
5
Agenda
6
Key Points Simulation Model
Requirements and
Specifications
Control Electrical
development process
PLC HIL
Automatically documenting
tests can speed up design
iterations and provide necessary
proof of system performance
7
Traditional Development Process
8
Model-Based Design Process
Simulation Model
Requirements Save time by
and developing in a single
Specifications simulation environment
Control Electrical
Produce better designs
by continuously
Embedded comparing design and
Software Mechanical specification
9
Demo: Wind Turbine System-Level Simulation
10
Linking Specification and Design
Situation:
Simulation Model
3. Mechanical System
Embedded
Software Mechanical
Model:
Mechanical Controls
Park
Hydraulic Supervisory
Logic Spin
Drag
Electrical Aero- Lift
dynamics
Wind
Actuators
Sensors
u + s1 s2
System
y
s3
Controller Plant
13
Detect Integration Issues Earlier
Plant Plant
Specification Model
Actuators
Sensors
u + s1 s2
System
y
s3
Controller Plant
14
Build Accurate Models Quickly
Plant
Multidomain
Fortran, C++ Plant
Specification Domain Knowledge Programming Effort Model
Mechanical
MATLAB, Simulink
Domain Knowledge Programming Effort
Hydraulic
15
MathWorks Physical Modeling Products
Simscape
Mechanical Hydraulic Electrical
SimPowerSystems
SimHydraulics
N S
SimElectronics
SimMechanics
SimDriveline
SimPowerSystems
SimElectronics
SimMechanics
SimHydraulics
SimDriveline
Simscape
Mechanical Hydraulic Electrical Thermal Pneumatic Magnetic
17
Case Study: Wind Turbine Modeling
Pitch
Wind Lift, Drag
Blades
Nacelle
Hub Geartrain Generator
Rotor
Speed
Generator
Speed
Yaw
Tower Grid
18
The Technology of Modern Wind Turbines
Model:
Geartrain Grid
Transformer
Load
21
Model the Geartrain in SimDriveline
Model:
Hub Generator
Shaft Shaft
Helical
Helical
Gear
Gear
Planetary
Gear
Buck-Boost Converter
23
Model DC to DC Power Converters
SimPowerSystems
Piecewise linear systems solution
Multiphase bridges and pulse generators
Transient and harmonic analysis
Faster simulation
SimElectronics
Nonlinear simultaneous equations solution
Include temperature effects
SPICE level switching device models
Detailed simulation
24
Model DC to AC Power Inverters
25
Mechanical Design: Import the Entire Design
Directly from a CAD Tool
SimMechanics Model
SolidWorks Model
The translator automatically generates the SimMechanics model using CAD information
26
Mechanical Design: Using SimMechanics Link
to Import from a CAD Tool
Automatically create SimMechanics
models from a CAD assembly
– Converts mass and inertia
to rigid bodies
– Converts mate definitions to joints
– Creates STL files for use
with SimMechanics visualization
Directly connects SolidWorks,
ProEngineer and Inventor
Public API for other CAD tools
Free download from
www.mathworks.com
– Requires MATLAB
27
Mechanical Design: Using SimMechanics Link
to Import from a CAD Tool
SimMechanics Link can
import XML file to:
– Create a new model
– Add to existing model
– Update an existing model
– Replace a portion of an
existing model
28
Model Blade Pitch
Linkage
Model:
30
Flexible Blades in SimMechanics
Model:
Rotor
Speed
Generator
Speed
Yaw
Tower Grid
32
Controlling Rotor Speed Using the Pitch Angle
Model:
Pitch
Lift
Rotor
Speed
Actuators
Sensors
s1 s2
u + s3
Physical
System
y
Controller Plant
(SL/SF) (Simscape)
34
34
Automatically Document Tests And Results
Situation:
Test
Design
Change Document
Evaluate
Results
Model:
P1 P2 Px
10 10 …
100 10 …
… … …
Parameters 4 36
Test Controller Hardware and Performance of
Generated Control Code
Pitch
Anemometer Command
Signal
Pitch
Angle
Simulink Model
Bachmann electronic
M1 hardware controller
runs turbine model
in real time Model is configured for HIL tests,
converted to C code,
and downloaded to controller
38
Model-Based Design
39
Summary
41
Modeling Physical Systems
With MathWorks Products
Modeling Approaches
42
Modeling Approaches
Programming
Block Diagram
Modeling Language
Symbolic Methods
43
Modeling Approaches
Block Diagram
Modeling Language
Symbolic Methods
44
Modeling Approaches
Symbolic Methods
45
Modeling Approaches
k = ?
b = ?
Parameter Tuning
46
Modeling Approaches
47
Simscape and Physical Modeling Products
Simscape
Mechanical Hydraulic Electrical
SimPowerSystems
SimHydraulics
N S
SimElectronics
SimMechanics
SimDriveline
Motor
Servoamplifier Hall Effect
Models that reflect system Sensor
DC Motor
Structure are easier to
understand,
modify, and reuse
Speed Controller
A B
T P T
Vehicle
Dynamics
Hydraulic Valve
Gears Diff
Engine
49
Quickly Build Intuitive Models Physical Modeling
Motor
Servoamplifier Hall Effect
Models that reflect system Sensor
DC Motor Best Practice
Structure are easier to
understand,
modify, and reuse
Speed Controller
A B
Aileron Mechanics
T P T
Hydraulic Valve
50
Electrical Systems in Equations
R DC Motor
dim
v K e imR wind L wind
dt
L d
θ T K t im D J
dt
Kt,Ke
J,b
i
51
Electrical Systems in Simscape
R DC Motor
dim
v K e imR wind L wind
dt
L d
θ T K t im D J
dt
Kt,Ke
J,b
i
τ,ω
PhysMod “Blocks” are acausal
– Bi-directional energy flow
– Domain-specific physical ports
(electrical, hydraulic…)
– Graphically model system topology
53
Demo: Signal Flow vs. Network Approach
Electrical example: RC circuit
Simulation Results:
i v/r
Input Stimulus: dv
ic
dt
input output
1
p
RC
Simulink (Block diagram) Model
54
Signal Flow vs. Network Approach
with hardware interactions
input output
- - vout
1
iin iout dt
C
Original Simulink model:
No interactions
No conservation
56
Signal Flow vs. Network Approach
Summary
57
Simscape Pre-defined Domains
58
Simscape Language Example: DC Motor
59
Simscape Language Example: DC Motor
component dc_pm
nodes
p = foundation.electrical.electrical; % p:left
n = foundation.electrical.electrical; % n:left Physical
r = foundation.mechanical.rotational.rotational; % r:right
c = foundation.mechanical.rotational.rotational; % c:right Connections
end
parameters
Kt = {10 'N*m/A'}; % Torque constant
Ke = {10 'V/(rad/s)'}; % Back EMF Constant
Rwind = {1 'Ohm'}; % Winding Resistance Motor
Lwind = {1e-3 'H'};
J = {1 'kg*m^2'};
% Winding Inductance
% Motor Inertia
Parameters
B = {1 'N*m/(rad/s)'}; % Motor Damping
end
variables
theta = { 0, 'rad' }; % Angular Displacement
tq = { 0, 'N*m' };
w = { 0, 'rad/s' };
% Torque through variable
% Ang Vel across variable
Internal
i = { 0, 'A' }; % Current through variable Variables
v = { 0, 'V' }; % Voltage across variable
end
equation
w == theta.der;
v == Ke*w + i*Rwind + Lwind*i.der; % Motor Motor
end
tq == -Kt*i + B*w + J*w.der; % equations
Equations
end
60
Simscape Language Overview
61
61
Benefits of Network Modeling Approach
62
62
Multi-Domain System in Simscape
6
7
4
1. Voltage is applied to motor
2. Motor generates torque to spin pump
3. Pump supplies pressure to the
8 hydraulic valve
3 4. Actuator is used to open/close the
2
valve and direct fluid flow
1 5. Hydraulic cylinder moves left or right
depending on valve position
6. Mechanical load provides opposing
force to cylinder
7. Motion sensor feeds position back to
controller
8. Control unit provides set point
9. Position control is achieved
10. No system equations derived!
63
63
Multi-Domain System in Simscape
6
7
9
4
1. Voltage is applied to motor
2. Motor generates torque to spin pump
3. Pump supplies pressure to the
8 hydraulic valve
3 4. Actuator is used to open/close the
2
valve and direct fluid flow
1 5. Hydraulic cylinder moves left or right
depending on valve position
6. Mechanical load provides opposing
force to cylinder
7. Motion sensor feeds position back to
controller
8. Control unit provides set point
9. Position control is achieved
10. No system equations derived!
64
64
Summary
66