> 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/dual-angle-sensors-with-faults-cpu.md).

# Dual Angle Sensors with Faults CPU

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-7bcc150dfb7d929c845c8103684910b7c68579bc%2Fsps-ehs-2angle-sensor-fault-block.png?alt=media" alt="" width="228"><figcaption></figcaption></figure>

The **Dual Angle Sensors with faults CPU** block, located in the **eFPGAsim/External circuit editor workflow/machines/Sensor** library, performs the control of the 2 resolvers and 2 Quadrature Encoders embedded in the FPGA Dual angle sensor with faults module.

It also communicates with the FPGA in order to monitor the resolver signals and the sensor angle.

## Mask parameters

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

{% tabs %}
{% tab title="General" %}

<table data-search="false"><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Set all parameters from input ports</strong></td><td>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. Numerical value to send to the input port for the popup menus is written between square brackets in the description below.</td></tr><tr><td><strong>Resolver {i} Carrier Source</strong></td><td>Selects the resolver carrier source, between the internal carrier generator [1] or an external source (generally from an analog input channel) [0].</td></tr><tr><td><strong>Resolver {i} Carrier Frequency</strong></td><td>Internal carrier generator frequency, in hertz.</td></tr><tr><td><strong>Resolver {i} Pole Pairs</strong></td><td>Number of pole pairs of the resolver/encoder emulator. This parameter should be an integer number between 0 and 63.</td></tr><tr><td><strong>Resolver {i} Angle Offset</strong></td><td>Offset apply to the rotor angle in degrees to adjust the phase of the resolver/encoder angle. This parameter is applied before the resolver/encoder pole pair parameter.</td></tr><tr><td><strong>Resolver {i} Reverse Speed</strong></td><td>When selected [1], this option reverse the resolver sine/cosine modulation direction</td></tr><tr><td><strong>Encoder {i} Resolution</strong></td><td>The quadrature encoder resolution, in pulses per revolution.</td></tr><tr><td><strong>Encoder {i} Polarity</strong></td><td>This parameter sets the encoder polarity, Active-High [1] or Active-Low [0].</td></tr><tr><td><strong>Show fault settings</strong></td><td>When this option is selected, parameters for fault control will appear in the block mask.</td></tr><tr><td><strong>Resolver {i} Sine Modulator Sine Gain</strong></td><td>The sine modulation output sine component amplitude.<br>Default value is 1.</td></tr><tr><td><strong>Resolver {i} Sine Modulator Cosine Gain</strong></td><td>The sine modulation output cosine component amplitude.<br>Default value is 0.</td></tr><tr><td><strong>Resolver {i} Cosine Modulator Sine Gain</strong></td><td>The cosine modulation output sine component amplitude.<br>Default value is 0.</td></tr><tr><td><strong>Resolver {i} Cosine Modulator Cosine Gain</strong></td><td>The cosine modulation output cosine component amplitude.<br>Default value is 1.</td></tr></tbody></table>
{% endtab %}

{% tab title="Configuration" %}

| Parameter                      | Description                                                                                                                                                                                                          |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Communication port numbers** | Number of the communication port used to communicate with the FPGA core. Please check the bitstream documentation to setup accordingly this tab.                                                                     |
| **Controller Name**            | Links this block to an OpCtrl block by entering the same 'Controller Name' as specified in the OpCtrl block. The OpCtrl block controls initialization of the settings of one specific FPGA-based card in the system. |
| {% endtab %}                   |                                                                                                                                                                                                                      |
| {% endtabs %}                  |                                                                                                                                                                                                                      |

## Inputs

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

## Outputs

| Output              | Description                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Resolver\[i]Out** | <p>This output is a Simulink composite signal containing all outputs from the resolvers and encoders emulated by the block.These signals are:</p><ul><li><strong>Theta\_sensor:</strong> Angle of the resolver/encoder pair as received from the Theta (i) input.</li><li><strong>sin\_res, cos\_res, car\_res:</strong> The resolver sine modulation, cosine modulation and carrier, respectively.</li></ul> |

## 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/dual-angle-sensors-with-faults-cpu.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.
