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.
OpFcn Engine Sync Pattern Gen
Block
Mask
Description
The functionality is used to simulate an engine rotation and produce pulse patterns synchronized on angular engine positions. This feature is called Engine Synchronous Pulse Generation (ESPG).
Pulses may be defined either as:
- rise and fall engine positions or
- a start position combined with a pair of time duration specific to each engine direction.
The maximum number of pulses that may be generated on a channel is limited by these factors:
- The angular resolution. For instance, if the cycle duration is 720° and the angular resolution is 0.1, the maximum possible number of pulses is 7200°.
- The firmware capacity of 256 events per calculation steps.
- The engine speed. A faster engine will require more pulses per step.
- Computation time. Sorting pulses and transfering them to the firmware requires computation time, which may lead to overruns. This is the factor which is the most likelly to cause limitations.Guidelines are provided below for minimizing the computation load.
Important note: Negative speeds, Slow-To-Stop sequences, Pattern Position Switching sequences and time based pulses are supported only by RPG module bitstreams with minor ID 6 or later.
Parameters
Controller Name | Each functionality block such as the OpFcnAnalogIn block must refer to an OpCtrl block such as the OP5130 Ctrl block, that will manage the data transfer with the IO board. The binding between OpFcn and OpCtrl blocks is performed via the use of the Controller name that each OpCtrl block uniquely defines. This binding is checked during the initialization phase of the model. If no OpCtrl block is found that defines the same Controller Name as this OpFcnAnalogIn block, the OpFcnAnalogIn block is simply disabled and returns 0s. |
---|---|
Selection of functionalities | Selection of ESPG channels to be used. The possible values are dependent on the controller block and hardware. |
Cycle duration | Duration of an engine rotation cycle. Many applications use 720°, which is actually two engine rotations. |
Max speed | The maximum speed, in RPM, at which the engine is expected to run. The maximum possible speed is limited by the model sample time. An engine cycle must last at least four calculation steps. Use the following formula to validate the maximum speed: 4 < (Cycle duration) / (6 * Max speed * Model Sample time) |
Resolution | Resolution in degrees required for the pulse generation. Most applications use 0.1 degrees. This parameter affects the maximum speed. For example, if the resolution is set to 0.001 degrees, the maximum speed (before losing pulses)is 2600 rpm, but if the resolution is set to 0.1 degrees, the maximum speed without losing pulses is 7000 rpm. |
Number of Patterns | Number of patterns that will be used for the simulation. This number is required to set the size of the different data buses for the Slow-To-Stop and Pattern Position Switching functionalities. |
Maximum pulses per channels | Number of pulses that will be used for a specific channel or all channels of each pattern. This field can be set with two different possible inputs :
|
Activity State | Active high or active low pulses may be produced. |
Use Slow-to-Stop feature | Create the block inports/outports required for Slow-to-Stop sequences. A Slow-to-Stop sequence is composed of the following phases:
|
Use Pattern Position Switching feature | Create the block inports/outports required for Pattern Position Switching sequences. A Pattern Position Switching is to occur on the ordered positions set in the "Pattern Switch Angles" input of the block. |
Maximum number of pattern position switch points | Maximum number of pattern position switch points that will be used during the Pattern Position Switching sequence. Slow-to-Stop and Pattern Position Switching are supported only by RPG module bitstreams with minor ID 6 and later. These options and their related settings are disregarded by earlier bitstream revisions. |
Inputs
Speed | Rotation speed in RPM. A positive value indicates forward rotation (from 0° to Cycle duration) and a negative value indicates backward rotation (from Cycle duration to 0°). Any value between ±Max Speed may be used. For bitstreams that do not support backward rotation, negative values are handled the same as 0. |
---|---|
Pattern Select | Number that specifies which pattern is to be used at the current model step. This input is disregarded when a STS and/or RPPPS sequence is active. |
Pulse Counts N | A vector specifying the number of pulses for each channel of the pattern N. |
Pattern N | An input (array) is created for each pattern. These are used to describe the pulses to be generated. Each pulse may be described either as start and stop positions or a start position and a time duration. Each input is a vector whose width is equal to twice the sum of the maximum number of pulses to be generated on each channel. Each pulse has two entries in each channel vector. The content of the pattern vector is ordered based on the sizes set in the Maximum pulses per channels vector. |
| The first entry is the active edge position and the other inactive edge position. The pulses are always defined for the forward duration and the ESPG block will automatically mirror the pulse around its start position in when to rotation is backward. For instance, a [485° 490°] pulse in the forward direction will become [485° 480°] in the backward direction. |
| The first entry is the position of the active edge and the second value indicates the duration for each direction as follows: |
[StartPosition 100000000+BackwardDuration*10000+ForwardDuration] where BackwardDuration is the duration of the pulse in tenths of microseconds when the engine is running backward and ForwardDuration is the duration of the pulse in tenths of microseconds when the engine is running Forward. | |
The following rules, though not essential, are heavily recommended in order to minimize the required computation time: | |
| |
For a given channel, some example of valid patterns would be: | |
| |
Phasing | A vector specifying an angular offset in degrees to be applied to each channel. This is useful to shift individual patterns. Any positive or negative values are supported. This value is considered at every step independently of the Latch input. |
Latch | If the input is higher than 0.5, the patterns described on the pattern inputs are to be reloaded. This mechanism is used to:
|
Sequence Enable | When this input goes higher than 0.5, a Slow-To-Stop and/or Pattern Position Switching sequence is initiated under the following circumstances:
Aborting a STS and/or RPPPS sequence is possible by setting Sequence Enable to 0.When a STS sequence is aborted, the engine will return to its normal mode and will keep the last STS speed as its nominal speed. When an RPPPS sequence is aborted, the engine will return to its normal mode and will keep the last RPPPS pattern as its current pattern. The following inputs are available when the Slow-to-Stop option is used: |
STS Enable | When this input goes higher than 0.5, a Slow-to-Stop (STS) sequence will be initiated when the Sequence Enable is triggered. Once started, the STS sequence may be interrupted in any STS region. |
Important | Once a slow to stop sequence is started, the following signals are saved internally and further changes are disregarded until the end of the Slow-to-Stop sequence:
Pulse positions and phasing remain configurable for all patterns. |
STS Speed | The speed, in RPM, at which the engine is expected to run during the STS sequence. May be either positive or negative. Any engine speed exceeding Max speed will be saturated. The minimum possible speed is: Minimum speed (RPM) = 1.24176 * Resolution Any speed entered below this threshold will be interpreted as a stop (0 RPM) |
STS Gradient | The rate at which the speed will go from the current speed to the STS Speed once the STS sequence is started. The unit is RPM/s. Positive and negative values are accepted but only the absolute value is considered. The application will determine automatically the direction of the speed change. |
STS Stabilization Position | The angular position in degrees around which the engine will be once the slow down is completed. This is useful to position the engine near points of interests (such as the first STS position) since a full engine rotation may last minutes at low speeds. |
STS Position Counts | Number of valid positions in the STS Positions inport. The maximum number of STS Positions is 16. |
STS Positions | Angular positions in degrees at which the engine will switch the direction during the STS sequence. The last valid value in the signal is the stop position. The consecutive STS positions values must be separated by at least 2 resolution units. Used in conjunction with the STS Position Count input. |
STS Stop Duration | The engine will stay stopped until the STS Stop Duration (in seconds) elapses. If this value is 0, the engine will stay stopped until the user changes the engine speed input. |
The following inputs are available when the Pattern Position Switching option is used: | |
Pattern Switch Enable | When this input goes higher than 0.5, a Pattern Position Switching (RPPPS) sequence will be initiated when the Sequence Enable is triggered. Once started, the RPPPS sequence may be interrupted at any step of the sequence. |
Important | Once a Pattern Position Switching sequence is started, the following signals are saved internally and further changes are disregarded until the end of the sequence:
|
Pattern Switch Counts | Number of valid positions in the Pattern Switch Angles inport. This number is not limited. |
Pattern Switch Angles | Angular positions in degrees at which the engine will switch pattern during the Pattern Position Switching sequence. The last valid value will be the active pattern once the Pattern Position Switching sequence is completed. Used in conjunction with the Pattern Switch Counts input. |
Pattern Switch Offsets | Number of engine cycles to be reached for each Pattern Switch Angle before switching pattern. Offsets must be set to 0 if the related STS Region is different from -3, -2 or the Pattern Switch Counts value. |
Pattern Switch STS Regions | STS Region that contains the related Pattern Switch Angle. Must be set to 0 if STS Enable is set to 0 or if STS Position Counts is set to 0. |
The following describes the different STS Regions and if the user can set an engine cycle offset in the related STS region:
STS Region Number | Description | Engine Cycle Offset Allowed |
---|---|---|
0 | Region value to specify when STS functionality is deactivated. | Yes |
-3 | Region where a pattern will switch before the STS Gradient begins. | Yes |
-2 | Region between the STS Gradient starting point and the STS Stabilization Position. | Yes |
-1 | Region between the STS Stabilization Position and the first direction switch. | No |
1 to N - 1 (N = STS Position Counts) | Regions where a pattern switch will occur during a STS event. | No |
10 | Region where the pattern switch will occur after the STS event has completed. | Yes |
Pattern Switch Patterns: Pattern to be switched to when the engine meets the related Pattern Switch Angle.
Outputs
Position: Angular position of the engine at the beginning of the current step in degrees.
Status: The possible values are:
Value | Description |
---|---|
0 | No errors |
-1 | FIFO accumulation detected. This usually means that an execution overrun occurred (model computation time exceeded the specified sample time). |
-2 | Invalid pulse pattern. One of the pulse patterns did not respect the set of rules described above. |
-3 | Invalid time. Obsolete code that can only be reported by old firmware revisions. |
-4 | FIFO overrun. In this condition, the firmware event FIFO has been cleared. This could result from a model overrun or an engine that is running to fast for the model sample time. |
-5 | FIFO underrun. Obsolete code that can only be reported by old firmware revisions. |
-6 | Number of events exceeds hardware limitation. The hardware is limited to a maximum of 16 events per sample time. |
-7 | STS Position count error. Due to a difference between the vector size for the STS Reverse and Stop Positions input and the STS Position Count input value. |
-8 | Activity State vector has been disabled. Due to incompatible size, the polarity cannot be set for each channel separately. Only global polarity (low/high) will be available. |
Current Pattern Set: Displays the number of the current Pattern.
STS Status: Available only if the Slow-to-Stop option is used. Allows monitoring the evolution of a Slow-to-Stop sequence. The possible values are:
Value | Description |
---|---|
0 | No STS sequence is in progress and the engine is allowed to rotate freely. |
-3 | The system is waiting for the appropriate moment to start slowing down in order to reach STS Speed near the STS Stabilization Position. |
-2 | The engine speed is changing from the current speed to the STS Speed value at the rate specified by STS Gradient. This corresponds to the engine slowing down. |
-1 | The engine speed has reached the STS Speed value and the engine position is currently between the STS Stabilization position and the first STS Position. |
1 to N - 1 (N = STS Position Counts) | The engine is now progressing between specified STS positions, one after the other. |
N (N = STS Position Counts) | The engine is now stopped, the Slow-To-Stop sequence has reached its end. |
Pattern Switch Status: Available only if the Pattern Position Switching option is used. Allows monitoring the evolution of a Pattern Position Switching sequence. The possible values are:
Value | Description |
---|---|
0 | No Pattern Position Switching sequence is in progress and the engine is allowed to rotate freely. |
1 to N (N = Maximum number of pattern position switch points) | A Pattern Position Switching sequence is in progress, the Pattern Position Switch Point index to be reached is displayed. |
Pattern Switch Warnings: Allows to monitor the validity of the parameters of each switch point.If at least one warning value is different from 0, the user will not be able to launch a Slow-To-Stop and/or Pattern Position Switching sequence. The possible values are:
Value | Description |
---|---|
0 | The parameters of the corresponding switch point are valid. |
-10 | In this STS Region, the use of the engine cycle offset is forbidden. It must be set to 0. |
-11 | The corresponding engine cycle offset is inferior to 0 or is superior to the internally calculated number of rotation required for the STS Slow Down region. This internal calculation is based on different parameters: current speed, STS speed, and STS Stabilization Position |
-12 | The corresponding Pattern Switch Position does not fit, based on the previous Position Switch Angle and the boundaries of the related STS region. |
-13 | The corresponding STS Region is forbidden. The possible values are -3, -2, -1 and 1 to N (N = STS Position Counts value). The transition point between the two STS Regions belongs to the previous STS region. |
-14 | The corresponding Pattern number is forbidden. The possibles values are 1 to N (N = Number of Patterns). |
Characteristics and Limitations
Note: The active pattern state is always applied to the ESPG outputs at the beginning of each calculation step. For instance, this means that if the current position is 150° and the block is requested 100° to 200° pulse, the pulse will be active starting at150° rather than waiting for the next passage through 100°.
Direct Feedthrough | Yes |
---|---|
Discrete sample time | Yes |
XHP support | Yes |
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