Skip to content

PWM Generator ​

Pulse-width modulation source. Compares an internal triangle/sawtooth carrier (frequency f_sw) against an input duty signal to produce a 0/A switching waveform that drives an IGBT, MOSFET, or other power switch.

Category: Sources

Ports ​

PortKindSignalNotes
dutyControl inputReal
outControl outputReal

Parameters ​

ParameterTypeDefaultUnitsDescriptionID
f_swNumber1000—Switching (carrier) frequency in Hzswitching_frequency
ANumber1—High-state output value (low state is 0)amplitude
φNumber0—Carrier phase offset, normalised to one switching period (0..1)phase
PolarityChoice: Active high / InvertedActive high—0 = active high (out=A while duty>ramp), 1 = invertedpolarity

Used in samples ​

In the course ​