Space Vector PWM block for PLECS auto coding

Hi!

I’m currently working on implementing SVPWM using PLECS auto-coding for the TI LAUNCHXL-F280039C (C2000). I would like to know whether the PLECS “Space Vector PWM” block is compatible with auto code generation targeting this platform.

However, I’ve encountered an issue during code generation. Below is an image of the model setup I’m using:


Could you please advise me, whether the Space Vector PWM block is supported for embedded code generation? If not, what is the recommended method to implement SVPWM for the F280039C target using PLECS?

I’ve also attached the model for your reference.

SVPWM_auto.plecs (30.8 KB)

Thank You!

The Space Vector PWM block from the PLECS library directly outputs switching pulses at the sw output. It uses a specific timing scheme (Variable-step discrete) to ensure the timing of various switching events, which is not possible to execute on the C2000 device (or with any fixed-step solver for that matter).

Additionally, the inputs to the PWM block from the C2000 Target Support Package library are modulation indices. One should use a modulation index based space vector modulation scheme. The 3-Phase Index-Based Modulation block in the PLECS library will generate the appropriate duty cycles for a range of SVPWM approaches. You would connect the modulation index output of that block to the input of the PWM component from the C2000 library.

The “SVPWM Control of a Grid-Connected Three-Level NPC Inverter” demo model shows the conceptual arrangement, but for a more sophisticated index-based modulation approach for a three-level converter.