Field oriented control (FOC) of permanent magnet synchronous machine (PMSM)
Table of Contents
This technical note presents a common control technique for Permanent Magnets Synchronous Machines (PMSM). The Field-Oriented Control (FOC) method is a motor control strategy that orients the stator current vector in a rotating reference frame of the machine. First, the note introduces the general operating principles of the Field-Oriented Control and then, details a possible design methodology. Finally, a practical control implementation is introduced to drive the machine with a power inverter, controlled either by the B-Box RCP or the B-Board PRO. Please note that imperix offers a ready-to-use motor drive system to develop and test motor control techniques. More details can be found in the Motor Testbench quick start guide (PN181).

General principles of field oriented control
The Field Oriented Control (FOC) is a form of vector control [1]. The machine currents, voltages, and magnetic fluxes are expressed as space vectors inside a Rotating Reference Frame (RRF). In the case of a synchronous machine, the stator and rotor fluxes are synchronous [2]. Therefore, a natural choice is to orient the RRF such that its d-axis is aligned with the rotor flux. The rotor position must be known to orient the RRF. The position is either measured with an encoder or estimated with a sensorless technique. Both options are presented in PN104 and TN136, respectively. The working principle of FOC relies on the machine’s equations in that RRF. Let us first consider the stator equations of an isotropic PMSM in the RRF [2]:
Let us also consider the expression of the torque [2]:
Since the machine is assumed to be isotropic,
It appears in equation (3) that the stator flux (d-axis component) and the torque can be controlled independently by the current
System-level modeling of the field oriented control algorithm
The independent control of
A more intuitive approach
The d and q axes of a rotating reference frame have a physical meaning in the case of an electrical machine: the d-axis is directly aligned on a rotor magnetic pole and the q-axis is shifted from 90°E (electrical degrees), thus the name quadrature axis. As always, two magnetic poles of opposite polarity are shifted by 180°E.
Referring to equation (1), the total stator flux
Flux and torque control
Plant model
The phases of a PMSM at the stator being essentially RL circuits, the transfer functions linking the voltage to the current are:
Field oriented control implementation
The stator currents control consists of two digital PI controllers. Since the d and q axes are coupled, a decoupling network is necessary to achieve independent control of each current component, as developed in TN106. The PI regulators can be tuned using the magnitude optimum criterion [4][5]:
The parameter
Flux reference
The field-oriented control (FOC) is mainly used as a torque controller. Therefore the d-axis current reference is usually set to zero, to maximize the torque production [1]. However, some flux optimization techniques set the d-axis current to a non-zero reference. For example, field weakening techniques reduce the stator flux on the d-axis to operate above the nominal speed.
B-Box / B-Board implementation
Software resources
ACG SDK for Simulink
Current controller for field oriented control
The figure below shows a possible implementation of a current controller for FOC with Simulink. One can identify the two PIs for the d and q axes and the decoupling network in between. The saturation limits of the PIs are set dynamically, depending on the DC bus voltage.
Tuning of the PI controllers
Here is a complete numerical example of how to tune the PI controllers of the FOC. The machine parameters are presented in the Experimental results section. Since the available PMSM is isotropic, the inductance is the same on the d and q axes. Therefore, both PIs have the same following transfer function and the same tuning.
As explained in the PN142, the execution of the digital control is affected by a delay along the control chain. It can be subdivided into the following delays:
According to the information provided by imperix Cockpit (formerly the Timing info tab in BB Control), the cycle delay is less than 20% of a sampling period. Since the sampling phase was set to
The total delay is then the sum of the small time constants:
According to the magnitude optimum criterion, the parameters of the PIs are computed as:
Experimental results of the field oriented control
The experimental setup consists of a PMSM supplied by a voltage source inverter controlled by a B-Box prototyping controller. The FOC algorithm is implemented using the graphical programming of the ACG SDK library for Simulink. The power converter is built from 4x PEB 8032 phase-leg modules (3 phases and 1 braking chopper leg). Another PMSM connected to 3 power resistors is used as a brake to generate a load torque.
Machine parameters
The implemented field-oriented control algorithm was validated experimentally on a Unimotor fm servomotor from Control Techniques.
Parameter | Value | Unit |
Rated power | 1.23 | kW |
Pole pairs | 3 | – |
Rated phase voltage | 460 | V |
Rated phase current | 2.7 | A |
Rated mechanical speed | 314 | rad/s |
Rated torque | 3.9 | Nm |
Stator resistance | 3.4 | Ohm |
Stator inductance (d and q axis) | 12.15 | mH |
Permanent magnet flux | 0.25 | Wb |
Moment of inertia (PMSM only) | 2.9 | kg cm2 |
Test conditions
- Load torque: 3.9 Nm (PMSM with resistors as load)
- Inverter DC link voltage: 500 V
- Control and sampling frequency: 20 kHz
- Sampling phase: 0.5
- PWM outputs: carrier-based
- Current measurements filtered with a 1.6 kHz cut-off frequency (using the front panel of the B-Box RCP)
Experimental results of field oriented control
The tracking performance of the torque control was validated experimentally on a modular three-phase inverter by performing a reference step from -1 Nm to 3.9 Nm (nominal torque). The current controllers on both axes can follow their respective references with fast dynamics and no overshoot.

The corresponding phase currents are also shown below. Since the current on the d-axis is zero, the q-axis current corresponds to the envelope of the phase currents.

Academic references
[1] Nguyen Phung Quang, Jörg-Andreas Dittrich, “Vector Control of Three-Phase AC Machines”, Springer, 2015, ISBN 978-3-662-46914-9
[2] Slobodan N. Vukosavic, “Electrical Machines”, Springer, 2013, DOI 10.1007/978-1-4614-0400-2
[3] Jan A. Melkebeek, “Electrical Machines and Drives: Fundamentals and Advanced Modelling”, Springer, 2018, ISBN 978-3-319-72729-5
[4] Hansruedi Bühler, “Réglage de systèmes d’électronique de puissance – Volume 1: théorie”, Presses Polytechniques et Universitaires Romandes, 1997, ISBN-10: 2-88074-341-9
[5] Karl J. Åström and Tore Hägglund; “Advanced PID Control”; 1995