Vector control (FOC) explained: Clarke, Park, d and q axes
Almost all modern performance controllers drive their motors using vector control, more commonly known by its English name FOC ("Field Oriented Control"). It is known to make the motor quieter and more efficient. This guide explains how it achieves this, without complex equations, but without omitting anything.
The essentials
- The torque of a motor with permanent magnets depends on the angle between the rotor's magnetic field and the magnetic field created by the current: it is at its maximum when these fields are at a 90-degree angle.
- FOC continuously calculates the rotor's position and precisely applies the current at a 90-degree angle.
- To achieve this, it converts the three alternating currents of the motor into two fixed values, known as current d and current q.
- The current 'q' generates the torque; the current 'd' should ideally remain at zero, except when attempting to increase speed (demagnetization).
The problem to be solved
A permanent magnet motor has magnets on its rotating part (the rotor) and windings on its stationary part (the stator). The current flowing through the windings creates a magnetic field; the magnets also have their own magnetic field. The torque is generated by the attraction between these two magnetic fields, just like when you bring two magnets close together.
This torque is at its maximum when the magnetic field of the windings is ahead by a quarter of a full electrical rotation, or 90 degrees, relative to the magnetic field of the magnets. When closer, it produces less torque and generates the same amount of heat; at 0 degrees, it only causes the motor to heat up. As the rotor rotates, the magnetic field of the windings must rotate with it, maintaining this angle hundreds of times per second.
Square wave control only uses six positions per electrical revolution: the angle varies around 90°, but never remains at that specific point. This results in torque fluctuations and noise. Field-Oriented Control (FOC), on the other hand, aims to maintain a constant 90° angle.
Step 1: Measure the currents and determine the position
The controller measures the current in the motor phases tens of thousands of times per second. Since the sum of the three currents is zero, theoretically, measuring two is sufficient; however, many controllers measure all three for greater accuracy.
It also needs the rotor angle, which is provided by sensors (Hall sensors, encoders), or estimated through a calculation called an observer, based on the voltages and currents. Our guide on motor position sensors details these solutions.
Step 2: Clarke transformation, from three phases to two
The three phases of the motor are offset by 120°. The Clarke transformation groups the three currents into two perpendicular components, called alpha and beta, without losing any information. This transforms the system from three axes to a standard two-axis plane. These two currents remain alternating; they rotate with the motor.
Step 3: Park, and observe from the rotor
This is the core concept behind Field-Oriented Control (FOC). The Park transformation rotates this plane along with the rotor, utilizing its angle. From the perspective of the rotor, the current no longer rotates; instead, it becomes two values that are almost constant.
- The "direct" current (meaning "straight" or "aligned") is aligned with the magnetic field. It does not produce torque in a surface-mounted permanent magnet motor; instead, it strengthens or weakens the magnetic field.
- The q-current (for "quadrature") is at a 90-degree angle to the magnets. It is this current that produces the torque, proportionally.
Operating a three-phase AC motor thus becomes as simple as operating a DC motor: you adjust two fixed values instead of chasing three sine waves.
Step 4: The controllers
The throttle sets a torque command, which translates to a current (q) command. The current (d) command is typically set to zero. Two controllers, one for each axis, continuously compare the measured current to its setpoint and calculate the voltage to apply in order to correct the difference. These are generally proportional-integral (PI) controllers, whose settings depend on the motor's resistance and inductance. This is why we perform motor detection.
Step 5: Reverse parking and modulation
The controllers provide two voltages in the rotor reference frame. The Park transformation inverts these voltages, converting them to the fixed reference frame of the stator. The controller then translates these voltages into opening and closing commands for the six switches in the power bridge. This final step is called modulation; the most common method, known as vector modulation (SVPWM), extracts slightly more usable voltage from the battery than simple sinusoidal modulation.
This entire cycle repeats with each switching period, typically tens of thousands of times per second. Our guide on the inside of a motor controller shows the hardware that executes these commands.
What Field-Oriented Control (FOC) actually brings:
- A regular torque curve: fewer vibrations, smoother acceleration, and a quieter motor.
- Improved Efficiency: Each ampere is utilized where it generates torque, which reduces heat generation for the same amount of torque.
- Direct torque control: The throttle controls a force, which makes for precise handling.
- Defluxing (Field Weakening): By manipulating the D current, it's possible to exceed the motor's "natural" maximum speed. See our guide on defluxing (field weakening).
The limitations
- FOC (Field-Oriented Control) relies on accurate rotor position information; even a small angle error can result in a loss of torque and overheating of the motor.
- It's based on a motor model: incorrect parameters (failed detection, motor that has overheated) degrade the riding experience.
- It requires more complex calculations, therefore necessitating a faster microcontroller than a simple square wave control system.
Frequently Asked Questions
Are FOC and a "sinusoidal controller" the same thing?
Not exactly. A "sinusoidal" controller sends sinusoidal voltages, which already smooths out the motor's operation. Field-Oriented Control (FOC) goes further: it measures the currents and regulates them in the rotor's reference frame. All FOC controllers produce sinusoidal currents, but not all sinusoidal controllers implement FOC.
Why keep the motor current at zero?
In a surface-mounted permanent magnet motor, current "d" does not produce torque; it would only cause the motor to heat up. It is kept at zero, except for high-speed demagnetization. In contrast, a carefully chosen current "d" in an interior permanent magnet motor actually adds torque.
Does FOC (Field-Oriented Control) work without a sensor?
Yes, it's possible thanks to an observer that estimates the position based on voltage and current readings. This is very effective while riding, but more challenging when the vehicle is completely stopped, where specific techniques or sensors are required.