PP-PWM – Programmed Patterns PWM

The FPGA-based PP-PWM (programmed pulse pattern) peripheral provides a specialized PWM scheme for two and three-level inverters, which relies on pre-computed pulse patterns. This type of modulation technique is often used to eliminate specific harmonics from the current spectrum. It is notably useful in applications that operate with a low pulse number, i.e. a low ratio between switching frequency and fundamental signal frequency.

The PP-PWM peripheral can be used for implementing all sorts of modulation techniques that rely on pre-computed pulse patterns, such as Selective Harmonic Elimination (SHE or SHEPWM) or other Optimized Pulse Patterns (OPPs).

The Programmed Pattern PWM module features the following characteristics:

  • Three-phase output PWM for 2 and 3-level inverters
  • A maximum of 16 switching angles per quarter period (64 angles per period)
  • Angles update every quarter period

Similarly to other PWM modules, the following parameters of the PP PWM module can be configured:

  • Complimentary High and Low signals offer a configurable dead-time generation
  • Programmed Pattern PWM outputs can be activated or deactivated during operation

Programmed Pattern PWM operation

To generate a PWM signal, the Programmed Pattern PWM module needs a set of switching angles between [0; \(\frac{\pi}{2}\)]. Thanks to the quarter-wave symmetry of the reference sinusoidal signal, only the angles for the first quarter of the sinewave are required. The angles for the three other quarters will be reconstructed by symmetry inside the FPGA peripheral.

Along with the angles, a vector of transitions with the same length as the angles vector is required. This vector of transition will specify for each angle, whether the switching signal will go “up or down”. A value of 1 encodes an upwards transition while a -1 encodes a downward transition. Two waveform examples for 2- and 3-level inverters are given below.

Programmed pattern pwm waveform for 2 level inverters
2-level Programmed Pulse PWM
Programmed pattern pwm waveform for 3 level inverters
3-level Programmed Pulse

When comparing both waveforms, it can be noted that the 2-level waveform contains an additional transition in the middle of the period (angle = \(\pi\)) since a 2-level inverter cannot generate a zero voltage output.

At its output, the Programmed Pattern PWM module provides the gating signals and also indicates the current phase angle, for instance allowing for synchronization with the grid.

Simulink PP-PWM block

Signal specification

  • The input \(\alpha\) contains the vector of angles between [0; \(\frac{\pi}{2}\)] that define the programmed pattern.
  • The input signal t is a vector containing the transitions for each angle.
  • The input signal f defines the pulse frequency.
  • The outputs are the generated PWM signals, according to the block configuration and the phase angle \(\theta\). The PWM outputs are only used for simulation.
  • The phase angle output \(\theta\) is the phase angle for grid synchronization.
Programmed pattern pwm block Simulink.

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • Converter type configures the programmed pattern PWM for a two or three-lvl inverter.
  • Number of angles configures the number of angles per quarter period.
  • Show "activate" input makes the A (active) signal input visible. If not checked, the PP-PWM block is always active by default (once the controller outputs are enabled).
  • Deadtime duration: configures the dead-time duration.

PLECS PP-PWM block

Signal specification

  • The input \(\alpha\) contains the vector of angles between ]0; \(\frac{\pi}{2}\)[ that define the programmed pattern.
  • The input signal t is a vector containing the transitions for each angle.
  • The input signal f defines the pulse frequency.
  • The outputs are the generated PWM signals, according to the block configuration and the phase angle \(\theta\). The PWM outputs are only used for simulation.
  • The phase angle output \(\theta\) is the phase angle for grid synchronization.
Programmed pattern pwm block PLECS.

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • Converter type configures the programmed pattern PWM for a two or three-lvl inverter.
  • Number of angles configures the number of angles per quarter period.
  • PWM activation makes the A (active) signal input visible. If not checked, the PP-PWM block is always active by default (once the controller outputs are enabled).
  • Deadtime duration: configures the dead-time duration.

C++ functions

Specific to Programmed Pattern PWM

void PpPwm_ConfigureLevel(unsigned int level, unsigned int device=0);Code language: C++ (cpp)

Configures the number of levels of the power converter.

It has to be called in UserInit().

Parameters

  • level: the number of levels of the power converter (2 or 3)
  • device: the B-Box/B-Board to address when used in a multi-device configuration
void PpPwm_ConfigureNumberOfAngles(unsigned int numAngles,
unsigned int device=0);Code language: C++ (cpp)

Configure the number of angles (maximum 16) per quarter period.

It has to be called in UserInit().

Parameters

  • numAngles: number of angles per quarter period
  • device: the B-Box/B-Board to address when used in a multi-device configuration
void PpPwm_ConfigureActivateAsRealTime(unsigned int device=0);Code language: C++ (cpp)

Makes the activate signals real-time tunable.

It enables the use of PpPwm_Activate and PpPwm_Deactivate in the control interrupt.

It has to be called in UserInit().

  • device: the B-Box/B-Board to address when used in a multi-device configuration
float PpPwm_GetCurrentAngle(unsigned int device=0);Code language: C++ (cpp)

Retrieves the value of the phase angle in radian.

It can be called in UserInit() or in the control interrupt routine.

  • device: the B-Box/B-Board to address when used in a multi-device configuration
bool PpPwm_SetAngles(float angles[], unsigned int variations,
unsigned int device=0);
Code language: C++ (cpp)

Sets the list of switching angles and the corresponding variations

It can be called in UserInit() or in the control interrupt routine.

  • angles: the table containing the list of switching angles
  • variations: the variations/transitions corresponding to each angles
  • device: the B-Box/B-Board to address when used in a multi-device configuration
void PpPwm_SetFrequency(float frequency, unsigned int device=0);
Code language: C++ (cpp)

Sets the frequency of the pulse pattern

It can be called in UserInit() or in the control interrupt routine.

Parameters

  • frequency: the pulse pattern frequency
  • device: the B-Box/B-Board to address when used in a multi-device configuration

Functions common to all PWM drivers

These functions are common to all PWM blocks. Further documentation is available on the PWM page.

void PpPwm_ConfigureDeadTime(float deadTime, unsigned int device=0);Code language: C++ (cpp)

Configures the dead-time duration.

It has to be called in UserInit().

Parameters

  • deadTime: the dead-time duration in seconds
  • device: the B-Box/B-Board to address when used in a multi-device configuration
void PpPwm_Activate(unsigned int device=0);
Code language: C++ (cpp)

Activates the addressed PWM output(s). This function acts on both PWM outputs (PWM high and PWM low).

It can be called in UserInit() or in the control interrupt routine.

Parameters

  • device: the B-Box/B-Board to address when used in a multi-device configuration
void PpPwm_Deactivate(unsigned int device=0);Code language: C++ (cpp)

Deactivates the addressed PWM output(s). This function acts on both PWM outputs (PWM high and PWM low).

It can be called in UserInit() or in the control interrupt routine.

Parameters

  • device: the B-Box/B-Board to address when used in a multi-device configuration