GPIO-Based Nonlinear Predictive Control for Flux-Weakening Current Control of the IPMSM Servo System

Abstract: This paper proposes a generalized proportional integral observer (GPIO) based nonlinear predictive control (NPC) for an interior permanent magnet synchronous motor (IPMSM) to improve the flux-weakening (FW) current control performance against the complex nonlinear cross-coupling terms and the IPMSM parameters’ variations. First, the IPMSM is remodeled to further analyze the FW control difficulties caused by such cross-coupling terms and parameters variations. Considering the parameters’ variations as a kind of disturbance, a GPIO is then designed to compensate for such disturbance. A GPIO-based NPC is finally designed to handle the nonlinear cross-coupling terms to obtain an optimized current control performance. Experiments on a digital signal processor (DSP) based IPMSM servo system validate the workability of the proposed control scheme.


Introduction
The interior permanent magnet synchronous motor (IPMSM) has drawn great attention in the applications of industrial robots, electric vehicles, etc., due to its high performance of a wider speed range and a greater mechanical torque as compared with the surface permanent magnet synchronous motors (SPMSM) [1][2][3]. IPMSM and SPMSM have different permanent magnets' installation positions in the iron core, and therefore they have different inductance characteristics, i.e., the IPMSM has a bigger quadrature-axis inductance than the direct-axis inductance while the SPMSM has almost the same direct-axis and quadrature-axis inductances. Hence, the IPMSM can provide a considerable reluctance torque (which is a part of the mechanical torque) while the SPMSM has almost no reluctance torque [4][5][6]. Moreover, to exploit the potential performance of IPMSM, a flux-weakening (FW) control framework rather than a traditional i d = 0 control framework must be employed [7][8][9]. The i d = 0 control framework is designed that, for the IPMSM, the reference direct-axis current is given as 0 for simple, and the FW control framework is designed that a minus reference direct-axis current trajectory (to be designed) is given to the IPMSM. There are two great advantages by employing the FW control framework. First, the minus direct-axis current can decrease the stator voltage especially when it is close to the maximum voltage that the inverter can provide, in order to increase the speed of IPMSM to exceed the original maximum speed. Second, a well-designed minus direct-axis reference current can make the IPMSM output a considerable reluctance torque [10][11][12]. Although the flux-weakening control framework has such superiority, it also faces more difficulties in the current controller design. First, note that there are complex nonlinear cross-coupling voltages in the current dynamics of the IPMSM (see Equation (2) for details). Such nonlinear cross-coupling terms become very larger in coordinates (d-and q-axes) of the motor as reference coordinates and ignoring the dead-time effects, the voltage equations of the IPMSM can be written in the following forms [4]: where R s0 is the nominal value of the stator resistance, L d0 and L q0 are respectively the nominal values of the d-and q-axes stator inductances, i d and i q are respectively the d-and q-axes stator currents, u d and u q are respectively the d-and q-axes stator voltages, and u where n p is the number of pole pairs, ψ f is the rotor flux linkage, and ω is the rotor angular speed.

Remark 1.
Nonlinear cross-coupling terms. In Equation (2), the d-axis coupling term n p ωL q i q is related to the q-axis stator current i q , and the q-axis coupling term −n p ωL d i d − n p ωψ f is related to the d-axis stator current i d , so they are together called cross-coupling terms. Those multiply-form nonlinear cross-coupling terms grow greater from the constant torque (CT) region to the FW region, so they need major consideration in the current controller design.
Furthermore, considering the motor parameters' variations, each motor parameter can be expressed as the sum of its nominal value and change, given by R s = R s0 + ∆R s , where R s0 and ∆R s are respectively the nominal value and change of stator resistance, L d0 and ∆L d are respectively the nominal value and change of d-axis stator inductance, L q0 and ∆L q are respectively the nominal value and change of q-axis stator inductance, and ψ f 0 and ∆ψ f are respectively the nominal value and change of rotor flux linkage. Substituting Equation (3) into Equation (1), the dynamic model of the IPMSM from Equation (1) can be rewritten as where p d and p d are respectively the d-and q-axes time-varying voltages terms, given by Remark 2. Motor parameters' variations. The terms p d and p d caused by the motor parameters' variations are time-varying, and moreover they grow greater from the CT region to the FW region. Hence, they also need major consideration in the current controller design.

Cascade Flux-Weakening Control Framework
A cascade framework is usually used for the motor control in the industrial applications. Figure 1 shows the cascade IPMSM flux-weakening control framework, where the speed is regulated by a speed controller in the outer-loop, and the d-and q-axes currents are regulated by a current controller in the inner-loop. The d-and q-axes currents i d and i q can be obtained from the phase currents i a and i b by Clarke and Park transformations. The rotor angular velocity can be calculated from the position sensor. The reference current vector magnitude i * s is generated by the speed controller, and the d-and q-axes reference currents i * d and i * q are generated by a kind of flux-weakening algorithm. There are some different kinds of FW algorithms, such as the maximum torque per ampere (MTPA) algorithm, the maximum torque per voltage (MTPV) algorithm, the voltage-comparison based FW algorithm, etc. In this paper, the voltage-comparison based FW algorithm in used in the experimental validation. The block diagram of this algorithm is shown in Figure 2, where U dc is the DC bus voltage of the servo drive, I dmax is the maximum amplitude of i * d and I qmax is the maximum amplitude of i * q . Remark 3. Note that the nonlinear cross-coupling terms and the motor parameters' variations are the main difficulties. No matter which flux-weakening algorithm is used, these difficulties still remain to be solved in the current controller design.

Remark 4.
In this section, the classical model of the IPMSM is used, and there is also a kind of full IPMSM model with variable parameters (in particular L d , L q and R s ) as given in [32]. In fact, directly employing the full PMSM model is another kind of solution for the problems caused by the motor parameters' variations, and this can also improve the performance of the traditional methods, such as the integral NPC and PI. It should be pointed that using the classical model of PMSM and solving the problems in the controller design is simpler and more convenient in the existing condition. For example, the existing general servo products lack the detection of motor temperature, which is needed in the identification of L d , L q , and R s .

Remark 5.
It must be pointed out that the minus reference d-axis current must be limited in terms of its amplitude and duration in practical applications because an excessive d-axis current for a long time can demagnetize the machine [33]. Note that large current i d appears at very high speed. For the FW algorithm in actual servo products, the restriction on i d needs to be very strict for the extreme high speed operation of the motor. In the experiment at 5000 rpm in this paper, the restriction is appropriately relaxed (−I dmax is set as −4 A) in order to test the current control performance at such extreme high speed.

Controller Design
Here, considering the nonlinear cross-coupling terms and parameters variations, a novel nonlinear predictive control is designed to provide the d-and q-axes stator voltages which minimize the errors between the d-and q-axes currents and their references, respectively. For convenience, the current dynamic Equation (4) can be rewritten into a standard nonlinear system as where x, u, d, and y are respectively the state, input, disturbance, and output, given by g 1 and g 2 are the input and the disturbance gain matrices, respectively, given by and the functions f (x) and h(x) are given by To seek the best control input, a generalized cost function is defined as where T P is the predictive period, y(t + τ) is the predicted output, given by and y r (t + τ) is the desired future reference, given by

GPIO Design
The generalized proportional integral observer (GPIO) provides an adequate way to estimate the disturbance in the nonlinear system, given by where w 1 , w 2 , . . . , w n and w n+1 are the estimations of x, d, . . . , d (n−1) and d (n) , respectively, and α 1 , α 2 , . . . , α n and α n+1 are the observer gain matrices to be designed, given by Assumption 1. For the nonlinear servo system (6), at least n time derivative of the disturbance d exists.

Assumption 2.
The disturbance d has constant value in steady-state, i.e., lim Disturbance can be proved to be estimated and removed from the output channel in steady-state by the following theorem. Theorem 1. Consider the closed-loop current nonlinear system (6). Suppose that assumptions 1 and 2 are satisfied. If the observer coefficients α 1 , α 2 , . . . , α n and α n+1 are tuned such that A e in Equation (17) is a Hurwitz matrix, the estimated value of disturbance w 2 can asymptotically track the actual disturbance d.
Proof. For the nonlinear servo system, define the disturbance estimation errors e 1 e 2 . . . e n+1 as Denote an observer error matrix e = [e 1 e 2 . . . e n+1 ] T and a disturbance matrix e = [0 0 . . . d] T . Combining the nonlinear servo system (6), the GPIO (13) and Equation (15), the derivative of e can be expressed asė = A e e +ḋ. (16) Equation (16) is an error system, where the error system matrix A e is given by where I is a 2-order square matrix. The error system given by Equation (16) is asymptotically stable if A e is tuned as a Hurwitz matrix andḋ is bounded. This completes the proof.

Output Prediction with Disturbance Compensation
With employing the GPIO, the disturbance d = p d p q T can be estimated by the estimation w 2 = p dpq T , wherep d andp q are the estimated values of p d and p q . Here, to compensate the disturbance, a new inputû is designed aŝ Substituting Equation (18) into Equation (6), a disturbance-compensated nonlinear servo system can be obtained, given by In addition, then, the future output of the system (19) is calculated. The input relative degree (IRD) of the system (19) is defined as σ. The future output y(t + τ) is predicted by Taylor series expansion where r is the control order (see [27] for detailed definition). The input relative degree (IRD) σ is equal to 1, and the control order r is chosen as 0. Hence, the output y and its derivative are given by where In addition, then, the predicted output array can be obtained, given bȳ where Γ(τ) is a weighting matrix, given by

Receding Optimization and Control Law Design
Similarly to Equation (23), the reference output array can be obtained, given bȳ , and the (i, j)th element ofΓ is given bȳ By virtue of Equations (23)- (26), the performance index (10) is expressed as Let (∂J/∂û d ) = 0 and (∂J/∂û q ) = 0. Then, the optimized inputû which minimizes the cost function (27) where Combining Equations (18) and (28), an optimized and disturbance-compensated control input is finally obtained, given by

Experimental Validation
In this section, a series of experiments are conducted on a DSP-based IPMSM servo system. The experiment platform is showed in Figure 3. The processor chip of the experimental drive is a fixed-point DSP (TMS3202812 made by Texas Instruments, Dallas, TX, United States). The PWM period is set as 100 µs, and the dead-time is set as 3.2 µs. The power driving circuit consists of a single-phase of diode bridge rectifier, a large capacitor filter, and an IGBT inverter. The DC link voltage is 310 V. The phase currents are measured by the Hall-effect devices, and the position of the rotor is measured by the 17-bit absolute encoder. The experimental motor is an eight-pole IPMSM, and the nominal parameters are shown in Table 1.   To illustrate the superiority of the proposed control method (NPC + GPIO), experiments have been carried out compared with the integral nonlinear predictive control (NPC + I) and the improved proportional integral (PI) control. The control performances of these controllers against the nonlinear cross-coupling terms and the motor parameters' variations have been tested in current control mode and speed control mode respectively, to reflect the different working conditions of the motor and obtain fair comparisons.

Remark 6.
Using two integrators to compensate the disturbance d, the control of NPC + I is given by where Remark 7. The performance of the basic PI for flux-weakening current control is bad. Hence, the basic PI control is improved by a voltage feedforward decoupling compensation. Figure 4 shows the diagram of such improved PI current control. Figure 4. Current control based on the improved PI control.

Control Performance under Current Control Model
In this subsection, the control performances against the nonlinear cross-coupling terms and the motor parameters' variations are tested under current control model, where the reference d-and q-axes currents are directly given and the speed loop of the IPMSM does not work. The control parameters are tuned and shown in Table 2. 4096 R s , L d ,L q and ψ f are tuned to be nominal or inaccurate respectively in the two cases NPC + I K Id = 3000, K Iq = 3000 R s , L d ,L q and ψ f are also tuned to be nominal or inaccurate respectively in the two cases PI K Pd = 36, K Id = 3000, K Pq = 36, K Iq = 3000 (subscripts d and q mean d-or q-axis, respectively) R s , L d ,L q and ψ f are also tuned to be nominal or inaccurate respectively in the two cases  Table 1 are used into tuning the parameters of the controllers, and this case is designed to independently test the performance against the nonlinear cross-coupling terms. In addition, then, the case of motor parameters' variations is defined that inaccurate motor parameters are used, and this case is designed to test the performances against both the nonlinear cross-coupling terms and the motor parameters. The inaccurate motor parameters are set as that L d , L q , and ψ f decrease by 30%, and R s increases by 100%. Figures 5 and 6 both show that the proposed NPC + GPIO controller has a smallest overshoot and a shortest settling time as compared with the NPC + I controller and the PI controller no matter in the case of nominal model or in the case of motor parameters' variations. The concrete dynamic-state and steady-state performance indices in the two cases are respectively given in Tables 3 and 4. It is also observed that the proposed NPC + GPIO controller has a smallest offset error and a smallest fluctuation rate in the two cases. Hence, the proposed NPC + GPIO controller shows the best dynamic-state and steady-state performances as compared with the NPC + I controller and PI controller no matter in the case of nominal model or in the case of motor parameters' variations. With the motor parameters varying, the proposed NPC + GPIO controller also maintains the best performances, while the NPC + I controller and PI controller both face the deterioration of control performances.

Remark 8.
A direct experimental method to realize manually-adjustable model parameters variations is putting the motor into a thermostat to keep a constant high temperature, and then using precise instruments to read the new values of R s , L d , L q , and ψ f . This method is very difficult to realize, and, moreover, the values of L d , L q are related to not only the temperature, but also the d-and q-axes currents, the winding current frequency, and the rotor angular. Thus, the manually-adjustable model parameters variations are almost impossible to be exactly realized by the direct experimental means. In this paper, the model parameters' variations are realized by tuning the corresponding parameters of the controllers far from their nominal values. This indirect experimental method is easily realized and still effective.   Table 4.
Comparison of current-tracking performance indices in the case of model parameters variations.

Speed Controller d-or q-Axis Current Controller
Dynamic-State Steady-State

Control Performance under Speed Control Mode
In the previous subsection, the outer-loop speed controller does not work, and the inner-loop current control performances of the NPC + GPIO, NPC + I and PI controllers are independently tested. In this subsection, the outer-loop speed control performance is tested by using the same speed controller (PI) and different current controllers, to investigate the improvement of the outer-loop control performance by just improving the inner-loop control performance. The experimental conditions are set so that the motor faces the same model parameters' variations as the previous subsection, and the same control parameters of the current controllers as the previous subsection are used. For the outer-loop speed control, parameters of the PI controller are chosen as K p = 0.03 and K i = 30. Figures 7-9 show the speed and current responses with operation speeds at 500 rpm, 4000 rpm and 5000 rpm, respectively, under the same speed controller (PI) and the different current controllers. At the operation speeds of 500 rpm, the motor is in the CT region, and, at speeds 4000 rpm and 5000 rpm (maximum speed), the motor is mainly in the FW region. With the operation speed at 500 rpm, it is clearly observed from Figure 7a that the proposed NPC + GPIO inner-loop controller realizes a faster and smoother outer-loop speed dynamic process as compared with the NPC + I and the PI controllers. The corresponding d-and q-axes current responses are shown in Figure 7b-g. To be more clear, the d-and q-axes current-tracking errors are given in Figure 7h-i, where one can find that the NPC + GPIO has the best current-tracking performances. In addition, then, with the operation speeds at 4000 rpm and 5000 rpm, Figures 8a and 9a show that the proposed NPC + GPIO inner-loop controller maintains a good speed dynamic performance, while the NPC + I or the PI inner-loop controller faces the significant performance degradation. The corresponding current responses and current-tracking errors are shown in Figures 8b-i and 9b-i. In addition, the proposed NPC + GPIO controller has the best current-tracking performances. The concrete speed-tracking performance indices are given in Table 5, and the proposed NPC + GPIO current controller also has a smallest speed offset error and a smallest speed fluctuation rate.
With the operation speed at 500 rpm, it is clearly observed from Figure 7a that the proposed NPC + GPIO inner-loop controller realizes a faster and smoother outer-loop speed dynamic process as compared with the NPC + I and the PI controllers. The corresponding d-and q-axes current responses are shown in Figure 7b-g. To be more clear, the d-and q-axes current-tracking errors are given in Figure 7h-i, where one can find that the NPC + GPIO has the best current-tracking performances. In addition, then, with the operation speeds at 4000 rpm and 5000 rpm, Figures 8a and 9a show that the proposed NPC + GPIO inner-loop controller maintains a good speed dynamic performance, while the NPC + I or the PI inner-loop controller faces the significant performance degradation. The corresponding current responses and current-tracking errors are shown in Figures 8 and 9b-i. In addition, the proposed NPC + GPIO controller has the best current-tracking performances. The concrete speed-tracking performance indices are given in Table 5, and also the proposed NPC + GPIO current controller has a smallest speed offset error and a smallest speed fluctuation rate. Figure 10 shows the speed and current responses with operation speed at 500 rpm-4000 rpm-500 rpm, to reflect the control performance in the case of transition between the CT and FW regions. It is clearly observed from Figure 10a that the proposed NPC + GPIO inner-loop controller realizes a fastest and smoothest transition process between the CT region (around 500 rpm) and FW region (around 4000 rpm). The corresponding d-and q-axes current responses are shown in Figure 10b-i, and one can find that the NPC + GPIO also has the best current-tracking performances. The fastest and smoothest transition process between the CT and FW regions mainly benefits from the improvement of current-tracking performances.
Finally, performance in the case of load disturbance is tested. When the motor is running at a steady state, the load torque is added suddenly and removed suddenly after some duration. Figures 11 and 12 respectively show the responses with operation speed at 500 rpm (in CT region) in the case of 2.4 N·m load torque (nominal torque), and 4000 rpm in the case of 1.5 N·m load torque (nominal power), respectively. It can be observed from Figures 11a and 12a that the proposed NPC + GPIO maintains a best speed dynamic performance in the case of load in both CT and FW regions. In addition, the speed dynamic performance in the case of load is improved because current-tracking performances as shown in Figures 11b-i and 12b-i are first improved.
In brief, with using the same outer-loop speed controller and just the different inner-loop current controllers, the proposed NPC + GPIO current controller realizes the best speed-tracking performance in different cases. Moreover, from the CT region to the FW region, the proposed NPC + GPIO current controller maintains a good speed performance, while the NPC + I or the improved PI faces the significant performance degradation. (g) q-axis current response under the PI controller; (h) d-axis current-tracking errors under the different current controllers (the d-axis response current (id) minus the d-axis reference current (idr)); (i) q-axis current-tracking errors under the different current controllers (the q-axis response current (iq) minus the q-axis reference current (iqr)).

Remark 9.
In Figures 8b-g and 9b-g, it is observed that the reference d-and q-axes currents of the three different current controllers are different. Actually, in the flux-weakening algorithm employed in this paper, the reference d-and q-axes currents relate to the outputs of the current controller.
Remark 10. In Table 5, t s of the PI current controller (with operation speed at 5000 rpm) is not given since there always exists speed-tracking errors more than 5%. Therefore, bad current-tracking performances make the flux-weakening speed control fail.
Remark 11. In Figure 9a (with operation speed at 5000 rpm), it can be observed that oscillations occur at steady-state speeds under the NPC + I and PI, and they are weak in Figure 8a (with operation speed at 4000 rpm). Note that 5000 rpm is the maximum limit speed of this motor which does not generally appear in the actual working condition, and the original reason for this experimental phenomenon is that the current control problems (nonlinear cross-coupling terms and motor parameters' variations) become the most serious. On the one hand, the minus reference d-axis current is calculated by the FW algorithm to reduce the stator voltage and increase the motor speed further, and if the d-axis current tracks its reference very well (see Figure 9b), the speed response will be very smooth. However, if the d-axis current response has some oscillation (see Figure 9c,d), this kind of oscillation will also occur in the speed response. On the other hand, since the d-and q-axes currents' responses have some oscillations, the mechanical torque will also have some corresponding oscillation, and this will also lead to the oscillation in speed response.

Conclusions
In this paper, a GPIO-based NPC has been designed for the IPMSM servo system to improve the FW current control performance against the complex nonlinear cross-coupling terms and the IPMSM parameters' variations. A comparison of the integral NPC scheme and the improved PI control scheme has proved its superiority. Experiments under the current and speed control modes have been respectively conducted on a DSP-based IPMSM servo system. The results have validated that the proposed control scheme can obtain a satisfactory FW control performance.
Author Contributions: C.W. conceived the main idea, performed experiments, and wrote the manuscript. J.Y. contributed to developing the idea in this research. C.W., J.Y. and Q.L. thoroughly revised the paper. All authors have read and agreed to the published version of the manuscript.