5.1.2. Fundamentals of FOC¶
MCAF utilizes field-oriented control (FOC) of motor current. This section describes the theory of FOC in general, with some specific notes on MCAF implementation.
5.1.2.1. Torque production and reference frames¶
The goal of field-oriented control (FOC) is to control instantaneous electromagnetic torque with high bandwidth. This is possible — although not obvious for newcomers to field-oriented control — by managing two orthogonal components of current in a reference frame at some electrical angle \(\theta_e\). The electrical frequency \(\omega_e = \frac{d\theta_e}{dt}\) is the rate at which the electrical angle changes.
Electrical angles and frequencies are proportional to mechanical angles and frequencies as expressed in Equation 5.1, where \(N_p\) is the number of pole pairs. For example, a six-pole machine, with \(N_p=3\), undergoes three electrical cycles for each mechanical revolution.
Electromagnetic torque \(T_{em}\) in three-phase rotating machinery is proportional to the cross product of stator currents and rotor flux linkage, as shown in Equation 5.2. Here \(\hat{z}\) is a unit vector along the axis of rotation, x and y are components of a two-dimensional plane perpendicular to \(\hat{z}\), and the current vector is an equivalent vector sum of currents based on how the resulting fields are aligned with these x and y axes.
The angle \(\phi\) between flux linkage and current vectors, illustrated in Figure 5.1, plays an important role in determining electromagnetic torque. If the two vectors are aligned, this angle \(\phi\) is zero, and no torque is produced. Maximum torque occurs when the flux linkage and current vectors are perpendicular, and the term \(\sin \phi\) in Equation 5.2 is ±1.
It is important to note that these x and y axes are arbitrary — we can pick any unit basis vectors \(\hat{x}\) and \(\hat{y}\) that form a mutually perpendicular set with the axis of rotation \(\hat{z}\), such that their cross product \(\hat{x} \times \hat{y} = \hat{z}\).
There are two common choices for these basis vectors. One is the stationary frame, commonly aligned with one of the stator phases. Pictured on the left of Figure 5.2 is a three-phase stator with windings positioned 120° apart. This is equivalent — at least in terms of magnetic flux linkage — to a two-phase stator with orthogonal windings α and β, pictured on the right. For any combination of currents \(I_A, I_B, I_C\) in the three-phase stator winding, the same magnetic field seen by the rotor can be produced by an appropriate combination of currents \(I_\alpha\) and \(I_\beta\) through two “virtual” coils used to create the horizontal and vertical components of the stator field. The mathematical conversion of projecting three-phase quantities onto these virtual orthogonal coils is called the Clarke transform, after one of its originators, Edith Clarke. [2]
The Clarke transform is a linear transformation, shown in Equation 5.3, which can apply to any vector quantity \(X\), although typical examples are voltage \(V\), current \(I\), or flux linkage \(\psi\).
This is usually expressed in the equivalent matrix form, as in Equation 5.4, with the transformation matrix \(T_{\alpha\beta}\):
The inverse Clarke transform, Equation 5.5, converts from αβ to ABC, using the transformation matrix \(T_{\alpha\beta}{}^+:\)
We can substitute \((x,y) \Rightarrow (\alpha,\beta)\) in Equation 5.2 to obtain Equation 5.6, describing torque based on stationary-frame quantities:
In the stationary reference frame, the flux vector \(\psi_{\alpha\beta}\) and current vector \(I_{\alpha\beta}\) are not fixed, but rotate along with the rotor’s magnetic field.
The other common choice of basis vectors is the rotating reference frame, aligned with the electrical angle of excitation \(\theta_e\) as it increases with electrical frequency \(\omega_e\). This reference frame has components denoted \(d\) (“direct”) and \(q\) (“quadrature”). The transformation from αβ to dq axes is a rotation by an angle \(-\theta_e\), shown in Equation 5.7. This is known as the Park transform, named for Robert Park, who developed it in the late 1920s, while working at General Electric to analyze the dynamics of synchronous motors. [1] [3] With permanent-magnet synchronous motors, this reference frame is known as the synchronous reference frame. Correct alignment for a PMSM occurs when the d-axis is aligned with the rotor flux, and the electrical angle \(\theta_e\) is identical to the rotor’s electrical angle \(\theta_r\).
The inverse Park transform, Equation 5.8, rotates in the opposite direction to convert from dq to αβ axes.
We can substitute \((x,y) \Rightarrow (d,q)\) in Equation 5.2 to obtain Equation 5.9, describing torque based on synchronous-frame quantities:
The advantage of using the synchronous frame is that for steady-state rotation, to produce constant electromagnetic torque \(T_{em}\), the flux linkage vector \(\psi_{dq}\) and the current vector \(I_{dq}\) are constants. This allows current controllers with an integrator term to operate with zero steady-state error. It also allows for independent torque and flux control.
It is worth noting that for different motor types, the angle of the reference frame \(\theta_e\) and the electrical angle of the rotor \(\theta_r\) may or may not be identical. For permanent-magnet synchronous motors, the reference frame should be aligned with the permanent magnet flux of the rotor, so that \(\theta_e = \theta_r\). For induction motors \(\theta_e \ne \theta_r\); the electrical frequency \(\omega_e = \omega_r + \omega_s\) where \(\omega_r\) is the rotor speed expressed as an alectrical frequency, and \(\omega_s\) is the slip frequency needed to produce rotor current.
5.1.2.2. Stator voltage and flux equations¶
5.1.2.2.1. General stator voltage equation¶
The equations so far in this section on FOC have involved torque, angle, and the vector components of flux linkage and current. The stator voltage, which is the voltage across the stator coils, is a more relevant quantity than flux linkage, since we can measure and control voltage more directly.
Motor control engineers working with FOC often talk about a voltage vector \(V_{dq}\) in a rotating reference frame, and even though this voltage vector is not directly measurable — there are no actual “d” and “q” coils — it can be derived mathematically through the Park and Clarke transforms from per-phase measurements of the actual motor coils. The stator voltage equations relating voltage, flux, and current, in a reference frame rotating with electrical frequency \(\omega_e\), are shown below in equation 5.10. This equation is valid for both induction motors and permanent-magnet synchronous motors.
Here the \(R_s\) coefficient is the stator resistance.
The \(\omega_e\psi\) terms are known as speed voltage and are artifacts of the rotating reference frame; they have nothing to do with the motor construction, and are present even with other loads such as a three-phase inductor or transformer when operated in FOC with a reference frame rotating at frequency \(\omega_e\). They also represent an interesting cross-coupling behavior between the d- and q-axes.
5.1.2.2.2. PMSM voltage equations¶
For the PMSM, the flux equations are listed in Equation 5.11 and relate the flux linkage vector \(\psi_{dq}\) to the current vector \(I_{dq}\).
The terms \(L_d\) and \(L_q\) are the d- and q-axis stator inductances, which are generally identical for surface permanent magnet motors (SPMSM) but different for interior permanent-magnet motors (IPMSM), where usually \(L_q > L_d\) due to intentional differences in construction. For the IPMSM, inductances in the synchronous frame are independent of rotor position, but the inductances measured in the stationary frame (either per-phase or in the αβ frame) change with rotor position.
The term \(\psi_m\) is the permanent magnet flux linkage.
The flux equations can be substituted into the stator voltage equations to produce stator voltage equations expressed in terms of circuit voltages and currents, shown below in Equation 5.12:
From left to right, these terms represent the resistive voltage drop \(IR_s\), cross-coupling speed voltage, the voltage \(L\frac{dI}{dt}\) needed to change current, and the back-emf \(\psi_m\omega_e = K_e\omega_m\), where \(K_e = N_p\psi_m\) is commonly known as the back-emf constant or voltage constant.
5.1.2.2.3. PMSM torque equation¶
The PMSM flux equation can also be substituted into the torque equation (Equation 5.9) to derive Equation 5.13 showing the two torque terms found in a PMSM:
alignment torque or permanent magnet torque, resulting from the alignment between the rotor’s permanent magnet and the field caused by the stator current
reluctance torque, resulting from the tendency of the rotor iron to rotate towards the field caused by the stator current
For a SPMSM, \(L_d = L_q\), so there is no reluctance torque, and the electromagnetic torque is produced only by the q-axis component of current. In this case, d-axis current is driven towards zero (except in flux weakening) to reduce \(I^2R\) losses in the stator.
For an IPMSM, \(L_d < L_q\), and the reluctance torque can help increase efficiency by controlling \(I_d < 0\). The optimum choice of \(I_d\) is the aim of Maximum Torque Per Ampere (MTPA) algorithms.
5.1.2.2.4. Per-phase equivalent circuit¶
It is important to note that the equations in this section are derived from the per-phase equivalent circuit model, shown in Figure 5.3. This model treats each winding of a three-phase wye-connected PMSM as a winding resistance \(Rs\), winding inductance \(L\), and back-emf \(e\) in series, between the neutral and one of the three line terminals A, B, or C.
In this model, the back-emf components are sinusoidal voltages with the phase sequence A, B, C, separated by 120°.
The line-to-line resistance measurable at any pair of the terminals is \(2R_s\), and the line-to-line inductance measurable at any pair of terminals is \(2L\) for SPMSM. (For IPMSM, remember that inductance varies with rotor angle.) The line-to-line back-emf measurable at any pair of terminals has amplitude \(|e| = \sqrt{3} K_e\omega_m\) where \(K_e\) is the line-to-neutral back-emf constant in V/(rad/s).
5.1.2.2.5. Wye and delta connections¶
The per-phase model also applies equally to the delta-connected PMSM. A delta-connected stator, shown in Figure 5.4 can be modeled by an equivalent wye-connected stator with \(R_{s\sf Y} = \frac{1}{3}R_{s\Delta}\), \(L_{\sf Y} = \frac{1}{3}L_{\Delta}\), and \(K_{e \sf Y} = \frac{1}{\sqrt{3}}K_{e\Delta}\). Delta-connected windings also involve a phase shift of 30° because of the change in connections.
Knowing the wye-to-delta conversion is important for those motors which have individual phase windings that can be connected either as a wye or delta configuration, which is more common in larger electric machines. These motors have six terminals — A1, A2, B1, B2, C1, C2, or more commonly U1, U2, V1, V2, W1, W2 — which can be connected appropriately in a terminal box, as shown in Figure 5.5, in either wye or delta configuration depending on the installation of terminal jumpers.
Very large motors may have more than six winding terminals that can be reconnected in multiple ways; see for example Annex A2 of IEC 60034-8.
As long as the motor is supplied as a three-terminal black box from the manufacturer, however, the internal construction of the motor (wye or delta) doesn’t matter, and the theory of three-phase electric machines applies equally to either configuration.
5.1.2.2.6. Steady-state and phasor analysis¶
At steady state, the \(\frac{d}{dt}\) terms of Equation 5.12 are zero, and the voltage equations reduce to Equation 5.14
These can be pictured graphically in a voltage phasor diagram, as shown in Figure 5.6. The dark green arrows show back-emf, resistive, and inductive components of the resulting terminal voltage \(V_{t1}\), with zero d-axis current. This is typical operation for a PMSM in field-oriented control. The light blue arrows show additional resistive and inductive components caused by controlling d-axis current to \(I_d < 0\). This is done during flux-weakening operation, to reduce the magnitude of the terminal voltage by using the inductive voltage drop \(\omega_eL_dI_d\) to counteract part of the back-emf voltage.
Phasor analysis is a valuable yet extremely simple approach to determine the voltage requirements of a PMSM. Some care is necessary in the units used for the different motor parameters, so that Equation 5.14 is valid:
The per-phase equivalent model is stated in terms of line-to-neutral voltage.
Resistance and inductances should be line-to-neutral (half of the line-to-line value)
Back-emf should be calculated as line-to-neutral voltage (\(1/\sqrt{3} \approx\) 0.5774 of the line-to-line voltage)
Be aware of temperature coefficients, if operating the motor near its rated maximum temperature:
The resistance of copper stator windings will increase roughly linearly with temperature over normal operating temperature ranges (-55 °C to +200 °C). Relative to its value at 20 °C, copper’s resistance has a temperature coefficient of ≈0.4%/°C. [7]
Both neodymium and samarium-cobalt magnets have a slight negative temperature coefficient of remanence, which means that the back-emf decreases slightly with increasing temperature.
The units for computing the product of \(K_e\) and \(\omega_m\) (or \(\psi_m\) and \(\omega_e\)) should be consistent, so if \(K_e\) is available in V/(rad/s), then velocity \(\omega_m\) should be converted to rad/s; if \(K_e\) is available in V/kRPM, then velocity \(\omega_m\) should be converted to kRPM. (1 RPM = \(\frac{\pi}{30}\) rad/s)
Use peak amplitude rather than RMS for all voltages and currents. (1V RMS = \(\sqrt{2}\)V amplitude)
Motor manufacturers are notorious for specifying back-emf constant \(K_e\) inconsistently and ambiguously. It can be stated in terms of RMS or peak amplitude; line-to-line or line-to-neutral; and in terms of voltage per rad/s or RPM or kRPM.
The resulting components \(V_d\) and \(V_q\) should be added in quadrature, as shown in Equation 5.15, to compute the required amplitude of line-to-neutral terminal voltage.
Compute required line-to-line terminal voltage by multiplying line-to-neutral terminal voltage by \(\sqrt{3}\).
The motor and drive are well-matched if the maximum required line-to-line voltage is below the DC link voltage, but both are the same order of magnitude. (Typically, the maximum line-to-line terminal voltage \(|V_{dq}|\) is 70-95% of the minimum DC link voltage, to leave enough engineering margin so current can still change quickly — \(L\frac{dI}{dt}\) terms require voltage — even considering other voltage losses such as dead-time distortion and on-state voltage across the transistors.)
5.1.2.3. FOC block diagram¶
The general structure of an FOC controller is an inner vector current loop, and an outer velocity loop, as shown in Figure 5.7.
The inner vector current loop has a current controller that operates in the synchronous (dq) frame. Park and Clarke transforms are used in the feedback path to convert measured phase currents to the synchronous frame as inputs to the current controller, and in the forward path to convert desired synchronous-frame voltages \(V_{dq}\) to realizable PWM duty cycles in a three-phase bridge.
In its linear range, there is nothing particularly special about the vector current loop, and it is often realized as two PI controllers, one for the d axis and the other for the q axis. Saturation and antiwindup should be designed carefully, keeping in mind the overall vector controller, rather than as two independent axis controllers.
5.1.2.4. Implementation notes¶
The Components section has more information on the implementation details of field-oriented-control in MCAF.
Voltages in the αβ or dq frames are represented as line-to-neutral voltages. Per-phase voltages are relative to the negative terminal of the DC link.
5.1.2.5. Miscellaneous topics¶
5.1.2.5.1. Alternate reference frame transforms¶
There are two other common forms of reference transforms used, in addition to the forms of the Park transform (\(\alpha\beta \rightarrow dq\), Equation 5.7) and Clarke transform (\(abc \rightarrow \alpha\beta\), Equation 5.4) described above.
One is the full 3×3 Clarke transform (\(abc \rightarrow \alpha\beta0\)) in Equation 5.16, using the transformation matrix \(T_{\alpha\beta 0}\):
Here, the zero-sequence component \(X_0\) is the common-mode voltage. For motors without an accessible neutral connection, this voltage is arbitrary and does not affect operation of the motor. (The zero-sequence component does matter in some cases, where parasitic capacitance between windings and motor housing can cause what are known as bearing currents to flow through the motor bearings, gradually damaging them through electrical discharge. This is known as electrical fluting, and reduces the operating life of the motor. [4] [5] )
It is worth noting that the common form of the Clarke transform (Equation 5.4) and the Inverse Clarke transform (Equation 5.5) are not truly inverses, since their transformation matrices are not square, but rather pseudoinverses. It is possible to go make a full round trip from \(\alpha\beta \Rightarrow abc \Rightarrow \alpha\beta\) since one product of the two matrices is the identity: \(T_{\alpha\beta}T_{\alpha\beta}{}^+ = I\). But in the other direction, \(abc \Rightarrow \alpha\beta \nRightarrow abc\) since the matrix product \(T_{\alpha\beta}{}^+T_{\alpha\beta}\) does not have full rank. In plain terms, the zero-sequence component is lost as soon as the 2×3 Clarke transform is applied, and cannot be recovered.
The full 3×3 Clarke transform is invertible, on the other hand; the 3×3 Inverse Clarke transform is shown in Equation 5.17 using the transformation matrix \(T_{\alpha\beta 0}{}^{-1}\).
The other common reference frame transform is the 2×2 Reduced Clarke transform (\(ab \rightarrow \alpha\beta\)), shown in Equation 5.16, which allows conversion of only two currents \(I_A\) and \(I_B\) into αβ coordinates through the assumption \(I_A + I_B + I_C = 0\).
This is used in MCAF for calculating \(I_{\alpha\beta} = T_{AB}I_{AB}\) from phase currents A and B, with C unmeasured. It is possible to construct similar matrices \(T_{BC}\) and \(T_{AC}\) when the unmeasured phase is A or B.
5.1.2.6. References¶
Some of the material in this section was adapted from the section “FOC in Fifteen Minutes” from the 2016 MASTERS presentation How to Succeed in Motor Control.