physical system modelling with matlab/simulink · use simulink, simscape, and simulink real-time to...
TRANSCRIPT
![Page 1: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/1.jpg)
1© 2017 The MathWorks, Inc.
Physical System Modelling with MATLAB/Simulink
Vasco Lenzi
Application Engineer
MathWorks Bern
![Page 2: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/2.jpg)
2
Setting the Expectations
▪ I will be solving an engineering problem using Simulink&Simscape.
▪ I’ll try to show you how theory and industry workflows mix
▪ Please fill out the lecture feedback survey! Three questions, one minute,
no email asked ;)
![Page 3: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/3.jpg)
3
Key takeaways
▪ Physical System Modelling is the process of understanding, formalizing and
deploying a real system inside a simulation framework
▪ Working with virtual models allows you to:
– Explore design possibilities
– Optimize system performance
– Simulate critical situation and verify control software
– Enable model-based control algorithm
▪ Use the right tool for the right task
![Page 4: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/4.jpg)
4
![Page 5: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/5.jpg)
5
![Page 6: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/6.jpg)
6
Common Concerns when Innovating
Do we know the “thing” works when we turn it on?
Have we validated malfunctions and safety?
How big are the risks of returns?
Projects concerning complex and big
Outcome uncertain, issues found at the end
Risks from delays and quality issues
![Page 7: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/7.jpg)
7
Digital Transformation of the Industry: is everywhere
– Higher flexibility given by small batches production
with the economies of scale
– Higher speed from prototyping to mass production
using innovative technologies
– Increased productivity thanks to lower set-up time
and reduced downtimes
– Improved quality and scrap reduction thanks to
real time production monitoring through sensors
– Higher competitiveness of products thanks to
additional functionalities enabled by Internet Of
Things
Buzzwords:
Industry 4.0
IIoT (Industrial Internet of Things)
![Page 8: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/8.jpg)
8
Key Enabler: Mechatronics
Combination of mechanical-, computer-,
telecommunications-, systems- and control
engineering with electronics
![Page 9: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/9.jpg)
9
Key Enabler: Digital Twin
▪ A digital replica of physical assets,
that can be used for various purposes.
▪ Integrate machine learning and analytics
to create living digital simulation models
that continuously learn and update
themselves
![Page 10: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/10.jpg)
10
Hydro-Québec Models Wind Power Plant
Performance
ChallengePlan the integration of new wind farms into the power system,
predict power output, and ensure safe, reliable operation
SolutionUse MathWorks products to simulate individual wind
turbines and wind farms and to generate C code for
multiprocessor simulation of entire power systems
Results▪ Simulation speed increased to real time
▪ Equipment needs accurately predicted
▪ Dynamic simulations enabled
“Accurate modeling is essential not only for
planning investments but also to detect
situations that can cause an outage. With
MathWorks tools, we can simulate power
electronics, mechanics, and control systems
in one environment, and our models
respond like the turbines we have in the
field.”
Richard Gagnon
Hydro-QuébecLink to user story
Turbines on a wind farm.
![Page 11: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/11.jpg)
11
Source:wikipedia.org
![Page 12: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/12.jpg)
12
Lockheed Martin Simulates Orion Spacecraft Missions
Using a Multidomain Power System Model
ChallengeSimulate the Orion spacecraft’s power system to
validate the design, test fault conditions, and verify
system performance
SolutionUse Simulink and Simscape Power Systems to
model solar arrays, batteries, and the complete
system and to run simulations for a variety of mission
profiles
Results▪ Development time cut by two-thirds
▪ Library of reusable components established
▪ Low-level coding minimized
“With Simscape Power Systems we created an integrated power
system model that connects electrical and thermal domains, so
we get the whole picture during our mission-level simulations. If
we need to model the motors that turn the solar arrays, we have
the capability to integrate those mechanical components, too.”
- Hector Hernandez, Lockheed Martin
Link to user story
NASA’s Orion spacecraft.
![Page 13: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/13.jpg)
© Reishauer AG
Oliver Stamm
Folie 13Workflow: The elements
Examples of configured CAD Models
![Page 14: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/14.jpg)
© Reishauer AG
Oliver Stamm
Folie 14Solution: Virtual machine of different Systems
Current systemVirtual prototype: better trajectories, faster,
less moving mass, cheaper
![Page 15: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/15.jpg)
© Reishauer AG
Oliver Stamm
Folie 15Technology: Output
Simulation Data Inspector: View of results during one cycle
Belt tensions [N] Axis positions [mm] Deviation stiff vs. Elastic [mm]
![Page 16: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/16.jpg)
16© 2017 The MathWorks, Inc.
Physical Modelling within MATLAB & Simulink
![Page 17: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/17.jpg)
17
▪ Purpose: Explore design or physical parameters
▪ Requirements:
– Physics of system are well-known
– System-level equations can be derived and implemented
Data-DrivenFirst Principles
Programming
Block Diagram
Modeling Language
Symbolic Methods
Modeling Approaches
![Page 18: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/18.jpg)
18
Modeling Approaches
▪ Purpose: Explore design or physical parameters
▪ Requirements:
– Physics of system are well-known
– Component-level models exist or can be created
Data-DrivenFirst Principles
Physical NetworksProgramming
Block Diagram
Modeling Language
Symbolic Methods
![Page 19: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/19.jpg)
19
Modeling Approaches
▪ Purpose: Model an existing design (real or virtual)
▪ Requirements:
– Relevant set of measured data is available
– Design and physical parameters will not be changed
Data-DrivenFirst Principles
Physical NetworksProgramming
Block Diagram
Modeling Language
Symbolic Methods
Neural Networks
System Identification
Statistical Methods
MeasuredModel
![Page 20: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/20.jpg)
20
Demystifying Deep Learning
ETH Zürich, ML Room E12
Wednesday, October 17 – 16:15-18:00
More Information and Free Registration:
https://bit.ly/2PpmZTR
MATLAB Academic Tour
![Page 21: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/21.jpg)
21
Case study – Ball-on-WheelRapid Control Prototyping
![Page 22: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/22.jpg)
22
Simscape Products
▪ MATLAB and Simulink provide
foundation for technical computing
and algorithm development
▪ Simscape platform
– Simulation engine and custom diagnostics
– Foundation libraries in many domains
– Language for defining custom blocks
▪ Simscape add-on libraries
![Page 23: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/23.jpg)
23
Model-Based Design
How big should the motor be?
What’s the impact on the controller?
How does my controller structure
should look like?
Requirements Verification and Validation
What model fidelity is good enough? Am I using
the right techniques?
INTEGRATION
IMPLEMENTATION
DESIGN
TE
ST
AN
D V
ER
IFIC
AT
ION
RESEARCH REQUIREMENTS
![Page 24: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/24.jpg)
24
Model-Based Design
One of the key industrial
verification methodology:
INTEGRATION
IMPLEMENTATION
DESIGN
TE
ST
AN
D V
ER
IFIC
AT
ION
RESEARCH REQUIREMENTS
“in-the-loop” workflows
![Page 25: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/25.jpg)
25
Algorithm Plant Model
Does algorithm
perform well on
actual device
with true
latencies?
Harness
Code
In-the-loop verification methodologiesHardware-in-the-Loop: “HIL”
Code
Real-Time Machine
eg “Speedgoat”Production embedded target
![Page 26: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/26.jpg)
26
ChallengeEvaluate design concepts and parameter values for construction
equipment before building physical prototypes
SolutionUse Simulink, Simscape, and Simulink Real-Time to model
hydraulic, mechanical, and engine systems and perform real-
time, operator-in-the-loop simulations
Results▪ Number of prototypes reduced
▪ Issues in the field resolved faster
▪ Controller tuned in simulation
Volvo Construction Equipment Streamlines Product
Development with a Real-Time, Human-in-the-Loop
Simulator
Volvo Construction Equipment’s real-time, human-in-
the-loop simulator.
Link to user story
“It was technically impossible for us to
build a full-scale hydraulic system model
to run in real time without Simulink,
Simscape, and Simulink Real-Time. Our
simulator enables us to test new
concepts for construction equipment,
tune parameters, reduce lead times, and
minimize issues in the field.”
Jae Yong Lee
Volvo Construction Equipment
![Page 27: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/27.jpg)
27
Hardware Support for Project-Based Learning
▪ Supported target hardware
– Arduino® Uno, Mega 2560,
– LEGO® MINDSTORMS®
– Raspberry Pi Model B, B+, 2, and 3
– BeagleBone Black
– Samsung Galaxy Android Devices
– Apple iPhone and iPad
– Microsoft Kinect
– …
Hardware for Project Based Learning
Hardware Support
![Page 28: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/28.jpg)
28
Free MathWorks Online training @ ETH Zürich
Link
![Page 29: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/29.jpg)
29
Writing algorithm for embedded targets
Graphical programming
Coding languages
Sig
nal
Pro
cessin
g
Co
ntr
ol
Sta
te M
ach
ine, L
og
ic
Industry Best Practices Modeling a plant
First principles
Data driven
Transfer Functions
Simulink
Simscape Language
Symbolic Math
Simscape Multibody (CAD models)
Simscape
System IdentificationNeural Network
StateflowSimulink
C/C++-code in Simulink
MATLAB
![Page 30: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/30.jpg)
30
Key takeaways
▪ Physical System Modelling is the process of understanding, formalizing and
deploying a real system inside a simulation framework
▪ Working with virtual models allows you to:
– Explore design possibilities
– Optimize system performance
– Simulate critical situation and verify control software
– Enable model-based control algorithm
▪ Use the right tool for the right task
![Page 31: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/31.jpg)
31© 2017 The MathWorks, Inc.
Appendix: Useful Links and Resources
MathWorks @ ETHZ
![Page 32: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/32.jpg)
32
Internet of Things / Cloud
▪ MATLAB Online & Drive
▪ Thingspeak
![Page 33: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/33.jpg)
33
ODEs vs DAEs and Algebraic Loops
▪ Simulink is great for ODEs…..
▪ ….but most physical systems have algebraic constraints
▪ And in Simulink models, algebraic constraints cause algebraic loops
▪ The system become a DAE (Differential Algebraic Equation)
▪ Be careful in dealing with algebraic loops!
![Page 34: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/34.jpg)
34
How to handle algebraic loops
https://www.mathworks.com/help/releases/R2017b/simulin
k/ug/algebraic-loops.html#bsxw0e2-1
Guy on Simulink: Why you should never break a continuous algebraic loop with a Memory block
![Page 35: Physical System Modelling with MATLAB/Simulink · Use Simulink, Simscape, and Simulink Real-Time to model hydraulic, mechanical, and engine systems and perform real-time, operator-in-the-loop](https://reader030.vdocuments.us/reader030/viewer/2022040103/5e7ea49965fb9e26ef654294/html5/thumbnails/35.jpg)
35
Simulink Units
▪ Specify physical units for Simulink signals
and bus elements
▪ Identify unit mismatches at the component interfaces
▪ Automatically convert units
▪ Enforce consistency by restricting the unit system
Specify, visualize, and check consistency
of units on interfaces
Modeling and Simulation