Interactive field-oriented control
See a motor think.
Field-oriented control, from rotating vectors and coordinate transforms to production-ready interrupt code.
- 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
- 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.
Contents
- 01
Foundations
Read any three-phase quantity as one rotating vector, and scale a drive so nothing overflows.
- Space vectors Where the rotating field comes from, and why two numbers describe three phases.
- Power in three phases Why one phase pulses to zero, three deliver a constant, and where the 3/2 comes from.
- Clarke and Park abc to alpha-beta to dq, the 2/3 factor, and what an angle error costs.
- Per-unit and scaling Normalised bases, fixed-point formats, and choosing them so nothing overflows.
- 02
The machine
Move between abc, αβ and dq in either direction, and know which angle each step needs.
- PMSM dq model The four parameters, the voltage equations, and measuring them without dropping factors.
- Measuring the machine Where the four parameters come from, the factors that get dropped, and what heat does to them.
- Torque and MTPA Magnet torque, reluctance torque, and why id = 0 is not always the optimum.
- Field weakening What to do when the back-EMF reaches the DC link and negative id stops being optional.
- 03
The inverter
Predict the voltage a machine demands, the torque it returns, and where its speed runs out.
- The bridge Six devices, one gate pattern, which one is carrying the current right now, and what it dissipates.
- Six-step commutation What FOC replaced: six fixed directions, 14% torque ripple, and 15.5% more voltage.
- Space-vector PWM Sectors, dwell times, and why min-max injection is the same thing as SVPWM.
- Deadtime The distortion a safety interlock costs you, and what compensation actually recovers.
- 04
Sensing
Turn a voltage request into gate signals, and account for what deadtime takes back.
- Current measurement One, two or three shunts, when to sample, and the signature each error leaves in dq.
- The converter What a finite number of codes does to a current, and why dq rounds differently from the phases.
- The DC link The bridge from the supply side: ripple current, sag, and where braking energy goes.
- Position sensors What each sensor really tells you, and the d-axis offset that stands between a count and an angle.
- 05
Control and estimation
Place a sampling instant that measures current rather than switching noise.
- The current loop Gains from the machine parameters, decoupling, and anti-windup that works.
- Speed and position loops Why cascades work, how far apart the bandwidths must be, and startup saturation.
- Sampled time The controller is a difference equation: which error sample it uses, and what aliasing does.
- Sensorless position Flux and sliding-mode observers, the PLL, and which way each filter shifts the angle.
- 06
Implementation
Tune a current loop from machine parameters, and stop an integrator winding up.
- Timing and synchronisation The delay budget, phase margin from pure algebra, and where the ISR time goes.
- The peripherals it needs PWM, triggered ADC, fault inputs — what the silicon must do, and the register rules that bite.
- Software architecture Layers that point inwards, one owner of the inverter, and a witness the control law does not use.
- Bringing a drive up The order to switch things on in, so that a regression has exactly one candidate cause.
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.