2002 Teaching Nonlinear Modeling, Simulation, and Control of Electronic Power Converters Using MATLAB-SIMULINK
2002 Teaching Nonlinear Modeling, Simulation, and Control of Electronic Power Converters Using MATLAB-SIMULINK
Abstract—This paper describes an efficient method to teach SPICE simulation has, therefore, become a part of several
analysis and simulation of power electronic converters to un- power electronics courses. SPICE is fitted with physical models
dergraduate students, using system level nonlinear state-space of semiconductors and switching devices. Physical modeling
models. System-level modeling of power electronic converters re-
produces only the ideal switching behavior of the semiconductors produces well-detailed results, but leads to high calculation ef-
and is a useful concept for the numerical simulation of power con- fort and often introduces convergence problems during transient
verters, since simulations present no convergence problems and simulation (SPICE has 86% success rate [15]). To overcome
require little computational time. Switched state-space models, these convergence problems, the power semiconductors are
programmed in the MATLAB/SIMULINK software package, usually fitted with suitably designed snubbers. Students and
can be advantageously used to simulate power converters at
the system level and also to design and study their controllers. teachers [13], [14], [16] are, therefore, committed to solving
Switched state-space nonlinear models should be obtained using the convergence problems and to reducing the computing time
a theoretical framework suitable for the enhanced control of and memory needed, both time consuming tasks.
variable structure power systems. Since the method is inherently
With suitable snubber circuits and device values, SPICE
nonlinear, no approximated linear models are needed; and since
state-space models are used, modern control techniques (sliding is able to perform the time-domain, steady-state behavior
mode, neural networks, fuzzy logic) for power converters can and transient analysis needed to study most power electronic
easily be used. This paper summarizes the proposed methodology circuits. However, some built-in capabilities of SPICE, such
and gives some examples. as dc operating point and small signal ac frequency analysis,
Index Terms—Electronic power converters, power converter are not usable for power converters. SPICE ac frequency
control, power converter modeling, power converter simulation. analysis does not provide the dynamic transfer functions of
power converters, because of the switching operation of the
I. INTRODUCTION power semiconductors. Therefore, two simulation packages are
often needed [17]. Furthermore, because of the huge amount
To reach this goal, students should be able to analyze power mathematical modeling and control and the simulation of
semiconductor circuits using classic network theory without power converters, this paper shows, in Section II, how to
going through complicated mathematics. The derived models write system-level models of power electronics circuits. In
should be suitable for implementing a computer simulation of Section III, examples of pulse width modulation (PWM) ac/dc
the power converter. This accomplishment can be a powerful and dc/ac power electronic converters are given.
motivation for the somewhat tedious mathematical modeling The simulation models described are quite suitable to study
work, because students tend to prefer the automatic use of power electronics converters in drives or other applications
the computer, encouraged by its well-known relevance as a whose simulation times are not too long, since only the ideal
powerful tool for research and development. behavior of the power switches is considered.
“MATLAB/SIMULINK” software [19] is widely used for the This work was initially developed for research in the area of
simulation of almost all types of dynamic systems. This soft- new topologies for power electronics. However, further develop-
ware package is also valuable for teaching and learning since it ments allowed its use as a valuable teaching aid. Therefore, this
provides a series of standard routines and software toolboxes, work presents a new way to teach undergraduate students the
such as a control toolbox, system identification blocks, non- dynamic behavior of power electronics circuits without cutting
linear control design block set, and neural networks block set, down the analytic skills needed to learn and synthesize power
which enable students to perform system simulation, identifica- converter controllers. The new method can also be used as veri-
tion, and control. fication of analytical methods, allowing students to check their
The latest versions of MATLAB/SIMULINK include a mathematical work quickly and use it for power converter be-
“Power System Blockset” [20]. This toolbox features electrical havior and controller development.
models of power semiconductors and the most commonly used
power devices (machines, transformers, power lines, voltage II. MODELING PROCEDURE
sources), and allows simulation of power systems and power
electronics. This package is valuable for simulating well-known To obtain a nonlinear model easily for power electronic
topologies several of which are included as demonstrations, circuits, students need only to apply Kirchhoff’s circuit laws.
but it tends to generate too many algebraic loops on more To avoid the use of complex mathematics, the electrical and
complex or novel power topologies. These algebraic loops are semiconductor devices must be represented as ideal compo-
difficult to handle (because they are inherent to the modeling nents (zero ON voltages, zero OFF currents, zero switching
method) and are time consuming, often preventing simulation times). Therefore, auxiliary binary variables can be used
convergence. Furthermore, this toolbox does not easily allow to determine the state of the switches. Then, students must
open-loop or closed-loop simulation of series associations of ensure that the equations obtained by the use of Kirchhoff’s
power rectifiers, nor does it study the steady and the tran- laws should include all the permissible states due to power
sient-states in cases of unbalanced or distorted and/or polluted semiconductor devices being ON or OFF.
power supply. Considering the approach of [18] with PSPICE The steps to obtain a system-level modeling and simulation of
and SIMPLORER, the authors think that a system-level sim- power electronic converters are listed below. The two last steps
ulation, considering only the ideal switching and functional obtain the controller(s) and perform closed-loop simulations.
behavior of power semiconductors, would be desirable for 1) Determine the state variables of the power circuit in order
MATLAB/SIMULINK. The system-level simulation is fast to write its switched state-space model [22].
enough and free of algebraic loops and convergence problems 2) Assign integer variables to the power semiconductor (or
(SIMULINK has built-in integration methods suited to deal to each switching cell) ON and OFF states (generally, if
with stiff systems). Therefore, it could avoid the problems of the circuit includes power switches, it needs 2 topolo-
the “Power System Blockset” mentioned above. Additionally, gies minus those forbidden by topological restrictions).
the system-level derived models to implement in SIMULINK 3) Determine the conditions governing the states of the
can be used for closed-loop controller design, since they are power semiconductors or the switching cell.
switched state-space models. This advantage is lost when using 4) Assume the main operating modes of the converter
the “Power System Blockset” or “SIMPLORER.” (continuous or discontinuous conduction or both) or the
Considering the increasing capabilities of modes needed to describe all the possible circuit opera-
“MATLAB/SIMULINK” for the simulation of dynamic tional modes. Then, apply Kirchhoff’s laws and combine
systems [21], it is advantageous to adapt the ideal models of all the required stages into a switched state-space model,
semiconductors and simulation methods presented here for which is the desired system-level model.
this software since only one software package is needed. The 5) Write this model in the integral form, or transform the dif-
simulation time is short (a few seconds); an excellent graphical ferential form to include the semiconductors logical vari-
interface is available with parametric identification of the ables in the control vector: the converter will be repre-
system and the ability to choose the numerical integration sented by a set of nonlinear differential equations.
method and toolboxes for closed-loop control. In addition, 6) Implement the derived equations with “SIMULINK”
the SIMULINK package offers the benefits of a hierarchical blocks (open-loop system simulation is then possible to
structure and uses “MATLAB” as its mathematical engine. check the obtained model).
If required, the modeling method here proposed could be 7) Use the obtained switched space-state model to design
adapted to other programs. Since the goal is to teach nonlinear linear or nonlinear controllers for the power converter.
PIRES AND SILVA: TEACHING NONLINEAR MODELING, SIMULATION, AND CONTROL OF ELECTRONIC POWER CONVERTERS 255
III. EXAMPLES
A. Buck DC/DC Regulator
Consider the buck regulator of Fig. 1. Students should be able
to preview the continuous and discontinuous conduction modes
of operation. Using the procedure outlined in Section II, the
modeling steps are the following.
(b)
Step1) The state variables of the Fig. 1 chopper are and
Fig. 2. (a) Block diagram to model the i current, v and v voltages
. of the circuit of Fig. 1; (b) Block diagram showing the control method, the
Step2) The states of the power switch can be represented converter load and output devices.
by a switching variable defined as
(7) is shown in Fig. 5(a). The voltage and are
if is driven ON AND obtained using respectively (3) and (1).
(1)
if is OFF. Step7) A simple control method [Fig. 2(b)] is used to set the
Step3) To model operation in the continuous and discontin- input current. The power switch is driven on by the
uous conduction modes, the states of the power diode clock signal (clocked turn-on) and driven off when the
can be described by the binary variable current exceeds a defined value (peak-current
turn-off). This defined value is a step from 3 A to
if AND 9 A at 0.4 ms.
(2)
if AND . Step8) The algorithm for solving the differential equations
and the step size should be chosen before running
Therefore, the voltage (Fig. 1) is any simulation. This example considers a 10-kHz
switching frequency and 100 time steps per period.
The Runge–Kutta 4–5 algorithm, with a step size of
10 s, has been selected. Simulations of the dc/dc Buck
(3)
converter were made using 5 , 0, 2 mH,
0, 5 mF, 50 V, 15 V, 0
Step4) Applying Kirchhoff’s laws to Fig. 1, students can A.
write Students can easily change the component values and verify
what happens to the voltages and currents. Fig. 3(a) shows the
(4)
current, which has a step from 3 A to 9 A at 0.4 ms, the
and current and the Clk clock pulses. Fig. 3(b) shows the
and voltages. From 0 to 0.4 ms operation is in the
(5)
discontinuous conduction mode, and equals when the
current is zero. From 0.4 ms to 1 ms operation
Step5) For a resistor load , the inductor current and
is in the continuous conduction mode, and is zero when
output voltage can be obtained by integrating (4) and
switch Q1 is off. The converter simulations and graphics display
(5) over time
took only 10 s on a 166-MHz Pentium.
(10)
and
(11)
and
(b) (12)
Fig. 3. Main waveforms of the buck converter; (a) i and i currents and
the Clk clock pulses; (b) the v and v voltages. where the switching function is given by (13). This
definition assumes continuous conduction mode in the
boost mode, and two-level operation, typical of voltage
source PWM reversible rectifiers
if AND
(13)
if AND .
Considering the voltage (11) and current (12),
again applying Kirchhoff’s laws, students can easily ob-
tain the switched, state-space equations of the PWM rec-
tifier
(14)
and
Fig. 4. Single-phase voltage source switch-mode rectifier.
(15)
low harmonic content, and they can behave as power factor
preregulators. Therefore, it is important for most students of Step5) For a resistor load , the converter input current
electrical engineering to study the behavior of these power and output voltage can be obtained by integrating
converters alone or with their controllers. (14) and (15)
Using the procedure outlined in Section II, the modeling steps
are: (16)
Step1) The state variables of the rectifier of Fig. 4 are chosen and
to be and .
Step2) To avoid shorting the output capacitor (and de- (17)
stroying the power semiconductors), the two switches
of each bridge leg must be in complementary states Step6) Using “MATLAB/SIMULINK,” the subsystem de-
(topological restriction). Therefore, the semiconductors scribing the behavior of the boost inductor current (16) is
are grouped into two switching cells, whose states shown in detail in Fig. 5. This subsystem “Single-Phase
PIRES AND SILVA: TEACHING NONLINEAR MODELING, SIMULATION, AND CONTROL OF ELECTRONIC POWER CONVERTERS 257
Fig. 5. Block diagram describing the behavior of the input current of the single
phase ac/dc converter.
Fig. 7. Block diagram of the input current controller.
(18)
(b)
Using sliding mode stability ( ) and also Fig. 8. (a): Reference for the input current (i ). (b) Input current (i ) and
considering (18) (14), the control law (19) is derived. It defines scaled input voltage (V =15).
the switching function to obtain , which is
a sinusoidal wave in phase with the input voltage. This action The “current controller” subsystem (Fig. 7) outputs the
achieves a near unity power factor. As power switches (e.g., switching function . The block “product” generates the
MOS power transistors, or insulated gate bipolar transistors) sinusoidal reference . A step is used to change the phase
present upper bounds for their switching frequency, a positive of this reference [Fig. 8(a)], enabling power factors close to 1
constant and the current ripple 2 are designed to achieve before the step and close to 1 (for inverter operation) after the
switching frequencies suitable for the power semiconductors step. Block “sum_3” implements (18), and block “ ” together
used with “Relay3” (with hysteresis width 2 ) implement (19).
The derived input current controller is encased in the rec-
S1 S4 are driven ON tifier model (Fig. 6). The use of subsystems is encouraged, en-
and S2 S3 are driven OFF and abling alternative controller testing by simple replacement of the
S2 S3 are driven ON existing controller with a new block, whose output must be the
and S1 S4 are driven OFF (19) switching variable . The study of the rectifier with three-level
operation is possible just by allowing 1 0 1 .
The approach considered here is similar to current mode con- Step8) Simulations will allow students to verify that this con-
trol, but a PWM modulator is not needed. The semiconductors troller draws input current with sinusoidal shape, also
are driven ON or OFF just when needed at variable switching presenting near unity power factor. Operation in the in-
frequency. verter mode is also studied. Prior to running the simula-
258 IEEE TRANSACTIONS ON EDUCATION, VOL. 45, NO. 3, AUGUST 2002
Fig. 10. Block diagram for the model of the three-phase ac/dc converter.
the current reference is reversed, since the capacitor voltage de- voltage is plotted in Fig. 11(e) and the line-to-line voltage
creases. The simulation time was about 35 s using a 166-MHz , is shown in Fig. 11(f). The presence of two
Pentium, which is fast enough for the classroom. and three voltage levels in these voltages is clearly illustrated.
These examples highlight a simple method to integrate the Validation of the simulations in the laboratory is a very im-
teaching of power converter modeling, simulation, and control. portant step since it enables students to gain or enhance insight
More exercises can be proposed to derive other controllers. in the simulation method and, above all, it increases experience
Changing the controller is straightforward: replace the con- in handling the problems of real power converters.
troller block with the new design, provided that it outputs 1 or 0 Proposed Exercises:
to drive the switches “ON” or “OFF.” For instance, a sinusoidal III) Repeat exercise I) of the previous example for this
PWM modulator can be used to control the output voltage, and converter. Compare the result with that presented in
the capacitor value can be increased to store enough energy Figs. 11(e) and 8(f).
to allow almost constant dc voltage supply in the inverter IV) Evaluate the ac current ripple and compare it with the
mode. Then, for a dc voltage of 400 V the converter leg design value. Explain the differences.
260 IEEE TRANSACTIONS ON EDUCATION, VOL. 45, NO. 3, AUGUST 2002
Fig. 13. SIMULINK block diagram for the association of two three-phase converters connected back to back.
and no convergence problems were found. The somewhat [17] , “A software tool for learning the dynamic behavior of power elec-
tedious work needed to obtain the switched, state-space model tronics circuits,” IEEE Trans. Educ., vol. 39, pp. 50–55, Feb. 1996.
[18] O. Apeldoorn, S. Schroder, and R. De Doncker, “A new method for
of the converter, which is a theoretical frame necessary for Power electronics system-simulation with Pspice,” in Proc. ISIE’97
controller design, can be advantageously used to perform Conf., Guimarães, Portugal, July 1997, pp. 217–222.
the simulation. Therefore, this methodology is an effective [19] Math Works Inc., Matlab Users Guide, 1997.
[20] Mathworks. (2000, Sept.) Power system blockset 2.1 release
tool to teach undergraduate students to simulate electronic notes. [Online]. Available: http://www.mathworks.com/ac-
power converters dynamics and their control design. Using cess/helpdesk/help/techdoc/relnotes/powersys.shtml
the “MATLAB/SIMULINK” software package, students or [21] D. Graovac and V. Katic, “Modeling and simulation of AC/DC converter
in nonstandard supply conditions,” in ELECTRIMACS’96, Sept. 1996,
power converter control engineers are provided with a powerful pp. 547–550.
simulation and control tool for power converters. Several ac/dc [22] J. F. Silva, “Control methods for power converters,” in Power Electronics
and dc/ac converters have been successfully simulated. The Handbook, M. H. Rashid, Ed. New York: Academic, 2001, ch. 19, to
be published.
examples given illustrate the considerable potential of the [23] V. Utkin, “Sliding mode control design principles and applications to
presented techniques as teaching aids. electric drives,” IEEE Trans. Ind. Electron., vol. 40, pp. 23–26, Feb.
1993.
[24] W. Gao and J. Hung, “Variable structure control: A survey,” IEEE Trans.
REFERENCES Ind. Electron., vol. 40, pp. 2–22, Feb. 1993.
[1] Berkeley University. (2001, Sept. 6) SPICE MANUALS [Online]. Avail-
able: from bwrc.eecs.berkeley.edu/Classes/IcBook/SPICE/MANUALS
[2] University of Pennsylvania, Department of Elec-
trical Engineering. (2001, Sept. 6) SPICE—A Brief Vitor Fernão Pires (M’96) received the B.S. degree
Overview, SPICE User’s Guide [Online]. Available: in electrical engineering from Institute Superior
http://www.seas.upenn.edu/~jan/spice/spice.overview.html of Engineering, Lisbon, Portugal, and the M.S.
[3] Intusoft. (2001, Sept. 5) Better design through simulation. [Online]. and Ph.D. degrees in electrical and computer engi-
Available: http://www.intusoft.com/. neering from Technical University of Lisbon (UTL),
[4] ATP. (2001, Sept. 5) Alternative transients program. [Online]. Available: Portugal, in 1988, 1995, and 2000, respectively.
http://www.emtp.org/. Since 1991, he has been a member of the teaching
[5] SABER. (2001, Sept. 5) Saber® mixed-signal simulator. [Online]. staff at Electrical Engineering Department, Superior
Available: http://www.emtp.org/http://www.analogy.com/products/sim- Technical School of Setúbal—Polytechnic Institute
ulation/simulation.htm#Saber. of Setúbal, Setúbal, Portugal. Currently, he is a
[6] CASPOC. (2001, September) CASPOC 2001: A simulation odyssey. Professor, teaching power electronics and control
[Online]. Available: http://www.caspoc.com/ of power converters. He is also a Researcher at Centro de Automática, UTL.
[7] SIMEC Corporation. (2001, September) Simplorer simulation system. His present research interests include the areas of low-distortion rectifier
[Online]. Available: http://www.simplorer.com. topologies, converter control, modeling, and simulation.
[8] Ansoft. (2001, September 6) SIMPLORER. [Online]. Available:
www.simec.com.
[9] Cadence. (2001, September 6) SPECTRE circuit simulator. [Online].
Available: http://www.cadence.com/datasheets/spectre_cir_sim.html José Fernando A. Silva (M’91–SM’00) born in
[10] MicroSim Corporation, PSpice Reference Manual, 1991. Monção Portugal in 1956, received the Dipl.Ing. in
[11] Pspice.com. (2001, September 6) Design community in action. [Online]. electrical engineering and the Ph.D. degree in elec-
Available: http://www.pspice.com/. trical and computer engineering (power electronics
[12] M. H. Rashid, SPICE for Circuits and Electronics Using and control), from Institute Superior of Engineering
PSpice. Englewood Cliffs, NJ: Prentice-Hall, 1990. (IST), Technical University of Lisbon (UTL),
[13] N. Mohan, “Power electronics: Computer simulation, analysis, and ed- Lisbon, Portugal, in 1980 and 1990, respectively.
ucation using PSpice,” Minnesota Power Electronics Research & Edu- He is currently an Associate Professor of Power
cation, 1992. Electronics at IST, teaching power electronics and
[14] M. H. Rashid, Power Electronics Circuits, Devices, and Applica- control of power converters and a Researcher at
tions. Englewood Cliffs, NJ: Prentice-Hall, 1993. Centro de Automática, UTL. His main research
[15] Veribest. (2000, September) VERIBEST circuit simulator. [Online]. interests include power semiconductor devices, modeling and simulation, new
Available: http://www.veribest.com/sales/ads/analog/convergence.html converter topologies, and sliding mode control of power converters. He has
[16] D. W. Hart, “Circuit simulation as an aid in teaching the principles of authored or coauthored one book, one book chapter, and over one hundred
power electronics,” IEEE Trans. Educ., vol. 36, pp. 10–16, Feb. 1993. papers.