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

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

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

- 103
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 losses from semiconductors and the thermal circuit to model the propagation of heat flow. In this tutorial we analyze the behavior of the MOSFET junction temperature, individual and total losses of the switches, and the overall system efficiency.

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

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

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

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

- 108
PLECS: Component Libraries (Standalone)

The aim of this tutorial is to build a PLECS model using custom components from a user-defined library. It discusses the following topics:

• How to structure a library
• How to update a library component
• How to break a library reference and customize it
• How to create a library within a library
• How to create a model reference

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

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

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

- 112
PLECS: Introduction to the State Machine Block

This tutorial demonstrates how to use the State Machine block for graphical definition of a constant on-time control 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.

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

- 114
PLECS: Analysis Tools

This tutorial introduces the PLECS Analysis Tools that can be used to perform steady-state and small-signal analyses. The Steady-State Analysis tool can be used to find the steady-state operating point of the system and the Small-Signal Analysis tools can be used to obtain open-loop and closed-loop transfer functions. Three types of small-signal analyses are available: AC Sweep, Impulse Response Analysis and Multitone Analysis.

- 115
PLECS: Running PLECS Standalone from MATLAB

This tutorial explains how to run a PLECS Standalone simulation using MATLAB® and JSON-RPC. With this setup one can make use of the high simulation speed and parallel simulation capabilities of PLECS Standalone while still working in the familiar MATLAB environment.
116