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

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

-