Professional Documents
Culture Documents
PLECS-piece-wise Linear Electrical Circuit Simulation For Simulink PDF
PLECS-piece-wise Linear Electrical Circuit Simulation For Simulink PDF
-
PLECS Piece-wise Linear Electrical Circuit Simulation for Simulink
Jost H. Allmeling and Wolfgang P. Hammer
Power Electronics and Electrometrology Laboratory
Swiss Federal Institute of Technology (ETH) Zurich
8092 Zurich, Switzerland
Abstract - In this paper a new toolbox, PLECS, for the fast The Power System Blockset models semiconductors and
simulation of power electronic circuits under Simulink is present- switches as inductances in parallel with current sources to
ed. This toolbox provides the means for modeling large power make the simulation continuous even during switching actions.
electronic systems containing both electrical circuits and control- When simulating complex power electronic systems, however,
lers. The program is based on a state-space formulation for cir- the processes during switching are of little interest. Here, the
cuits that consist of linearelements (RLC), transformers, sources,
use of ideal instantaneous switches is more appropriate. Firstly
meters, and ideal switches. Diodes,thyristors, IGBTs and other
nonlinear elements such as saturable inductors can be assembled this yields systems that are linear between two switching in-
by combining linear elements and switches. Thus, a piece-wise stances. Secondly, to handle the discontinuities at the switch-
linear model is attained which leads to a stable and fast simula- ing instances only two integration steps are required. Both
tion. An attached benchmark simulation demonstrates the capa- speed up the simulation considerably. The application of ideal
bility of PLECS. switches in circuit simulation programs has been described in
[2]-[4]. To achieve the goal of improving simulations under
Simulink by the use of ideal switches, a new tool had to be de-
I. INTRODUCTION
veloped.
The development of power electronic systems usually in-
volves the design of both the electrical circuit and the control 11. USING PLECS
algorithms. To study the behavior of these systems thoroughly
This paper presents PLECS, a toolbox for piece-wise linear
simulation is essential.
simulation of electrical circuits within the Simulink environ-
For the simulation of purely electrical circuits powerful pro- ment. Circuits to be simulated with PLECS may consist of ide-
grams like Spice and Saber exists. They allow the user to enter al resistors, inductors, capacitors, transformers, voltage and
the circuits as netlists or schematics. However, incorporating current sources, meters, and switches. These latter elements -
complex control structures requires a thorough knowledge of sources, meters, and switches - form the interface between the
the specific program. electrical circuit and the control system. This points towards
Simulink, an extension to Matlab, is a program for simulat- modeling the electrical circuit as one single Simulink sub-
ing dynamic systems. It is widely used for the simulation of system. Its inputs are the commands for controlled sources and
control systems, since even complex structures can be built switches. Measurements taken by the volt- and ammeters are
easily and Matlab provides powerful evaluation of the simula- provided as the subsystem’s outputs.
tion results. Therefore, Simulink is also convenient for the de- Circuits are defined by an input file which has a format sim-
sign of closed loop controlled power electronic systems. ilar to the Saber input file format. They can be arbitrarily as-
However, systems containing electrical circuits cause difficul- sembled using the built-in ideal components or user-defined
ties, in that they cannot be modeled in a straightforward way. templates. Templates are compound components or sub-cir-
Simulink accepts neither schematics nor netlists for electrical cuits that in turn consist of templates or built-in components.
circuits. Instead they must be represented by mathematicalfor- PLECS provides linear elements and switches. At any time
mulae - be it state-space equations or nodal formulation - the switches in PLECS are either short or open circuits. This
which must be set up individually for every topology. This pro- means that before and after the instant of switching the circuit
cess is time-consuming and error-prone. is purely linear and hence its overall behavior is piece-wise lin-
Since summer 1998 the Power System Blockset is available ear.
[l]. This toolbox allows the user to combine the electrical sys- Nonlinear components, e.g. a saturable inductor, may be ap-
tem and the controller in one system model by entering the cir- proximated as piece-wise linear by combining linear elements
cuit diagram at Simulink block level. Although the Power and switches. True nonlinearities must be modelled by voltage
System Blockset also contains components such as diodes and controlled current sources (or vice versa), the characteristics of
GTOs the extensive use of these elements leads to very long which are computed in an external feedback loop. This meth-
simulation times. Furthermore, ideal elements like switches re- od, however, reduces the performance and should therefore be
quire snubber circuits to make the simulation converge. Thus, used minimally.
this toolbox is not well suited for simulating large power elec- Switches are also the basis for power electronic compo-
tronic systems. nents. They can be controlled externally or internally or a com-
355
bination of both. External in this context means that the control
signal does not directly depend on voltages or currents in the
circuit but is instead supplied by the overlaying control system.
Examples for externally controlled switches are breakers and
half-bridges of VSIs. Internal control variables are voltages or
currents that can be measured in the circuit. The simplest ex-
ample of a purely internally controlled switch is a diode, which
is switched on by a positive voltage and off by a negative cur- Fig. 1: Buck converter
rent. Power electronic components such as thyristors, GTOs
and IGBTs operate according to a logical combination of ex-
ternal and internal switching conditions.
356
T For example, for a conducting transistor (i.e. vT = 0 ) and a
y = [vout iouJ (output variables) (5) blocking diode (i.e. i, = 0 ) the specific equation system has
the following form, where the matrices A , , B , , C , , D , are
s = [vs idT (undetermined switch variables) (6) indicated:
1 0 0 0 0 0 0 0
U = [v,, isrJT (input variables) (8)
1 0 0 0 0 0 0 0 0
(9)
0 1 0 0 0 0 0 0 0
I represents the identity matrix. The rows marked with X 0 0 1 0 0 0 0 0 0
contain additional information about the switch variables
0 0 0 1 0 0 0 0 0
which is of no further interest here.
0 0 0 0 1 0 0 0 0
Example: Buck Converter 0 0 0 0 0 1 0 0 0
10 0 0 0 010 0 0 1 0 -1 o]
This method is illustrated using the example of the buck
converter. The independent mesh and node equations are:
B. Implementation in Simulink
0 = VT-VD-V,, (10) The state-space equations are embedded in Simulink by
means of an S-Function which is entirely programmed in C.
iL.L = -vD-vC-iL. R (11) The interaction between this S-Function and Simulink is out-
lined in Fig. 5. At any integration step the actual states x and
0 = iT+iD-iL (12)
inputs U are fetched from the model workspace. The state de-
rivatives iare then computed according to (1) and passed on
vc.C = -vc.G+iL (13) to the Simulink solver. There, they are integrated along with
The output variables are: the control system. The user has the choice between various
solving algorithms offered in Simulink’s simulation parame-
ters menu.
At the same time, the system outputs y are calculated ac-
This yields the generic equation system: (15) cording to (2) and written back to the model workspace. The
switch manager decides which set of matrices has to be used.
This decision is based on the system outputs and the gate in-
puts g .
0 0 0 0 0 1 - 1 0 0 0 0 - 1
IV. CONTROL OF IDEAL SWITCHES
O L O O O 0 -1 0 0 -1 -R 0
0 0 0 0 0 0 0 1 1 0 - 1 0 The switch manager constantly monitors the system output
c o o o o 0 0 0 0 - G 1 0 and the gate signals and compares them with the thresholds
0 0 1 0 0 0 1 0 0 0 0 0 given in the switching conditions. The switching conditions
0 0 0 1 0 0 0 0 1 0 0 0 form the boundary of a specific topology’s validity. If any
boundary condition is violated the switch manager toggles the
0 0 0 0 1 0 0 0 0 0 1 0
respective switch(es).
357
It has been pointed out in section I11 that the number of pos-
sible topologies increases exponentially with the number of
switches used in the circuit. However, not all of these topolo-
gies are actually needed. Therefore it is not practical to calcu-
late all of them in advance. Instead, they are computed as they
are encountered during the simulation. The most recently used
matrices are cached in order to further reduce the computation-
al effort.
358
controlled both by internal and external conditions. For com-
parison both examples are also simulated with the Power Sys-
tem Blockset and with Saber. All simulations have been
performed on a Sun Ultra 1C/200 MHz.
3 59
C. Other Applications
-
projects, hard- and soft-switching converter and rectifier sys-
tems are investigated. Special interest is taken in the develop-
ment of fast control algorithms.
The largest of the simulation models consists of 24 switches
and 20 state variables. However, this is not a limit for the size
of systems that can be simulated with PLECS.
Fig. 10: 6-pulse controlled rectifier
VI. CONCLUSIONS
PLECS has been proven as a useful tool for the simulation line to line voltages
of arbitrary electric, especially power electronics circuits in a
Simulink control environment. Circuits are entered as netlists out@g
U
PLECS y d ?
c DC current
and seamlessly integrated into Simulink as S-functions. Thus, v-1-1
full benefit can be taken from Simulink’s highly accurate inte- 6-Pulse Rectifier
gration algorithms. alpha
Pulse
Switches are modeled as short and open circuits, the actual generator
state of which may depend on internal and external conditions.
The use of Simulink’s zero crossing detection ensures that the alpha i-en
exact switching instants are hit.
For models where ideal switches are to be simulated PLECS Pl-controller
i-ref
is superior to both circuit simulation programs such as Saber
and the existing Power System Blockset regarding speed, ac-
curacy and stability.
.
Fig. 11: Sirnulink model of the 6-pulse conuolled rectifier
30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
REFERENCES
CPU time
Saber 39.30 s
360