How to generate variable phase-shift carrier in PLECS

Hi,

I’m new to PLECS and would like to know how to generate a variable phase-shifted carrier (an up-down counting triangular waveform).

My goal is to use it for phase-shifted PWM (PSPWM) control of a flying capacitor converter.

I found the TI PWM module, which seems to support variable phase shifting. However, I couldn’t find a way to access the carrier waveform itself and did not see the PWM outputs.

Is there a method to directly generate phase-shifted carrier signals in PLECS? Using the carrier waveforms directly would be more convenient for my application than using the PWM outputs.

Thanks in advance for your help.

Hi Jerry,

There is a “Variable Phase PWM” block in the PLECS library. You can use that generate the PWM signals. If you place a “Probe” component in your schematic and then drag-and-drop the PWM block onto the probe (or into the probe window) then you can access the carrier signals.

There are other approaches that are less straightforward. You can use the block from the TI C2000 TSP but it requires additional configuration steps (you need to place it within a Code Generation Subsystem and configure the target for a TI C2000 processor). One cannot access the carrier signals directly with this block due to its implementation.

You can also generate the carrier yourself directly using the approaches outlined in this forum post.

Regards,
Bryan

Hi Bryan,

Thank you for your information.

But I still don’t understand how to use TI PWM module, there is no PWM output port?

Could you advise the simplest way to use this module?

Thanks

Hi Jerry,

To see the outputs/inputs for TI specific blocks you have to place them in a subsystem. The reason is that this separate the parts of the model you would like to generate code for (i.e. what you want on the C2000 device) vs. other parts of the system you are trying to model. This way you can define all the inputs/outputs into the microprocessor and model how they can interact with your converter.

Here is a simple example: simple_c2000_pwm.plecs (20.6 KB)

You can see more complete examples in the TI C2000 specific demos (click Window + Demo Models then click the TI C2000 Target Support Demos in the left-hand tree to browse the models. They are constructed in a similar fashion, with the TI C2000 specific components within a system targeted for Code Generation.

Hope this helps!

Regards,
Bryan