General description

The SV-PWM block generates PWM signals based on the Space Vector Modulation (SVM) algorithm. This algorithm determines the three vectors that are the closest to the reference vector, and compute the dwell times for each one. Based on those times, a duty cycle is  computed and a triangular carrier is used to generate the PWM signal for each phase, as explained in TN135: Three-phase NPC inverter

When using the single-rate update configuration, the computed duty-cycles are synchronously applied at the end of the PWM period. With the double-rate update, the duty-cycle is updated twice per period: in the middle and at the end (in other words when the carrier reaches its maximum and when it reaches its minimum).

The frequency of the carriers is configured by connecting the SV-PWM block to a CLK - Clock generator. The frequency can even be tuned during the control execution as explain in PN121: Variable frequency operation with the B-Box/B-Board.

Like the other PWM blocks, it supports dead-time generation and can be activated or deactivated. More information is available on the PWM page.

Simulink block

Signal specification

  • The input αβ0 is the normalized reference vector in the stationary reference frame (-1.0 to 1.0).

  • The input signal > is the clock input and must be connected to the CONFIG block or to an independent CLK.

  • The outputs are the generated PWM signals, according to the selected output mode and the converter type. The outputs are only used in simulation.

The parameters output mode, addressed PWM, dead-time and show ”activate” input are common to all PWM blocks and are further documented on the PWM page.

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.

  • Converter type configures the SVM algorithm for a 2- or 3-level inverter.

  • Output mode selects between a single PWM signal or complementary signals with a dead-time.

  • Starting PWM channel: selects the first PWM output to be used for the set of PWM signals of the SVM algorithm.

  • Use optical outputs only selects if the PWM signals can be addressed only to the optical outputs, or if the electrical outputs (lanes 16 to 31) can also be used.

  • Show ”activate” input makes the A signal input visible. If not checked, the CB-PWM block is active by default.

  • PWM parameters update rate selects when the duty-cycle and phase parameters are applied.

    • Single-rate: they are applied at the end of the carrier period.

    • Double-rate: they are applied twice per carrier period: when the carrier reaches its lowest point and when it reaches its highest point.

  • Dead-time duration: configures the dead-time duration if the Output mode is set at Dual (PWM_H + PWM_L).

PLECS block

Signal specification

  • The input αβ0 is the normalized reference vector in the stationary reference frame (-1.0 to 1.0).
  • The input A allows the activation (1) or deactivation (0) of the PWM output(s).

  • The input signal > is the clock input and must be connected to the CONFIG block or to an independent CLK.

  • The target outport (only visible at the atomic subsystem level) are the generated PWM signals, according to the selected Output mode (see PWM page for information). These outputs are only used in simulation.

The parameters output mode, addressed PWM, dead-time and show ”activate” input are common to all PWM blocks and are further documented on the PWM page.

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.

  • Converter type configures the SVM algorithm for a 2- or 3-level inverter.

  • Output mode selects between a single PWM signal or complementary signals with a dead-time.

  • Starting PWM channel: selects the first PWM output to be used for the set of PWM signals of the SVM algorithm.

  • Use optical outputs only selects if the PWM signals can be addressed only to the optical outputs, or if the electrical outputs (lanes 16 to 31) can also be used.

  • Show ”activate” input makes the A signal input visible. If not checked, the CB-PWM block is active by default.

  • PWM parameters update rate selects when the duty-cycle and phase parameters are applied.

    • Single-rate: they are applied at the end of the carrier period.

    • Double-rate: they are applied twice per carrier period: when the carrier reaches its lowest point and when it reaches its highest point.

  • Dead-time duration: configures the dead-time duration if the Output mode is set at Dual (PWM_H + PWM_L)

C++ functions

Functions specific to the space vector PWM

Select the PWM outputs
void SvPwm_ConfigureOutputs(tSvModulator modulator, tPwmOutput startingOutput,
	tPwmOutputType outputType, unsigned int startingDevice);

Configures the PWM outputs of a Space Vector modulator. 

It has to be called in UserInit().

Parameters

  • modulator: the SVM modulator id (SV_MODULATOR_0 to SV_MODULATOR_4)

  • startingOutput: the first PWM channel or lane to address

  • outputType: the nature of the PWM outputs (OPTICAL_PWM_OUTPUT or ELECTRICAL_PWM_OUTPUT)

  • startingDevice: the first B-Box/B-Board to addressed when used in a multi-device configuration.

Select between 2-level and 3-level
void SvPwm_ConfigureLevel(tSvModulator modulator, unsigned int level);

Configures the number of levels of the power converter.

It has to be called in UserInit().

Parameters

  • modulator: the SVM modulator id (SV_MODULATOR_0 to SV_MODULATOR_4)

  • level: the number of levels of the power converter (2 or 3)

Set the phase
void SvPwm_ConfigurePhase(tSvModulator modulator, float phase);

Configures the carrier phase-shift relative to the CLK.

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

Parameters

  • modulator: the SVM modulator id (SV_MODULATOR_0 to SV_MODULATOR_4)

  • phase: the carrier phase-shift relative to the CLK (0.0 to 1.0)

Select a CLOCK
void SvPwm_ConfigureClock(tSvModulator modulator, tClock clock);

Connects a clock generator to the modulator.

It has to be called in UserInit().

See: CLK - Clock generator

Parameters

  • modulator: the SVM modulator id (SV_MODULATOR_0 to SV_MODULATOR_4)

  • clock: the clock to use (CLOCK_0, CLOCK_1, CLOCK_2 or CLOCK_3)

Run algorithm in cartesian coordinates
void SvPwm_RunCartesian(tSvModulator modulator, float dAlpha, float dBeta, float dZero);

Runs the SVM algorithm in cartesian coordinates, and applies the corresponding duty-cycles to the configured outputs.

It can be called in the interrupt routine.

Parameters

  • modulator: the SVM modulator id (SV_MODULATOR_0 to SV_MODULATOR_4)

  • dAlpha: the component of the Space Vector to apply along alpha axis (-1.0 to 1.0)

  • dBeta: the component of the Space Vector to apply along beta axis (-1.0 to 1.0)

  • dZero: the homopolar component of the Space Vector to apply (-1.0 to 1.0)

Run algorithm in polar coordinates
void SvPwm_RunPolar(tSvModulator modulator, float m, float phi, float dZero);

Runs the SVM algorithm in polar coordinates, and applies the corresponding duty-cycles to the configured outputs.

It can be called in the interrupt routine.

Parameters

  • modulator: the SVM modulator id (SV_MODULATOR_0 to SV_MODULATOR_4)

  • m: the norm of the Space Vector to apply (0.0 to 1.0)

  • phi: the angle of the Space Vector to apply

  • dZero: the homopolar component of the Space Vector to apply (-1.0 to 1.0)

Run algorithm in 60° coordinates
void SvPwm_Run(tSvModulator modulator, float Vg, float Vh, float dZero);

Runs the SVM algorithm in the 60° coordinates, and applies the corresponding duty-cycles to the configured outputs.

It can be called in the interrupt routine.

Parameters

  • modulator: the SVM modulator id (SV_MODULATOR_0 to SV_MODULATOR_4)

  • Vg: the component of the Space Vector to apply along g axis (-1.0 to 1.0)

  • Vh: the component of the Space Vector to apply along h axis (-1.0 to 1.0)

  • dZero: the homopolar component of the Space Vector to apply (-1.0 to 1.0)

Select an update rate
void SvPwm_ConfigureUpdateRate(tSvModulator modulator, tPwmRate rate);

Select when the duty-cycle and phase parameters are applied.

  • Single-rate: they are applied at the end of the carrier period.

  • Double-rate: they are applied twice per carrier period: when the carrier reaches its lowest point and when it reaches its highest point. (for TRIANGLE and INVTRIANGLE carriers only)

It has to be called in UserInit().

Parameters

  • modulator: the SVM modulator id (SV_MODULATOR_0 to SV_MODULATOR_4)
  • rate: the update rate to use (SINGLE_RATE or DOUBLE_RATE)

Functions common to all PWM blocks

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

Select the output mode
void CbPwm_ConfigureOutputMode(tPwmOutput output, tPwmOutMode outMode,
	unsigned int device=0);

Selects the PWM output mode.

If the output mode selected is COMPLEMENTARY, a dead-time must be configured using the CbPwm_ConfigureDeadTime() function.

It has to be called in UserInit().

Parameters

  • modulator: the SVM modulator id (SV_MODULATOR_0 to SV_MODULATOR_4)
  • outMode: the output mode to use (COMPLEMENTARY, INDEPENDENT or PWMH_ACTIVE)

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

Configure the dead-time
void CbPwm_ConfigureDeadTime(tPwmOutput output, float deadTime, unsigned int device=0);

Configures the dead-time duration if the output mode is set as COMPLEMENTARY.

It has to be called in UserInit().

Parameters

  • modulator: the SVM modulator id (SV_MODULATOR_0 to SV_MODULATOR_4)
  • outMode: the output mode to use (COMPLEMENTARY, INDEPENDENT or PWMH_ACTIVE)

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

Activate the output
void CbPwm_Activate(tPwmOutput output, unsigned int device=0);
Deactivate the output
void CbPwm_Deactivate(tPwmOutput output, unsigned int device=0);

Activates or deactivates the addressed PWM output(s). If the addressed PWM output has been set as COMPLEMENTARY or PWMH_ACTIVE this function acts on both outputs.

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

Parameters

  • modulator: the SVM modulator id (SV_MODULATOR_0 to SV_MODULATOR_4)
  • device: the B-Box/B-Board to address when used in a multi-device configuration

  • No labels