PLECS PIL

Run your Processor in the Loop

The PLECS PIL package is a complete solution for Processor-In-the-Loop (PIL) simulations with PLECS Standalone or PLECS Blockset.

With PLECS PIL you can execute control code on actual embedded hardware tied into the virtual loop of a PLECS model.

Why PIL?

Engineers developing embedded control algorithms often test such code, or portions thereof, by executing it inside a circuit simulator. Using PLECS, this can be easily done with a C-Script or DLL block. This approach is referred to as Software-in-the-loop (SIL). A SIL simulation compiles the embedded source code for the native environment of the simulation tool (e.g. Win64) and executes the algorithms within the simulation environment. 

The PIL approach, on the other hand, executes the control algorithms on the real embedded hardware. Instead of reading the actual sensors of the power converter, values calculated by the simulation tool are used as inputs to the embedded algorithm. Similarly, outputs of the control algorithms executing on the processor are being fed back into the simulation to drive the virtual environment. Note that SIL and PIL testing are also relevant when the embedded code is automatically generated from the simulation model.

A major advantage of PIL over SIL is that during PIL testing, actual compiled code is executed on the real MCU. This detects platform-specific software defects such as overflow conditions and casting errors. Also, although PIL testing does not execute the control algorithms in true real-time, the control tasks do execute at the normal rate between two simulation steps. Therefore, PIL simulation can be used to expose and analyze potential problems related to the multi-threaded execution of control algorithms, including jitter and resource corruption. 

What is included?

At the PLECS level, the PIL package consists of a specialized PIL block, a Target Manager, and a library of high-fidelity peripheral models.

On the embedded side, ready-to-use framework libraries and sample applications are provided. This makes it easy to integrate PIL functionality into your projects.

Supported Embedded Processors

Currently, the PLECS PIL package offers support for the following MCUs :

  • TI C2000 Family (including latest Delfino dual-core processors)
  • ST STM32F4 Series
  • Microchip dsPIC33F (MC version)

Plexim is a member of the TI Design Network.