Post · 7 min read· pp. 898–904

Coordinate Transformations in FOC v2.4+

On this page

Field Oriented Control (FOC) is a mathematical technique that transforms the control of BLDC and stepper motors into the equivalent of controlling a DC motor. This page explains the mathematical foundations of FOC, focusing on the coordinate transformations and principles that enable precise torque control.

The FOC principle: Electromagnetic force maximization

FOC ensures that the magnetic field generated by the stator windings is always positioned 90° ahead of (perpendicular to) the rotor’s permanent magnetic field.

This 90° relationship maximizes electromagnetic force according to Lorentz force law:

F⃗=∫(I⃗×B⃗) dL\vec{F} = \int (\vec{I} \times \vec{B}) \, dL

For a conductor carrying current II in a magnetic field BB, the force magnitude is:

F=B⋅I⋅L⋅sin⁡(θ)F = B \cdot I \cdot L \cdot \sin(\theta)

Where:

  • BB = magnetic field strength (Tesla)
  • II = current magnitude (Amperes)
  • LL = effective conductor length (meters)
  • θ\theta = angle between magnetic field and current direction

Maximum force condition: Fmax=B⋅I⋅LF_{max} = B \cdot I \cdot L occurs when θ=90°\theta = 90° since sin⁡(90°)=1\sin(90°) = 1.

Torque generation

For a motor with radius rr, the torque is:

τ=r⋅F=r⋅B⋅I⋅L=Kt⋅I\tau = r \cdot F = r \cdot B \cdot I \cdot L = K_t \cdot I

By maintaining the 90° relationship between stator field and rotor flux, FOC ensures maximum torque per amp, and (τ=Kt⋅I\tau = K_t \cdot I) is achieved at all rotor positions.

Comparison with DC motors

In DC motors, brushes and commutator mechanically maintain this 90° relationship:

  • Brushes switch current direction as rotor rotates
  • Commutator segments ensure field alignment is always optimal
  • Automatic 90° relationship without computation

FOC achieves the same result electronically through mathematical transformations:

  • Rotor position sensor provides θel\theta_{el}
  • Coordinate transforms calculate required phase currents/voltages
  • Inverter applies calculated voltages
  • Result: AC motor controlled like DC motor, but without mechanical wear

Six-step commutation visualization showing rotating magnetic field synchronized with rotor

Coordinate transformations: The mathematical core

FOC uses multiple reference frames to simplify motor control. The key insight is that controlling currents in a rotating reference frame (that follows the rotor) is much simpler than controlling them in the stationary frame (fixed to the stator).

Reference frames

Each motor winding a,b,c (or stepper a and b) can produce a magnetic field vector in the stationary direction. Each of the directions is 120° apart from each other (stepper 90° apart). The motor rotor has permanent magnets that generate stationary magnetic field which is rotating with the rotor and at any give point is θ\theta degrees apart from the phase a magnetic field. See the figure below for a visualisation of the different reference frames.

Then we can define three different reference frames that will be used in the FOC control. One single current vector with magnitude II and angle θ\theta can be represented in any of them. See the image below.

1. Stationary frame (abc):

  • Fixed to the stator
  • Three phase voltages/currents: ua,ub,ucu_a, u_b, u_c or ia,ib,ici_a, i_b, i_c
  • Time-varying sinusoids at electrical frequency ωe\omega_e

2. Stationary orthogonal frame (θ\theta-β\beta):

  • Also fixed to the stator
  • Two orthogonal components: uθ,uβu_\theta, u_\beta or iθ,iβi_\theta, i_\beta
  • Clarke Transform converts abc → θβ\theta\beta
  • Still time-varying

3. Rotating frame (d-q):

  • Rotates with the rotor at ωe\omega_e
  • Two components: ud,uqu_d, u_q or id,iqi_d, i_q
  • Park Transform converts θβ\theta\beta → dq
  • DC values when synchronized with rotor
  • Enables simple PI control

The d-q reference frame

In the d-q frame rotating at electrical angle θel\theta_{el}:

  • d-axis (direct): Aligned with rotor flux (permanent magnet field)
  • q-axis (quadrature): Perpendicular to rotor flux (90° ahead)

Key property: For maximum torque efficiency: id=0,iq=τKti_d = 0, \quad i_q = \frac{\tau}{K_t}

This means:

  • id=0i_d = 0: No current wasted on flux (permanent magnets provide it)
  • iqi_q: All current produces torque

Clarke Transform (abc → θβ\theta\beta)

Converts three-phase quantities to two-phase orthogonal components:

For balanced three-phase systems:

[iθiβ]=23[1−12−12032−32][iaibic]\begin{bmatrix} i_\theta \\ i_\beta \end{bmatrix} = \frac{2}{3} \begin{bmatrix} 1 & -\frac{1}{2} & -\frac{1}{2} \\ 0 & \frac{\sqrt{3}}{2} & -\frac{\sqrt{3}}{2} \end{bmatrix} \begin{bmatrix} i_a \\ i_b \\ i_c \end{bmatrix}

Expanded:

iθ=23(ia−12ib−12ic)=iaiβ=23(32ib−32ic)=13(ib−ic)\begin{align} i_\theta &= \frac{2}{3} \left( i_a - \frac{1}{2}i_b - \frac{1}{2}i_c \right) = i_a \\ i_\beta &= \frac{2}{3} \left( \frac{\sqrt{3}}{2}i_b - \frac{\sqrt{3}}{2}i_c \right) = \frac{1}{\sqrt{3}}(i_b - i_c) \end{align}

Using ia+ib+ic=0i_a + i_b + i_c = 0 (Kirchhoff’s law), this simplifies to:

iθ=iaiβ=13(ib−ic)=13(ib+ia+ib)=2ib+ia3\begin{align} i_\theta &= i_a \\ i_\beta &= \frac{1}{\sqrt{3}}(i_b - i_c) = \frac{1}{\sqrt{3}}(i_b + i_a + i_b) = \frac{2i_b + i_a}{\sqrt{3}} \end{align}

Geometric interpretation: Projects three 120° spaced vectors onto two orthogonal axes.

Park Transform (θβ\theta\beta → dq)

Rotates the stationary θ\theta-β\beta frame to align with the rotor:

[idiq]=[cos⁡(θel)sin⁡(θel)−sin⁡(θel)cos⁡(θel)][iθiβ]\begin{bmatrix} i_d \\ i_q \end{bmatrix} = \begin{bmatrix} \cos(\theta_{el}) & \sin(\theta_{el}) \\ -\sin(\theta_{el}) & \cos(\theta_{el}) \end{bmatrix} \begin{bmatrix} i_\theta \\ i_\beta \end{bmatrix}

Expanded:

id=iθcos⁡(θel)+iβsin⁡(θel)iq=−iθsin⁡(θel)+iβcos⁡(θel)\begin{align} i_d &= i_\theta \cos(\theta_{el}) + i_\beta \sin(\theta_{el}) \\ i_q &= -i_\theta \sin(\theta_{el}) + i_\beta \cos(\theta_{el}) \end{align}

Result: Time-varying AC currents (iθ,iβi_\theta, i_\beta) become DC currents (id,iqi_d, i_q) in the rotating frame, making PI control straightforward.


Inverse transformations: From control to actuation

FOC control operates in the d-q frame, but the motor requires phase voltages. The inverse transforms convert back:

Inverse Park Transform (dq → θβ\theta\beta)

[uθuβ]=[cos⁡(θel)−sin⁡(θel)sin⁡(θel)cos⁡(θel)][uduq]\begin{bmatrix} u_\theta \\ u_\beta \end{bmatrix} = \begin{bmatrix} \cos(\theta_{el}) & -\sin(\theta_{el}) \\ \sin(\theta_{el}) & \cos(\theta_{el}) \end{bmatrix} \begin{bmatrix} u_d \\ u_q \end{bmatrix}

Expanded:

uθ=udcos⁡(θel)−uqsin⁡(θel)uβ=udsin⁡(θel)+uqcos⁡(θel)\begin{align} u_\theta &= u_d \cos(\theta_{el}) - u_q \sin(\theta_{el}) \\ u_\beta &= u_d \sin(\theta_{el}) + u_q \cos(\theta_{el}) \end{align}

This is a rotation matrix that converts the DC voltages (ud,uqu_d, u_q) back to the stationary frame.

Inverse Clarke Transform (θβ\theta\beta → abc)

For 3-phase BLDC motors:

[uaubuc]=[10−1232−12−32][uθuβ]\begin{bmatrix} u_a \\ u_b \\ u_c \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ -\frac{1}{2} & \frac{\sqrt{3}}{2} \\ -\frac{1}{2} & -\frac{\sqrt{3}}{2} \end{bmatrix} \begin{bmatrix} u_\theta \\ u_\beta \end{bmatrix}

Expanded:

ua=uθub=−12uθ+32uβuc=−12uθ−32uβ\begin{align} u_a &= u_\theta \\ u_b &= -\frac{1}{2} u_\theta + \frac{\sqrt{3}}{2} u_\beta \\ u_c &= -\frac{1}{2} u_\theta - \frac{\sqrt{3}}{2} u_\beta \end{align}

For 2-phase stepper motors, no Clarke transform is needed:

ua=uθ=udcos⁡(θel)−uqsin⁡(θel)ub=uβ=udsin⁡(θel)+uqcos⁡(θel)\begin{align} u_a &= u_\theta = u_d \cos(\theta_{el}) - u_q \sin(\theta_{el}) \\ u_b &= u_\beta = u_d \sin(\theta_{el}) + u_q \cos(\theta_{el}) \end{align}

The two phases are already in the θ\theta-β\beta frame.


Motor-specific implementations

BLDC motors (3-phase)

  • Transformations: Full chain (Park → Clarke → 3 phases)
  • Equations: Use ud,uq→uθ,uβ→ua,ub,ucu_d, u_q \to u_\theta, u_\beta \to u_a, u_b, u_c
  • Driver: 3-phase PWM driver

Stepper motors (2-phase)

  • Transformations: Park only (ud,uq→ua,ubu_d, u_q \to u_a, u_b)
  • Equations: No Clarke needed (already orthogonal)
  • Driver: 2-phase PWM driver
  • Note: θ\theta-β\beta frame coincides with physical phases A-B

Hybrid stepper motors

  • Transformations: Full chain like BLDC
  • Driver: 3-phase BLDC driver (phase C as mid-point reference)
  • Special: Phase C typically held at Vsupply/2V_{supply}/2 in SinePWM mode

Further reading


Copyright © 2026. Distributed by an MIT license.