
H-Bridge Converter
1 Overview
This RT Box demo model features a current-controlled H-bridge circuit powering an inductive load.
The model is split into two distinct subsystems called “Plant” and “Controller”. The plant contains an
H-bridge converter with inductive load, and the controller employs a proportional-integral (PI) current
control scheme. These subsystems can then be independently built on the PLECS RT Box either for
Hardware-in-the-loop (HIL) testing of an external controller or for rapid control prototyping (RCP).
The following sections provide a brief description of the model and instructions on how to simulate it.
Real-time execution on the RT Box requires the model to execute using a fixed-step solver. The dis-
cretization step size parameter specifies the base sample time of the generated code and is used to dis-
cretize the physical model and control domain state-space equations. The execution time represents
the actual time it takes to execute one discrete step of the PLECS model on the RT Box hardware. The
chosen discretization step sizes and average execution times for each subsystem in this demo model
are shown in Tab. 1.
Table 1: Discretization step size and average execution time of real-time models with two RT Box 1
Subsystem Discretization Step Size Average Execution Time
Plant 2 µs 1 µs
Controller 100 µs(fsw = 10 kHz)0.7µs
1.1 Requirements
To run this demo model, the following items are needed (available at www.plexim.com):
• Two PLECS RT Boxes and one PLECS and PLECS Coder license
• The RT Box Target Support Library
• Follow the step-by-step instructions on configuring PLECS and the RT Box in the Quick Start guide
of the RT Box User Manual.
• Two 37 pin Sub-D cables to connect the boxes front-to-front.
Note that this demo model is targeted at two RT Boxes application, with one running the Plant and
the other running the Controller. In this way, the execution time of each real-time target is minimized.
Besides, the setup can easily transition to a HIL or RCP test later on.
However if the user has only one RT Box available, please check the corresponding models targeted
for one RT Box application. In this case, two 37 pin Sub-D cables are still needed to connect in front
Analog Out interface with Analog In interface, and Digital Out interface with Digital In interface.
• For RT Box 2 and 3, by default the multi-tasking feature is enabled in this demo. “Controller” part
is circled with a Task frame block, and runs in one core. The rest of the circuit on the schematic be-
longs to the “Base task”, and runs in another core. In this way the computational effort is split onto
different cores. Please check the default setting under Scheduling tab of the Coder options... win-
dow.
• For RT Box 1, multi-tasking is disabled since there is only one CPU core available for calculating
the model, which includes both Plant and the Controller.
Note This model contains model initialization commands that are accessible from:
PLECS Standalone: The menu Simulation + Simulation Parameters... + Initializations
PLECS Blockset: Right click in the Simulink model window + Model Properties + Callbacks +
InitFcn*
www.plexim.com 1