Vom Konzept zum Modell physikalischer Systeme Smarter Modellieren mit Simscape A B T P T + - 12V Up V- V+ Down Up Down M Maximilian Apfelbeck MathWorks München, 9.07.2014 2014 The MathWorks, Inc. 1
Key Take-Aways Create accurate, reusable plant models quickly and easily V+ V- Intuitive and easy to read multi-domain modeling approach Optimize system performance Develop in a single environment u s1 s3 s2 Actuators System Sensors y 2
Model-Based Design Development Process Requirements Executable Specifications User Acceptance Testing Environment System Design Physical Components Design with Simulation Models Continuous Test and Verification Integration testing Complete Integration & Test System-Level Specification Algorithms Component Design Automatic Code Generation Code Verification and Validation System-Level Integration & Test Research Subsystem Design Embedded Software Digital Electronics Subsystem Integration & Test Data Analysis C, C++ VHDL, Verilog Algorithm Development MCU DSP FPGA ASIC Data Modeling Integration Implementation Subsystem Implementation 3
Model-Based Design Multi-Domain Modeling and Algorithm Development Requirements Methods for modeling systems in different domains User Acceptance Testing Environment System Design Physical Components Integration testing Complete Integration & Test System-Level Specification Algorithms Data Flow (Block diagram) Physical Modeling (Schematic) System-Level Integration & Test Component Design Code Verification and Validation Research Subsystem Design Embedded Software Digital Electronics Subsystem Integration & Test Data Analysis C, C++ VHDL, Verilog Data Modeling Algorithm Development Event-Driven Systems MCU DSP FPGA ASIC Integration Implementation Programing Language (Textual) Subsystem Implementation 4
What Is This? ω V+ V- V in K b i m R m L m di m dt d T K i t m D J dt 5
How To Model This System? V+ ω V- 6
How To Model This System? 7
Fast and Efficient Plant Modeling Simulink: Input/Output Simulink is best known for signal-based modeling Causal, or input/output Simscape enables bidirectional flow of power between components System level equations: Formulated automatically Solved simultaneously Cover multiple domains Simscape: Physical Networks 8
Through & Across Variables q p 1 p 2 p 1 p 2 p 3 p 4 Abstract to a physical network All nodes have the same pressure (across variable) Sum of flows (through variables) at a node is zero Each component must specify an equation involving the through and/or across variables at its boundary 9
SimMechanics SimDriveline SimElectronics SimPowerSystems SimHydraulics SimPowerSystems SimMechanics SimHydraulics SimDriveline SimElectronics Physical Systems in Simulink Simscape Mechanical Hydraulic Thermal Liquid Electrical Pneumatic Magnetic N S Simscape MATLAB, Simulink Custom Domains via Simscape Language Electrical power systems Multidomain physical systems Fluid power and control Multibody mechanics (3-D) Mechanical systems (1-D) Electromechanical and electronic systems 10
SimPowerSystems SimMechanics SimHydraulics SimDriveline SimElectronics Simscape Add-on Libraries SimDriveline Gears, leadscrew, clutches, tires, engines SimElectronics Actuators, sensors, and semiconductors SimHydraulics Pumps, actuators, pipelines, valves, tanks Simscape MATLAB, Simulink Simscape Mechanical Hydraulic Electrical SimMechanics Multibody systems: joints, bodies, frames Thermal Pneumatic Magnetic N S SimPowerSystems Three-phase electrical networks Custom Domains via Simscape Language Multidomain physical systems 11
Physical Modeling Best Practice Structure your system and componentize it Get familiar with the available blocks Build incrementally Write test scripts/harnesses Use appropriate level of fidelity Add dampers, fluid volumes or capacities to un-stiffen the system 12
DC Motor Modeling Options V+ V- Pre-build components Equivalent circuit model with Simscape components Define a custom component using Simscape language 13
Viewing Simscape Simulations Results ssc_explore Explore simulation results from entire physical network Select multiple signals Overlay or separate plots Arrange plots Extract plot to separate window Spend more time analyzing, less time simulating Download from MATLAB Central http://www.mathworks.com/matlabcentral/fileexchange/28184-simscape-simulation-results-explorer 14
Developing Control Systems Implement high-fidelity nonlinear plant models u + s1 s2 s3 Controller Plant y Extract linear model for use with linear control theory A x + B u = 0 Root Locus Bode Plot Explore interaction between control system and plant Real Axis Frequency Optimize system performance 15
Key Take-Aways Create accurate, reusable plant models quickly and easily V+ V- Intuitive and easy to read multi-domain modeling approach Optimize system performance Develop in a single environment u s1 s3 s2 Actuators System Sensors y 16
Backup Simscape Editing Modes Share models with other Simscape users Simulate, analyze, generate code without purchasing extra licenses Model Developer Purchases Simscape and add-on products Function Full Mode Restricted Mode Add or delete regular Simulink blocks Yes Yes Change Simulink solver, simulate Yes Yes Change numerical parameters Yes Yes Access PowerGUI functions, settings Yes Yes Generate code Yes Yes Add/delete blocks from add-on products Yes No Make or break physical connections Yes No Change block parameterization options Yes No Change Simscape Local Solver Yes No Model using Simscape and add-on products Model Users Purchases Simscape Add-on product installed, No add-on purchases required 17
Backup Simscape Equation Formulation and Simulation Simscape performs several steps before starting a simulation Diagram parsing Symbolic simplification Index reduction These steps are performed automatically to ensure robust and quick simulations Physical Network (diagram) Parse diagram for component connections Structural Model Behavioral Model Incorporate component equations, parameters, and setup functions Integration Simulation Results Equations for Simulation Index reduction Simplification of equations through symbolic methods Reduced System of Equations 18