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

Notation

Every page here uses the same symbols and the same conventions. This is the list, and the parameters of the machine the figures run on.

Conventions, fixed everywhere

These hold on every page. A page that needs a different one says so in its own text.

  • Amplitude-invariant scaling. The Clarke transform carries the 2/3 factor, so α and β hold the phase peak. Power is then 3/2 (v_d i_d + v_q i_q). The power-invariant convention scales by √(2/3) and has no factor — neither is wrong, and mixing them is.
  • α lies along phase a. β leads α by 90°.
  • d lies along the rotor flux, q leads d by 90°.
  • θ is measured from α, positive counter-clockwise.
  • Positive i_q makes positive torque on a machine with the rotor turning positive. Negative i_d weakens the field.
  • Duty is 0 to 1, centre-aligned, with the pulse centred on the middle of the period — so the null vector straddles the boundary.
  • Currents are per phase, and so are R_s, L_d and L_q. A line-to-line measurement is two windings in series.

Quantities

SymbolMeaningUnit
Phase currents, as measured at the machine terminalsA
The same current in the stationary two-axis frameA
The same current in the rotor frame — d along the magnet fluxA
Voltage the controller requests, in the rotor frameV
DC-link voltage at the bridge, not at the supplyV
Electrical angle of the rotor flux, measured from the α axisrad
Mechanical rotor angle, related by theta_e = p*theta_m + offsetrad
Electrical and mechanical angular velocityrad/s
Closed-loop crossover, the loop bandwidth in rad/srad/s
Electromagnetic torque produced at the airgapN·m
Duty cycle, 0 to 1, as written to a compare register—

Machine parameters

SymbolMeaningUnit
Stator resistance, per phase — not line to lineΩ
Axis inductances, per phase. Equal on a surface-magnet machineH
Magnet flux linkage seen by one phaseWb
Pole pairs — half the pole count—
Rotor plus load inertiakg·m²
Viscous friction coefficientN·m·s

Timing and control

SymbolMeaningUnit
Carrier frequency. The control ISR runs once per periodHz
Control period, 1/f_pwm for single-update PWMs
Transport delay, sample instant to the centre of the resulting voltages
Deadtime, the interlock between one device turning off and the other ons
Proportional and integral gains of a PI controllerV/A, V/A·s

The reference machine

One machine throughout the site, so numbers on different pages can be compared. A 48 V interior-magnet PMSM. Every value below is read from src/core/machine.ts at build time — the same constants the figures run on, not a copy.

QuantityValue
0.35 Ω
210 µH
330 µH
8.5 mWb
4
120 g·cm²
1.57×
0.051 N·m/A
4.36 V/krpm, line-to-line RMS
70.8 A

See also the formula sheet and what goes wrong.