Nothing Special   »   [go: up one dir, main page]

Plecs Tutorial: Modeling A Switched-Mode Power Supply Using PLECS

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

PLECS

Tutorial

Modeling a Switched-Mode Power Supply using PLECS

Tutorial Version 1.0

www.plexim.com
Request a PLECS trial license

Check the PLECS documentation


Modeling a Switched-Mode Power Supply using PLECS

1 Introduction
The aim of this exercise is to use PLECS to create a detailed model of a two-stage power electronic
converter. The example application, shown in Fig. 1, is a switched-mode power supply comprising a
single-phase input rectifier that creates a DC voltage of approximately 325 V, and an output forward
converter stage that steps the input DC voltage down to approximately 11 V. Since the focus of this ex-
ercise is on modeling the switching converter rather than the control system, the forward converter is
operated in open-loop control mode with a fixed duty cycle. The specific learning goals for this exercise

Utility Input Filter High-frequency Output Low-pass


supply rectifier capacitor transformer rectifier filter Load

Figure 1: Electrical circuit of a switched-mode power supply

are listed as follows:


• Create a detailed model of a DC-DC converter in a step by step approach.
• Learn a few useful keyboard shortcuts.
• Gradually add more nonlinear details to your simulation.
• Estimate the transformer saturation limit.
• Establish diode overvoltages and overcurrents.
Before you begin Ensure you have the reference files that you can compare with your own models
at each stage of the exercise.

2 Idealized Forward Converter


The forward converter, shown in Fig. 2, is essentially a buck (step-down) converter with an isolation
transformer. When the MOSFET is on, diode D1 is forward biased and conducts the inductor current,
which increases during the on interval. When the MOSFET is switched off, the inductor current com-
mutates from D1 to D2 and begins to decrease. If inductor current never decreases to zero during the
off interval, the converter is said to operate in continuous conduction mode. More detailed information
about the operation of the forward converter can be found in [1].
The approach that you will use to model the power supply is to start with a basic model of the forward
converter as shown in Fig. 2. For this step, you will assume the transformer to be ideal and you will
model the input rectifier stage using a fixed DC voltage. In the following steps you will add more de-
tails to the component models and include an input rectifier stage.

www.plexim.com 1
Modeling a Switched-Mode Power Supply using PLECS

Your Task: Model the idealized forward converter shown in Fig. 2. Be sure to use the ideal
MOSFET component from the library. Use a Pulse Generator block with a frequency of 20e3 Hz
and a duty cycle of 0.4 to control the switch. Display the load voltage using the PLECS Scope.
Monitor the MOSFET and inductor currents by dragging these components into a Probe block
and checking the Current signals. Use a Signal Demultiplexer block to display the MOSFET
and inductor currents on separate scope plots. Adjust the simulation Stop time to 3 ms (found in
the Simulation + Simulation Parameters menu, or press Ctrl+E), but leave all other param-
eters as their defaults and run the simulation (Simulation + Run or Ctrl+T).

L: 50e-6

D1

D2 C: 400e-6 R: 1 V

V: 325 n: [12 1]
Scope

Probe
Probe

Pulse Generator
f: 20e3
DutyCycle: 0.4

Figure 2: PLECS circuit of idealized forward converter

? Does the converter operate in continuous or discontinuous conduction mode?

A After the startup transient settles, it is in continuous conduction mode. In continuous conduc-
tion mode, the steady-state inductor current is always greater than zero.

At this stage, your model should be the same as the reference model:
Forward_Converter_1.plecs.

3 Practical Forward Converter


3.1 Including the transformer magnetizing inductance
In a practical forward converter design, the magnetizing inductance of the transformer must be mod-
eled to ensure that the magnetizing current does not reach saturation levels.

Your Task: To add this effect to your model, add a magnetizing inductance Lm in parallel with
the primary winding of the ideal transformer, as shown in Fig. 3. Set Lm = 5 mH and try to run
the simulation again.

? Why does PLECS abort with an error message? (Take a look at the conduction state of the
semiconductors.)

A When the MOSFET opens, there is no longer a path for the magnetizing inductance current to
flow, thus forcing it to instantaneously jump to zero. This isn’t possible in PLECS.

www.plexim.com 2
Modeling a Switched-Mode Power Supply using PLECS

L: 50e-6

D1

Lm D2 C: 400e-6 R: 1 V

V: 325 n: [12 1]
Scope

Probe
Probe

Pulse Generator
f: 20e3
DutyCycle: 0.4

Figure 3: Forward converter with transformer magnetizing inductance

Note: If PLECS aborts with such an error message, there is usually something wrong with the
circuit design. In reality, the MOSFET in off-state represents a very large resistance rather than
an open circuit. You can model this with an additional resistor, e.g. Roff = 10 kΩ, connected in
parallel to the MOSFET. If you display the voltage across the MOSFET now, you will observe
a very high voltage when the MOSFET is turned off. It is this voltage that would destroy the
MOSFET in reality.

3.2 Adding a demagnetizing winding


One approach that allows the transformer magnetic energy to be recovered uses a third demagnetizing
winding as shown in Fig. 4. If the MOSFET switches off, the magnetizing current now has a return
path through diode D3 and the tertiary winding.

Figure 4: Practical forward converter with a tertiary demagnetizing winding

Your Task: Add a third winding to the transformer and connect a diode according to Fig. 4. To
do this, add an additional winding to the primary side by changing the number of windings to
[2 1]. Set the number of turns on the additional winding to 12 and reverse its polarity by setting
the polarity vector to +-+.

www.plexim.com 3
Modeling a Switched-Mode Power Supply using PLECS

Note: In order to avoid transformer saturation the transformer must be totally demagnetized
before the MOSFET starts to conduct. It is a common practice to have the same number of turns
on the primary and the demagnetizing windings.

? Add a Probe and Scope block to monitor the current through Lm and gradually increase the
duty cycle of the pulse generator. What is the maximum duty cycle that can be reached before
the transformer saturates?
A 50 %

At this stage, your model should be the same as the reference model:
Forward_Converter_2.plecs.

4 Parasitic effects
The output DC-DC stage of the converter now operates correctly with ideal components. The next
stage of this modeling exercise is to add parasitic effects such as transformer leakage inductance and
diode reverse recovery charge to investigate the effects of these non-idealities.

4.1 Transformer leakage inductance


The windings of a practical transformer are not completely coupled. All windings have a small leakage
inductance that can be modeled as an inductor in series with the winding.

Your Task: Add a leakage inductance of Ll = 10 nH at the secondary side of the transformer as
shown in Fig. 5.

Figure 5: Forward converter with leakage inductance

? How does the leakage inductance influence the shape of the current through the diodes D1 and
D2 ? If you cannot observe any difference, zoom into the commutation interval.

A The diode current now rises over a short period of time rather than instantaneously.

? Why is it not possible to connect leakage inductances in series with the primary and the de-
magnetizing windings?

www.plexim.com 4
Modeling a Switched-Mode Power Supply using PLECS

A Again, by adding inductance in these paths, there would be no route for the inductive current
to flow when the MOSFET is turned off.

4.2 Diode reverse recovery


In PLECS, power semiconductors are usually represented by static models consisting of an ideal
switch, a forward voltage and an on-resistance. In some cases, however, it may be desirable to include
dynamic effects during semiconductor turn-on and turn-off.
The reverse recovery effect of power diodes is probably the most important dynamic effect. It causes
power dissipation and overvoltages that must be accounted for in the circuit design. The effect can be
observed when a forward biased diode is rapidly turned off. It takes some time until the excess charge
stored in the diode during conduction is removed. During this time the diode represents a short circuit
instead of an open circuit, and a negative current can flow through the diode. The diode finally turns
off when the charge has been removed by the flow of reverse current. PLECS uses a behavioral model
presented in [2] to model reverse recovery.

Your Task: In the circuit from Section 4.1, replace the diodes D1 and D2 with the Diode with
Reverse Recovery component, Drr . For this exercise, you can use the default diode parameters.

Note: The reverse recovery diode model introduces stiff differential equations and will create an
error or result in a long simulation time if you use the standard ode45 solver. In the Simulation
Parameters, you will need to manually change the Solver type from the non-stiff DOPRI to
the stiff RADAU for PLECS Standalone or ode15s for PLECS Blockset. However since PLECS
version 4.5 a new variable-step solver auto has been added as default, where the solver switch-
ing from DOPRI to RADAU is automatically done if a model is found to become stiff during a
simulation. By default the Relative tolerance setting is 1e−3 . Change the relative tolerance to
1e−6 and observe the effect on the simulation speed and the diode currents during a switching
transition.

? How large is the peak overcurrent value in diode Drr1 and the peak overvoltage in diode Drr2
in steady-state operation?

A ~ 18 A for Drr1 and ~ 30 V for Drr2 .

At this stage, your model should be the same as the reference model:
Forward_Converter_3.plecs.

5 Including the mains rectifier


In the last part of this exercise, you will complete the converter model by replacing the DC voltage
source with a mains rectifier stage.

Your Task: Add a 325 V (230 Vrms), 50 Hz Voltage Source AC component in series with a 200 µH
inductor to model the single-phase mains. The input stage of the power supply consists of a
diode rectifier with a DC filter capacitor. Model the input stage according to Fig. 6 and display
the mains current and the DC link voltage using a Scope block. Adjust the simulation stop time
to 40 ms in order to simulate two full periods of mains supply.

www.plexim.com 5
Modeling a Switched-Mode Power Supply using PLECS

At this stage, your model should be the same as the reference model:
Forward_Converter_4.plecs.

Figure 6: Circuit model for power supply including mains rectifier and forward converter

6 Conclusion
This exercise has demonstrated a step by step approach for creating a detailed model of a two stage
DC-DC converter starting with an idealized model of a forward converter. When the diode reverse re-
covery effect was added, the system became numerically stiff because the simulation model had time
constants differing by several orders of magnitude. The time constant of the reverse recovery phe-
nomenon is in the range of 10 ns and the time constant of the output filter is in the order of 1 ms. How-
ever, with the use of a stiff solver and appropriate tolerance settings, the converter could still be simu-
lated with a fast speed.
In practice a control system would be added to regulate the output voltage. A voltage controller can
easily be implemented using the control blocks in the PLECS component library, but this step is left
for the user to explore.

References
[1] Ned Mohan, Tore M. Undeland, William P. Robbins, Power Electronics – Converters, Applications
and Design, Third Edition, John Wiley & Sons, 2003
[2] Alan Courtay, MAST Power Diode and Thyristor Models Including Automatic Parameter Extrac-
tion, SABER User Group Meeting Brighton, UK, September 1995

www.plexim.com 6
Revision History:

Tutorial Version 1.0 First release

How to Contact Plexim:

% +41 44 533 51 00 Phone


+41 44 533 51 01 Fax
) Plexim GmbH Mail
Technoparkstrasse 1
8005 Zurich
Switzerland
@ info@plexim.com Email
http://www.plexim.com Web

PLECS Tutorial
© 2002–2022 by Plexim GmbH
The software PLECS described in this document is furnished under a license agreement. The software
may be used or copied only under the terms of the license agreement. No part of this manual may be
photocopied or reproduced in any form without prior written consent from Plexim GmbH.
PLECS is a registered trademark of Plexim GmbH. MATLAB, Simulink and Simulink Coder are regis-
tered trademarks of The MathWorks, Inc. Other product or brand names are trademarks or registered
trademarks of their respective holders.

You might also like