CB-PWM – Carrier-based PWM
Table of Contents
The Carrier-based PWM block generates PWM signals based on one of the 4 following carrier shapes:
When using the single-rate update configuration, the computed duty-cycle is synchronously applied at the end of the PWM period. With the double-rate update and a TRIANGLE carrier, 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 carrier is configured by connecting the CB-PWM block to a Clock generator. The frequency can even be tuned during the control execution as explained in Variable frequency operation with the B-Box/B-Board.
The phase-shift of the carrier can also be changed during execution, independently for each PWM block.
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 signal
D
is the duty-cycle (0.0 to 1.0) - The input signal
P
is the carrier phase-shift relative to the CLK (0.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 input
A
allows the activation (>0) or deactivation (<=0) of the PWM output(s). - The output(s) is/are the generated PWM signal(s), according to the selected
Output mode
. The output(s) is/are only used in simulation.
Parameters
- Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
- Output mode selects between a single PWM signal or complementary signals with a deadtime.
- Addressed PWM selects the PWM outputs to address.
- Modulation parameters
- Carrier type selects the type of carrier (TRIANGLE, SAWTOOTH, INVTRIANGLE, or INVSAWTOOTH)
- Duty-cycle configures the duty cycle. It can be tuned in real-time using the D signal input or be configured only once from the block mask parameter.
- Phase configures the carrier phase-shift relative to the CLK. It can be tuned in real-time using the P signal input or be configured only once from the block mask parameter.
- 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. (for TRIANGLE and INVTRIANGLE carriers only)
- Simulation output type
- PWM signals: outputs are logic gate signals 0 or 1.
- Duty-cycle: outputs are duty-cycles between 0 and 1. This option is only used with averaged power switch models.
- Complementary signal parameters
- Dead-time duration configures the dead-time duration if the Output mode is set to Dual (PWM_H + PWM_L).
output mode
, addressed PWM
, dead-time
and show ”activate” input
are common to all PWM blocks and are further documented on the PWM page.PLECS block
Signal specification
- The input signal
D
is the duty-cycle (0.0 to 1.0) - The input signal
P
is the carrier phase-shift relative to the CLK (0.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 input
A
allows the activation (>0) or deactivation (<=0) of the PWM output(s). - The target outport(s) (only visible at the atomic subsystem level) is/are the generated PWM signal(s), according to the selected
Output mode
. The output(s) is/are only used in the simulation.
Parameters
- Addressing
- Device ID selects which B-Box/B-Board 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 the PWM outputs to address.
- Modulation parameters
- Carrier type: selects the type of carrier (Triangle, Sawtooth, Inverted triangle, or Inverted sawtooth)
- Duty-cycle(s)(vectorizable) configures the duty-cycle. It can be tuned in real-time using the D signal input or be set as a constant and configured from the block mask parameter.
- Carrier phase-shift(s)(vectorizable) configures the carrier phase-shift relative to the CLK. It can be tuned in real-time using the P signal input or be set as a constant and configured from the block mask parameter.
- 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.
- 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. (for triangle and invtriangle carriers only)
- Simulation output type
- PWM signals: outputs are logic gate signals 0 or 1.
- Duty-cycle: outputs are duty-cycles between 0 and 1. This option is only used with averaged power switch models.
- Complementary signal parameters
- Dead-time duration configures the dead-time duration if the Output mode is set at Dual (PWM_H + PWM_L).
output mode
, addressed PWM
, dead time
and PWM activation
are common to all PWM blocks and are further documented on the PWM page.C++ functions
Functions specific to the carrier-based PWM
Functions common to all PWM drivers
These functions are common to all PWM blocks. Further documentation is available on the PWM page.