0% found this document useful (0 votes)
170 views5 pages

Buck Converter With Parameter Sweep

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
170 views5 pages

Buck Converter With Parameter Sweep

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

PLECS

dx

DEMO MODEL

Buck Converter with Parameter Sweep

Last updated in PLECS 4.3.1

www.plexim.com
Request a PLECS trial license

Check the PLECS documentation


Buck Converter with Parameter Sweep

1 Overview
This demonstration is based on the demo model “Buck Converter with Analog Controls” in the PLECS
demo models library. It performs a parameter sweep by modifying the value of inductor L1 from a sim-
ulation script.

2 Model
The schematic shows a buck converter with an analog proportional integral derivative (PID) controller.
The inductor L1 is labeled in the schematic below and can be simulated three times in an automated
fashion, with a value of 50 µH, 100 µH, and 200 µH, respectively.

L1
Time: 1e-3
L: varL

S1

V: 28 C: 500e-6 R: 6 R: 1

R: 11e3

R: 85e3 C: 1.1e-9
R: 120e3 C: 2.7e-9

f: 100e3 +
-
< .25 V V: 5
R: 47e3
UpperLimit: 0.9
LowerLimit: 0.1

Figure 1: Buck converter with analog controls

3 Simulation
The simulation demonstrates the start-up of the converter and a load jump at 1 s. A single transient
simulation can be performed where an inductance value of 50 µH is assigned to L1 from the model
initializations. Alternatively, by using the pre-defined script, three simulations are performed, one
for each inductance value of L1 described above. The result of each simulation is displayed as a new
trace in the scope. Each trace is labeled with the corresponding inductance value. The script also ana-
lyzes the simulation result and prints the peak current value into the MATLAB or Octave console. To
run the scripted simulation demonstration execute the following steps for either PLECS Blockset or
PLECS Standalone:
• Blockset: Double-click on the subsystem block in the Simulink model to view and run the m-file
parameter_sweep_script.m in the MATLAB editor which has the following content:
% create path to scope
scope = ('buck_converter_with_parameter_sweep/Circuit/Scope');

% clear all previous traces in scope 'Scope' in the current model

www.plexim.com 1
Buck Converter with Parameter Sweep

plecs('scope', scope, 'ClearTraces');

% parametric values to be swept


inductorValues = [50, 100, 200]; % in uH

for ix = 1:length(inductorValues)
% set value for L1
varL = inductorValues(ix) * 1e-6;
% start simulation, return probed signal values to workspace using Output port '1'
[t, x, y] = sim('buck_converter_with_parameter_sweep');
% hold and label traces in scope
plecs('scope', scope, 'HoldTrace', ['L=' mat2str(inductorValues(ix)) 'uH']);
% find maximum current value and index
[maxv, maxidx] = max(y(:,1));
% Output maximum current values to MATLAB console
fprintf('Max current for L=%duH: %fA at %fs\n', inductorValues(ix), maxv, t(maxidx));
end

The results are printed into the MATLAB console.


• Standalone: Select Simulation scripts... from the Simulation menu and run the following Pa-
rameter Sweep script:
% create simStruct with field 'ModelVars'
mdlVars = struct('varL', 50e-6);
simStruct = struct('ModelVars', mdlVars);

% clear all previous traces in scope 'Scope' in the current model


plecs('scope', './Scope', 'ClearTraces');

% parametric values to be swept


inductorValues = [50, 100, 200]; % in uH

for ix = 1:length(inductorValues)
% set value for L1
simStruct.ModelVars.varL = inductorValues(ix) * 1e-6;
% start simulation, return probed signal values to workspace using Output port '1'
out = plecs('simulate', simStruct);
% hold and label traces in Scope
plecs('scope', './Scope', 'HoldTrace', ['L=' mat2str(inductorValues(ix)) 'uH']);
% find maximum current value and index
[maxv, maxidx] = max(out.Values(1,:));
% Output maximum current values to Octave Console window
printf('Max current for L=%duH: %fA at %fs\n',
inductorValues(ix), maxv, out.Time(maxidx));
end

The results are printed into the Octave console which can be accessed by selecting Show Console
from the Window menu.

4 Conclusion
This model demonstrates using a simulation script to perform a parameter sweep of a physical circuit
value in either PLECS Blockset or PLECS Standalone. This example code can be readily be adapted to
other applications.

www.plexim.com 2
Buck Converter with Parameter Sweep

Inductor current
30

25

20

15
A

10

5 L=50uH:Inductor current
L=100uH:Inductor current
0 L=200uH:Inductor current

Load voltage
18

17

16

15
V

14

13
L=50uH:Capacitor voltage
12 L=100uH:Capacitor voltage
L=200uH:Capacitor voltage
11
0.0 0.5 1.0 1.5 × 1e-3
Time (s)

Figure 2: Output results of three different inductance values from parameter sweep

www.plexim.com 3
Revision History:

PLECS 4.3.1 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 Demo Model


© 2002–2021 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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy