Go to start of banner

# Introduction

This technical note presents a common control technique for Permanent Magnets Synchronous Machines (PMSM). The Field-Oriented Control (FOC) method 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, targeting the B-Box RCP or B-Board PRO with

# Software resources

Note: For PLECS users, a model is available for download in the TN114.

# General principles

The Field Oriented Control (FOC) is a form a vector control [1]. The currents, voltages and magnetic fluxes of the machine 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 as its d-axis is aligned with the rotor flux.

The position of the rotor must be known in order 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 a PMSM in the RRF [2]:

Let us also consider the expression of the torque [2]:

The equations from (1) and (2) can be re-arranged as such:

It appears in equation (3) that the stator flux (d-axis component) and the torque can be controlled independently by the current $//$ and $//$, respectively. The q-axis component of the stator flux is fixed by the torque control, since it proportional to $//$.

## System-level modeling

The independent control of $//$ and $//$  can consist of two PI regulators with a decoupling network, as any vector control strategy [1]. The FOC algorithm usually generates voltage references that a PWM modulator transforms into gating signals for a voltage source inverter. In the present implementation, the rotor position measurement is derived from an incremental encoder. The figure below shows the complete block diagram of the implementation, with a carrier-based PWM modulator and an encoder/decoder module.

## 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.

###### Figure 2: Direct and quadrature axes

If the magnetic poles of the stator are aligned with their opposite poles on the rotor, the system is at equilibrium and the stator flux vector is aligned on the d-axis. Conversely, if the magnetic poles of the stator are not aligned with their opposite counter-part, their attractive and repulsive forces generate a torque on the rotor. In this case, the stator flux is not aligned with the d-axis and the angle difference between the two - commonly called the load angle (or power angle) [3] - is non-zero.

###### Figure 3: Alignment of the magnetic flux vector: (a) zero torque (b) maximal torque

In summary, the q-axis component of the stator flux contributes to the torque generation and the d-axis component only magnetizes the machine.

## Flux and torque control

### Plant

To control effectively the stator currents generated by the voltage source inverter, the relation between the stator voltages and currents needs to be determined. The phases of a PMSM at the stator being essentially RL circuits, the transfer functions linking the voltage to the current are:

### Control

The control of the stator currents can simply consist of two digital PI controllers, followed by some basic mathematical operations to compute the PWM duty cycles. Since the d and q axes are coupled, a decoupling network is necessary in order to achieve independent control of each current components, as developed in TN106.

The PI regulators can be tuned using the magnitude optimum criterion [4][5]:

The parameter $//$ represents the sum of all the small delays in the system. The product note PN142 explains how to determine the total delay of the system. A numerical example is given below.

### Flux reference

The FOC is mainly used as a torque controller. Therefore the d-axis current reference is usually set to zero, in order to maximize the torque production [1].

The d-axis current may be set to a non-zero reference when using a flux optimization technique. For example, field weakening techniques reduce the stator flux on the d-axis in order operate above the nominal speed.

# B-Box / B-Board implementation

### Current controller

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 on 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 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 condition $//$ is true. That is why the control delay is only 1 switching period.

The total delay is then the sum of the small time constants

According the magnitude optimum criterion the parameters of the PIs are computed as:

# Experimental results

The experimental setup consists of a PMSM supplied by voltage source inverter controlled by a B-Box prototyping controller. The FOC control is implemented using the graphical programming of 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 a brake to generate a load torque.

### Machine parameters

The FOC algorithm was validated experimentally on the following PMSM.

 Model: Control techniques 095U2B300BACAA100190 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

• DC link voltage: 500 V

• Interrupt 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)

### Results

The tracking performance of the torque control was validated experimentally 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 envelop of the phase currents.