Documentation Home Page ◇ RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
PWM Out
Description
The PWM Out functionality of the OPAL-RT Board driver provides the simulation with the possibility of outputting pulse width modulated values through the digital output channels of the OP5354 or OP5360-2 modules installed in the simulator.
In order to generate valid PWM signals, two inputs are required: the carrier frequency and the duty cycle. The shape of the PWM signals is defined by their polarity, initial phases, symmetricity and in the case that complementary signals are outputted, the dead time between them.
These parameters are customizable for each PWM signal. A detailed description for them is given in the Signals configuration section below.
The frequencies used must be between 0 and 180 kHz for bitstreams generated with RT-XSG version up to v3.3.3. After this version, the limit for the maximum frequency will depend on the hardware used in the system.
The duty cycles must be between 0 and 1.
Usage
Once the bitstream configuration file has been parsed, the location of the digital output modules becomes visible to the user. The channels of the modules are grouped into bunches of 8. By clicking on each group of 8, the user has access to the configurable options of the group.
Bitstreams generated with an RT-XSG version of 3.1.2 or later offer the possibility of using the selectable digital input-output feature (SDIO).
The SDIO feature gives the user the option to switch between the type of functionality (either static, PWM, or Event Generator) for a group of channels.
The user will know if the bitstream offers the feature as soon as its configuration is loaded in the General section of the Opal-RTBoard configuration page.
Verifying that a bitstream is SDIO-capable is done in the channel group configuration section. If the bitstream has the feature then a drop-down list is present. If it is not, the functionality is displayed as a non-editable field (i.e. grayed out).
Channel Group Configuration
Enable
Checking this box enables the transmission of PWM data for the channels in the group once the simulation has started, provided that the type of functionality is set to Pulse width modulated.
Clicking Enable also adds the connection points for each of the 8 channels' frequency and duty cycle in the Configuration panel of RT-LAB.
In order to output data, connections must be made between points in the model (in the form of OpOutput blocks) and the PWM output connectable points.
Connections with LabView panels are also possible.
To create a connection, the user drags-and-drops the connectable items onto an appropriate OpOutput block in the Configuration panel of the RT-LAB project.
Digital Type
In case the bitstream is SDIO-capable, this field takes the form of a drop-down list. This list provides the user with the choices for the type of functionality to be applied for the current group of 8 digital output channels.
To send frequency and duty cycle values (for the generation of the PWM signals), the option Pulse width modulated must be chosen.
Otherwise, if the bitstream is not SDIO-capable, this field is seen as non-editable. This means that the 8 channels in the current group can only operate with the functionality described in the grayed-out field. For the sending of frequency and duty cycle values, please verify that the field displays Pulse width modulated.
Output Complementary
This field is only visible if Pulse width modulated is specified in the Digital type field (described in the item above).
When this box is checked, a complementary signal will be generated for every other channel in the group, as seen in the schematic below:
Because a complementary signal is outputted on the channel adjacent to its reference, the number of user-configurable channels is divided by 2. Therefore, channels 1, 3, 5 and 7 in the signals list (where numbering starts from 0) will appear grayed out to denote that they will be used for outputting complementary signals.
Enable RT phase shift control
This field is only visible if the feature is supported in the bitstream and that Pulse width modulated is specified in the Digital type field (described in the item above).
Dynamic pulse shifting is available during run time when the box is checked. This means that the user can change the phase in real time, as opposed to setting it in the configuration (see Initial Phase in Signals configuration section below). To do so, connections must be made between the model and the newly created points for each enabled channel's phase.
Enable RT dead time control
This field becomes visible with the following conditions: the Output Complementary is set, the feature is supported in the bitstream and Pulse width modulated is specified in the Digital type field (described in the item above).
Dynamic dead time is available during run time when the box is checked. This means that the user can change the dead time in real time, as opposed to setting it in the configuration (see Dead time in Signals configuration section below). To do so, connections must be made between the model and the newly created points for each enabled channel's dead time.
Allow disabling channel
This field is only visible if Pulse width modulated is specified in the Digital type field (described in the item above).
Checking this box allows the user to disable of each channel in real time. To do so, a connection must be made with each channel's Disable connectable in order to control its output.
If Output complementary is set, the connection point controls both the channel and its complementary output. Note that the duty cycle of both physical channels (the PWM and its complementary) is set according to the polarity chosen (i.e. 0 for active high polarity and 1 for active low polarity).
Signals Configuration
Channels in pulse width modulated output groups have the following parameters to configure:
Polarity
This parameter allows the user to choose the polarity of each signal in the group. Is it presented as a drop-down list and the two choices the list offers are Active high (default) and Active low.
Active high or Active low means that the active part of the duty cycle is either low (low voltage) or high (high voltage).
A signal configured to be Active high outputs a high voltage value for the active part of its duty cycle.
As an example, for a signal with a frequency of 10 kHz (period of 100 us) and a duty cycle of 0.4, high voltage is output for 40 us (0.4 * 100 us)and low voltage for 60 us (the remaining time in the period: 100 us - 40 us).
In contrast, a signal configured to be Active low outputs a low voltage value for the active part of its duty cycle.
Taking the same example as above: low voltage will be outputted for 40 us (the active part of the duty cycle of 0.4 * 100 us) and a high voltage for the remaining60 us of the period.
Note that this mode has an influence on the complementary signals produced when the Output complementary checkbox is selected and a Deadtime value different from 0 is used.
In the Active high mode, low voltage is sent during the delay specified by the Deadtime value; in Active low mode, the high voltage will be sent during the delay.
Wave Mode
This parameter sets the generation pattern of the carrier wave of a signal. If the generation mode is set to Symmetric, the carrier is a triangular waveform. An Asymmetric generation mode corresponds to a sawtoothed carrier waveform.
As a result, a symmetric PWM signal has the same amount of time between the beginning of the period and the rising edge of its active phase as between the falling edge of the active phase and the end of the period.
For an asymmetric PWM signal, the rising edge of the active phase will be aligned with the beginning of the period.
This is illustrated below:
Initial Phase
This parameter is used to specify the phase between each PWM signal and the carrier wave.
The initial phase of the signal is expressed as a fraction of the period. For example, a signal with a frequency of 10 kHz (period being 100 us) that has been configured to have an initial phase of 0.1 will have the rising edge of its active phase delayed by 10 us (initial phase of 0.1 * period of 100 us).
Accepted values for this field are any floating-point values between 0 and 1.
Dead Time
This parameter is only visible if the Output complementary checkbox is selected.
The inclusion of dead time will reduce the length of the active phase of the two complementary waveforms, thus reducing their duty cycle.
The value mentioned in this field denotes an amount of time (in us) that the two complementary signals will remain in their inactive phases.
This concept is illustrated in the image below:
As mentioned above, when the polarity is Active low, the high voltage is sent during the delay specified in this field; if the polarity is Active high, then the low voltage is sent during the delay.
Floating-point values between 0.00 and 10.23 are accepted for this field.
Characteristics and Limitations
For the connector pin assignments, the user should refer to the carrier documentation.
The current version of the pulse width modulated digital output functionality of the OPAL-RT Board driver has the following limitations:
- The duty cycle values must range between 0 and 1
OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter