Variable Frequency PWM

Purpose

Generate PWM signals with variable frequency

Library

Control / Modulators

Description

../../_images/varfreqpwm.svg

The Variable Frequency PWM block generates one or several PWM signals with a variable switching frequency.

The block offers different regular sampling methods for the modulation index if the parameter Carrier type is set to Symmetrical (carrier counts up/down). If double edge sampling is used, the modulation index is updated at the minimum and maximum of the carrier. The regular sampling methods are visualized in the Symmetrical PWM block. If the Carrier type parameter is set to Sawtooth (carrier counts up), the modulation index is updated when the carrier reaches the minimum.

The \(f'\) input is sampled when the carrier reaches the minimum, regardless of the Carrier type. Fig. 187 illustrates the \(f'\) input sampling and the sampling instant is indicated by a solid black dot.

../../_images/var_freq_pwm.svg

Fig. 187 Variable frequency PWM sampling diagram

Inputs and Outputs

The input m is the modulation index, \(f'\) is a frequency scaling factor, and the output s is the switching function. If the modulation index is a vector, the switching function is also a vector of the same width. The input \(f'\) has to be a scalar value. The output \(s\) is in on-state if the modulation index \(m\) is greater than the carrier.

m

A scalar or vector representing the modulation index.

f’

A scalar signal that represents a scaling factor for the nominal carrier frequency. The resulting carrier frequency is calculated as \(f_\mathrm{PWM} = f' \cdot f_\mathrm{nominal}\), where \(f_\mathrm{nominal}\) is the value of the Nominal carrier frequency parameter. The \(f'\) input must be in the range \([0.001, 1000]\).

Parameters

Carrier type

Specifies the carrier type. Sawtooth (carrier counts up) and Symmetrical (carrier counts up/down) counter modes are supported.

Modulation index sampling

The Regular Sampling method lets you choose among single update at either min or max, and double update at both min and max of the carrier. This parameter is visible if the Carrier type parameter is set to Symmetrical (carrier counts up/down).

Nominal carrier frequency

The nominal frequency \(f_{\rm nominal}\) of the carrier signal when the \(f'\) scaling factor input is equal to \(1\), in hertz \((\mathrm{Hz})\).

Carrier limits [min max]

The range of the carrier. The default is [-1 1].

Output values [off on]

Values of the switching function in off-state and on-state. The default is [-1 1].

Probe Signals

Max event

Outputs a rising edge if the carrier reaches the maximum value.

Min event

Outputs a rising edge if the carrier reaches the minimum value.

Carrier

Outputs the carrier signal for each channel.