Você está na página 1de 46

MATLAB, Simulink, Simscape,

SimPowerSystems, xPC Target:


Modelizacin y prototipado de sistemas
elctricos y electrnicos de potencia

Hotel ME, Madrid


2 octubre 2012

2012 The MathWorks, Inc.1


MathWorks Vital Statistics

Developers of MATLAB & Simulink


2,400 staff worldwide
Support staff worldwide
Development staff in Natick, MA
30% of revenue invested in R&D
$700M annual revenue
2012 - orders from
23,000 companies
in 128 countries

22
Key Capabilities Drive MathWorks Business

Verification,
Validation,
Test and Model Code verification
and Test measurement checking Qualification kits

Automatic Rapid Embedded DSP software VHDL/Verilog PLC


Code
Generation
prototyping software code
and HIL

System
Simulink DSP designs State charts Physical Discrete-event modeling
Modeling and
Simulation
Communication modeling Video processing
systems

Data Analysis
and Algorithm
Control design Optimization Image Computational Computational
Development Signal processing Statistics processing finance biology

Application Student version Distributed and MATLAB


Technical
Computing MATLAB deployment Instrument and database parallel computing Mobile for
connectivity iPhone

1985 1990 1995 2000 2005 2010

Founded in 1984

3
MathWorks Investment in Magnetics Added
To Simscape
Physical Modeling Pneumatics Added
To Simscape

Simscape Language
Introduced

SimElectronics Thermal effects


Introduced optional ports

Code Generation
Advances
Simscape
Simscape Diagnostics
Introduced Improvements

SimHydraulics
Introduced

SimDriveline Simscape-Based
Introduced Library Introduced

3-D Visualization
SimMechanics SolidWorks ProEngineer Second Generation
Improvements
Introduced Translator Translator Technology
AutodeskTranslator

SimPowerSystems Electric Drives Ideal Switching Intf. Elements


Introduced Library Introduced Algorithm Introduced Editing Modes

1998 2000 2002 2004 2006 2008 2010 2012 2014


4
Optimize System-Level Performance

Actuators

Sensors
u + s1 s2
System
y
s3

Controller Plant

Simulating plant and controller in one environment


allows you to optimize system-level performance.
Automate tuning process using optimization algorithms
Accelerate process using parallel computing

5
Detect Integration Issues Earlier

Plant Plant
Specification Model

Actuators

Sensors
u + s1 s2
System
y
s3

Controller Plant

Controls engineers and domain specialists can work


together to detect integration issues in simulation
Convert plant models to C code for hardware-in-the-loop tests
Distribute models to other internal users without extra licenses
Distribute models to external users while protecting IP

6
Model-Based-Design Adoption Scenarios
Modeling & Simulation Adoption

Requirements- Virtual Verification System Validation Fully-leveraged


& Validation (re-application of tests or Model-Based Design
based V&V test plan from simulation-
(connecting models (using Simulation or
Analysis with system based testing to
to requirements, hardware-based testing,
testing reqs in sim, models & requirements)
easy comparison of
and modeling the results from Early Testing
requirements) to Hardware Testing)

Closed-loop Hardware-in-the- Simulation-based


System Simulation Loop Development
Simulation (plant-model code gen, (representing and analyzing the
(either simple plant maybe prototype code- system behavior, then
models or full system gen too) generating code for the portion
models) of interest)

Graphical Specs Design Prototyping Graphical


(algorithm code-gen for Programming
Algorithm HW-based prototyping) (graphically representing the
Modeling algorithm and generating code)
(no plant models)

Simulation Real-Time Testing Production

Code Generation Adoption


7
What is the Most Expensive
Project Stage to Find Errors In?
Errors introduced early but found late in
the process are expensive to fix!
Relative cost to fix an error

Errors introduced in:

coding phase

design phase

requirements phase

Requirements phase Design phase Coding phase Testing phase


Project phase where error is fixed

Source: Return on Investment for Independent Verification &


Validation, NASA, 2004.
8
Start Testing on Day One

RESEARCH REQUIREMENTS

DESIGN

Environment Models

Mechanical Thermal Electrical

TEST & VERIFICATION


Supervisory Logic

Control Algorithms

IMPLEMENTATION

Structured
C, C++ VHDL, Verilog
Text

MCU DSP FPGA ASIC PLC


TEST
SYSTEM

INTEGRATION

9
Early Verification of Concept
Predict dynamic system behavior by simulating
- Less physical prototypes
DESIGN
Use of simulation results for system design
Environmental Models - What / if studies
- Short iteration cycles
Mechanical Thermal Electrical

Control Algorithms Idea

Supervisory Logic

Simple
model

Detailed
model

10
Appropriate Methods of Modeling

Algorit
DESIGN hm
Devel
Environmental Models Control & filter
opme algorithms
nt
(Simulink)
Mechanical Thermal Electrical Data
Modeli
ng
Control Algorithms
Control & Supervisory
Supervisory Logic Logics (Stateflow)

Embedded Digital
Software Electronics
VHDL,
C, C++
Verilog

Electronical, thermal, MCUDSP FPGA


ASIC
mechanical systems
(Physical Modeling) Reuse
of legacy code
Integr
ation
& engineering data from
- Cosimulation
Implement V&V
- Exiting algorithms in
C, MATLAB
11
Integrated Control Design

Reuse of the model for extracting plant


description
Algorit
directly from model
DESIGN Automated
hm creation of a linearized small signal
Devel
equivalent model at selected operating points
Environmental Models opme
Interactive
nt and automatic control design
Data
Mechanical Thermal Electrical according Linear Control Theory
Modeli
ng
Control Algorithms

Supervisory Logic

Embedded Digital
Software Electronics
VHDL,
C, C++
Verilog

MCUDSP FPGA
ASIC

Robust control design by considering converter


Integr
ation
behavior at several operating points in parallel
Implement V&V

12
Test and validate in real-time
RESEARCH REQUIREMENTS

DESIGN

Environmental Models

Mechanical Electrical
Rapid Prototyping of Control Algorithms
Control Algorithms
Fast implementation of algorithms in
Supervisory Logic C & HDL for functional testing in RT

IMPLEMENTATION

VHDL, Structured
C, C++
Verilog Text

MCU DSP FPGA ASIC PLC


Hardware-In-The-Loop Testing of Plant

Capability of testing critical scenarios


without risk of damaging HW

13
Automatic Production Code Generation
RESEARCH REQUIREMENTS
General
Code generation in C/C++, HDL,
DESIGN IEC61131- Structured Text

Fast implementation by automatic


code generation from models
Support of fixed point data format
Control Algorithms
in simulation and code generation
Supervisory Logic
Prevention of implementation
errors
Algorithm development
independent of implementation HW
IMPLEMENTATION

VHDL, Structured
C, C++
Verilog Text
C-Code
MCU DSP FPGA ASIC PLC Integration of Legacy C/C++-Code
Automated integration with variety
of Embedded IDEs and P/DSP

14
Traceability from Requirements to Code
RESEARCH REQUIREMENTS
Linking Requirements with Model
Blocks and generated Code
DESIGN
Find corresponding locations
Environmental Models
easily in model and code
Mechanical Electrical

Control Algorithms

Supervisory Logic

IMPLEMENTATION

15
Benefits of Model-Based Design
RESEARCH REQUIREMENTS
Predict system behavior in
DESIGN
early development state
Environment Models

Mechanical Thermal Electrical


Handle system complexity

TEST & VERIFICATION


Supervisory Logic
Short iteration cycles
Control Algorithms

Less physical prototypes


IMPLEMENTATION

Structured
C, C++ VHDL, Verilog
Text Fast implementation by
MCU DSP FPGA ASIC PLC automatic code generation

Reuse of test cases


INTEGRATION

16
Modeling Physical Systems
With MathWorks Products

Modeling Approaches

First Principles Modeling Data-Driven Modeling

Physical Networks Statistical Methods


Programming (Model Based System
(MATLAB, C) (Simscape and other
Physical Modeling Calibration Toolbox) Identification
(System Identification
Block Diagram products) Toolbox)
(Simulink)

Modeling Language Neural Networks


(Simscape language) (Neural Network
Toolbox)
Symbolic Methods Parameter Tuning
(Symbolic Math (Simulink Design Optimization)
Toolbox)

17
Thinking outside the block
Physical network approach vs. Simulink block diagrams

Simulink Blocks are casual


Transfer functions
Input and output ports (signal flow)
Graphically model system equations

Physical Blocks are acausal


Bi-directional energy flow
Domain-specific physical ports
(electrical, hydraulic)
Graphically model system topology

18
Conservation is Physical

Simscape generalizes conservation laws across physical domains


i = 0 at every junction (where i is the through variable)

Simscape pre-defined domains:


Port Type Across Variable Through Variable
Electrical Voltage Current
Hydraulic Pressure Flow rate
Mechanical Angular velocity Torque
(rotational)
Mechanical Translational velocity Force
(translational)
Pneumatic Pressure and temperature Mass flow rate and
heat flow
Thermal Temperature Heat flow
19
Simscape

20
SimPowersystems

21
Introduction to

SimPowerSystems

SimElectronics
SimMechanics

SimHydraulics

SimDriveline
SimPowerSystems
Enables physical modeling (acausal)
of electrical power systems
Simscape
and electric drives
MATLAB, Simulink
25kV

Electrical system topology


represented by schematic circuit Breaker 2250 HP
Load

Used by electrical, system 3.125 MVA, 2.4kV


and control engineers
to develop plant models
and test control systems

22
SimPowerSystems
Key Features
Comprehensive block libraries
for building power system models
Detailed models of common
AC and DC electric drives
Different simulation modes
to speed model execution
Ideal switching algorithm, enabling
fast simulation of power electronics
PowerGUI provides convenient tools
for common analysis tasks
Extensive set of demonstration
circuits and systems
23
Working with SimPowerSystems

SimPowerSystems is a tool for modeling


the generation, transmission, distribution,
and consumption of electrical power

With SimPowerSystems
you can:
Quickly build electrical power
system models
Model synchronous and
asynchronous electric drives
Perform common electrical
system analysis tasks
Develop and test controls
Generate code for improved performance
24
Quickly Build Electrical Systems

Build models that look like an


electrical schematic:
Three-phase components
Detailed electric drive models
Flexible AC Transmission Systems
(FACTS)
Parameterize model using
MATLAB variables
Connect to Simulink with
sources and sensors
Save subsystems for reuse
in other models or libraries
25
Model Electric Drives

Combine power electronics,


machine, and control algorithm
GUI to assign key parameters
Common strategies for
speed and torque control
Adjustable level of fidelity
(detailed, averaged)
Common machine types can be
used as motors or generators:
Permanent magnet
Synchronous, asynchronous
Induction
Single phase or 3-phase
26
Calculate Model Parameter Values
Asynchronous or PMSM Models
Calculates Data Values
Line to Line RMS Voltage 400 V
parameters for Nominal Frequency 50 Hz
equivalent circuit Full Load Current 194 A
Full Load Torque 352 N.m
directly from Synchronous Speed 2982 rpm
data sheet values
Plot torque speed
relationship
Automatically update
machine model

Compute Block Parameters Apply to Selected Block

27
Electrical System Analysis

Quick access to tools for


common analysis tasks:
Display steady-state V and I
Display and modify initial states
Perform load flows
Display impedance measurements
FFT analysis
Report generation
Multiple simulation modes
Discrete and phasor modes
enable you to speed up simulations

28
Improve Simulation Performance

Ideal switching algorithm


Efficiently recalculate state-space matrix
based on states of switches
Displays equations to command window

Enables simulation of
ideal switches
Faster simulations
(explicit solver, larger time steps)
Does not require difficult parameter
A1x + B1u A2x + B2u
values (snubber, etc.)
Remove non-ideal effects, making
simulation results easier to interpret
29
Connecting
to Simscape
Electrical connection
via interface blocks
Add custom components
using Simscape language
Include other domains
Mechanical ports
Synchronous, asynchronous,
DC, and PMS machines

30
SimPowerSystems Supports
Simscape Editing Mode
Model Developer
Purchases Simscape
Share SimPowerSystems models and add-on products
with other Simscape users
Simulate, analyze, generate code
without purchasing extra licenses

Model using Simscape


Function Full Restricted and add-on products
Mode 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
Model Users
Generate code Yes Yes Purchases Simscape
Add/delete blocks from add-on products Yes No Add-on product installed,
Make or break physical connections Yes No No add-on purchases required
Change block parameterization options Yes No
Change Simscape Local Solver Yes No 31
Developing Control Systems

Implement high-fidelity, + s1 s2

nonlinear plant models u s3

Controller Plant

Extract linear model for use Ax+Bu=0


with linear control theory
Root Locus Bode Plot

Explore interaction between


control system and plant Real Axis Frequency

Optimize system performance

32
SimPowerSystems Demonstration
PM Synchronous Motor Drive (ac6_example.mdl)

Discrete solver provides fast,


accurate results.
33
SimPowerSystems Summary

SimPowerSystems

SimElectronics
SimMechanics

SimHydraulics

SimDriveline
Enables physical modeling
of electrical power systems
Simscape
Models look like power network schematic
MATLAB, Simulink
Three-phase, electric drives, FACTS, etc.
Solvers optimized for fast simulation
of high-speed switching electronics
Continuous, discrete, and phasor methods
Ideal switching algorithm
Many analyses are automated
Load flows, FFT analysis, and more
Combining with other physical modeling
tools to model multidomain systems
34
ABB Accelerates Application Control
Software Development for Power
Electronic Controller

Challenge AC 800PEC controller.


Adopt a more efficient development process using tools
that accelerate the design of new application software
for a high-powered electronic controller for power
converters
Solution
Use MathWorks tools to design and validate their control
algorithms while streamlining the application software
development process for the controller
Our system engineers can
Results program, simulate, and verify
Development times and costs reduced
the AC 800PEC controllers
Development process improved
Highly accurate code generated regulation software very rapidly
in MATLAB and Simulink.
Fritz Wittwer
ABB
Link to user story

35
Alstom Generates Production Code for
Safety-Critical Power Converter Control
Systems

Challenge
Design and implement real-time power conversion and
control systems for trams, metros, and railways
Pendolino tilting train.
Solution
Use MathWorks tools for Model-Based Design to design,
simulate, and automatically generate production code for
safety-critical transportation systems
When Alstom delivered a
Results Pendolino train to Czech
Development time cut by 50% Railways, the railway
Defect-free, safety-critical code generated and certified application was the first with
Common language established
automatically generated code
to receive TUV certification.
Han Geerligs
Alstom

Link to user story

36
Hydro-Qubec Models Wind Power Plant
Performance

Challenge
Plan the integration of new wind farms into the power
Turbines on a wind farm.
system, predict power output, and ensure safe, reliable
operation
Solution Accurate modeling is essential not
Use MathWorks products to simulate individual wind only for planning investments but
turbines and wind farms and to generate C code for also to detect situations that can
multiprocessor simulation of entire power systems
cause an outage. With MathWorks
Results tools, we can simulate power
Simulation speed increased to real time electronics, mechanics, and control
Equipment needs accurately predicted systems in one environment, and
Dynamic simulations enabled our models respond like the turbines
we have in the field.
Richard Gagnon
Hydro-Qubec
Link to user story

37
What is xPC Target?

2012 The MathWorks, Inc.


38
Model-Based Design: Early V&V is the Key
REQUIREMENTS

Verification & Validation


Design Test

Environment Testing
Design Integration
(HIL)
Verification Testing

Controller
Code
Verification

Implementation

Embedded
Software

C, C++

MCU DSP

39
Real-Time Testing Scenarios:
Functional Rapid Prototyping

Code
Execution
Generation
Host/Target
Real-time

Wiring and
Signal Conditioning

Real-Time Target Computer Production Plant Hardware 40


Real-Time Testing Scenarios:
Hardware-in-the-Loop (HIL) Simulation

Code
Generation
Code
Execution Generation
Host/Target/Target
Real-time

Wiring and
Signal Conditioning

ECU or MicroController Real-Time Target Computer 41


What is xPC Target?

1
Host xPC Target 3
computer on
with Target
MATLAB Computer
2

Ethernet or RS 232

Environment allows the real-time execution of Simulink models on a


separate PC-based target computer

42
What is xPC Target?

Host xPC Target


computer on
with Target
MATLAB Computer

Host
computer Ethernet or RS 232xPC Target
on
with Target
MATLAB Computer

Ethernet or RS 232

Environment provides interactive access between the real-time


application and the host computer
Allows live parameter tuning, control from the original Simulink
model and offline analysis support in MATLAB. 43
What is xPC Target?

Host xPC Target


2 computer on
with Target
MATLAB Computer

Ethernet or RS 232
4

2
3
1

Environment provides interactive access between the real-time


application and the host computer
Allows live parameter tuning, control from the original Simulink
model and offline analysis support in MATLAB. 44
What is xPC Target?

Host xPC Target


computer on
with Target
MATLAB Computer

Ethernet or RS 232

Environment provides numerous I/O device driver blocks


Blocks are easily configurable within the Simulink model and
communicate with actual hardware in real-time.
45
What is xPC Target?

xPC Target
on
Target
Computer

Environment provides numerous I/O device driver blocks


Blocks are easily configurable within the Simulink model and
communicate with actual hardware in real-time.
46

Você também pode gostar