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.

タイトル 説明 ファイル PDF Video
PLECS: Modeling a Switched-Mode Power Supply

This tutorial introduces the user to the basic working principles of PLECS including the top-down modelling approach and basic user interface interaction. During the exercise the user creates a detailed model of a two-stage power electronic converter including a single-phase input rectifier and an output forward converter. Since the focus of this exercise is on modeling the switching converter rather than the control system, the forward converter is operated in open-loop control mode with a fixed duty cycle.

Tags: #Basic

-
PLECS: Solver Accuracy and Settings

Variable-step solvers are more accurate and typically faster than fixed-step solvers for simulating power electronic systems. And while they are crucial in helping you realize the simulated results of your design, the algorithms can seem like a black box and knowing how to properly tune them intimidating. This tutorial introduces the user to important variable-step solver configuration parameters that influence the accuracy and time step of the simulation, including the relative tolerance, absolute tolerance, maximum step size and refine factor. Understanding the purpose of the settings will help with setting up both an accurate, but numerically efficient simulation. Further, you will learn a technique for rendering simulation output waveforms in an efficient manner, and how to compare the accuracy of variable- and fixed-step solvers.

Tags: #Basic

-
PLECS: Thermal Simulation of a Buck-Converter

This tutorial instructs the user on how to use the thermal modeling features of PLECS to create a combined electrical-thermal simulation of a buck converter. A thermal simulation in PLECS comprises both loss generating semiconductors and thermal circuit components and this exercise has the user design a model that has these necessary building blocks. Then you will extend an existing thermal model for the MOSFET with conduction loss and thermal impedance data using the Thermal Editor and built-in Curve Import Wizard tool. With the thermal circuit and component loss data in place, one can monitor various details in the system, such as the steady-state operating junction temperature of the MOSFET, individual and total losses of the switches, and overall system efficiency.

Tags: #Basic

PLECS: Introduction to the PLECS Magnetic Domain

In PLECS, the user can build complex inductors and transformers in a special magnetic circuit domain based on the permeance-capacitance analogy. Primitives such as windings, cores, and air gaps are provided in the component library. The aim of this exercise is to use PLECS Magnetic domain components to design a transformer for a forward converter. The user will start with an idealized, fully-electrical converter model and incrementally add more realistic effects, including leakage inductance, and a magnetic circuit representation with non-linear core saturation.

Tags: #Basic

-
PLECS: Using the C-Script Block

The C-Script block is a versatile tool in the PLECS component library that can be used for implementing custom controllers and components. The advanced capabilities of the C programming language combined with the flexible sample time settings in the C-Script block allow almost any custom component model, from a simple mathematical function to a complex state machine, to be implemented. The C-Script block can also simplify the workflow when writing C code for DSP controllers since the code can be reused for the DSP. In this tutorial the user will learn how the C-Script block interfaces with the simulation engine through function calls and the different time settings available in the C-Script block. Exercises include using the C-Script block for implementing a mathematical function and for implementing both a continuous and discrete PI controller.

Tags: #Basic

-
PLECS: Efficient PWM Generation using the C-Script Block

This material builds on the first C-Script block tutorial and demonstrates the component is not only useful for implementing mathematical and control functions, but also for implementing state machine programs. State machines are useful for generating switching patterns and for sequencing controller modes. In this exercise, the user will implement a state machine program that creates a symmetrical pulse width modulation (PWM) signal with a blanking delay between switching transitions.

Tags: #Advanced

-
PLECS: Using the DLL block

The PLECS DLL block is useful for testing custom C control code with a PLECS model. Compared with the C-Script block, C control code can be included in a model via the DLL block without having to conform to the function structure of the C-Script block and the control code can be written using the same file structure that is used for the DSP control code. In this tutorial you will learn how to link a DLL file that implements a digital PI controller to a PLECS model. This involves creating an embedded project in an IDE, writing the control logic, compiling the code and generating the DLL, and debugging the file while it is running in a PLECS model.

Tags: #Advanced

-
PLECS: Modeling an Electric Vehicle with the Mechanical Domain

This tutorial explains how to use the mechanical modeling features of PLECS to create a combined electro-mechanical system representing an electric vehicle propelled by an electric motor. The user will get familiar with the PLECS Mechanical domain's Rotational and Translational libraries consisting of Sources, Components, and Sensors subcategories for modeling mechanical dynamics and measuring mechanical variables of interest such as speed, position, and force/torque. After developing a mechanical model for the motor and rotating driveline, the user will build a translational vehicle model to observe the effects of a lumped vehicular system experiencing a road load force and tire frictional force.

Tags: #Basic

-
PLECS: Building a Modulator with the Finite State-Machine Block

This tutorial demonstrates how to use the State Machine block for graphical definition of a modulation scheme. A state machine can be used to control, model, and predict system behavior. It is also a convenient way to represent a process which evolves over time and reacts to system inputs. The alternative to using a state machine is distributing specific task-handling functions under the correct loops of the code, such as with the C-Script block. While the C-Script block is a powerful tool allowing direct interaction with the solver execution routines, the State Machine block has a very intuitive interface and workflow, and requires less coding experience.

Tags: #Basic

PLECS: Introduction to PLECS Standalone

This tutorial introduces the basic concepts of PLECS Standalone by having the user build up a simple passive network and a buck converter circuit. The instructions explain how to use the component libraries to model a system in the PLECS workspace, as well as how to interconnect components and parameterize them. Then a simulation can be run and resulting schematics and waveforms are provided for comparison. The user will also learn how to create a subsystem for organizing the model, implement controls for a multi-domain system, and use the Probe block to monitor component signals as an alternative to using meters and sensors.

Tags: #Basic

PLECS: Introduction to PLECS Blockset

This tutorial introduces the basic concepts of PLECS Blockset by having the user build up a simple passive network and a buck converter circuit in a PLECS Circuit block within a Simulink model. The instructions explain how to use the component libraries to model a system in the PLECS workspace, as well as how to interconnect components and parameterize them. Then a simulation can be run and resulting schematics and waveforms are provided for comparison. A further iteration demonstrates that the PLECS environment can be directly interfaced to the Simulink one so that the complete model can be comprised of blocks in both. The user will also learn how to create a subsystem for organizing the model, implement controls for a multi-domain system, and use the Probe block to monitor component signals as an alternative to using meters and sensors.

Tags: #Basic

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.

Tags: #Basic

Embedded Code Generation: Introduction to Embedded Code Generation for TI C2000 Series

This tutorial introduces the major functional blocks of the PLECS embedded code generation tool for the Texas Instruments (TI) C2000 processor family, the simple workflow for going from an offline model to working controller, and advanced features such as the External Mode allowing live inspection and verification of the working code. In addition to PLECS, PLECS Coder, and the target support library, a Piccolo MCU F28069 LaunchPad development kit is required for this exercise. Further, if you have access to a PLECS RT Box, it provides a virtual circuit environment for testing the generated code. In the first exercise you will create a simple program to blink an LED on the LaunchPad, followed by instructions for pulse-width modulation (PWM) signal generation, Analog-to-Digital Converter (ADC) sampling techniques, and closed-loop control design.

Tags: #Basic

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.

Tags: #Basic

-
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.

Tags: #Basic

-
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.

Tags: #Advanced

-
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.

#Tags: Advanced

-
PLECS: Implicit Model Vectorization

This tutorial instructs the user on how to use the concept of vectorization in PLECS, where scalar variables and signals can be combined into a common bus, such as to reduce schematic complexity and design dynamic custom components that can be reconfigured based on variable assignments and/or settings. The user will learn how to vectorize component parameters and which auxiliary blocks are used to perform basic vectorizing functions, including to implement series and parallel connections. This feature is useful in avoiding the duplication of a part of a circuit several times and modeling circuits in a more condensed form. Finally, the concept of implementing user-defined parameters is introduced for the purpose of making variable-dimension structures.

Tags: #Basic

-
PLECS: Creating Custom Components and Subsystem Masks

This tutorial explains how to create a custom component and component mask using the example of a photovoltaic (PV) string. Masking a subsystem allows users to define a custom interface for a Subsystem block that hides the underlying schematic, making it appear as a single component with its own icon and parameter window. This tutorial also gives a brief introduction to the programming language Lua that is used to implement dynamic component masks.

Tags: #Basic

-
PLECS: XML-RPC Interface and Controller Design in Python

The XML-RPC interface of PLECS Standalone allows you to send and receive data to and from PLECS Standalone using an external program. Many programming languages such as Python, Java, C++, or Ruby offer standard XML-RPC Libraries to set up an XML-RPC client. In this tutorial Python 3 is used to launch PLECS simulations and retrieve the simulation results to be post-processed. In this tutorial you will learn:

- how the XML-RPC interface is embedded into PLECS Standalone and the simulation workflow.
- how to design a simple current control scheme using the Python Control System Library.
- how to use the XML-RPC interface to interact with PLECS (starting a simulation and reading back data).

Please note that PLECS Blockset does not have a built-in XML-RPC interface.

Tags: #Advanced

-
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

Tags: #Advanced