Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Use the SPWM Generators to generate sinusoidal pulse width modulated signals on the FPGA.  These  These signals can be mapped directly to the circuit model Switches

...

In the System Explorer window configuration tree, expand the Power Electronics Add-On custom device, then Circuit Model >> SPWM Generators to display the following subsections and custom device channels. Assign values to the channels to configure the SPWM Generators. The value of an input channel can be modified dynamically at execution time.

SPWM Carrier

Channel Name

Type

Units

Default Value

Description

Carrier Frequency

Input

Hz

5000 Hz

Frequency of the Carrier signal.

Modulation Index

Input

1

Amplitude of the Modulation signal.

SPWM Frequency Generators

Channel Name

Type

Units

Default Value

Description

SPWM Frequency Engine X

Input

Hz

60 Hz

Frequency of the Modulation signal.

SPWM Generator X

Channel Name

Type

Units

Default Value

Description

Dead Time

Input

Seconds

0 s

Time during which both the SPWM signal and its complementary are held in an inactive state, immediately before the SPWM signal goes active.

Frequency Engine

Input


0

Index of the SPWM Frequency Engine used to generate the PWM signal.

Setting a value of 2 will connect SPWM Frequency Engine 2 to the SPWM generator. Use the same SPWM Frequency Engine with multiple different SPWM generators to ensure that they stay phase locked in time.

Phase

Input

Degrees

0

Phase offset of the generated SPWM signal relative to the other SPWM signals using the same frequency engine.

SPWM Generators Description

Sine Triangle PWM is a common modulation technique for converting DC power sources into AC power sources.  In  In the Power Electronics Add-On, the specific implementation of the SPWM generators allows for multiple SPWM signal outputs, but only one carrier frequency and one modulation index.  Frequency  Frequency Engines are responsible for storing the current phase for signals based on their frequency and a free-running clock on the FPGA represented as 'time' in equation

Mathblock ref
anchorSPWM_FreqEnginePhase

...

Modulation & carrier signals are internal signals used for storing the current state of each individual SPWM generator.   The carrier signal is a triangle wave whose frequency is set by the Carrier Frequency channel.  The  The amplitude of the Modulation signal is set through the Modulation Index channel. 

...

When the Modulation signal is greater than the Carrier Signal, the SPWM generator outputs True, otherwise it outputs False.  The  The animation below shows the internal Modulation and Carrier signals with the corresponding SPWM signal.  In  In this example, the Modulation Index is 0.6.

...