DC DC Converter Simulation White Paper
DC DC Converter Simulation White Paper
DC DC Converter Simulation White Paper
DC-DC converters include a variety of topologies to convert voltage level, including buck, boost, SEPIC, and Ćuk.
Digital control enables the DC-DC converter to handle varying power supplies and loads while maintaining power
quality over its operational range. This white paper explains how you can use system-level simulation with Simulink®
for developing digital controls for DC-DC converters.
Simulink enables you to identify design problems early and optimize the system behavior by simulating and explor-
ing multiple design options and operational cases from a single development environment. A system model serves as
the basis for all development activities, from requirements development through design, implementation, and
testing.
Using a single-ended primary-inductor converter (SEPIC) example, this white paper steps through the development
of power converter digital control using modeling and simulation. The digital controller will adjust the brightness of
LEDs on a DC/DC LED kit made by TI (Figure 1). The SEPIC and the embedded processor are also part of the kit.
Figure 1. TI’s DC/DC developer’s kit, which includes the microcontroller card that will run the digital power converter controller.
W H I T E PA P E R | 2
Speed Up Digital Control Design of DC-DC Converters with Simulink
You will also see how power electronics engineers can use Simulink to perform some common tasks, including:
• Modeling passive circuit elements, power semiconductors, and varying power sources and loads
• Simulating the converter in continuous and discontinuous conduction modes
• Determining power losses and simulating the thermal behavior of the converter
• Tuning the controller to meet design requirements such as rise time, overshoot, and settling time
• Generating C code from the controller model for implementation on TI’s C2000™ microcontroller
“Simulation and code generation enable us to turn changes around quickly and eliminate
human errors in coding. Our algorithms typically work the first time, so we no longer
waste a big part of our development cycle debugging code.”
— Dr. Robert Turner, senior R&D engineer at ABB
Learn More
ABB Accelerates the Delivery of Large-Scale, Grid-Connected Inverter Products with Model-Based Design - User Story
W H I T E PA P E R | 3
Speed Up Digital Control Design of DC-DC Converters with Simulink
SEPIC schematic
L1 inductor current
L1
Diode
DC G
C4
Asynchronous C5
PWM Generator C12
L2 C14
12V
f(x) = 0
Figure 2. The schematic (top) and the equivalent Simscape model (bottom) of the SEPIC.
You may want to conduct additional analyses to further evaluate the converter design. For example, rerunning the
simulation with smaller inductor values or with larger load may force the converter to operate in discontinuous con-
duction mode (DCM) depending on the actual values selected (Figure 3). Another observation in this model is that
the switch is assumed to be ideal—that is, the nonlinear dynamics associated with the turn-on and turn-off times
are not modeled in this example.
W H I T E PA P E R | 4
Speed Up Digital Control Design of DC-DC Converters with Simulink
-2
6
20 L1 inductor current (DCM) SEPIC Output voltage (DCM)
4
10
2
0 0
-2
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
0.0451 0.04512 0.04514 0.04516 0.04518 0.0452
6 Time (seconds)
20 4
10
0
0 -2
2
4
0 2
0
-2
-2
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
0.0451 0.04512 0.04514 0.04516 0.04518 0.0452
Figure 3. Simulation results of the SEPIC in discontinuous (top) and continuous (bottom) conduction mode.
Learn More
VONSCH Speeds the Development of Control Systems for Solar Inverters and Battery Chargers - User Story
W H I T E PA P E R | 5
Speed Up Digital Control Design of DC-DC Converters with Simulink
Electrical™. To model the thermal dynamics of the converter, you can use Simscape, which lets you simulate multi-
domain models in the Simulink environment.
To parameterize the MOSFET block, you can use the datasheet for the MOSFET used in the TI kit (Figure 4). Both
static and dynamic characteristics from the datasheet are used to parameterize the block.
Once the MOSFET is parameterized, you can compare the characteristic curves of the MOSFET block (steady-state,
transfer, and gate charge characteristics) with the graphs provided in the datasheet to ensure a close match. As
shown in the bottom row of Figure 5, the simulated and actual characteristics curves are very close, verifying that
the behavior of the MOSFET model is close to that of the real hardware.
W H I T E PA P E R | 6
Speed Up Digital Control Design of DC-DC Converters with Simulink
MOSFET Steady State Characteristics MOSFET Transfer Characteristics MOSFET Gate Charge Characteristics
Define Conditions
id (Vg and Vds) id
-+
Vds(m)
- +
Vg
MOSFET Curves: Ic vs. Vds for Varying Gate Voltage MOSFET Curves: Id vs. Vg for Varying Temperatures Gate Charge Characteristics
100 100 8
90 90
7
80 80
0 0
0 0.1 0.2 0.3 0.4 0.5 0.6 1 1.5 2 2.5 0 0.2 0.4 0.6 0.8 1 1.2
Drain-Source Voltage (V) Gate-Source Voltage (V) Qg - Gate Charge (nC) X 10-8
Figure 5. Comparing the characteristics of the parameterized MOSFET block in Simscape Electrical and the actual characteristics from the
datasheet. The top row shows the models used to generate the plots in the second row. The responses match closely, indicating
good parameterization.
The parameterized N-Channel MOSFET block can then be added to the SEPIC model, replacing the ideal switch
block (Figure 6). By enabling the thermal port of the block, you can model and simulate both the electrical and ther-
mal dynamics of the converter simultaneously. You can calculate the dissipated power losses of the MOSFET in the
model, based on logged simulation data. Note that the model is still operating in open loop with a fixed duty cycle.
15
L1 Diode
10
5
C4
12V PWM C5
Duty
Ref L2 C12 0
C14
0 0.05 0.1 0.15 0.2
Time (seconds)
Output voltage
x 10 -8
f(x) = 0 Heat flow
10
Thermal
Ideal Temperature
Heat Flow
Source
Sensor
5
Ambient
Convection Temperature
Heatsink
Heat flow
0
0 0.05 0.1 0.15 0.2
Copyright 2018 The MathWorks, Inc. Time (seconds)
Figure 6. The SEPIC model with nonlinear switching dynamics (top), with plots of the electrical and thermal dynamics simulation results (bottom).
W H I T E PA P E R | 7
Speed Up Digital Control Design of DC-DC Converters with Simulink
Learn More
Lockheed Martin Simulates Orion Spacecraft Missions Using a Multidomain Power System Model - User Story
DC/DC Sepic
Voltage Mode Control (VMC)
L1
C4
C5
12V L2 C12
C14
Voltage
f(x) = 0
PWM1H
Vout1REF
W H I T E PA P E R | 8
Speed Up Digital Control Design of DC-DC Converters with Simulink
You can simulate the model with the default PID “Our system engineers can program, simulate,
controller gains to evaluate the behavior of the and verify the AC 800PEC controller’s
system (Figure 8). To improve performance, you
regulation software very rapidly in MATLAB
can use the PID Tuner in Simulink Control
and Simulink. This approach markedly reduces
Design™, which lets you automatically tune the
PID controller gains. PID Tuner will attempt to
development times and produces significantly
automatically linearize the system to facilitate fewer deviations from the specifications.”
tuning of the PID gains. However, the simulation — Fritz Wittwer, ABB
model cannot be linearized because it contains
high-frequency switching. To address this chal-
lenge, you can use System Identification Toolbox™
and simulated input-output data to identify a
transfer function that approximates the linear-
ized converter dynamics.
Figure 8. Performance of the PID controller before (left) and after (right) automatic tuning of the PID gains.
System Identification Toolbox lets you generate output data from PID Tuner by running the simulation for a small
change in the MOSFET duty cycle. You can then identify the transfer function from simulated input-output data.
You can specify the desired order for the identified model—for example, a second-order transfer function with a pair
of complex poles. Once the transfer function has been obtained, PID Tuner automatically computes PID controller
gains to meet user-specified bandwidth and phase margin requirements. The computed gains are used to update the
gains of the PID Controller block in the Simulink model.
You can verify that the performance of the tuned controller meets the response time requirements by running the
simulation with the original nonlinear system (Figure 8, right). You may also want to execute additional simulation
tests to ensure that performance is acceptable in multiple scenarios. For example, you can add various load types,
rerun the simulation, and examine the results.
Learn More
ABB Accelerates Application Control Software Development for a Power Electronic Controller - User Story
W H I T E PA P E R | 9
Speed Up Digital Control Design of DC-DC Converters with Simulink
Figure 9. Interfacing with external hardware in Embedded Coder by downloading hardware support packages.
You can then update the control logic part of the model using the blocks from the support package to add ana-
log-to-digital conversion, interrupts, and PWM generation functionalities for the TMS320F28035 microcontroller
(Figure 10).
C28x
PI_Controller_Optimized
IRQ11
Interrupt
1 Vout1Ref
Vout1Ref
ADC_INT() C2802x/03x/05x/06x
Duty1 WA
C2802x/03x/05x/06x ePWM
Vout1Ref A4 Vout1
Voltage Ts = -1 ADC
DataType = fixdt(0,16,12) DataType = fixdt(1,32,24)
Vout1ADC
DataType = fixdt(1,32,24) LED driver PWM
Variant_PI_Controller
PI_Controller_ISR
Figure 10. Adding drivers, PWM generation, and control of pins for the target hardware using the hardware support package.
W H I T E PA P E R | 10
Speed Up Digital Control Design of DC-DC Converters with Simulink
With the new blocks in place, you can generate “The code we generated with Embedded Coder
code for the microcontroller. The code generation does just what it is supposed to do. Writing
report (Figure 11, right) provides bidirectional
code with nine PI loops in it by hand and then
traceability between the Simulink model and
debugging it on hardware would have added
generated code. TI’s Code Composer Studio™ IDE
(Figure 11, left), if downloaded, will deploy the
six months or more to the schedule.”
executable to the microcontroller if the hardware — Brad Landseadel, Stem
is connected. Using this capability, you can gen-
erate and deploy code to the target hardware
directly from Simulink.
Figure 11. Generating and deploying code to the target hardware directly from Simulink. You can also access the code generation report to trace
the code back to your Simulink model.
With code generated and deployed to the microcontroller, you can use the Simulink model as an interface to tune
parameters in the code and to monitor signals in real time. Figure 12 shows a Simulink model in which a knob is
used to change the value of reference voltage for the converter. This value is updated in the code running on the
microcontroller, allowing you to change LED brightness.
W H I T E PA P E R | 11
Speed Up Digital Control Design of DC-DC Converters with Simulink
Figure 12. Using the Simulink model to tune parameters on the generated code running on the microcontroller.
For example, you can use a knob to change the LED brightness command and see the LED response in real time.
Learn More
Bosch eBike Systems Develops Electric Bike Controller with Model-Based Design - User Story
Stem Accelerates Development of Power Electronics Control Systems with Model-Based Design - User Story
Conclusion
This white paper explains how Simulink speeds up developing a digital controller for a power converter. Simulink
lets you model the converter and design a PID controller using simulation to test the controller over the converter
normal and abnormal operation ranges. Finally, you can generate C code from the controller model and implement
it on a microcontroller, such as TI’s TMS320F28035.
Get Started
Take the next step to speed up your power converter control project:
• Power Electronics Control Design with Simulink - Overview
• Developing DC-DC Converter Control in Simulink (19:53) - Video
• Trial Software for Power Electronics Control - Download
• Developing Embedded Software - Consulting Services
© 2019 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See mathworks.com/trademarks for a list of additional trademarks.
Other product or brand names may be trademarks or registered trademarks of their respective holders.
W H I T E PA P E R | 12