Explicit model predictive control of permanent magnet synchronous motors based on multi-point linearization

Permanent magnet synchronous motors (PMSMs) have been broadly applied in servo-drive applications. It is necessary to improve the performance of PMSM. An explicit controller designed for PMSM based on multi-point linearization is proposed to reduce the linearized model error caused by different running status of PMSM. The mathematical model of PMSM system in the synchronous rotating frame and the problem formulation are introduced at first. Then, the preliminaries about explicit model predictive control (MPC) algorithm are presented in this article. Based on this, the multi-point linearization model is created for explicit MPC controller design. Moreover, the block diagram of the proposed method for PMSM system is presented. Finally, the simulation results are provided to demonstrate that the proposed explicit MPC controller based on multi-point linearization achieves better performance than that based on traditional single-point linearization, but requires the same online computation time because of the offline optimization of explicit MPC.


Introduction
In recent decades, permanent magnet synchronous motors (PMSMs) have played a significant role in motion control applications, including electric vehicles such as Toyota Prius, BYD, Nissa Leaf, and so on (Lara et al., 2016;Mwasilu et al., 2016;Sreejith and Singh, 2019;Velagic´and Sˇabic´, 2014;Zanma et al., 2020). This is mainly because PMSMs have various advantages like high-power density, high efficiency, high torque-current ratio, and compact structure (Koiwa et al., 2019;Zhang et al., 2019). Traditionally, the proportional integral (PI) (Jung et al., 2014;Yi et al., 2017) control has been applied in PMSM drives to obtain fast four-quadrant operation and smooth starting of the system. With the development of the computing hardware, a number of advanced control algorithms have emerged to obtain reduced torque ripple, improved efficiency and insensitivity to parameter changes but at the expense of high online computational complexity. The popular algorithms are fuzzy control, sliding mode control, adaptive control, neural network inverse method as well as model predictive control (MPC) (Liu et al., 2019;Mani et al., 2018;Sun et al., 2020;Wang et al., 2019;Wu et al., 2020). Among these approaches, MPC is proposed as an alternative control method for PMSM system due to its fast dynamic performance and multivariable constraint control capability (Ganapathy and Santha, 2019). MPC can predict and determine the future voltage vector to achieve the optimization of the cost function. The results are assessed by using the cost function penalizing the deviation from a given set point value to a hard constraint . MPC transforms the control problem into an optimization problem, which provides great convenience for dealing with constraints and nonlinear models. The optimal control problem is solved at each sampling moment to obtain the control action sequence. The asymptotic stability and the optimality of constrained MPC are discussed in Mayne et al. (2000). The main outstanding advantage of MPC over other methods is that the security and physical limitations of the motor system can be directly incorporated into the formulation of control problems as control objectives (Jia et al., 2019). Therefore, the future constraint violations are preventable.
However, one nonnegligible drawback of MPC is that the real-time implementation of MPC involves high computational complexity resulted by the optimization process at each sampling time. In order to reduce online computational burden, Bemporad et al. (2002) proposed an explicit solution to the optimization problem, which is known as explicit MPC. Explicit MPC can gain the same performance as MPC including the stability of the system. It transfers the optimization problem from online to offline so as to reduce the online computation time. The explicit control law are represented by continuous piecewise affine (PWA) functions. The online computation is only about simple lookup table to confirm the partition of the state variables, which considerably reduces the online computation time. This means that explicit MPC is certainly suitable for fast sampling systems like PMSM system. The design and validation of explicit MPC for PMSM was presented in Cychowski et al. (2005), demonstrating that the resulting controller achieves the same level of performance as conventional MPC but requires much less online computation time. A PMSM control method (Mynar et al., 2016) was developed based on explicit MPC using a novel linearization and constraint handling method, which allowed natural field weakening. It also added an extra compensation voltage calculation to the controller output to remove the inaccuracy introduced by the model linearization process.
Unfortunately, there are limitations on using MPC. It is generally known that the performance of MPC remains heavily dependent on the precision of the model. The linearized model error caused by different running status can lead to poor performance. This indicates that a single linear model is not able to obtain good control performance for this system. Therefore, based on explicit MPC, we propose a multi-point linearization method to linearize the PMSM model at a few operating points to cover the wide operating range. Because of its offline optimization, the online computational burden cannot be increased by using muilti-point linearization method. Compared with the single-point linearization method, the dynamic and steady-state performance of the system has been improved when the working condition of the motor changes. The simulation results indicate the effectiveness of the proposed approach.
The structure of this article is arranged as follows. Firstly, the mathematical model of PMSM and the brief account of the existed problem are described. Then, the preliminaries of explicit MPC are reviewed. Subsequently, the proposed algorithm including the multi-point linearization method, model selection and model switching schedule, and the controller design are presented. The next section depicts the simulation results and a comparative method to prove the effectiveness of this approach. Finally, the last section gives conclusions of this proposed method.

PMSM mathematical model
PMSM is a complex nonlinear system. In order to better design advanced PMSM control algorithm, it is important to establish an appropriate mathematical model. The d À q model for a PMSM in the rotating reference frame is very suitable for developing the proposed method. The equivalent circuit of a PMSM in rotating d À q reference frame is depicted in Figure 1 (Chaoui and Sicard, 2011). In this figure, R s is stator resistance, L d and L q are frame stator inductances, p n denotes the number of pole pairs, c f is constant magnetic flux, u d and u q are d À q frame stator voltages, i d and i q represent d À q frame stator currents, w m is rotor mechanical velocity. In the d À q reference frame, the electromagnetic moment equation of PMSM can be expressed as The relation between rotor mechanical w m and the electromagnetic moment T e can be described as which is regarded as the motion equation of PMSM. In this equation, J is the moment of inertia, B m is the viscous friction, and T L is the load torque. It is worth noting that the electrical angular velocity of the motor w e = p n w m . The unit of w m is rad=s. The mechanical velocity can also be represented by N r , the unit of which is r=min(revolutions per minute) and N r = 30 p w m . From Figure 1, equation (1) and equation (2), the nonlinear differential equation model of a PMSM can be described in rotating d À q reference frame as follows If the state variable is defined as x = ½i d i q w m T , and the control input variable is defined as u = ½u d u q T , then the above model can be written as follows System (4) may be discretized using, for example, Euler or Runge-Kutta methods to obtain a discrete-time description of the system. We denote the discrete-time expression of the model as follows PMSM is usually controlled by the i d = 0 strategy. Then the constraints of the system are primarily reflected in the rotating d À q axis voltage constraint where V dc denotes the DC-link voltage. It can be observed that the presented PMSM model contains nonlinear and cross-coupled terms. In the operation of a PMSM, the tracking speed and the load torque depend on the requirements of different operating conditions, which may vary significantly. If we directly linearize the PMSM model at only one point, the introduced model error will be too large to neglect. Therefore, it is crucial to design an appropriate linearization model to reduce model errors resulted by different working conditions of the PMSM. The purpose of this work is to create a more accurate approximation of the actual PMSM model based on multi-point linearization. The explicit MPC algorithm is involved in controller design to put the optimization process offline so as to reduce online computational complexity resulted by multiple model.

Explicit MPC
Before designing the controller, we review the fundamentals of explicit MPC and present the explicit law of control variables in this section. For a linear time-invariant system with n state variables, m inputs, and p outputs, the discrete statespace formulation at time instant k is given by where x 2 R n , u 2 R m , and y 2 R p represent the system state variable, input and output, respectively. Suppose that the system is subject to input and output constraints expressed as y min ł y(k) ł y max and u min ł u(k) ł u max . In MPC, the control objective is commonly described as a quadratic cost function where N p is prediction horizon, Q and R are symmetric and non-negative weighting matrices which are used to penalize the state and the control input, respectively.
The prediction model used to compute the future state trajectories is as follows where 6 4 3 7 7 5 . Then, the formulation of MPC can be described as equation (10) V where The matrices G, W and E are decided by the system constraints. A new variable z needs to be defined such that z = U(k) + H À1 F T x(k). Then, the MPC optimization problem can be rewritten as where is the current state vector which can be treated as a vector of parameters. We use x instead of x(k) for ease of description in the following part. It is noticed that H . 0 because R . 0. The number of inequalities is expressed in terms of q. The number of the free variables is n z = m 3 N p . Thus, z 2 R nz , H 2 R nz 3 nz , G 2 R q 3 nz , W 2 R q , S 2 R q 3 n . The above-mentioned MPC optimization problem can be converted to a multi-parametric quadratic programming(mp-QP) problem.
The mp-QP problem of equation (11) can be dealt with using the first-order Karush-Kuhn-Tucker(KKT) optimality conditions (Bemporad and Morari, 1999) Hz where the index j represents the j th row and l j denotes Lagrange multipliers, j = 1, Á Á Á , q. From equation (12) z Substitute the result into equation (13) to achieve the complementary slackness condition, which is l(À GH À1 G T l ÀW À Sx) = 0. The lagrange multipliers corresponding to active and inactive constraints are indicated byl and^l, respectively. For inactive constraints l = 0 and for active constraints, ÀGH À1G Tl ÀW ÀSx = 0. Thus whereG,W,S denote the rows of G, W, S corresponding to the set of active constraints. Therefore, the rows ofG are linearly independent, which indicates that (GH À1G T ) À1 exists. To sum up, l is an affine function of x. Then, substitute equation (17) to equation (16) to get Obviously, z is an affine function of x. The variable z should subject to the constraints of (15) Moreover, the Lagrange multipliers in (17) should satisfy (14) À The inequalities (19) and (20) describe a polyhedron in the state space, which is regarded as the critical region CR 0 . Once CR 0 has been created, the rest of the space has to be explored and new critical regions generated. The recursive algorithm for partitioning the state space is demonstrated in Dua and Pistikopoulos (2000). Therefore, online optimizations can be replaced by explicit control law, which is expressed as a piecewise affine (PWA) function. The PWA function is determined by a finite number of regions that partition state variables. Each region of the state variable corresponds to an explicit input control law. In each region, the PWA control function is expressed as Obviously, the controller is a linear continuous PWA function of state vector. Therefore, the online computation is only about searching in a lookup table to find the region where the current state x(k) belongs to. Then, the corresponding u(x) can be returned. More detailed explanation about methods for a lookup table are available in TøNdel et al. (2003). In this work, Multi-Parametric Toolbox 3.0 (Herceg et al., 2013) is utilized to design the controller.

Proposed controller based on multi-point linearization
In this section, the proposed explicit controller base on multipoint linearization is introduced. The definition of multi-point linearization, model selection and model switching schedule, and specific controller design are demonstrated successively.

Multi-point linearization
The operating conditions of a PMSM vary significantly. This renders the operating range of a PMSM large. A single linear model is not sufficient to achieve good control performance. We may linearize the model at a few operating points to cover the wide operating range. These different operating conditions mainly contain the changes of tracking speed and load torque. In this work, we consider that the motor has M different working points, which means that M steady state points should be included. Therefore, M linearization models based on these steady state points should be involved, which is described as multi-point linearization.
Multi-point linearization modeling means that the PMSM model is linearized at a few steady state points. In other words, the PMSM model is a linear time-varying model after multipoint linearization. For explicit MPC, this method just increases offline computation time other than online computation time, which means this approach will not increase the online computational burden. The number of the linearization times is determined by the number of the stable operating points required by the PMSM system. Let us consider that there are M different working points. At the i-th working point (x s, i , u s, i ), x s, i = g(x s, i , u s, i ), i = 1 Á Á Á M, the linearized model is Then, the combination of the linearized models is where a i denotes the weight factor of the i-th working condition of PMSM. a i satisfies P M i = 1 a i = 1. Define dx(k)=x(k)Àx s, i and du(k)=u(k) À u s, i , the model turns to be Equation (24)

Model selection and model switching schedule
The key point of model selection is to choose appropriate working points to linearize the original model. In this work, we assume that the information about the working condition change is known before the selection of operating points. Three different kinds of working conditions of PMSM are discussed. The selection of the linearization points for these three conditions are shown in Figure 2(a), (b), (c). Here, t 1 is the time when the working status of the motor changes and t 2 is the total simulation time. P 1 and P 2 are the selected points for two periods. Apparently, M = 2 in each case. The first working condition is that a sudden load torque is added to the motor system. From Figure 2(a), it is obvious that the steady state point corresponding to the point P 1 of the system is selected and the resulted linearized model is used from the beginning to time t 1 . When the load torque T L1 is added, the steady state point corresponding to the point P 2 should be calculated and the second resulted linearized model is used from time t 1 to time t 2 . The second condition includes a step change of the tracking speed from w ref 1 to w ref 2 , which is shown in Figure 2(b). For the second condition, it is a proper behaviour that the steady state points at two different reference speeds corresponding P 1 and P 2 in Figure 2(b), are adopted to linearize the original model. The last working condition demonstrated in Figure 2(c) focuses on triangular shape speed reference, which means that the trajectory of the tracking speed goes up continuously and then it goes down gradually. The speed error cannot be entirely cancelled during acceleration due to system constraints (Bolognani et al., 2008). Apart from this, model mismatch is also a significant factor that affects the performance of PMSM. It is crucial to choose suitable linearization points to reduce the speed error as much as possible. According to the results shown in Bolognani et al. (2008), the actual speed is less than the tracking speed during uniform acceleration and the actual speed is greater than the tracking speed during uniform deceleration. Thus, the point at which the speed value is as large as possible is selected as the linearization point in the process of acceleration while the point at which the speed value is as small as possible is selected in the process of deceleration so as to keep the actual speed as close to the reference value as possible. As shown in Figure 2(c), we choose the point P 1 , which is slightly less than the maximum tracking speed, and P 2 , which is slightly greater than the maximum tracking speed to calculate the corresponding steady state points.
How to switch between these M models is worth to be considered. It is certain that the reference status of the motor at different time is known in advance. The weighting factor a i is utilized to determine the working status of the motor. Define that when the motor is running in the i-th working condition. This means that the model is switched form one to another by adjusting the weight coefficient a i .

Controller design
We assume that the motor is working in the i-th working status. For the i-th(i = 1 Á Á Á M) linearized model, a i = 1 and the MPC optimization problem is where Q i and R i are state and control input weight matrices of the i-th cost function, N p is the prediction horizon. From the cost function of the multi-point linearization model, an evident benefit is that the weight matrices can be adjusted with the change of steady state point. The non-cascade explicit MPC controller is applied to the system. The explicit MPC controller is composed of two parts: offline calculation and online searching in a lookup table.
The block diagram of the PMSM system is shown in Figure 3. The offline part is completed by MPT3.0 toolbox, which obtains the partition of the state variables and the corresponding explicit control laws of inputs. The offline calculation process mainly includes initialization and optimization. To be specific, the linear discrete model is regarded as the input of MPT3.0 toolbox at first. Then according to the requirements of the system, the constraints of the model are provided. Next, the system model and the presented constraints are utilized to realize the optimization calculation of MPC. Finally, the partition of the state variables and the PWA functions are generated and saved in a lookup table.
The online sequential search in a lookup table is the controller execution part. At time k, the model switching part is utilized to decide the working condition of the motor so as to determine the points where the model is linearized. For the ith working condition, the input value at time k is dx(k) which is calculated by subtracting x(k) from x s, i and du(k) is obtained according to the partition of dx(k). Thus, u(k) is acquired by adding u s, i to du(k) as the input of PMSM to achieve the state value at the next moment.

Simulation results
In this section, we apply the proposed approach to a PMSM system to illustrate its applicability and effectiveness. The model of PMSM has been introduced above and the detailed parameters used in this section are displayed in Table 1.
Three different working conditions discussed in the previous section are adopted in the following simulations, including load torque change, tracking speed step change and tracking speed uniformly accelerated change. Case 1 simulates the working status that load torque grows from 0Nm to another constant value. Case 2 implements the simulation of tracking speed step changes. Case 3 simulates the process of accelerating and decelerating. The number of steady state points M = 2 in each case. The simulation time is set as 0.1s and the tracking value of the PMSM system changes at 0.05s in all cases. Moreover, the simulation results of singlepoint linearization model is taken for comparison. N p = 5, Q = dig(10, 20, 1000), R = 0:05I are used for singlepoint linearization of each case. For multi-point linearization, N p = 5, Q i = dig(10, 20, 1000), R i = 0:05I(i = 1, Á Á Á , M) are set in case 1, N p = 5, Q 1 = dig(10, 20, 1000), Q 2 = dig(10, 20, 1500), R i = 0:05I(i = 1, Á Á Á , M) are set in case 2, and N p = 5, Q i = dig(10, 20, 1000), R i = 0:05I(i = 1, Á Á Á , M) are set in case 3.
The simulation results of the three cases are shown in Figure 4, 5, and 6, respectively, where speed, d À q axis currents and d À q axis voltage dynamic response curves are all  displayed to show the performance of the motor. In Figure 4 and Figure  The simulation time from 0.045s to 0.075s is captured to clearly observe the difference between the results obtained from these two methods. The speed maximum fluctuation percentage and the regulation time of the two methods are displayed in Table 2 and Table 3. The stable state error is set to be 2e(-6) to calculate the regulation time. ML and SL in the figures and tables represent multi-point linearization and single-point linearization respectively. For the last case, the comparisons of speed response curves and the absolute error of speed are shown in Figure 6. Besides, the mean absolute errors (MAE) shown in Table 4 are calculated to validate the proposed method. From Figure 4, it is obvious that the proposed method can improve the performance of PMSM compared with singlepoint linearization model method when load torque changes from 0Nm to 20Nm. The comparison of speed response curves displayed in Figure 4(b), illustrating that the speed response using multi-point linearization can reach steady state faster    than that using single-point linearization. The comparison of current responses as well as control input are presented in Figure 4(d) and Figure 4(f). The data of Table 2 illustrate the maximum fluctuation percentage and regulation time of load torque step changes. When the load torque changes from 0Nm to 10Nm, 20Nm and 30Nm, the corresponding maximum fluctuation percentage of speed response using multi-point linearization method are 2.72%, 5.68% and 8.29% respectively, which are less than that of speed response using single-point linearization method (2.94%, 7.63% and 13.08%). Besides, the regulation speed of presented method is faster than that of single-point linearization method observing the contrast between the three regulation times of these two methods. The results demonstrate that the presented approach can achieve considerable improvement especially when load torque changes significantly. Furthermore, the results of step change of tracking speed changes are displayed in Figure 5. The proposed controller can track the changes of the reference speed more quickly than the controller using single-point linearization although the current contrast is not that obvious. The data from Table 3(a) clarify that using the proposed approach has 0:16% maximum fluctuation and 17:7ms regulation time, while using single-point linearization method has 0:21% maximum fluctuation and 18:4ms regulation time when tracking speed rises from 1000r=min to 1500r=min. The maximum fluctuation percentage and regulation time of tracking speed changes from 1000r=min to 800r=min are shown in Table 3(b). The results indicate that the proposed algorithm has better performance than single-point linearization whether the tracking speed takes an up step or a down step.
Finally, Figure 6 demonstrates the results of acceleration triangular speed reference. It can be seen from the speed error curve that the speed error using proposed approach is significantly less than that using single-point linearization model. The MAE of these two methods are depicted in Table 4, which provides further evidence that the presented controller has better performance. Besides, the higher the acceleration is, the more the performance is improved compared with the single-point linearization method.

Conclusions
This study focuses on the design and validation of explicit MPC of PMSM based on multi-point linearization. The proposed approach reduces the model error caused by the change of motor operating conditions, demonstrating the potential for enhancing the performance of PMSM system. The simulation results of three given different running conditions proved that the proposed explicit controller based on multi-point linearization can obtain better speed and current performance than that based on single-point linearization without increasing online computational burden. In the future, the differences of mutual inductance between the windings caused by the change of motor position would be considered because the parameter mismatch will cause the deterioration of the performance of MPC. We intend to develop a new explicit controller based on this parameter-varying PMSM system.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.