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

NameDirectionValue typeNotes
dutyinputdouble
outoutputdouble

Parameters

NameLabelTypeDefaultUnitsDescription
switching_frequencyf_swdouble1000Switching (carrier) frequency in Hz
amplitudeAdouble1High-state output value (low state is 0)
phaseφdouble0Carrier phase offset, normalised to one switching period (0..1)
polarityPolarityenum (Active high / Inverted)00 = active high (out=A while duty>ramp), 1 = inverted

Used in samples