Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The rte_pwm_generation.mdl model demonstrates how to use RT-EVENTS blocks to generate PWM signals of a different type. This example also shows how to add dead time to the PWM and also shows how to generate Space Vector PWM using this block. It also compares many methods to generate PWM using RTE Logical Operator block, or RTE PWM block.

Table of Contents
maxLevel3

Library

RT-EVENTS Source

Block

Image Removed

Description

The RTE SPWM block generates square wave pulses at regular time intervals. The frequency and duty cycle of the input signals determine the shape of the output waveform.

The figure below shows the main characteristics of the generated square wave pulses. T, Ton, Toff, D, and f are the period, the time on, the time off, the duty cycle, and the frequency of the PWM signal respectively.

Square Wave Characteristics of the Generated PWM SignalsImage Removed

The RTE SPWM block outputs scalar or vector signals depending on the number of phases selected in the parameters dialog box. When multiple phases are selected, the duty cycle must be provided for all the phases, and the duty cycle inport takes a vector of the same width as the number of phases. Also, note that the frequency input is applied to all the phases.

Center alignment mode

The RTE SPWM block lets you specify to choose the PWM pulses alignment. Depending on the application, it may be important to output the pulse at the beginning of the period, or to output, the pulse centered relatively to the PWM period. The figure below shows the 2 supported modes. The parameters dialog box allows selecting the alignment mode using the Center alignment mode parameter.

Center alignment mode effectImage Removed

Space Vector PWM

The RTE SPWM block allows the output of space vector PWM based on the space vector representation of the carrier signal (or duty cycle signals) in the d-q plane. This option is very useful for controlling inverter output voltage in power electric applications.

Note that this option is only available when the number of phases is three.

Rise time delay

The RTE SPWM block allows the output of PWM pulse with a delay applied on the rising edge of the pulse. The figure below shows the effect of the delay on the normal and complementary PWM signals. Note that the rise time delay value must be smaller than half the minimum period of the PWM.

Rise time delay effectImage Removed

...

color#D3D3D3

Note: that this option is only available when the complementary mode is selected.

Maximum number of events

The Maximum number of events parameter is used to determine the maximum number of transitions that can occur during one calculation step and the maximum frequency that can be output by the PWM block. The following formula determines the maximum frequency:

Fmax = Num / ( 2 * Ts),

where Num and Ts are the maximum numbers of events and the block sample time.

Mask

RTE SPWM Mask ParametersImage Removed

...

Number of phases

...

The number of phases to be output. The PWM block supports up to 6 phases.

...

Center alignment mode

...

When disabled, the pulse starts at the beginning of the period. When enabled, the pulse is centered relative to the current period.

...

Maximum frequency

...

The maximum frequency output by the PWM block.

...

Minimum frequency

...

The minimum frequency output by the PWM block.

...

Show enabling port

...

If selected, the PWM block adds a control input port that determines when the block is executed. When the control signal has a value of one, the block executes at each simulation step. When the control signal has a value of zero (0), the block holds on the last output value.

...

Complementary PWM

...

If selected, the PWM block adds an output port that contains the complementary PWM signals of each phase.

...

Space vector PWM

...

If selected, the PWM outputs are generated from the space vector representation of carrier signals.

...

Rise time delay

...

The time delay, in seconds, that is inserted between the fall and rise events of the PWM signal and its complementary part. The rise time delay is also related to the dead time or the dead band parameters.

...

Maximum Number of events

...

The maximum number of events or transitions that can occur during a single step. Above that value, the next events are skipped.

...

Sample time

...

The time interval between samples, in seconds.

Input

...

Frequency (Double)

...

The pulse frequency, in Hz. This parameter applies to all the phases.

...

Duty Cycle (Double)

...

The duty cycle of each phase specified as the percentage of the pulse period during which the signal is on. Valid values are between 0 and 1.

...

Enable port (Double)

...

The enable port controls when the block is executed. See Show enabling port parameter above.

Output

...

PWM (RTE Boolean)

...

RTE Boolean signal generated by the PWM block.

...

Complementary PWM (RTE Boolean)

...

RTE Boolean complementary signal generated by the PWM block.

Characteristics

...

Direct Feedthrough

...

No

...

Sample Time

...

Fixed discrete.

...

Work Offline

...

Yes

...

Dimensionalized

...

No

Examples

The rte_pwm_generation.mdl model demonstrates how to use RT-EVENTS blocks to generate PWM signals of a different type. This example also shows how to add dead time to the PWM and also shows how to generate Space Vector PWM using this block. It also compares many methods to generate PWM using RTE Logical Operator block, or RTE PWM block.