Professional Documents
Culture Documents
Plexim GmbH
Outline
Variable-step simulation
Ideal switches
Piecewise linear simulation
2.
Controller design
3.
Choice of components
Power input
vi
ii
Power
converter
Power output
io
Control
signals
Controller
3
vo
Load
Measurement
Reference
Simulation steps:
1160 " 153
Computation time:
0.6s " 0.08s
6
Switch conducting
Diode conducting
Transistor conducts
Diode blocks
Transistor opens
Impulsive voltage across
inductor
10
Transistor open
Diode conducts
11
12
Zero-Crossing Detection:
Time-step is reduced
Diode opens exactly at
the zero-crossing
13
1
s
y
B
D
g
PLECS S-function
14
Switch manager
Solver Overview
Continuous solvers
Taylor series polynomial
Step size control
Acceptable error
Relative, absolute tolerance
Output refining
Discrete solvers
Trapezoidal rule
Step size selection
15
1st order
5th order
y=sin(x)
Taylor series:
Source: Wikipedia
16
!"#$%
!&#$%
'()"
'(
*()"
*(
$()"
$(
17
Solver Settings
18
Acceptable Error
Local error
Difference between 4th and 5th order solutions
Acceptable error
Defines the local error limit
Determined by tolrel except for small state values
Local error
Acceptable error
19
20
Tolerances
Relative tolerance
Determines acceptable error limit when x > 0
Start with 10-3 (0.1%)
Numerical limit is 10-16
Absolute tolerance
Best to set to auto
21
Example LC circuit
Analytical solution:
22
Example LC circuit
Analytical solution:
23
24
Solver Families
Non-stiff
Inherently more efficient (no iteration required)
Smaller stability domain
Forward Euler - 1st order
ode45/Dopri - 5th order
Stiff
Less efficient (iteration required)
Larger stability domain
Backward Euler - 1st order
Radau/ode23tb - 5th order
25
Forward Euler
Truncate the Taylor Series
after the first term:
26
Numerical Experiment
Scalar system
Analytical solution
Forward Euler
27
Stability Analysis
Autonomous LTI system
Analytical solution
Analytically stable if
28
30
0.299999999999999989
0.200000000000000011
0.100000000000000006
= -0.000000000000000028
31
a+b+c
32
Backward Euler
Develop Taylor Series
around a time in the future:
33
34
35
Stability Domain
Dopri
Tustin
Radau
36
37
Event Detection
Define auxiliary functions that help locate discontinuities.
Function zeros must coincide with the discontinuities.
38
0
Time step1
Time step2
Output
0
39
Output
40
PWM Generation
41
Trapezoidal Rule
"&'(
"&
"#$%
!
$&
$&'(
42
Continuous waveform
Highest transient frequency constrains sample time
Set tsample < ttransient/10
Integration underestimate approx 3%
Switched system
Switches turned on at sample instants
Set tsample < tsw/100
43
Discrete: ts = 50s
Simulated current
44
Conclusion
Variable step solver operation
Causes of model stiffness
Solutions to stiffness
Explicit (non-stiff) vs. Implicit (stiff) solvers
Limits of stability
Limits of numerical accuracy
Event detection
45
Plexim GmbH
46
Introduction
The problem
Large simulation models can become slow
Many states, detailed component models
47
48
Reference:
49
50
Model Tuning
Simulation settings.
Choose the correct solver.
Blockset
Standalone
Non-stiff
ode45
Dopri
Stiff
ode23tb/ode15s
Radau
51
52
Procedure
Average inverter model.
Average space vector modulation.
Break algebraic loops.
53
54
Inverter Leg
d.T
Vdc
d.Vdc
ia
d.ia
d=0.3
55
56
57
58
Overmodulation
Add zero-sequence signal to modulation index
Reference: Vector Control of a Double-Sided PWM Converter and Induction Machine Drive, R. Ottersten
59
Algebraic Loops
What?
Multiple direct feedthrough blocks connected in a loop.
PLECS continuous inputs appear as a direct feedthrough system to
Simulink.
In feedback control systems, this will cause an algebraic loop.
60
Equations
I2 = (1 - d)/I1
V1 = (1 - d)/V2 !
62
63
Continuous PWM
=> 52 % faster
65
Block Diagram
PWM
Stiff system
Simulated for 0.2 s in PLECS Blockset & Standalone
66
Conclusion
Choose the right solver for the job (stiff or non-stiff)
Use sampled PWM
Make appropriate simplifications
For extremely large models:
PLECS Standalone
Real-time workshop
Averaged converter modeling
69
Plexim GmbH
70
71
Power semiconductors
Conduction loss
Switching loss
72
Semiconductor Losses
Gate signal
Switching loss
Conduction loss
73
Switching Losses
Switching energy loss dependent on:
Blocking voltage, device current, junction temperature, gate drive
Eon = f(Vce, Ic, Tj, Rg)
Turn on
Turn off
74
kA
3.0
4.5
VPK = 3800V
3.0
2.0
VDC = 2 kV
1.5
1.0
TJ = 125C
0.0
Courtesy ABB
0.0
5
tf ! 2.5s, ttail ! 7s
10
15
75
76
77
78
Off-state loss
Negligible - low leakage current
79
80
!!
!!
!!
!"
!!
!!
#
82
83
"t = 1.4
"t = 1.4
Experimental results
Acknowledments: Dr. Fabio Carastro, University of Nottingham
84
85
Thermal Domain
Thermal circuit analogous to electrical circuit.
Thermal and electrical circuits solved simultaneously.
86
87
IGBT Plate
Heatsink
Dual IGBT
module
88
Foster equivalent
89
90
Reference: M. Mrz and P. Nance, Thermal modeling of power electronic systems, www.iisb.fraunhofer.de
91
92
93
Implementation
Based on a C-Script block
Conduction and switching losses measure with a Probe
94
95
!
!
Iterative solution
Newton iteration
97
98
Po=100W
P2=95W
Efficiency:
99
Pi=100W
Po,P2=100W
Efficiency:
100
Pi=100W
Po,P2=100W
Thermal feedback:
Efficiency:
101
102
Datasheets
Given for a specific gate resistance and stray inductance
Good approximations can be made by extrapolating
manufacturers data (or asking for complete loss
measurements)
103
Conclusion
Fast & accurate thermal simulation using lookup tables
Operation of a combined electrical-thermal simulation
Calculating average device losses
Steady state analysis using Newton Raphson analysis
104
Plexim GmbH
105
Advanced Tools
C-Script block
Control design tools
Steady-state analysis
AC sweep
Impulse response analysis
Loop gain analysis
Other
Subsystem - custom components
106
Gain/phase
margins met?
107
Frequency Sweep
Algorithm:
For each frequency:
1. Run steady-state analysis
2. Apply sinusoidal perturbation
3. Extract system response using Fourier analysis
Caveats:
Period length: least common multiple of system period and
perturbation period
Computationally expensive
108
Transfer function:
109
111
Stability Verification
Loop Gain
Use Loop Gain Analysis Tool (Blockset)
AC Sweep (Standalone), or
Calculate using plbode function
Measure gain and phase margins to check stability
112
Custom Components
Why?
Support the top-down design approach
Easy to reuse, configure and measure
113
4
3.5
Current (A)
3
2.5
2
1.5
1
0.5
0
1
0.5
0
Insolation (kW/m2)
25
20
15
Voltage (V)
114
10
115
C-script Block
Plexim GmbH
116
117
118
Integration loop
Executed if continuous states defined in settings
Used for solving continuous differential equations
Continuous states used for declaring DEs
119
120
121
Continuous
Value: 0
Inherited from solver
Variable
Value: -2
At each time step the NextSampleHit must be specified.
122
123
+ ...
Solution
Use a hybrid fixed/variable step setting for PWM block
124
Macros
For interacting with model or solver
Examples
Input(0)
Output(0)
NextSampleHit
CurrentTime
125
126
Control Strategy
127
C-script block2
C-script block1
128
129
1: S1, S4 on
-1: S2, S3 on
130
>
v1
External event
C-Script
State machine
Time setting:
Simulation model: variable
C-Script: continuous
>
i1
if (IsMajorStep)
test_input(v1,i1);
update_state_machine();
131
Conclusion
Implement complex nonlinear and/or piecewise
functions without complex block diagrams
Model custom components and controls
Generate efficient sequencing with exact but flexible
time step control
State machine modeling
Incorporate external C code for hardware controllers
132