Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as...

56
1 © 2015 The MathWorks, Inc. Developing Fit-for-Purpose Simscape™ Models to Support System and Control Design Rick Hyde

Transcript of Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as...

Page 1: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

1© 2015 The MathWorks, Inc.

Developing Fit-for-Purpose

Simscape™ Models to Support System and Control Design

Rick Hyde

Page 2: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

2

Overview

Matching engineering design tasks to models

Examples

– Hybrid vehicle powertrain - with focus on need for multiple models

– Photovoltaic system - with focus on plant design and control

Tutorial – faulted DC motor

Page 3: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

3

Models must be matched to the engineering design task

Design task: Predict & optimize system performance

Model requirements:• Faster than real-time for drive cycle analysis• Component efficiency information as function of operating point

Page 4: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

4

Models must be matched to the engineering design task

Design task: Assess a

disruptive/novel actuation technology

Model requirements:• Torque-speed characteristics• Linearizable->frequency

response• Predict losses and heat

• Assess failure modes

Page 5: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

5

Models must be matched to the engineering design task

Design task: control

system design

Model requirements:• Linearizable• Include relevant

dynamics• Key tolerances &

uncertainties defined• Physics readily

understandable (no black boxes)

Page 6: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

6

Models must be matched to the engineering design task

Design task: reliability

assessment

Model requirements:• Operating limits• Tolerances• Fault behaviours• Behavioural fault triggering

Page 7: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

7

MathWorks is committed to supporting diverse modelling requirements

Linearizable

Deployable

Architecturally reconfigurable

Abstractable to mapped model

Configurable fidelity

FaultableCapture operating limits and apply tolerances

Datasheet-driven parameterization

Measurement-based parameterization

Design data import from specialist tool

Page 8: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

8

Overview

Matching models to engineering design tasks

Examples

– Hybrid vehicle powertrain - with focus on need for multiple models

– Photovoltaic system - with focus on plant design and control

Tutorial – faulted DC motor

Page 9: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

9

Hybrid vehicle powertrain example1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

Architecture selection

Compare series, parallel and power-split

Re-use same set of subsystems (battery, motor, engine etc)

i.e. an architecturally

reconfigurable model

Enabled by Simscape™ physical connections

Page 10: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

10

Battery

Datasheet-driven blocks from Simscape Electrical™

Option to model temperature & cooling

Hybrid vehicle powertrain example

1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

>>sscfluids_ev_battery_cooling

200 x real-time

Page 11: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

11

DC-DC Converter

Datasheet-driven blocks from Simscape Electrical™

Hybrid vehicle powertrain example

1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

Page 12: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

12

PMSM Motor and PMSM Generator

Datasheet-driven blocks from Simscape Electrical™

Hybrid vehicle powertrain example

1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

Page 13: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

13

Power-Split (planetary gear)

Datasheet-driven blocks from Simscape Driveline™

Hybrid vehicle powertrain example

1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

“A Review of Formulas for the Mechanical Efficiency

Analysis of Two Degrees-of-Freedom Epicyclic GearTrains“, Pennestri, Valentini

Page 14: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

14

Vehicle and Drive Cycle

System-level blocks from Simscape Driveline™

Automotive-specific blocks from Powertrain Blockset™

Hybrid vehicle powertrain example

1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

Page 15: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

15

Hybrid vehicle powertrain example1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

Optimize selected architecture

Sensitivity of drive cycle efficiency to key design parameters e.g. battery weight

Direct optimization of key design parameters

Enabled by MATLAB® scripting and Optimization and Global Optimization Toolboxes

Page 16: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

16

Battery

Measurement-based blocks from Simscape Electrical™

Hybrid vehicle powertrain example

1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

Page 17: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

17

PMSM Drives

Three constituent parts

Modelling fidelity must be sufficient to:

– Predict overall drive efficiency

– Predict electrical harmonics at DC supply

– Predict torque ripple applied to load

– Ensure components stay within operating limits

Hybrid vehicle powertrain example

1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

Page 18: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

18

PMSM Motor

Magnetic finite element level model required to:

– Determine flux linkage as function of currents and rotor angle

– Determine iron losses as function of load and speed

Import into Simscape using the Simscape Electrical™ FEM-Parameterized PMSM block (Design data import from

specialist tool)

Hybrid vehicle powertrain example

1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

Page 19: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

19

Simscape ElectricalImport from Maxwell (ANSYS)

>> elec_import_fem_maxwell

Data inANSYS Format

Maxwell

Export

Restructure intoMATLAB variables

>> elec_import_fem_motorcad

Page 20: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

20

Semiconductor switching devices

Artefacts that must be modelled to predict timing and losses:

– Non-linear I-V characteristics

– Non-linear charge characteristics

Modelling options

– Tabulated I-V and capacitance

– Imported SPICE subcircuits

Hybrid vehicle powertrain example

1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

Page 21: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

21

Simscape ElectricalSPICE Import

Convert SPICE models into Simscape components

– Command subcircuit2ssc

– Converts subcircuit definition to a

Simscape Language component

R2008a

Library

R2018b

Language

Netlist

Page 22: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

22

PMSM Drive Test Harness

Hybrid vehicle powertrain example

1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

Page 23: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

23

Vehicle

Simscape Multibody™

– Steering and suspension design

– Determine torque ripple coupling to steering and chassis

Hybrid vehicle powertrain example

1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

>> sm_double_wishbone_suspension

Page 24: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

24

Design validation

Revise system-level model (Abstractable to mapped model)

– Update drive cycle efficiencies, predicted range etc.

Validate detailed components deployed in full vehicle simulation

– Components must stay within permitted operating points (Capture

operating limits and apply tolerances)

– Assess impact of detailed component behaviour at system level

(Configurable fidelity)

HIL and simulator testing

– Simulink Coder deploys controllers and physical models to hardware

(Deployable)

– Abstraction of chassis if needed using Vehicle Dynamics Blockset™

(Configurable fidelity)

Hybrid vehicle powertrain example

1.Trade-off studies/select architecture

2. Optimize selected architecture

3. Detailed component design

4. Design validation

Page 25: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

25

Overview

Matching models to engineering design tasks

Examples

– Hybrid vehicle powertrain - with focus on need for multiple models

– Photovoltaic system - with focus on plant design and control

Tutorial – faulted DC motor

Page 26: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

26

MathWorks is committed to supporting diverse modelling requirements

Linearizable

Deployable

Architecturally reconfigurable

Abstractable to mapped model

Configurable fidelity

FaultableCapture operating limits and apply tolerances

Datasheet-driven parameterization

Measurement-based parameterization

Design data import from specialist tool

Page 27: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

27

Overview

Matching models to engineering design tasks

Examples

– Hybrid vehicle powertrain - with focus on need for multiple models

– Photovoltaic system - with focus on plant design and control

Tutorial – faulted DC motor

Page 28: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

28

Photovoltaic generator

Task: Assess/check stability margins

Solution #1: Linearize and view Bode plot using Simulink Control Design

Solution #2: Run a frequency-response identification exercise

Page 29: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

29

Photovoltaic generatorSolution #1: Linearize and view Bode plot using Simulink Control Design

1. Remove switching

– Simscape Electrical

average-value converters

2. Add linearization I/O

– Simulink Control Design

analysis points

3. Define operating point

– Simulate to desired

operating point

4. Linearize

– Launch Simulink Control

Design UI

Page 30: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

30

Photovoltaic generatorSolution #1: Linearize and view Bode plot using Simulink Control Design

1. Remove switching

– Simscape Electrical

average-value converters

2. Add linearization I/O

– Simulink Control Design

linear analysis points

3. Define operating point

– Simulate to desired

operating point

4. Linearize

– Launch Simulink Control

Design UI

Page 31: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

31

Photovoltaic generatorSolution #1: Linearize and view Bode plot using Simulink Control Design

1. Remove switching

– Simscape Electrical

average-value converters

2. Add linearization I/O

– Simulink Control Design

analysis points

3. Define operating point

– Simulate to desired

operating point

4. Linearize

– Launch Simulink Control

Design Model Linearizer UI

Page 32: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

32

Photovoltaic generatorSolution #1: Linearize and view Bode plot using Simulink Control Design

1. Remove switching

– Simscape Electrical

average-value converters

2. Add linearization I/O

– Simulink Control Design

analysis points

3. Define operating point

– Simulate to desired

operating point

4. Linearize

– Launch Simulink Control

Design Model Linearizer UI

Page 33: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

33

Photovoltaic generatorSolution #2: Run a frequency-response identification exercise

1. Add a Simulink Control Design Frequency

Response Estimator

block.

2. Configure for frequency points and sample time.

3. Run the model.

Page 34: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

34

Photovoltaic generatorSolution #2: Run a frequency-response identification exercise

1. Add a Simulink Control Design Frequency

Response Estimator

block.

2. Configure for frequency points and sample time.

3. Run the model.

Page 35: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

35

Overview

Matching models to engineering design tasks

Examples

– Hybrid vehicle powertrain - with focus on need for multiple models

– Photovoltaic system - with focus on plant design and control

Tutorial – faulted DC motor

Page 36: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

36

Faultable DC Motor

Requirements

– Normal behaviour as example ssc_dcmotor

– Faulted behaviour: one winding open-circuit

Non-requirements

– Transients and electrical noise due to brushing

Solution

1. Convert DC Motor subsystem to a Simscape component

2. Modify the component to be faultable

Page 37: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

37

Add

mask

Convert subsystem to Simscape componentsubsystem2ssc Function

subsystem2ssc(gcb)

Page 38: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

38

Convert subsystem to Simscape component

Page 39: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

39

Convert subsystem to Simscape component

Page 40: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

40

Convert subsystem to Simscape component

Page 41: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

41

Convert subsystem to Simscape componentUse Simscape Component block to instantiate

Page 42: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

42

Convert subsystem to Simscape componentLabel and order the ports

Page 43: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

43

Faultable DC Motor

Requirements

– Normal behaviour as example ssc_dcmotor

– Faulted behaviour: one winding open-circuit

Non-requirements

– Transients and electrical noise due to brushing

Solution

1. Convert DC Motor subsystem to a Simscape component

2. Modify the component to be faultable

Page 44: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

44

Faultable DC Motor

Requirements

– Normal behaviour as example ssc_dcmotor

– Faulted behaviour: one winding open-circuit

Non-requirements

– Transients and electrical noise due to brushing

Solution

1. Convert DC Motor subsystem to a Simscape component

2. Modify the component to be faultable

Page 45: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

45

Modify the custom component to be faultableRequirements & functional design

Fault behaviour

– Path seen by brushes goes open

circuit for 120 degrees of rotation

Implementation

– Represent this with a custom resistor

with resistance dependent on rotor

angle

Page 46: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

46

Custom resistor

>> sscnewfile(‘FaultableResistor’,’foundation.electrical.elements.resistor’)

Page 47: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

47

Custom resistor

To do:

1. Add a variable for rotor

angle.

2. Add a parameter for faulted

resistance.

3. Make resistance a function

of rotor angle.

4. Add logic to enable the

fault.

Page 48: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

48

Custom resistor

To do:

1. Add a variable for rotor

angle.

2. Add a parameter for faulted

resistance.

3. Make resistance a function

of rotor angle.

4. Add logic to enable the

fault.

Page 49: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

49

Custom resistor

To do:

1. Add a variable for rotor

angle.

2. Add a parameter for faulted

resistance.

3. Make resistance a function

of rotor angle.

4. Add logic to enable the

fault.

Page 50: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

50

Custom resistor

To do:

1. Add a variable for rotor

angle.

2. Add a parameter for faulted

resistance.

3. Make resistance a function

of rotor angle.

4. Add logic to enable the

fault.

open_circuit is zero for 1/3 of a revolution, otherwise one.

Switch between armature resistance and faulted resistance values

Advanced: note use of “gt” rather than “>” in conditional.

This takes out zero crossings which would cause numeric issues around zero speed.

Page 51: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

51

Custom resistor

To do:

1. Add a variable for rotor

angle.

2. Add a parameter for faulted

resistance.

3. Make resistance a function

of rotor angle.

4. Add logic to enable the

fault.

Page 52: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

52

Custom resistor

Page 53: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

53

Integrate custom resistor into custom DC motor

To do:

1. Replace standard resistor

with the faultable resistor.

2. Pass faultable resistor

parameters to DC motor

interface.

3. Add an equation that

defines rotor angle.

4. Create a test harness and

validate.

Page 54: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

54

Faultable DC Motor – Test Harness

Test:

– Drive motor at fixed 5rpm

– Measure torque

Page 55: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

55

Summary

Matching models to engineering design tasks

Examples

– Hybrid vehicle powertrain - with focus on need for multiple models

– Photovoltaic system - with focus on plant design and control

Tutorial – faulted DC motor

Page 56: Developing Fit-for-Purpose Simscape™ Models to Support ......– Determine flux linkage as function of currents and rotor angle ... – Assess impact of detailed component behaviour

56

How to find out more

MathWorks physical modelling page:– https://www.mathworks.com/solutions/physical-modeling.html

Steve Miller’s introduction video– https://www.mathworks.com/videos/physical-modeling-introduction-75883.html

MATLAB Central File Exchange– https://www.mathworks.com/matlabcentral/fileexchange/

Hybrid vehicle example:– https://uk.mathworks.com/matlabcentral/fileexchange/28441-hybrid-electric-vehicle-model-in-simulink