Tutorials

This page gives an overview on all available tutorials for PLECS, RT Box and Embedded Code Generation. Please note that only the PLECS Standalone files are provided for download. However, these can be easily imported into PLECS Blockset, by opening a new empty PLECS Circuit block inside a Simulink model and clicking File → Import from Standalone.

A complete list of PLECS-related videos can be found on the Plexim Youtube page.

The filters below will help you navigate through the collection of application examples. By clicking on the column headings in the table, the results are sorted in ascending or descending order.

Title Description Files PDF Video No.
RT Box: Introduction to the RT Box

In this tutorial you will learn step-by-step how to run basic PLECS models on the PLECS RT Box. The tutorial is designed for users making the transition from a PLECS model to a real-time simulation on the RT Box and how best to structure a model to facilitate this transition using PLECS Standalone. The user will gain a deeper understanding of the RT Box hardware, workflow, and the RT Box Target Support library components. Further, they will learn how to update PLECS Scopes with data from a real-time simulation, change parameters during a real-time simulation, and gather information about a simulation from the RT Box's web interface.

201
RT Box: Building a Voltage Source Inverter on the RT Box

In this tutorial you will build a simple three-phase voltage source inverter (VSI) for deployment on the RT Box. The tutorial is oriented towards users making their first practical models for the RT Box using PLECS Standalone and identifies potential missteps one may make along the way.
The primary learning goal for the tutorial is to demonstrate the limitations of conventional switch models in real-time applications, motivating the use of sub-cycle averaging and specialized hybrid power modules in later tutorial exercises.

- 202
RT Box: Timing and Step-Size Selection

In this tutorial you will learn step-by-step how to build and optimize a basic power converter on the PLECS RT Box and select an appropriate simulation step size. The tutorial is designed for users making the transition from a PLECS model to a hardware-in-the-loop (HIL) simulation on the RT Box using PLECS Standalone.
While basic PLECS circuit models can run on the RT Box, there are optimizations that improve the simulation accuracy and reduce computational load of real-time simulations. One key real-time optimization is to use the PWM Capture component and hybrid power modules. These two components unlock the high sample rate of the FPGA, such that the accuracy of the sensed duty cycle is no longer strictly determined by the model time step. This is critical in selecting an appropriate simulation step size.
The specific learning goals for the tutorial are:
• Establish the importance of sub-cycle averaging and hybrid power modules for real-time simulation.
• Understand how to optimize simple power converter models for real-time applications.
• Learn the process to select an appropriate model step size using the CodeGen mode.

- 203
RT Box: Model Optimizations

As real-time simulation models increase in complexity additional optimization steps may be required to achieve the desired performance. This tutorial provides additional optimization techniques for real- time simulation on the RT Box with a focus on hardware-in-the-loop (HIL) applications.
At the end of the tutorial you should understand how to reduce the number of switching combinations in a PLECS model. You will observe how this reduces the model execution time and reduces the size of the generated code.

- 204
RT Box: Virtual Prototyping

This tutorial is an extension of the tutorial on building a simple voltage source inverter (VSI) on the PLECS RT Box. You will apply the optimization techniques learned in the previous tutorial exercises to implement closed-loop control of a three-phase VSI system. You will use a virtual prototyping setup where the controller and plant will run on separate RT Boxes connected by loopback cables. Virtual prototyping is often helpful to evaluate the performance of the real-time platform before connecting to any control or power hardware and can be used as an intermediate stage when developing real-time simulations for the RT Box.

- 205
RT Box: From Offline to Real-Time

In this tutorial you will learn various techniques and some of the necessary modifications required to make an “offline” model capable and optimized for “real time” on the RT Box. Several common modeling approaches and configurations in offline simulation that can become problematic in real-time simulation are discussed, along with the related simplifications so that the HIL simulator is able to accomplish each update within a reasonable model step size. Further focus is on the use of specialized target blocks for generating and resolving high-resolution PWM gate signals with adequate accuracy. This involves using RT Box PWM Out/Capture blocks and the electrical power module components available in the PLECS component library. This tutorial also discusses the handling of transient events, and preventing numerical overflow as state variables may accumulate as a real-time simulation continues indefinitely.

- 206
RT Box: System Splitting for Distributed Real-Time Simulation

Large power electronic systems often include many switching devices so that real-time deployment on a RT Box can be challenging. Long calculation times, the size of executable code and the number of available I/Os are typical problems.
In this tutorial you will learn where and how to split a given PLECS model into two parts. Each part is then deployed on a separate RT Box. At the end different synchronization options between RT Boxes using SFP ports is explained.

For this tutorial you will need:

• 2 RT Boxes (either of type RT Box 1, 2 or 3 not CE)
• 2 D-SUB 37-pin male-to-female loopback cables
• 1 SFP cable

207