Power Electronics
Field-Oriented Control: Steering a Motor's Magnetic Field
Every 100 µs, a modern EV traction drive freezes the swirling three-phase currents of a 200 kW motor into two DC-like numbers — one that sets torque, one that sets flux — regulates them with a pair of PI loops, and paints the result back onto the stator as a rotating field that stays locked exactly 90 electrical degrees ahead of the rotor's north pole. That trick, Field-Oriented Control (FOC), is why a Tesla, an ABB industrial servo, and a $4 drone ESC can all deliver crisp, ripple-free torque from standstill to 20,000 rpm.
Before FOC, an AC induction motor was a blunt instrument: you fed it a frequency and hoped. FOC turns that same three-phase machine into something you can command like a brushed DC motor — instantaneous torque with no cross-coupling — by mathematically rotating your frame of reference onto the rotor itself, so the messy, time-varying AC problem collapses into a stationary two-axis problem you can actually close a loop around.
- Core equationT = (3/2)·p·[λ_m·i_q + (L_d−L_q)·i_d·i_q]
- Control framed–q rotor reference (Park)
- Torque axisi_q (i_d ≈ 0 for SPM)
- Loop rate8–20 kHz current loop; 50 µs–125 µs
- Used inEV traction, CNC servos, drones, HVAC, robotics
- EnablersClarke/Park, SVM, IGBT/SiC, DSP/FOC IP
Interactive visualization
Press play, or step through manually. The visualization is yours to drive — try it before reading on.
Watch the 60-second explainer
A condensed visual walkthrough — narrated, captioned, under a minute.
The core problem: torque you can't touch directly
In any AC machine, torque is the cross product of two magnetic quantities: the rotor flux linkage λ and the stator current vector iₛ. For a permanent-magnet synchronous motor (PMSM) the instantaneous torque is T = (3/2)·p·(λ_d·i_q − λ_q·i_d), where p is the number of pole pairs. Substituting the flux relations λ_d = L_d·i_d + λ_m and λ_q = L_q·i_q gives the working torque equation:
- T = (3/2)·p·[λ_m·i_q + (L_d − L_q)·i_d·i_q]
The first term is magnetic (alignment) torque — it depends only on i_q, the current component in quadrature with the rotor magnet. The second term is reluctance torque, which appears only when the rotor is salient (L_d ≠ L_q, as in interior-PM machines). λ_m for a mid-size traction PMSM is roughly 0.05–0.15 Wb, L_d and L_q are on the order of 0.1–1 mH, and p is typically 3–8.
The trouble is that in stationary coordinates i_a, i_b, i_c are sinusoids that spin at electrical frequency ω_e = p·ω_m — up to 1–2 kHz at redline. You cannot put a simple PI regulator on a moving target that reverses sign 2000 times a second. FOC's entire job is to make i_q and i_d appear as constant DC quantities so that ordinary linear controllers work. The 90° geometry is the payoff: hold i_d ≈ 0, put all current into i_q, and torque becomes linear in current, exactly like a brushed DC motor's T = k_t·I.
Rotating the frame: the Clarke and Park transforms
FOC gets to DC quantities through two coordinate rotations applied every control cycle:
- Clarke transform (abc → αβ): collapse three 120°-spaced phase currents onto an orthogonal two-axis stationary frame. i_α = i_a, and i_β = (i_a + 2·i_b)/√3 (using i_a + i_b + i_c = 0). This throws away one redundant degree of freedom — three currents that sum to zero carry only two independent values.
- Park transform (αβ → dq): rotate the stationary αβ frame by the measured rotor angle θ_e so the axes spin with the rotor. i_d = i_α·cos θ_e + i_β·sin θ_e, and i_q = −i_α·sin θ_e + i_β·cos θ_e. Because the frame now turns at the same rate as the current vector, the sinusoids stand still — i_d and i_q become DC.
The single most important input to this whole chain is θ_e, the electrical rotor angle. Get it wrong by 10° and you lose ≈1.5% torque (cos 10°) and inject reactive current; get it wrong by 90° and the motor makes zero useful torque. θ_e comes from an encoder/resolver (accuracy ~0.02–0.1°) or, in sensorless FOC, from a back-EMF observer or a high-frequency injection estimator at low speed. The inverse transforms (Park⁻¹ then Clarke⁻¹) run the pipeline backward to turn the two DC voltage commands V_d, V_q back into three phase voltages for the inverter.
The control loop, step by step
A production FOC loop is a nested cascade executed synchronously with the PWM carrier, typically at 8–20 kHz (50–125 µs per cycle):
- 1. Sample two phase currents (shunt or Hall) via the inverter's ADC, synchronized to the PWM low side so you read them mid-conduction; infer the third from Kirchhoff's law.
- 2. Read θ_e and ω_m from the encoder/observer.
- 3. Clarke → Park: transform measured i_a, i_b into i_d, i_q.
- 4. Outer speed/position loop (run 5–10× slower, ~1–2 kHz) compares commanded to actual speed and outputs the torque command, which becomes the i_q reference. The i_d reference is held at 0 below base speed.
- 5. Two inner PI current loops drive i_d → i_d* and i_q → i_q*, producing V_d and V_q. These loops must include decoupling feedforward: V_d = V_d,PI − ω_e·L_q·i_q and V_q = V_q,PI + ω_e·(L_d·i_d + λ_m), because the d and q axes are cross-coupled through the rotating frame (the ω_e·L·i speed-voltage terms).
- 6. Inverse Park → SVM: convert V_d, V_q back to V_α, V_β, then space vector modulation computes the three half-bridge duty cycles, extracting ~15% more DC-bus utilization than sine-triangle PWM by injecting third-harmonic common mode.
- 7. Update the six gate PWM registers and repeat.
The current-loop bandwidth is set by the PI gains, tuned so the closed-loop pole sits at ω_c ≈ R/L·(K_p/R gain); a well-tuned drive reaches 500–1500 Hz current bandwidth, giving a torque step response of 1–2 ms.
Field weakening: pushing past base speed
The inverter can only synthesize a phase voltage up to V_max ≈ V_dc/√3 (≈ 0.577·V_dc with SVM). As speed rises, the back-EMF (E = ω_e·λ_m) grows until it hits that ceiling — the base speed. Above it, there is no headroom left to push more i_q, so torque would collapse unless you do something clever.
That something is field weakening: command a negative i_d to drive stator flux against the magnet, reducing net air-gap flux and therefore back-EMF. The constraint is the voltage circle (V_d² + V_q²) ≤ V_max² combined with the current circle (i_d² + i_q²) ≤ I_max². As you climb the constant-power region you trade i_q (torque) for negative i_d (flux suppression), holding roughly constant power P = T·ω. A typical traction PMSM delivers a constant-power speed ratio (CPSR) of 3:1 to 4:1 — full torque to base speed (~4000 rpm), then constant power out to 12,000–16,000 rpm. Interior-PM machines with reluctance torque and high saliency achieve wider CPSR because negative i_d also generates useful reluctance torque instead of pure loss.
The hazard: if the controller loses regulation during deep field weakening at high speed, the suppressing i_d vanishes and back-EMF instantly exceeds V_dc, dumping an uncontrolled generation (UCG) current back through the inverter's body diodes. That can overvolt the DC bus and destroy the capacitors and switches — which is why active short-circuit and safe-state logic is mandatory in EV inverters.
Hardware and where it lives
FOC is a software algorithm riding on specific silicon. The stack is remarkably consistent across a 5 W gimbal and a 250 kW traction drive:
- Power stage: a three-phase, six-switch inverter. Small drives use MOSFETs (30–150 V); industrial and traction use IGBTs (600–1200 V) or increasingly SiC MOSFETs, which cut switching loss ~50% and allow 20+ kHz PWM at 800 V bus voltages.
- Sensing: low-side or in-line current shunts (1–5 mΩ) with amplifiers, or Hall-effect current sensors; a resolver or optical encoder (or sensorless observer) for θ_e; and DC-bus voltage sensing for the voltage limit.
- Compute: a motor-control MCU/DSP (TI C2000, ST STM32G4, NXP), often with a dedicated math accelerator or FPGA. A full FOC cycle — 2 Clarke, 2 Park, 4 PI evaluations, 1 SVM — is a few hundred cycles; at 20 kHz it consumes maybe 10–20% of a 170 MHz core.
You'll find FOC in EV traction inverters (Tesla, Prius), industrial servo drives (ABB, Siemens Sinamics, Yaskawa) governed by IEC 61800 for adjustable-speed drives, CNC spindles, drone and e-bike ESCs (VESC, SimpleFOC), HVAC compressors, and robot joints where sub-degree positioning and smooth low-speed torque are non-negotiable.
Failure modes, limits, and best practice
Most FOC failures trace back to a corrupted transform or a bad angle rather than the power stage. The recurring ones:
- Angle error / encoder offset: a mis-aligned encoder zero rotates the entire dq frame. Symptoms are asymmetric current draw, reduced torque, and heating. Fix with a startup electrical-angle calibration (align to i_d and record the offset). A resolver-to-digital converter phase lag at high ω_e also shifts θ_e — compensate for it.
- Parameter drift: the decoupling feedforward and field-weakening trajectory depend on λ_m, L_d, L_q, and R. Winding resistance rises ~40% from 25 °C to 130 °C, and magnets lose ~0.1%/°C of λ_m (and can irreversibly demagnetize above their knee temperature). Poor parameters degrade decoupling and can make field weakening unstable. Use online estimation or thermal derating.
- Current-sampling error: reading current at the wrong instant in the PWM cycle, ADC gain/offset mismatch between phases, or dead-time distortion injects a 6th-harmonic torque ripple. Enforce synchronized ADC triggering and dead-time compensation.
- Voltage saturation windup: when V_d² + V_q² exceeds V_max the PI integrators wind up and the loop goes nonlinear. Always implement anti-windup with dynamic voltage limiting that prioritizes V_d (flux) over V_q so the machine stays magnetically controlled.
- Sensorless low-speed dropout: back-EMF observers fail near zero speed (E → 0). Below ~5–10% of base speed, switch to high-frequency injection or open-loop I/f startup, then hand off to the observer.
Best practice: tune the current loop first with the rotor locked, verify the decoupling terms with a step in i_q at speed, then close the speed loop with 5–10× separation between loop bandwidths to preserve cascade stability.
| Attribute | Scalar V/f control | Field-Oriented Control (FOC) |
|---|---|---|
| Controlled quantity | Voltage/frequency ratio (open-loop magnitude) | Torque & flux components (i_q, i_d) as DC values |
| Torque at zero speed | Poor / unusable; slips and stalls | Full rated torque from 0 rpm |
| Dynamic response | 100–500 ms, sluggish | 1–2 ms, near-instant (bandwidth 500–1500 Hz) |
| Torque ripple | 5–15% typical | <1–2% with good current control |
| Compute cost | Trivial (8-bit MCU) | DSP/FPGA, ~50–200 MFLOPS, fast ADC |
| Typical use | Fans, pumps (variable-torque loads) | Traction, servos, robotics, precision spindles |
Frequently asked questions
Why use FOC instead of simple V/f (scalar) control?
V/f control only sets a voltage magnitude and frequency; it cannot regulate torque directly, gives poor performance near zero speed, and responds in hundreds of milliseconds. FOC controls the torque-producing (i_q) and flux (i_d) current components independently as DC values, delivering full torque from 0 rpm, 1–2 ms dynamic response, and <2% torque ripple. The price is a DSP-class processor, fast synchronized current sensing, and knowledge of the rotor angle.
Why is the rotor angle θ_e so critical, and what happens if it's wrong?
θ_e defines the Park rotation that aligns your control frame with the rotor magnet. A 10° error costs about 1.5% torque and injects wasteful reactive current; a 90° error produces essentially zero useful torque and can cause runaway or braking. That's why every FOC drive either uses an encoder/resolver calibrated to the magnet's electrical zero or a sensorless observer, and why encoder-offset calibration is a mandatory commissioning step.
What is field weakening and when do you need it?
Above base speed the back-EMF (ω_e·λ_m) uses up all available inverter voltage, so you can't push more torque current. Field weakening commands a negative i_d to oppose the magnet flux, reducing back-EMF and extending the speed range at constant power. Typical PMSM traction drives reach a 3:1–4:1 constant-power speed ratio this way, but losing control during deep field weakening risks a dangerous uncontrolled-generation overvoltage on the DC bus.
How fast does the current control loop need to run?
The inner i_d/i_q PI loops typically run synchronously with the PWM carrier at 8–20 kHz (50–125 µs), because current-loop bandwidth must be roughly 5–10× the electrical frequency and 5–10× the speed loop. This yields a current-loop bandwidth of 500–1500 Hz. The outer speed/position loop runs slower, around 1–2 kHz, maintaining the cascade separation needed for stability.
Does FOC work on induction motors or only on PMSMs?
Both. On a PMSM the rotor flux is fixed by the magnet and θ_e comes directly from rotor position. On an induction motor there's no magnet, so you use indirect rotor-flux-oriented control: the flux angle is computed from the slip relation (the flux leads the rotor by the slip frequency), and i_d actively magnetizes the machine while i_q makes torque. The transform math and current loops are identical; only the flux/angle estimation differs.
Why add decoupling feedforward to the current loops?
In the rotating dq frame the two axes are cross-coupled by speed-voltage terms: the q-axis current induces a voltage on the d-axis (−ω_e·L_q·i_q) and vice versa. Without cancellation these terms fight the PI loops, degrading response as speed rises. Adding feedforward V_d = −ω_e·L_q·i_q and V_q = ω_e·(L_d·i_d + λ_m) makes the d and q loops behave as independent first-order systems, so a fast torque step doesn't disturb the flux axis.