Physical Modelling with Simscape Rick Hyde

Similar documents
Mathematical Modelling Using SimScape (Electrical Systems)

Index. Index. More information. in this web service Cambridge University Press

Modeling a powertrain in Simscape in a modular vehicle component model library. Stuttgart, , MBtech, Jörn Bader

Comparison of Simulation Programs for Supercapacitor Modelling Model Creation and Verification PATRIK JOHANSSON BJÖRN ANDERSSON

A system is defined as a combination of components (elements) that act together to perform a certain objective. System dynamics deal with:

MAS601 Design, Modeling & Simulation. Day 2

Equivalent Circuits. Henna Tahvanainen. November 4, ELEC-E5610 Acoustics and the Physics of Sound, Lecture 3

2.004 Dynamics and Control II Spring 2008

Introduction to AC Circuits (Capacitors and Inductors)

(Refer Slide Time: 00:01:30 min)

MODELING IN XCOS USING MODELICA

Modeling of Dynamic Systems: Notes on Bond Graphs Version 1.0 Copyright Diane L. Peters, Ph.D., P.E.

Lab 3: Quanser Hardware and Proportional Control

Deriving a Fast and Accurate PMSM Motor Model from Finite Element Analysis The MathWorks, Inc. 1

Modeling and Simulation Revision III D R. T A R E K A. T U T U N J I P H I L A D E L P H I A U N I V E R S I T Y, J O R D A N

Lecture 39. PHYC 161 Fall 2016

Lab 1: Dynamic Simulation Using Simulink and Matlab

2002 Prentice Hall, Inc. Gene F. Franklin, J. David Powell, Abbas Emami-Naeini Feedback Control of Dynamic Systems, 4e

ET3-7: Modelling II(V) Electrical, Mechanical and Thermal Systems

Modeling and Simulation Revision IV D R. T A R E K A. T U T U N J I P H I L A D E L P H I A U N I V E R S I T Y, J O R D A N

Verification of model connection by FMI using acausal modeling tools ~ JSAE WG Activities ~

Solved Problems. Electric Circuits & Components. 1-1 Write the KVL equation for the circuit shown.

Name Class Date. RC Circuit Lab

ENGG4420 LECTURE 7. CHAPTER 1 BY RADU MURESAN Page 1. September :29 PM

Physics 102 Spring 2006: Final Exam Multiple-Choice Questions

Electromagnetic Oscillations and Alternating Current. 1. Electromagnetic oscillations and LC circuit 2. Alternating Current 3.

ES205 Analysis and Design of Engineering Systems: Lab 1: An Introductory Tutorial: Getting Started with SIMULINK

Simulation of Vehicle Drivetrain with Modelica

ELECTROMAGNETIC OSCILLATIONS AND ALTERNATING CURRENT

Vehicle Propulsion Systems. Electric & Hybrid Electric Propulsion Systems Part III

Electromagnetics and Electric Machines Stefan Holst, CD-adapco

LF Electromagnetics. Marius Rosu, PhD. Vincent Delafosse. EM Lead Product Manager. EM Senior Product Manager ANSYS, Inc.

Automatic Control Systems. -Lecture Note 15-

EE 410/510: Electromechanical Systems Chapter 4

Outline. Week 5: Circuits. Course Notes: 3.5. Goals: Use linear algebra to determine voltage drops and branch currents.

Symbolic Model Reduction for Linear and Nonlinear DAEs

DcMotor_ Model Help File

MCE380: Measurements and Instrumentation Lab. Chapter 5: Electromechanical Transducers

AC&ST AUTOMATIC CONTROL AND SYSTEM THEORY SYSTEMS AND MODELS. Claudio Melchiorri

Analysis of Dynamic Systems Using Bond Graph Method Through SIMULINK

Hydraulic (Fluid) Systems

ENGI9496 Modeling and Simulation of Dynamic Systems Bond Graphs

Solution for Fq. A. up B. down C. east D. west E. south

ME 3210 Mechatronics II Laboratory Lab 4: DC Motor Characteristics

2005 AP PHYSICS C: ELECTRICITY AND MAGNETISM FREE-RESPONSE QUESTIONS

Modeling of Electrical Elements

Texas A & M University Department of Mechanical Engineering MEEN 364 Dynamic Systems and Controls Dr. Alexander G. Parlos

Contents. Dynamics and control of mechanical systems. Focus on

Modeling and Experimentation: Compound Pendulum

Problem info Geometry model Labelled Objects Results Nonlinear dependencies

Chapter three. Mathematical Modeling of mechanical end electrical systems. Laith Batarseh

Coupling Physics. Tomasz Stelmach Senior Application Engineer

MAGNETIC HYSTERESIS MODELING AND VISUALIZATION FOR SPICE BASED ENVIRONMENTS

EDEXCEL NATIONALS UNIT 5 - ELECTRICAL AND ELECTRONIC PRINCIPLES. ASSIGNMENT No. 3 - ELECTRO MAGNETIC INDUCTION

ET3-7: Modelling I(V) Introduction and Objectives. Electrical, Mechanical and Thermal Systems

Finite Element Model of a Magnet Driven Reed Switch

Modeling and Analysis of Dynamic Systems

NUMERICAL ANALYSIS PROJECT PART I: ORDINARY DIFFERENTIAL EQUATIONS

Introduction to Controls

RC Circuits (32.9) Neil Alberding (SFU Physics) Physics 121: Optics, Electricity & Magnetism Spring / 1

Multi-domain Modeling and Simulation of a Linear Actuation System

Motion Control. Laboratory assignment. Case study. Lectures. compliance, backlash and nonlinear friction. control strategies to improve performance

Finite Element Method based investigation of IPMSM losses

EE292: Fundamentals of ECE

Generators for wind power conversion

Low Inductance Low Temp Rise DC Bus Capacitor Properties Enabling the Optimization of High Power Inverters. Abstract. 1.

INF5490 RF MEMS. LN03: Modeling, design and analysis. Spring 2008, Oddvar Søråsen Department of Informatics, UoO

Modelling and simulation of a measurement robot

Chapter 2. Engr228 Circuit Analysis. Dr Curtis Nelson

Equal Pitch and Unequal Pitch:

As light level increases, resistance decreases. As temperature increases, resistance decreases. Voltage across capacitor increases with time LDR

Electromagnetics in COMSOL Multiphysics is extended by add-on Modules

MATH 312 Section 3.1: Linear Models

Yell if you have any questions

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Physics 8.02 Spring 2003 Experiment 17: RLC Circuit (modified 4/15/2003) OBJECTIVES

Motor-CAD combined electromagnetic and thermal model (January 2015)

ASSOCIATE DEGREE IN ENGINEERING RESIT EXAMINATIONS SEMESTER 1. "Electrical Eng Science"

Kirchhoff's Laws and Circuit Analysis (EC 2)

Inductance, Inductors, RL Circuits & RC Circuits, LC, and RLC Circuits

Mutual Inductance. The field lines flow from a + charge to a - change

DC motors. 1. Parallel (shunt) excited DC motor

PhysicsAndMathsTutor.com 1

School of Engineering Faculty of Built Environment, Engineering, Technology & Design

Coupled Drive Apparatus Modelling and Simulation

POE Concepts and Learning Objectives

ECEN 420 LINEAR CONTROL SYSTEMS. Lecture 6 Mathematical Representation of Physical Systems II 1/67

Lecture # 2 Basic Circuit Laws

Parameter Prediction and Modelling Methods for Traction Motor of Hybrid Electric Vehicle

Inductance, RL and RLC Circuits

SC125MS. Data Sheet and Instruction Manual. ! Warning! Salem Controls Inc. Stepper Motor Driver. Last Updated 12/14/2004

Model of a DC Generator Driving a DC Motor (which propels a car)

Alternating Current. Symbol for A.C. source. A.C.

Unit 57: Mechatronic System

Sensing, Computing, Actuating

Basic Electronics. Introductory Lecture Course for. Technology and Instrumentation in Particle Physics Chicago, Illinois June 9-14, 2011

Physics 102 Spring 2007: Final Exam Multiple-Choice Questions

Sensors and Actuators Sensors Physics

FEEDBACK CONTROL SYSTEMS

Analysis of Electric DC Drive Using Matlab Simulink and SimPower Systems

EDEXCEL NATIONAL CERTIFICATE/DIPLOMA UNIT 5 - ELECTRICAL AND ELECTRONIC PRINCIPLES NQF LEVEL 3. OUTCOME 3 - MAGNETISM and INDUCTION

Transcription:

Physical Modelling with Simscape Rick Hyde 1 2013 The MathWorks, Inc.

Outline Part 1: Introduction to Simscape Review approaches to modelling Overview of Simscape-based libraries Introduction to physical networks Simscape tutorial: DC motor Part 2: Application examples PMSM and drive Landing gear extension/retraction Engine cooling system 2

Designing physical systems Multi-domain Mechanical Electrical R 6 5 Hydraulic/pneumatic Thermal 2 4 3 1 Modelling environment Multi-domain Mix with algorithms/control Multiple levels of fidelity Optimization tools Code generation 3

Data-driven versus physics-based modelling Data sources Data-driven Experimental data External tool (complexityreduction exercise) Complex behaviour with many unknowns Examples Combustion engine Aerodynamics Physics-based Mathematical paradigms ODEs & DAEs State charts Physical networks Behaviour is adequately approximated by limited set of equations Examples Algorithms/control Gears & clutches E( x, ) x f ( x, u, ) 4

Extending Simulink using Simscape Equation set x Simulink f Explicit equation Relevance e ( x, u, ) Single body motion Multiple-body motion when there is compliance Most algorithms (control) Simscape extension Equation set E( x, ) x f ( x, u, ) Implicit equation Relevance 1-D multi-body systems e.g. drivelines Electrical networks Hydraulic/pneumatic networks s1 s2 s3 5

What does this model represent? 6

What does this model represent? 7

Modelling an electrical circuit in Simulink Step 1: figure out the equations Step 2: build the model 8

Modelling an electrical circuit in Simscape Build the model 9

Modelling an electrical circuit in Simscape Component equations from library blocks Additional constraints from circuit topology 11

Algebraic loops in Simscape Simscape converts entire network to equations and solves them simultaneously, so it intrinsically solves algebraic loops. 12

Signal-based modelling methods pose challenges Very flexible, but can be difficult to use efficiently Requires expertise in several areas Physics, math, programming Deriving system level equations is difficult and error prone Resulting model can be difficult to read and maintain 13

Physical modelling methods ideal for plant models Build accurate models quickly System-level equations derived automatically Model is easier to read Reflects structure of system Easier to update model New technologies or designs can be easily incorporated into the model 14

SimPowerSystems SimMechanics SimHydraulics SimDriveline SimElectronics Simscape libraries Simscape MATLAB, Simulink 15

Extensive Component Libraries SimElectronics > 90 component models Actuators, drivers Sensors Semiconductors Integrated circuits Models look like schematics Easy to read and interpret 16

Generate Code Use Simulink Coder to convert models into C code Share with other users (Model Reference) Protect intellectual property u u s1 s2 s3 Controller s1 s2 s3 Plant.DLL (Simulink) Model Reference Protected Mode Alternative: ssc_protect Run hardware-in-the-loop simulations u s1 s2 s3 17

Outline Part 1: Introduction to Simscape Review approaches to modelling Overview of Simscape-based libraries Introduction to physical networks Simscape tutorial: DC motor Part 2: Application examples PMSM and drive Landing gear extension/retraction Engine cooling system 18

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 19

Through & across variables by domain Domain Through Across Electrical Current Voltage Hydraulic Flow rate Pressure Rotational mechanical Torque Angular speed Translational mechanical Force Translational speed Pneumatic Mass flow Heat flow Pressure Temperature Magnetic Magnetic flux Magneto motive force Thermal Heat flow Temperature 20

Components Domain (across, through) Resistance Inductance Capacitance Electrical (v, i) Resistor Inductor Capacitor Rotational mechanical? Translational mechanical Hydraulic Resistance (R) dissipates power. R=voltage/current (ratio of across to through) 21

Components Domain Resistance Inductance Capacitance Electrical (v, i) Resistor Inductor Capacitor Rotational mechanical (w, trq) Rotational damper Translational mechanical Hydraulic 22

Components Domain Resistance Inductance Capacitance Electrical (v, i) Resistor Inductor Capacitor Rotational mechanical (w, trq) Rotational damper Translational mechanical (v, F) Hydraulic Translational damper 23

Components Domain Resistance Inductance Capacitance Electrical (v, i) Resistor Inductor Capacitor Rotational mechanical (w, trq) Rotational damper Translational mechanical (v, F) Translational damper Hydraulic (p, Q)? 24

Components Domain Resistance Inductance Capacitance Electrical (V, i) Resistor Inductor Capacitor Rotational mechanical (w, trq) Rotational damper Translational mechanical (v, F) Hydraulic (p, Q) Translational damper Hydraulic orifice p=kq n 25

Components Domain Resistance Inductance Capacitance Electrical (v, i) Resistor Inductor Capacitor Rotational mechanical (w, trq) Rotational damper? Translational mechanical (v, F) Hydraulic (p, Q) Translational damper Hydraulic orifice p=kq n Inductance keeps through variable flowing (current) 26

Components Domain Resistance Inductance Capacitance Electrical (v, i) Resistor Inductor Capacitor Rotational mechanical (w, trq) Rotational damper Rotational Spring Translational mechanical (v, F) Hydraulic (p, Q) Translational damper Hydraulic orifice p=kq n Inductance keeps through variable flowing (current) 27

Components Domain Resistance Inductance Capacitance Electrical (v, i) Resistor Inductor Capacitor Rotational mechanical (w, trq) Rotational damper Rotational Spring? Translational mechanical (v, F) Translational damper Translational spring Hydraulic (p, Q) Hydraulic orifice p=kq n Accumulator Capacitor maintains across variable (voltage) 28

Components Domain Resistance Inductance Capacitance Electrical (v, i) Resistor Inductor Capacitor Rotational mechanical (w, trq) Rotational damper Rotational Spring Inertia Translational mechanical (v, F) Translational damper Translational spring Mass Hydraulic (p, Q) Hydraulic orifice Accumulator Fluid inertia p=kq n Capacitor maintains across variable (voltage) 29

The inerter Invented by Prof Malcolm Smith, Cambridge University. Force is proportional to relative acceleration. 30

Outline Part 1: Introduction to Simscape Review approaches to modelling Overview of Simscape-based libraries Introduction to physical networks Simscape tutorial: DC motor Part 2: Application examples PMSM and drive Landing gear extension/retraction Engine cooling system 31

DC Motor: Modelling options 1. Use SimElectronics DC Motor block 2. Build an equivalent circuit using Simscape foundation library 3. Define a custom component using Simscape language Equation-based Composite 32

SimElectronics pre-built component 33

SimElectronics DC motor parameterization options Parameterized according to datasheet standards Multiple methods for assigning parameters Description, functionality and formulation provided in Help dialog 34

SimElectronics pre-built component example 35

Equivalent circuit based on Simscape foundation library components 36

Equation-based Simscape language component 1. Define equations 2. Define ports/connections 3. Define variables 4. Define parameters 5. Write block help 6. Add icon [optional] 7. Publish v = Ri + L di dt + kω 37

Equation-based Simscape language example 38

Equation-based Simscape language component v = Ri + L di dt + kω τ = ki 39

Composite Simscape language component Connect components in Simscape language file Refer to existing components Overwrite parameter values if necessary Connect components 40

Outline Part 1: Introduction to Simscape Review approaches to modelling Overview of Simscape-based libraries Introduction to physical networks Simscape tutorial: DC motor Part 2: Application examples PMSM and drive Landing gear extension/retraction Engine cooling system 41

PMSM and drive modelling Components PMSM Switching devices (IGBTs) Controller Tools SimPowerSystems System-level to support circuit and controller design SimElectronics Detailed switching device models fine-tuning and losses prediction 42

Complexity IGBT modelling I-V characteristic Piecewise linear Lookup table Physics-based Composite/complex Dynamics No dynamics Behavioural Constant capacitance Nonlinear charge model Complexity: Slower simulations, detailed parameterization required Higher-fidelity/better predictions 43

Complexity IGBT modelling SimPowerSystems Piecewise linear No dynamics or constant capacitance SimElectronics Nonlinear, physics-based, simple Datasheet parameterization Easily tuneable by optimization SPICE Composite from complex physics-based components Manufacturer NETLIST 44

pmsm_drive 45

System-level equivalent of PMSM and drive Example pmsm_drive suitable for Component design Electrical system design What about the system designer e.g. for a hybrid vehicle? Model the whole system and predict efficiency/performance Multiple drive cycles HIL test 46

Abstracted PMSM drive Energy-based Mechanical power out = power in minus losses Losses (physics-based analysis) Copper losses proportional to the torque Iron losses dependent on voltage and switching frequency Losses (empirical approach) Tabulate as function of torque and speed (and possibly DC volts) Table derived from detailed PMSM and drive model Assume torque is closed-loop controlled 47

Abstracted PMSM drive 48

sm_landing_gear 49

Landing Gear Design Model: Problem: Determine the force required of the hydraulic cylinder to meet system specifications Solution: Use Simulink, SimMechanics, SimHydraulics, and SimElectronics to design the system 50

Modeling Thermal Fluid Systems Thermal Liquid Library New domain and library for thermal liquid systems Single-phase liquids Fluid properties vary with temperature Applications Heat exchangers Pipelines 51

Engine cooling example 52

Challenges in Thermal Fluid Simulation Restrictions on block combinations Some combinations require fluid volumes at nodes Blocks sharing differential variables makes initialization difficult Pneumatic Domain Fluid Volume Volume usually required at node Poor behavior at regime changes, low flow rates, and flow reversals Zero crossing difficulties, solver issues Tube 1 Tube 2 Tube 3 Flow Direction Properties in Tube 2 depend on flow direction 53

Addressing challenges with full-flux method Each element contains a volume of fluid No fluid volumes at nodes Control volume approach used in each element Internal nodes defined Network nodes have no differential variables Power flux includes convection+conduction Smooth temperature variation of node temperature at zero flow Heat Mech. Fluid Volume BoundaryA BoundaryB Thermal Fluid Internal Node Thermal Fluid Temp. A Temperature Temp. B Node Temp. Convection dominates Conduction dominates mdot 54

Simscape language best practice Build incrementally Write test scripts/harnesses Avoid discontinuities Use appropriate level of fidelity Write out equations for custom blocks before building 55

Conclusions Simscape extends Simulink to Support a network approach Create models that topologically match the physical system Create component models by Using ready-made blocks from MathWorks libraries Constructing composite components from Simscape foundation library blocks Writing custom equations in Simscape language All the benefits of Simulink apply e.g. Code generation Tight integration with MATLAB 56

LINKS Physical modelling central web-page: http://www.mathworks.co.uk/physical-modeling/ Essentials of physical modelling: http://www.mathworks.co.uk/help/physmod/simscape/ug/essential-physicalmodeling-techniques.html 57

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 58

Zero-Crossing Statistics Log zero-crossing statistics for Simscape networks Shows when ZCs occur Can help indicate location of simulation bottlenecks 59

Local Solvers Improve Simulation Performance Use fixed-step, implicit solvers locally on Simscape networks Use implicit solvers only where necessary Configure solver per physical network Run different physical networks at different sample rates Electrical (higher), mechanical (lower) Primary benefit is to speed-up simulations where fixed-step solvers are required, like HIL Variable step, implicit (ODE15s) Controller Physical Network Physical Network Fixed step, explicit (ODE1) Local fixed step Fixed-step, implicit (ODE14x) implicit solver #1 Controller Physical Network Physical Network Local fixed step implicit solver #2 Generated Code 60