General description

The sandbox PWM block allows driving the PWM output from a user-made modulator from within the FPGA.

Information on FPGA edition is available on PN116: Editing the FPGA firmware (sandbox)

Usage examples of the SB-PWM block are available on:

Because the user-generated FPGA signals still go through the PWM output chain, 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 A allows the activation (>0) or deactivation (<=0) of the PWM output(s).

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 device to address when used in a multi-device configuration.

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

  • Output configuration:

    • use checkbox: selects which PWM outputs are driven from the FPGA sandbox

    • output configuration: selects between a single PWM signal or complementary signals with a deadtime.

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

PLECS block

Signal specification

The input A allows the activation (>0) or deactivation (<=0) of the PWM output(s).

Parameters

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

  • Output mode selects between a single PWM signal or complementary signals with a deadtime.

  • Output lane(s) or Output channel(s)(vectorizable) selects which PWM outputs are driven from the FPGA sandbox.

  • PWM activation makes the A signal input visible if the option Use block input is selected. If not, the CB-PWM block is activated by default.

  • 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 sandbox PWM

There is no function specific to the sandbox PWM. The function SbPwm_ConfigureOutputMode() must be used to select the PWM outputs to be driven from the FPGA sandbox.

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);

Configures the PWM output to be driven from the FPGA sandbox and select 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

  • output: the PWM channel or lane to address

  • 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

  • output: the PWM channel or lane to address

  • 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

  • output: the PWM channel or lane to address

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

  • No labels