Build and Simulate Single-Phase Half-Bridge Inverter with
Ideal Switches and Thermal Port
In this example, you build and analyze a single-phase, half-bridge inverter that you control by using
sinusoidal pulse-width modulation (SPWM) and simulate the effects of generated heat and device
temperature.
To see the completed version of the model you create in this example, at the MATLAB® command
prompt, enter SinglePhaseHalfBridgeInverterThermalModel.
Build the Model
The single-phase, half-bridge inverter in this example consists of a power circuit and a
control system. First, create both parts of the model by adding and connecting the blocks.
Build the Power Circuit
The power circuit comprises a DC link, two semiconductor switches with their anti-parallel
diode, and an inductive load.
To build the power circuit:
1. Create a new model.
2. Add the blocks in this table. The Library Path column specifies the hierarchical path
to each block.
Block Purpose
DC Voltage Source Provide a DC link
Half-Bridge (Ideal, Model two semiconductor switches with their anti-parallel diodes and build the ha
Switching) with thermal effects
Inductor Model an inductive load
Convective Heat Transfer Represent a heat transfer by convection from the half-bridge to the ambient
Temperature Source Define the ambient temperature
Electrical Reference Provide the ground connection for the electrical conserving ports
Voltage Sensor Measure the voltage across the load
Current Sensor Measure the current that flows through the load
Solver Configuration Define the solver settings that apply to all physical modeling blocks
Simulink-PS Converter Convert an output physical signal to a Simulink signal
PS-Simulink Converter Convert a Simulink® input signal into physical signal
Scope Display the load voltage and the current wave
3. Note
4. You can use the Simscape™ function sscnew with a domain type of electrical to create a
Simscape model that contains these blocks:
Simulink-PS Converter
PS-Simulink Converter
Scope
Solver Configuration
Electrical Reference
5. Rename and connect the blocks as shown in the diagram.
To build the power circuit, this example uses a Half-Bridge (Ideal, Switching) block instead
of an IGBT (Ideal, Switching) block. Similarly to the Half-Bridge (Ideal, Switching) block,
you can calculate and parameterize the conduction loss of the IGBT and its anti-parallel
diode, and the switching-on and switching-off losses of the IGBT. However, you cannot
calculate the reverse recovery loss of the diode by using the same lookup table approach. To
account for the reverse recovery loss, you need to specify the parameters associated with the
diode charging dynamics. If you include the diode charging dynamics, the simulation requires
more computational effort, compromising its performance.
Build the Control
The control system generates two pulse-width modulated (PWM) gate signals that control the
switching behavior of two IGBTs in the Half-Bridge (Ideal, Switching) block.
To build the control system:
1. Add the blocks in this table to the model. The Library Path column specifies the
hierarchical path to each block.
Block Purpose
Sine Wave Generate a sinusoidal signal that represents a unit sinusoidal modulation wave
Constant Define the sinusoidal pulse-width modulation index
Product Obtain the sinusoidal modulation wave by multiplying the unit sinusoidal wave by the m
index
Bias Perform calculation to obtain the duty cycle signal
Block Purpose
Gain
PWM Generator Generate PWM gate signal for the upper IGBT of the Half-Bridge (Ideal, Switching) blo
Logical Operator Obtain the complementary PWM gate signal for the lower IGBT of the Half-Bridge (Ide
block
Data Type Convert the input Boolean signal to double signal
Conversion
Goto Pass the input PWM gate signal to the corresponding From block
From Receive a PWM gate signal from the corresponding Goto block and pass the signal as a
Mux Combine two PWM gate signals
2. Rename and connect the blocks as shown in the diagram.
Specify Model Parameters
Specify these parameters to represent the behavior of the system components:
Model Setup Parameters
Power Circuit Parameters
Control System Parameters
Signal Display Parameters
Model Setup Parameters
These blocks specify model information that is not specific to a particular block:
Solver Configuration
Electrical Reference
As with Simscape models, you must include a Solver Configuration block in each
topologically distinct physical network. This example has a single physical network, so use
one Solver Configuration block with the default parameter values.
You must include an Electrical Reference block in each Simscape Electrical™ network. This
block does not have any parameters.
Power Circuit Parameters
Specify these parameters to represent the behavior of the power circuit components:
1. Set the Constant voltage parameter of the two DC Voltage Source blocks to 100.
2. In the Half-Bridge (Ideal, Switching) block, set the parameters as follows:
Main settings
o Gate-control port — PS
o Switching device — IGBT
o Threshold voltage, Vth — 0.5. With this value, the Half-Bridge (Ideal,
Switching) switches on when the value at the input port is equal to 1 and
switches off when the value at the input port is equal to 0. If you set the
threshold voltage to the actual threshold value, then you must change the
value at the input gate ports accordingly.
o On-state behavior and losses — Tabulate with temperature and
current
Integral Diode settings
o Integral protection diode — Yes
o Diode model — Tabulated I-V curve
o Table type — Table in If(Tj,Vf) form
Thermal Port settings
o Thermal network — External
o Junction thermal mass — 0.1
Variables settings
o Select Override Junction temperature Target.
o Priority — High
o Value — 25
3. In the Inductor block, set these parameters:
Inductance — 0.005
Series resistance — 1
Parallel conductance — 0
4. In the Convective Heat Transfer block, set these parameters:
Area — 1e-3
Heat transfer coefficient — 20
5. In the Temperature Source block, set the Temperature parameter to 298.15.
For a semiconductor device, the generated heat, or thermal loss, includes:
Conduction loss of the switch and its anti-parallel diode
Switching-on and switching-off loss of the switch
Reverse recovery loss of the anti-parallel diode
In this model, the Half-Bridge (Ideal, Switching) block models the semiconductor. The
example models the thermal loses based on the voltage, current, and temperature. When the
Half-Bridge (Ideal, Switching) block conducts current, the conduction loss is calculated by
multiplying the on-state voltage across the half-bridge and the current that flows through
itself.
A 2-D lookup table determines the value of the on-state voltage. To define the 2-D lookup
table, in the Main settings, specify the values of the On-state voltage
Vce(Tj,Ice), Temperature vector Tj, and Collector-emitter current vector Ic parameters.
The conduction loss of the anti-parallel diode is calculated by using the Forward currents
If(Tj,Vf), Junction temperatures, Tj, and Forward voltages, Vf parameters in the Integral
Diode settings.
A 2-D lookup table determines the value of the switching-on loss of the IGBT and then
proportionates it to the Off-state voltage for loss data parameter. To define the 2-D lookup
table, in the Losses settings, specify the values of the Switch-on loss,
Eon(Tj,Ice), Temperature vector for losse,s Tj, Collector-emitter current vector for
losses, Ice parameters.
The switching-off loss of the IGBT is calculated by using the Switch-off loss,
Eoff(Tj,Ice) parameter in the Losses settings and the reverse recovery loss of the diode is
calculated by using the Diode reverse recovery loss, Erec(Tj,Ice) parameter.
The generated heat dissipates from the half-bridge to the ambient atmosphere. The
Convective Heat Transfer and the Temperature Source blocks model this thermal behavior.
For more options of thermal network modeling, see Simulating Thermal Effects in
Semiconductors.
Control System Parameters
Specify the following parameters to get the PWM gate signals for the upper and lower IGBTs
from a sinusoidal modulation wave:
1. In the Constant block, set the Constant value parameter to 0.8.
2. To generate a unit sinusoidal modulation wave, set the parameters of the Sine Wave
block:
Amplitude — 1
Bias — 0
Frequency (rad/sec) — 2*pi*60
Phase (rad) — 0
Sample time — 0
3. In the Bias block, set the Bias parameter to 1.
4. In the Gain block, set the Gain parameter to 0.5.
5. Set the PWM Generator block parameters:
Carrier counter — Up-Down
Timer period (s) — 1/2/2000
Phase delay (s) — 0
Sample time — 0
6. In the Logical Operator block, set the Operator parameter to NOT.
The sinusoidal modulation wave is equal to 0.8⋅sin(2π⋅60⋅t). To change the modulation wave,
modify the modulation index, frequency, and phase values.
The PWM Generator block cannot receive the modulation wave as an input, because it must
be a duty cycle. To obtain the duty cycle from the modulation wave, this example uses this
equation:
D=
M+12
where D is the duty cycle and M is the modulation wave. The Bias and Gain blocks of the
control system implement this calculation.
The output PWM gate signal from the PWM Generator block controls the upper IGBT. The
Logical Operator block implements the complementary PWM gate signal that controls the
lower IGBT. The value of the Timer period (s) parameter of the PWM Generator block is
equal to 1/2/2000, which means that the switching frequency is equal to 2 kHz.
The Goto blocks and From blocks implement the connection between the generated PWM
gate signals and the two IGBTs in the Half-Bridge (Ideal, Switching) block. Setting the Goto
tag parameter in a Goto and From block to the same tag allows you to pass a signal from one
block to another without connecting them.
Signal Display Parameters
Specify the parameters of the Scope block to display the output signals.
Double-click the Scope blocks and then click the View > Configuration Properties to open
the Scope Configuration Properties dialog box. On the Logging tab, clear the Limit data
points to last check box.
Configure the Solver Parameters
Configure the solver parameters to use a continuous-time solver. Simscape Electrical models
only run with a continuous-time solver when you clear the Local Solver parameter of
a Solver Configuration block. Use the Configuration Parameters dialog box to change the
simulation end time, tighten the relative tolerance for a more accurate simulation, and remove
the limit on the number of simulation data points Simulink saves.
1. In the model window, select Modeling > Model Settings to open the Configuration
Parameters dialog box.
2. In the left pane, click Solver:
Set Stop time to 4/60.
Set Solver to ode23t (Mod. stiff/Trapezoidal).
Set Max step size to 1e-4.
Set Relative tolerance to 1e-4.
3. Click OK.
For more information about configuring solver parameters, see Simulating an Electronic,
Mechatronic, or Electrical Power System.
Simulate the Model and Analyze the Results
Run the simulation and plot the results. In the model window, select SimulationRun.
To view the load voltage and current, double-click the Scope blocks. You can do this before
or after you run the simulation.
This figure shows the load current.
The next figure shows the load voltage.
The load voltage is a PWM wave varying between -100 V and 100 V.
To view other simulation results, such as the conduction loss of the Half-Bridge (Ideal,
Switching) block, use the Simscape Results Explorer. To enable the Simscape Results
Explorer, first log the simulation data for all variables:
In the model window, select Modeling > Model Settings to open the Configuration
Parameters dialog box.
In the left pane, click Simscape:
o Set Log simulation data to All.
o Select the Open viewer after simulation check box.
o Clear the Limit data points check box.
Click OK.
In the model window, select Simulation > Run to run the simulation. This figure shows the
Simscape Results Explorer window that opens automatically.
When you click a node in the left pane, the corresponding plots appear in the right pane. For
example, if you click the variable power_dissipated in Half-Bridge (Ideal,
Switching) > S1, then the Simscape Results Explorer plots the conduction loss of the upper
IGBT in the half-bridge.
To select several variables for side-by-side plot comparison, press Ctrl and click multiple
variables. For example, check the switching-on and switching-off loss of the upper IGBT and
the reverse recovery loss of the anti-parallel diode:
You can also check the total power loss and the junction temperature of the half-bridge by
clicking the Qj and Tj variables in Half-Bridge (Ideal, Switching) > thermal_port.
For more information, see Simscape Results Explorer.