How does your motor controller know where the rotor is?
The Zen Position Decoder is the rotor/shaft position-feedback block for closed-loop motor control — it reads where the motor is so a PWM drive can steer it. It carries two decode paths that run side by side: an incremental quadrature encoder decoder (A/B/Z, x1/x2/x4) and a resolver-to-digital path that turns sine/cosine samples into a shaft angle via a CORDIC atan2. For motor-control SoC integrators building EV traction, EPS steering, and BLDC/PMSM drives. Every number here is sourced from the product datasheet or marked TBC.
1. Position Decoder in one paragraph
The Position Decoder closes the motor loop: the PWM drive moves the rotor, and this block tells the controller where the rotor actually is. Feed it an incremental quadrature encoder — conditioned A/B/Z lines — and it decodes direction and a signed 32-bit position at x1, x2, or x4 resolution, homes or captures on the index pulse, measures speed over a programmable window, and flags illegal A/B transitions. Feed it digitized resolver sine/cosine instead, and a 14-stage CORDIC atan2 turns them into a 16-bit shaft angle plus a wrap-safe angular speed. Both paths run concurrently; the integrating wrapper picks which feedback source is active, and a single interrupt line aggregates index, speed, and fault events.
- encoder / resolver front end
- Position Decoder paths
- angle / position registers
2. What it is, at a glance
| Element | Detail | Status |
|---|---|---|
| Quadrature decode | A/B gray-code, 90° apart; signed direction | exists |
| Resolution modes | x1 / x2 / x4 edge selection | exists |
| Position counter | signed 32-bit, R/W preset to home/offset, MODULO wrap | exists |
| Index (Z) action | reset-to-home or capture-to-register | exists |
| Speed | signed counted edges per programmable window | exists |
| Glitch filter | per-channel debounce; programmable dwell | exists |
| Resolver angle | 14-stage CORDIC atan2; 16-bit, 4-quadrant | exists |
| Angular speed | wrap-safe signed delta (360°→0° reads small) | exists |
| Fault detection | illegal-transition + resolver loss-of-signal, both sticky | exists |
| Interrupts | 4 maskable sources, one aggregated line | exists |
| Hall-sensor commutation | roadmap | TBC |
| BiSS / EnDat / SSI absolute encoders | roadmap | TBC |
| Max input rate / fmax at node | characterization downstream | TBC |
Sources: Zen Position Decoder product datasheet; as-built RTL.
3. How a client uses it
- Instantiate the decoder on the peripheral bus; wire its single interrupt line into your controller.
- Connect a sensor — route an A/B(/Z) encoder through a line receiver, or feed digitized resolver sin/cos with a per-sample strobe. Both can be wired; select the active source at integration.
- Configure — pick x1/x2/x4 and glitch-filter dwell for the encoder, or the resolver magnitude-fault bounds; set the speed window; choose index reset-to-home or capture.
- Read the loop — the controller reads signed position and speed (quadrature) or 16-bit angle and angular speed (resolver) each cycle to run the field-oriented control.
- React to faults — route the sticky illegal-transition and resolver loss-of-signal flags into your safety aggregator for an ISO 26262 fault reaction.
4. Verification & provenance
- Checked against the math. The CORDIC angle is verified within ≤ 3 LSB of a golden
atan2across all quadrants and axes, including an arbitrary off-axis angle; angular speed tracks rate with correct sign, and a 350°→10° step reads as a small positive move, never full scale. - Exact-count assertions. Quadrature is checked for exact x1/x2/x4 count ratios, correct index reset/capture, sub-filter-length glitch rejection, signed speed, MODULO wrap, and illegal-transition detection — 17 of 17 assertion-based tests pass.
- Clean gates. Passes Verilator DV and Yosys synthesis with no inferred latches and no multi-driver nets; independently re-run on a fresh testbench.
Sources read
Sources: Zen Position Decoder product datasheet; as-built RTL.