Implementing USB-based PIL for TI F28377S LaunchPad without RT Box

Hello everyone,

I am currently working on a project to implement an MPPT algorithm (PSO/SMC) for a Boost Converter using the TI C2000 TMS320F28377S LaunchPad. I want to perform a Processor-in-the-Loop (PIL) simulation where the plant (Boost Converter) runs on the host PC in PLECS, and the control algorithm runs on the physical LaunchPad.

I am trying to achieve this via a standard USB/Serial connection without using the PLECS RT Box. I have access to both PLECS 4.6 and PLECS 5.0, along with the TI C2000 Target Support Package (TSP).

My questions are:

  • Is there still a native way to perform traditional USB-based PIL for the C2000 LaunchPad in recent PLECS versions without an RT Box?

  • If the automated PIL block generation is no longer supported, is there a recommended alternative way?

Any insights or examples would be greatly appreciated. Thank you!

Hello,

PLECS PIL has been deprecated and is no longer supported. There isn’t a similar workflow where the control code executes on the MCU and the plant modeled on your PC without an RT Box.

Some alternate workflows are suggested in this previous post: Is PIL deprecated? - #2 by Bryan_Lieblick

Regards,
Bryan

I should also mention some community driven efforts in this direction. In this previous discussion @Marco_Guerreiro shared an Open Processor in the Loop (OPIL) tool which he developed. The primary link I am aware of is this repo, but it looks like he may use this in other projects on his personal github (e.g. ocp-lrs), but Marco is the one best suited to introduce his work.

Hi,

I use PiL in the way you described almost every day. When I started, PLECS had some support for PiL but not for the target I use (Zynq), so I created a tool to overcome this. The official repo is this one:

At the moment we only support targets with Ethernet, because PiL over USB would be too slow. However, we are currently looking into having a USB/serial port that could be used with pretty much any microcontroller. When I have updates, I’ll post here.

For the long term, I’d recommend using PiL over Ethernet. For the C2000, you can use an Ethernet shield such as W5500 to give you Ethernet. This will be much faster than USB. I don’t have an official, well document example for this; however, I did implement a TCP server for the C2000 with W5500 for another project, and that’s basically what you need. You can find the code here.

The disadvantage of our PiL tool is that is not a one-click solution. In the PiL from PLECS, you just click once and PLECS takes care of building, flashing, and simulating. With our tool, you have to do these things separately. You can automate them though, that’s what I do. But it just takes a bit more patience.

In my opinion, PiL is just as valuable as HiL, and even more so in some cases. With PiL, you can debug your code in closed-loop, which is not possible with HiL. This is very interesting if your focus is developing control algorithms, so I definitely recommend investing a bit of time to get a PiL setup.

1 Like