Documentation Home Page ◇ RT-XSG Toolbox Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
PWMI
Block
Mask
Description
The Pulse-Width Modulated Digital Input block computes the ‘on’ time and total time of one PWM period. Outputs are updated at every digital signal period. The two values can be used to compute the duty cycle of the input signal by the division Ton/Period. A digital filter can be applied to reduce the digital noise on the input signal.
Parameters
Signal polarity | Used to specify the input signal polarity. The polarity can be either Active-High (default) or Active-Low. Alternatively, the polarity can be set via an input port. ‘Active-Low’ for this parameter means that the signal is active-low, which means that a ‘Low’ output voltage is interpreted as a ‘1’ and a ‘High’ input voltage is interpreted as a ‘0’. ‘Active-High’ for this parameter means that the signal is active-high (default), which means that a ‘Low’ input voltage is interpreted as a ‘0’ and a ‘High’ input voltage is interpreted as a ‘1’. |
---|---|
Enable digital filtering of pulses | Used by the developer to enable (default) or disable digital filtering of narrow pulses on the input lines. The digital filter annihilates the effect of glitches on the line but induces a delay equal to the pulse minimum width. |
Pulse minimum width is set... | Available only if the digital filtering of narrow pulses is activated. It determines the mean by which the pulse minimum width is provided to the digital filters. It can be furnished either from a block input port of by a block parameter. |
Pulse minimum width, in seconds | Available only if the digital filtering of narrow pulses is activated and the developer has chosen to provide the pulse minimum width by a block parameter. The value corresponds to the pulse minimum width, in seconds (e.g. ‘100e-9’ = 100 nanoseconds, i.e. 10 clock cycles), between 0 and 10.23e-6 seconds. |
Add the digital input logic level as a ‘Status’ output | When selected, adds an output port to the block that gives the logic level of the input at the end of the preceding time step. |
Generate error on duration overflow | An overflow occurs if the on-time and/or period exceeds the capacity of a counter under the mask of this block. This capacity has been set to 20 milliseconds. |
Inputs
HSDIn | This signal is the input line. If the port width is larger than one, the signal MSBs are disregarded. |
---|---|
Enable | This signal allows the developer to enable/disable the update of the output registers. This input is also used to reset any error flag output. |
PulseMinWidth | This port is available only if the digital filtering of the pulses is enabled and if the developer has chosen to provide the pulse minimum width from a block input port. The number should be set as an integer number of 10-ns clock periods, between 0 and 1023). |
Polarity | This port is available only if the developer has chosen to provide the signal polarity from a block input port. The value corresponds to the polarity of the input lines. A ‘0’ for this parameter means that the signal is active-low, which means that a ‘Low’ input voltage is interpreted as a ‘1’ and a ‘High’ input voltage is interpreted as a ‘0’. A ‘1’ for this parameter means that the signal is active-high (default), which means that a ‘Low’ input voltage is interpreted as a ‘0’ and a ‘High’ input voltage is interpreted as a ‘1’. |
Outputs
TimeOn | This signal is the 20-bit wide Time-On value, corresponding to the total ‘on’ time, in clock ticks, of the last PWM period. This output is updated at the beginning of any PWM period with the last period data (Rising edge of HSDin for active-high signals or falling edge for active-low signals). |
---|---|
Period | This signal is the 20-bit wide PWM period total duration value, in clock ticks, of the last period. This output is updated at the beginning of any PWM period with the last period data (Rising edge of HSDin for active-high signals or falling edge for active-low signals). |
Status | This output port gives the logic level of the input after the application of the digital filter and is available only if the corresponding option is selected in the mask parameter window. |
Error | This output port is the ‘error’ flag and is available only upon request from the corresponding mask parameter. |
ErrorCode | This output port gives the error code associated with any error signaled by the ‘Error’ output port. The codes are the following:
|
Characteristics and Limitations
This block has no special characteristics. Figure 1 presents an example of its behavior for an active-high input signal.
Direct Feedthrough | N/A |
---|---|
Discrete sample time | N/A |
XHP support | N/A |
Work offline | YES |
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