# Resolver (`resolver`)

> Outputs the sine and cosine of the shaft's electrical angle.

![resolver](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/img/resolver.svg)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/mechanical/resolver/)

**Group:** Mechanical · **Kind:** `{"element":"resolver","kind":"mechanical"}`

## When to use it

Use it to feed sin and cos angle signals to a tracking loop. Use Position Sensor for the angle itself and Incremental Encoder for counts.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `shaft` | mechanical | Shaft terminal, it reads speed and loads nothing |
| `sin` | signal | amp times the sine of the electrical angle |
| `cos` | signal | amp times the cosine of the electrical angle |

## Common parameters

- `amp`: Size of the excitation signal (Default: 1)
- `poles`: Number of poles of the machine (Default: 2)
- `theta0`: Shaft angle at the start (Default: 0)

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `amp` | — | 1 |  | Size of the excitation signal |
| `poles` | — | 2 |  | Number of poles of the machine |
| `theta0` | rad | 0 |  | Shaft angle at the start |

_Parameter descriptions are in English in both languages._

## Model

The sensor integrates the shaft speed from theta0 and forms the electrical angle θe = (poles/2)·angle. The outputs are sin = amp·sin(θe) and cos = amp·cos(θe), so sin² + cos² = amp². These are the demodulated outputs, with no excitation carrier. The sensor is ideal, with no error, noise or delay.

## Common mistakes

- The outputs are already demodulated, so there is no excitation carrier to see or remove. To recover the angle, use a calculation that knows the quadrant, because plain sin divided by cos loses it.
- poles sets how many electrical cycles one turn gives, so a two-speed resolver with two pole pairs needs poles of 4. It must be even, and an odd value is refused.
- amp must be above zero, or the run is refused. It is the output amplitude, not the excitation amplitude, so use the transformation ratio times the excitation, and the angle starts at theta0, which does not follow the machine.

Problems rules: `compile.error`

## Datasheet and sources

amp is the output amplitude, the transformation ratio times the excitation amplitude. poles is twice the number of pole pairs (the speed count, 1X for one pair), and theta0 is the starting angle in mechanical radians.

## Example

Open the example with the command `file.openExample` and the name `demo:resolver`.

---
Generated by `cargo xtask reference` from the usage texts and parameter specs. Do not edit by hand.
