FOC Reference Field-oriented control, from the equations to the ISR

Field-oriented control

An interactive reference for FOC — from the coordinate transforms through to the interrupt handler. Every idea comes with an equation you can follow, a figure you can drag, and code that runs.

Start reading → 13 pages · 8 chapters

A PMSM running under the site's own closed-loop model — PI controllers, space-vector modulation, exact-ZOH machine. Left: the current vector turning in the airgap with the rotor. Right: the same currents in the stator frame, where they are sinusoids, and in the rotor frame, where they are constants. That flatness is the whole point of the subject. Drag the torque demand.

The whole loop

FOC is not a list of topics, it is one loop whose parts only make sense in terms of each other. Every block here is a page — follow whichever one you need.

The field-oriented control loop: current references, PI controllers, inverse Park, SVPWM, the bridge, the machine, current sensing, Clarke and Park, and the rotor angle that ties it together. i d *, i q * v d , v q v α , v β gates v a,b,c i a,b,c θ θ i d , i q torque demand current refs MTPA, field weakening + current PI two axes, decoupled inverse Park dq → αβ SVPWM αβ → duties bridge six switches, deadtime PMSM v → i → torque shunts + ADC sampled at the centre Clarke → Park abc → dq rotor angle encoder or observer
The forward path runs along the top; the measurement path returns along the bottom. The rotor angle feeds both — it is the one signal that turns a pair of coordinate rotations into field orientation, and it is why so much of the subject is really about knowing where the rotor is.

Contents

  1. 01

    Foundations

    Three-phase systems, space vectors, per-unit, and what a reference frame actually is.

  2. 02

    Reference frames

    Clarke, Park, and the angle everything depends on.

  3. 03

    The machine

    PMSM models, dq voltage equations, torque production, saliency and field weakening.

  4. 04

    The inverter

    Three-phase bridge, deadtime, sinusoidal vs space-vector modulation, overmodulation.

  5. 05

    Sensing

    Shunt topologies, sampling instants, ADC timing, gain and offset error.

  6. 06

    Control loops

    PI design from machine parameters, cross-coupling, anti-windup, bandwidth.

  7. 07

    Rotor position

    Encoders, halls, and sensorless: back-EMF observers, sliding mode, HFI.

  8. 08

    Implementation

    Fixed point, timer and ADC synchronisation, ISR budgets, bring-up order.