PWM Out

Purpose

Generate a PWM signal on a digital output.

Description

../../_images/pwmout.svg

The PWM Out generates a configurable PWM signal on a digital output of the RT Box. The modulation index for each channel must be provided via the input signal, which is a vectorized signal if the block uses multiple channels. During an offline simulation it behaves as a normal PWM generation block.

Parameters

General

Digital output channel(s)

Index of the digital output channel. For vectorized output signals a vector of output channel indices must be specified.

Carrier type

Selects the carrier waveform, either sawtooth or symmetrical.

Carrier frequency

The frequency of the carrier in Hertz (Hz). Note that the duty cycle resolution of the PWM generator is directly linked to the selected carrier frequency. Lower carrier frequencies result in reduced resolution. For details, see “Selected nominal carrier frequency” and “Duty cycle resolution” columns in tables Tab. 16 and Tab. 17 in the PWM Out (Variable) component.

Carrier phase shift

The phase shift of the carrier signal, in p.u. of the carrier period. The parameter can be either a scalar or a vector with the same width as the number of output channels.

Carrier limits

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

Turn-on delay

Turn-on delay of the PWM output in seconds.

Polarity

The polarity of the PWM output determines whether the PWM signal is in on-state (value 1) or off-state (value 0) when the modulation index exceeds the carrier. The parameter can be either a scalar or a vector with the same width as the number of output channels.

Update

If “On carrier minimum”, “On carrier maximum” or “On carrier minimum/ maximum” is selected the modulation index will be sampled when the carrier reaches its minimum or maximum values. If “Immediately” is selected the modulation index will be updated after each simulation step of the RT Box.

Synchronization with model step

If “Enabled” is selected and the discretization step size is an integer multiple of the PWM period, the PWM generation will be synchronized with the simulation steps of the RT Box. If the block is placed inside of a task frame, the step size of the task frame will be used for synchronization.

Protection

Safe state

Specifies the state to which the output signal is set when the Powerstage Protection Unit is activated. A value of 0 indicates a low signal value (0 Volts), a value of 1 indicates a high signal value (3.3V or 5V, depending on the output voltage level). The parameter can be either a scalar or a vector with the same width as the number of output channels. The Safe state is also applied before the real-time simulation is started and after it is stopped (manually or due to a runtime error).

Powerstage protection unit

Specifies the Powerstage Protection Unit that is associated with this PWM block. If the Powerstage Protection feature is not needed, the option can be set to “None”. Otherwise, up to four Powerstage Protection Unit can be configured per model. If a Powerstage Protection Unit is selected that is not configured in the model, PLECS shows a warning when running an offline simulation or generating code. See Powerstage Protection Unit for details.

Advanced

Active polarity for turn-on delay

Specifies whether the turn-on delay is applied during the rising edge (1, default) or the falling edge (0) of the PWM signal. The polarity should be changed to 0 only for switches that are turned on when the output voltage is 0 Volts. This parameter has no influence on the polarity nor the safe state of the output signal. The parameter can be either a scalar or a vector with the same width as the number of output channels.

ADC trigger output

Allows to generate an ADC trigger output, either “On carrier minimum”, “On carrier maximum” or “On carrier minimum/maximum”. This block output is hidden when “Disabled” is selected. Otherwise, the ADC output is intended to get connected to a trigger input of an Analog In block.