PWM Modulator

Description
Universal PWM Modulator for 3-phase 2-level VSIs.
Universal PWM Modulation Strategies
The PWMModulator generates the six complementary gate commands of a 3-phase, 2-level voltage-source inverter (VSI) by intersecting three normalized phase references with an analytical triangular carrier of period T_{sw} = 1 / f_{sw} (set by SwitchingFrequency). Because the carrier is not discretized, the predictive time-step solver schedules the exact commutation instants , so there is no sampling-time constraint or risk of missing a switching edge.
Reference reconstruction and carrier comparison
Clarke inverse is used to rebuild phase references from the \alpha\beta inputs:
Each phase is normalized with respect to half the DC link voltage:
where v_0 depends on the modulation mode. The normalized values are clamped to [-1, 1] to keep the intersection with the carrier safe in over-modulation. The triangular carrier is defined analytically with amplitude \pm1:
Upper gate commands follow G_{x,H} = 1 if v_x \ge v_{\text{car}}(t), else 0, and the lower gates are their complements (no dead-time is injected here).
Available scopes
- Vdc, Valpha, Vbeta – raw control inputs to the Clarke-inverse block.
- GA_H…GC_L – the six complementary gate commands delivered to the bridge.
- Carrier – analytical triangular carrier v_{\text{car}}(t) .
- Zero-sequence injection – the offset v_0 added to all phases according to the selected PWM strategy.
- Va_n, Vb_n, Vc_n – normalized phase references before zero-sequence injection (pure Clarke inverse divided by V_{dc}/2).
- Va_n (post zero-seq), Vb_n (post zero-seq), Vc_n (post zero-seq) – normalized phases after adding v_0 and clamping to [-1, 1] (these drive the gate comparison).
Modulation modes and zero-sequence injection
The carrier comparison stays identical for all modes; only the zero-sequence v_0 changes. Let \theta = \operatorname{atan2}(V_\beta, V_\alpha) and m_a = \dfrac{\sqrt{V_\alpha^2 + V_\beta^2}}{V_{dc}/2} be the modulation index.
Sine PWM (SPWM)
Pure sinusoidal modulation without offset:

Carrier-based MIN-MAX (carrier SVM)
Maximize the linear range (m_a \le \sqrt{2/3} \approx 1.15) by inserting a zero-sequence derived from the extrema of the normalized phases:
This reproduces the classic space-vector dwell pattern while keeping the carrier-based implementation.

Discontinuous PWM (DPWMMIN)
Clamps each phase to the negative rail during its 120° inactive sector to reduce commutations on the low-side devices:
The reference that reaches the minimum is pinned to -1, producing zero switching losses for the corresponding leg in that region.

Discontinuous PWM (DPWMMAX)
Symmetrical to DPWMMIN but clamps to the positive rail so the high-side switches rest:
Select this when the thermal stress on high-side devices dominates.

Discontinuous PWM1 (DPWM1)
Ensures the phase with the highest magnitude is clamped symmetrically around its peak (30° before/after), improving harmonic distortion while keeping one leg idle at any time:

Third-Harmonic Injection (THIPWM)
Adds a fixed third-harmonic component proportional to the modulation depth to boost the fundamental phase voltage while keeping continuous switching:
Here, \theta is the electrical angle of the fundamental setpoint in the \alpha\beta plane. The cosine term keeps the injected harmonic in phase with the reference voltages generated in the solver, extending the linear range while preserving continuous switching.

Space Vector Modulation (SVM)
This modulation strategy is one of the most popular overmodulation methods. It directly defines a sequence of different switching states to follow the complex vector voltage of the three-phase reference system.

Scope usage in SVM mode
When PWMType is set to SVM, the following outputs behave differently:
- Carrier: returns 0 (no carrier used in SVM)
- Zero-sequence injection: returns 0 (SVM does not use v_0 offset)
- Va_n…Vc_n (pre/post zero-seq): return 0 (Clarke-inverse normalization is bypassed in SVM)
The Vdc, Valpha, and Vbeta inputs remain active and directly control the sector selection and dwell-time calculation.
Library
Control > Sources
Pins
| Name | Description |
|---|---|
Parameters
| Name | Description |
|---|---|
| SwitchingFrequency | Switching frequency [Hz] |
| PWMType | PWM modulation type (cast to enum in solver) |
| SamplingTime | -none or 0: No sampling. The system will be solved in the Newton loop (default). -auto: Inherit the sampling time of its source device. -Sampling Period: defined in seconds. |