> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/efpgasim-library/simulink-sps-workflow/machines/resolver-encoder-sensors.md).

# Resolver Encoder Sensors

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-ed252e83d278207c8dd599ba8628a4b839d7f698%2Fsps-ehs-resolver-encoder-sensors-block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **Resolver Encoder Sensors** block, located in the **eFPGAsim/External circuit editor workflow/Machines/Sensor** library, performs the control of up to 4 Resolvers and 4 Quadrature Encoders embedded in the machine model.

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-891f1b4b294e3d97bcb7d057a7d83f23f75e6d61%2Fsps-ehs-resolver-encoder-sensors-mask.png?alt=media" alt=""><figcaption></figcaption></figure>

| Parameter                                 | Description                                                                                                                                                                                                                                                                                                 |
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Block Mode**                            | <p>Two options:</p><p><strong>Quad generic machine model:</strong> it controls 4 Resolver and 4 Quadrature Encoder blocks<br><strong>Dual PMSM Variable DQ</strong> it only controls 2 Resolver and 2 Quadrature Encoder blocks instead.</p>                                                                |
| **Resolver/Encoder Source Select**        | Sets the resolver and encoder source.                                                                                                                                                                                                                                                                       |
| **Set all parameters from input ports**   | <p>When selected, all other parameters will be disabled from the block mask and corresponding input ports will appear for dynamic access during the real-time simulation.<br>Numerical value to send to the input port for the popup menus is written between square brackets in the description below.</p> |
| **Resolver Angle Offset**                 | Offset apply to the rotor angle in degrees to adjust the phase of the resolver angle.                                                                                                                                                                                                                       |
| **Resolver Pole Pairs**                   | Number of pole pairs of the resolver emulator. This parameter should be an integer number between 0 and 128.                                                                                                                                                                                                |
| **Resolver Reverse Speed**                | When selected \[1], this option reverse the resolver sine/cosine modulation direction                                                                                                                                                                                                                       |
| **Resolver Initial Angle**                | Offset apply to the rotor angle in degrees to adjust the starting phase of the resolver angle.                                                                                                                                                                                                              |
| **Resolver Carrier Select**               | Selects the resolver carrier source, between the internal carrier generator \[1] or an external source (generally from an analog input channel) \[0].                                                                                                                                                       |
| **Resolver Force Angle**                  | When selected the rotor angle of the resolver stops rotating.                                                                                                                                                                                                                                               |
| **Resolver Carrier Frequency**            | Internal carrier generator frequency, in hertz.                                                                                                                                                                                                                                                             |
| **Encoder Resolution**                    | The quadrature encoder resolution, in pulses per revolution.                                                                                                                                                                                                                                                |
| **Encoder Polarity**                      | This parameter sets the encoder polarity, Active-High \[1] or Active-Low \[0].                                                                                                                                                                                                                              |
| **Encoder AleadsB**                       | This parameter sets the BleadsA \[1] or AleadsB \[0].                                                                                                                                                                                                                                                       |
| **Resolver External Carrier Shift**       | Offset apply to the delayed time of external resolver excitation, in second. Max value is 2.5e-6\*2^10 = 0.00256s.                                                                                                                                                                                          |
| **Encoder Angle Offset**                  | Offset apply to the rotor angle in degrees to adjust the phase of the encoder angle.                                                                                                                                                                                                                        |
| **Encoder Pole Pairs**                    | Number of pole pairs of the encoder emulator. This parameter should be an integer number between 0 and 128.                                                                                                                                                                                                 |
| **Resolver Sine Modulator Sine Gain**     | The sine modulation output sine component amplitude. Default value is 1.                                                                                                                                                                                                                                    |
| **Resolver Sine Modulator Cosine Gain**   | The sine modulation output cosine component amplitude. Default value is 0.                                                                                                                                                                                                                                  |
| **Resolver Cosine Modulator Sine Gain**   | The cosine modulation output sine component amplitude. Default value is 0.                                                                                                                                                                                                                                  |
| **Resolver Cosine Modulator Cosine Gain** | The cosine modulation output cosine component amplitude. Default value is 1.                                                                                                                                                                                                                                |

## Inputs

The input ports description is equivalent to the parameter description above.

## Outputs

| Parameter     | Description                                                                                                                                                                                  |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **DataFrame** | This output is a Simulink composite signal containing all outputs from the resolvers and encoders emulated by the block and should be connected to the loadin port of Generic Machine block. |

## Characteristics and limitations

| Direct Feedthrough   | NO  |
| -------------------- | --- |
| Discrete sample time | YES |
| XHP support          | YES |
| Work offline         | NO  |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/efpgasim-library/simulink-sps-workflow/machines/resolver-encoder-sensors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
