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 Outputs


The Encoder Out functionality of the OPAL-RT Board driver provides the simulation the possibility of outputting encoder signals through the digital output channels of the OP5354 or OP5360-2 modules installed in the simulator.
In the case of the OP4200 chassis, the OP5360-2 used is incorporated into the I/O cassette with ID OP4260-1.

A, B and Z encoder signals are generated based on the angular rate provided during the simulation. The final form of these signals depends on the frequency unit chosen, the resolution of the turning wheels, which channel leads and finally on the polarity chosen.
These parameters are customizable for a group of 8 channels, which means they apply to both encoders in the group. A detailed description for them is given in the Channel group configuration section below. Individual configuration of encoders is not available. 

The frequency unit can be revolutions-per-minute (RPM) or Hertz (Hz). 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 rate of each encoder is to be transmitted to the simulation at every step through its Input connection point within the channel group.


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.

Channel group configuration

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

  • Enable
    Checking this box will enable the generation of encoder data for the channels in the group once the simulation has started, provided that the type of functionality is set to Encoder Out (see item below for more detail).
    Clicking on Enable also makes the connection points for each encoder's (up to 2 per group) angular rate (or speed) available in HYPERSIM.
    In order to output data, connections must be made between points in the model and the encoder output 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 the sending of angular rate values, please verify that the field displays Encoder Out.

  • Number of Encoder Signals
    The value entered in this field represents how many encoders of the group are to be controlled. There are at most two encoders per group, therefore the user has the option of choosing to control just one encoder or both. An encoder is composed of a set of A, B and Z signals.
    Frequency values will be transmitted from the model to the FPGA at each calculation step for each encoder. This value will then be used to compute the state of the A, B and Z signals. These signals will be outputted on the physical module's channels 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 output '0'. They are not controlled by any kind of functionality (such as PWM, static or time-stamped digital).
When only one encoder is used, the second encoder's outputs are disabled. Therefore, the fourth up to the last channels of the group will output '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. Its maximum is 32767 cycles per revolution. However, the maximum resolution combined with high rates will lead to precision loss. The highest resolution at which the maximum speed of 10000 RPM (166.67 Hz) or negative values are achievable is 25000 PPR. 

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

  • Polarity
    This parameter allows the user to choose the polarity of the A, B and Z signals of the encoder(s). Is it presented as a drop-down list and the two choices the list offers are Active high (default) and Active low.
    By Active high or Active low is meant that the active part of the duty cycle will be either low (low voltage) or high (high voltage).
    A signal that is configured to be Active high will output a high voltage value for the active part of its duty cycle, whereas an Active low signal will output a low voltage value for the active part of its duty cycle.

Signals Configuration

Channels in encoder output 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 outputs translate to the physical channels of the digital output module. 

Characteristics and limitations

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

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

  • Currently not available on the OP4510 platform's expansion card
  • The maximum guaranteed resolution is 25000
  • The rates supported are between -166 Hz and 166 Hz or -10,000 RPM and 10,000 RPM
  • The bitstreams containing the encoder out 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