Documentation Home Page HYPERSIM Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

Encoder Inputs


The Encoder In functionality of the OPAL-RT Board driver provides the simulation with the encoder signal acquisition data obtained from the digital input channels of the OP5353 modules installed in the simulator.
In the case of the OP4200 chassis, the OP5353 module is incorporated into the I/O cassette with ID OP4250-1.

The driver provides the simulation with each encoder's angular rate, position of wheel within the rotation, the direction of movement and the functionality status after doing a quick processing of the A, B and Z signals received by the physical modules.

The angular rate can be measured in Hertz (Hz) or revolutions-per-minute (RPM) while the position of the wheel can be seen as a raw value or as an angle.
The rates can be positive or negative to represent forward or backward movement. Therefore, their limits are between -166 to 166 Hz or -10000 RPM to 10000 RPM.

The direction of movement is 1 for forward movement, -1 for backward movement and 0 when the rate is 0.
The status values can be -5 when there is a calculation error and the timestamp difference is negative or 0 when the functionality is working correctly.

All the values above are retrieved from the simulation at every step through each encoder's Rate, Position of wheel, Direction and Status connection points within the channel group.
When there is no physical input, the values reported in the model are 0 for every input.


Once the bitstream configuration file has been parsed, the location of the digital input 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.

Channel group configuration

  • Name
    The name of the channel group denotes the physical channels of the digital input module the current configuration will be applied to.

  • Enable
    Checking this box will enable the acquisition of encoder data for the current group once the simulation has started, provided that the type of functionality is set to Encoder In (see item below for more detail).
    Clicking on Enable also makes each encoder's angular rate, position of wheel, direction and the functionality's status available as connection points in HYPERSIM. This means that if the user wishes to monitor these values, connections must be made between points in the model and the encoder input connectable points.

  • Digital type
    Given that the encoder functionality cannot be selected dynamically (i.e. it is not part of the SDIO functionality), this field will always be grayed-out. For receiving encoder input specific values, please verify that the field displays Encoder In.

  • Number of encoder signals
    The value entered in this field represents how many encoders of the group are to be monitored. There are at most two encoders per group, therefore the user has the option of choosing to monitor just one encoder or both. An encoder is composed of a set of A, B and Z signals. These signals are used to compute the angular rate, position of wheel and direction of the encoder.
    The state of these signals is retrieved from the physical modules as such:
1st channel of the group    channel A of the first encoder
2nd channel of the group  channel B of the first encoder
3rd channel of the group  channel Z of the first encoder
4th channel of the group  channel A of the second encoder
5th channel of the group   channel B of the second encoder
6th channel of the group     channel Z of the second encoder
7th channel of the group     not used
8th channel of the group       not used

Regardless of how many encoders are used, the last two channels of the group will always input '0'. They are not attached to any kind of functionality (such as PWM, static or time-stamped digital).
When only one encoder is used, the second encoder's inputs are disabled. Therefore, the fourth up to the last channels of the group will input '0'. 

  • Frequency unit
    The unit in which the angular rate provided in the model is to be interpreted. The user has the choice between revolutions-per-minute (RPM) or Hertz (Hz).

  • Resolution (# of cycles per revolution)
    The resolution is also known as pulses-per-revolution (PPR) or count per revolution (CPR).
    The value entered in this field represents the number of cycles of the A and B signals per revolution. The highest detectable resolution is 65535 PPR. This value is higher than the maximum resolution of the Encoder Out due to how the functionalities are implemented in the FPGA. It is necessary to set this parameter to the right value to get a good estimation of the rate. 

  • Clockwise rotation
    This parameter determines whether the encoder signals are produced with signal A leading signal B (causing a clockwise rotation), or the reverse. 

  • Auxiliary output type
    The auxiliary output represents the position of the encoder wheel. This parameter sets the way this output is to be shown: either raw data or as an angle displacement. Selecting Angle will cause the Angle unit field to appear below. 

  • Angle unit
    This field is only visible if the Auxiliary output type is set to Angle. The options are DegreeRadian or Revolution

  • Minimal rate
    The minimal rate defines the lowest rate detectable by the current Encoder In. The lowest possible value is ±0.1 RPM (~±0.0017 Hz). Under this value, the rate is assumed to be zero. This parameter uses the unit specified in the Frequency unit field. 

Signals configuration

Channels in encoder input groups do not have any parameters to configure. Please refer to the table above (in the Number of encoder signals section) to see how the encoder inputs translate to the physical channels of the digital input module.

Characteristics and limitations

For the connector pin assignments, the user should refer to the carrier documentation.

The current version of the encoder input functionality of the OPAL-RT Board driver has the following limitations:

  • Currently not available on the OP4510 platform's expansion card
  • The maximum detectable resolution is 65535
  • The minimum detectable rate value is ±0.1 RPM or ~±0.0017 Hz
  • The rates supported are between -166 Hz and 166 Hz or -10000 RPM and 10000 RPM
  • The bitstreams containing the encoder in functionality have to be compiled at 100 MHz


OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | | +1 514-935-2323