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

Interactive field-oriented control

See a motor think.

Field-oriented control, from rotating vectors and coordinate transforms to production-ready interrupt code.

Start learning

24 pages · 6 chapters

shaft
— rpm
torque
— mN·m
i_d
— A
i_q
— A

Same instant, three views. The sinusoids on the left and the flat lines on the right are the same currents — that flatness is the whole point of the subject.

What is running here
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. Drag the torque demand.
  • Vectors to the ISR the transforms through to timer and ADC setup
  • Every figure is live change a parameter, watch the loop answer
  • The failure modes too deadtime, windup, angle error, saturation
  • One machine throughout 48 V PMSM, 0.35 Ω, 210/330 µH, 4 pole pairs

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, two per leg 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

    Read any three-phase quantity as one rotating vector, and scale a drive so nothing overflows.

  2. 02

    The machine

    Move between abc, αβ and dq in either direction, and know which angle each step needs.

  3. 03

    The inverter

    Predict the voltage a machine demands, the torque it returns, and where its speed runs out.

  4. 04

    Sensing

    Turn a voltage request into gate signals, and account for what deadtime takes back.

  5. 05

    Control and estimation

    Place a sampling instant that measures current rather than switching noise.

  6. 06

    Implementation

    Tune a current loop from machine parameters, and stop an integrator winding up.

Reference

Three ways into the same material that are not a chapter.

  • What goes wrong Thirty-two symptoms, and where each mechanism is explained.
  • Formula sheet Every equation on one page, with worked numbers from the model.
  • Notation Symbols, units, conventions, and the machine the figures run on.