Simple and robust model predictive control of PMSM with moving horizon estimator for disturbance compensation

: This paper deals with a novel robust current control scheme for PMSM drives, based on the model predictive control (MPC) theory. It has been designed a simple quadratic formulation of the reference tracking problem in order to compute the optimal commanded voltage. Considering only equality constraints allows the efficient computation of a closed-form solution which solves the minimisation problem. Authors' proposed objective function is extended to include the inequality constraints, such as current and voltage limitations, therefore, the problem indirectly penalises the violation of boundaries through a weighting strategy. However, the controller does not require any calibration effort, maintaining the application suitable for different drive systems. The increased robustness is achieved through the integration of a moving horizon estimation (MHE), which exploits the same explicit formulation obtained for the MPC, but with the objective of estimating the voltage disturbance affecting the machine. The dual estimation problem is directly integrated within the prediction step of the MPC, improving drastically the local accuracy of the nominal model prediction with further advantages in terms of precise reference tracking and disturbance rejection capabilities. The effectiveness of the proposed control is verified by mean of test-bed experiments.


Introduction
Model predictive control (MPC) is a promising control concept, well known for its beneficial performance concerning optimal control problems. Being of superior performances for multivariable and strongly coupled systems, MPC algorithms successfully are applied since the 1970s, especially within chemical engineering. However, due to the typical high computational demands, the application traditionally was limited to rather slow systems. MPC-based schemes present only one regulator which relies on the model of the machine to predict its future behaviour and to drive the machine accordingly. While its idea is relatively old [1,2], only the recent development of hardware with higher computational powers enables its implementation in systems with fast dynamics, such as electrical drives [3,4].
Electrical drives are of particular interest for the application of MPC, because in field as industrial robotics and automotive it is required to have rapid and precise signal tracking, such as the reference torque. Since the current dynamic is responsible of the torque dynamic and performance, a fast current-loop is required for fulfilling mechanical requirements. Further, their quite accurate model and the crucial role played by the hardware constraints in the drive dynamic can be directly accounted by receding horizon policies, avoiding any anti-windup technique. Many current control methods have been proposed in the last decades for electrical drives. From these, hysteresis and linear controller are the most popular in industrial applications [5], but among them the predictive control offers the fastest response [6]. In general, there are two main ways to implement the MPC as an infinite control set strategy: explicit and implicit formulation. The explicit MPC [7] requires the solution of the optimisation problem off-line, exploring all the physical cases of the system leaving only the realtime task of searching for the pre-computed solution. The implicit strategy, instead, aims to solve the full problem online at each sampling time, which can be quite challenging due to the hard-time constraint. However, in the past years, many strategies where proposed to exploit the full potential of the MPC in real-time [3,8,9].
Despite its great potential, the biggest challenge in MPC implementation is the non-linear behaviour of the drive, since the full and precise knowledge of the parameters is needed for the prediction and for the disturbance rejection, in order to avoid signal oscillations and steady-state error. To overcome this limit, in [10], an extended state observer (ESO) is used to improve the steadystate performance of the system. Also in [11], a predictive control is enhanced with an observer based on internal model, which exploits a simple updating law for fast disturbance estimation, influencing also the distorted frequency behaviour of the system output. Again, in [12], an ESO observer is shown to improve the robustness of a standard predictive control to the parameter mismatch in terms of reduced current overshoot and steady-state oscillation. It has been extensively reported that schemes based on disturbance observers can help to compensate non-linearities while featuring an easy structure and a low computational burden [13]. However, linear observers require tuning effort and have a limited bandwidth, reducing the overall control drive capabilities. Here, a more advanced observation technique, based on the moving horizon estimation (MHE), is proposed in order to further enhance the robustness of the main predictive control and avoid any calibration phase during the controller design. MHE is an optimisation-based scheme that has been applied in a few electric drive applications [9,14]. In this method, the estimation is stated as an optimisation problem. In particular, the states are estimated by a minimisation over a finite horizon of the errors given by the past measurements and the estimations based on the model. MHE is often referred to be the dual of the MPC [15]. Our proposal aims to couple both the MHE and the MPC techniques in order to reach the best performance attainable with a PMSM drive. At the same time, the linear machine model offers the opportunity to minimise the problem complexity obtaining a direct explicit solution of both the problems, which becomes efficient for real-time implementation with the typical switching frequency of industrial drives (10 KHz).
The paper is organised as follows: Section 2 provides the linear discrete-time mathematical model of the PMSM with the typical hardware constraints. Moreover, the closed-form solution of the optimal control problem is derived. Section 3 proposes the augmented cost function for indirectly accounting the voltage constraints. In Section 4, the MHE problem is formulated and the design choice are discussed. Finally in Section 5, different test-bed measurements are shown and resulting performances are analysed.

PMSM mathematical model
In this section, the development of the mathematical model of the drive dynamics and the model predictive policy is derived.
Considering a PMSM, the current dynamics in the time domain can be expressed in the d-q reference frame with a linear discrete state-space model representation as follows where the state x(k) = [i d ; i q ] T and the input u(k) = [u d ; u q ] T are the dq-axis currents and the reference voltages, respectively, and T s is the sampling time. The machine parameters are stated with R, L d and L q which stand for the stator phase resistance and the two axes inductances. Additional terms are used to refine the model. In particular, the cross-coupling between the d and q-axes, [16], the back EMF disturbance, modelling errors, parameter uncertainties and all other undesired effects are collected in the term q(x; t), which is a generic function of the state [17]. The fact that the model does not include any explicit parasitic effects description leads us to obtain a linear model with constant matrices A and B. In Section 4, the observer will be introduced in order to estimate q(x) = [q d ; q q ] T and compensate the inaccuracy of (1).

MPC formulation
The whole general idea behind the MPC is to select control actions overtime, which minimise a certain objective function given to the controller, possibly adopting the best feasible pattern. For our current control of a PMSM, the objective is to track the reference currents; therefore, the error can be penalised with a discrete quadratic cost over the prediction horizon as follow: where r = i d * , i q * T are the reference current, W x is the weighting matrix, and N is the prediction horizon. For simplicity, the reference dq currents will be considered constant along the predictive horizon. Considering (2), the optimisation problem can be stated as The general problem (3) contains the equality constraints, which represent the current dynamics, respectively, on the dq-axis and the inequality boundaries which limit the machine state and the control input to lie in a feasible region. For a PMSM drive, they can be described in the rotor reference frame as follows: where I max is the maximum current, which can be driven within the motor and U max represents a voltage limitation offered by the power electronics. In general, considering the SVPWM as a switching technique U max ≃ 0.57 ⋅ U dc , being U dc the DC bus voltage. Since our predictive control aims to guarantee tracking state performances, the state constraint can be ignored at this stage. Further, in the case that the voltage constraint is not directly taken into account, the problem (3) becomes a linear-quadratic equality constrained optimisation problem. Considering a prediction step N starting from the instance 0, the equality constraint can be generalised with the following recurrent formula which can be written in a compact matrix form as where x 0 is the initial state and q 0 is the initial estimated disturbance dynamic on the dq-axis. In this case, since q 0 is not directly modelled, we assume that it is constant during the prediction horizon, in fact it is not known in advance. This might be a strong assumption, but since the disturbance component of a PMSM includes both slow varying, such as temperature effects and high-frequency harmonic terms [18], the only effect of our assumption is to limit the correct high-frequency disturbance rejection. Finally, defined the generalised predictive scheme in (6) and considering (2) the equality constrained problem can be written as In (8), all but the optimisation vector of voltages U are fixed, therefore, it is possible to define a new variable as Substituting (9) in (8) and proceeding with the algebra with we obtain a regular linear-quadratic expression for our penalisation function depending only from the control input. Now the minimisation of the function J becomes straight-forward by imposing the gradient to zero, in fact Equation (12) is the optimal explicit solution for the conventional current predictive control; in particular, the computed voltages in an ideal case should bring the current to the reference in one single-sampling period, making unnecessary implementation of an horizon N > 1. In general, dealing with system delays and more involved cost functions, the extended horizon can help to improve the transient dynamic of the current.

Augmented cost function for the inequality constraints
As already mentioned in Section 2, the optimal problem written as in (3) cannot be solved in closed-form because of the inequality constraints presence. In fact it needs an iterative quadratic programming solver to find the solution that can compromise the practical implementation for its computational cost. Our proposal is to introduce a new term in the cost function in order to indirectly penalise the voltage respect to its physical limit, while maintaining available the closed-form optimal solution. The latter translates in an additional term dependent from the voltage with a dynamical weighting of the two cost-function's components as follows where f(U) and g(U) are the previous and added terms, respectively, while a and d are the dynamic coefficients just mentioned. In particular, the idea is to make effective the indirect voltage penalisation when there is a large deviation between the current state and the reference state that is in a transient situation, while to make it vanish when the steady-state condition is reached. Before expressing a and d explicitly, it is necessary to define an where x i and u i − 1 are last state prediction and last voltage reference, respectively. In case of a horizon N > 1, b will be a vector, producing consequently a different a and d component for each prediction step. Considering the case N = 1, it is worth mentioning that if u i − 1 is close to U lim , b is very large, while it tends to zero when last predicted state is close to the new reference. As b is defined, it could be suitable as weight for g, but normalised weights between zero and one are more appropriate, thus a and d are defined as follows.
In Fig. 1, the trend of the functions over the tracking error are plotted. When the error is maximum, for example during the transient of the state x starting from zero for tracking a specific reference, the optimisation penalises equally the tracking error and the voltage over the limit. Once the states are reaching their reference, the voltage penalisation component vanishes and the cost-function reduces to the original (7a) and (7b). Experimental results show both the cases when g is well weighted: one during transients and the other when voltage necessary to achieve the reference is close to the physical limit U lim . This is the consequence of how a and d have been thought.

Moving horizon estimation-based observer
In this section, the observer based on the MHE is proposed, in order to correctly estimate eventual mismatch quantities q on d -qaxis, which could lead to a wrong prediction within the MPC statespace model (1). In general, this kind of correction is necessary in order to obtain error-free tracking capabilities in steady-state operation [19].
Let us consider a moving time window of length N in the past as the red time window in Fig. 2. Using the notation as in (1), the state variable x k is represented in continuous live. The N + 1 estimates of the current time are indicated by black circles, while the ones of the previous time window are represented by red dashed circles. It is possible to define the information vector I k N composed by all the last N + 1 measured currents and N applied voltages during the instants within the time window.
The problem to be solved aims to define the estimation of the measured state x, which is hereafter denoted as x^, for each instant of the time window, as a function of the information vector I k N and of the initial prediction x¯k − N , based on the last excluded state and voltage vector. The latter is given by: The cost function that has to be minimised for pursuing the estimation is the following: where Γ a k − N , also called 'terminal-cost', can be seen as the initial information from k = −∞ up to the beginning of the estimation horizon. This term is necessary to give consistency to the actual optimisation problem with the past state information that are not explicitly accounted for in the current cost function. A typical formulation of the terminal cost is in the form of a quadratic penalisation as where η > 0 is a constant that defines the 'trust' in the prediction x k − N with respect to I k N . Therefore, the general MHE formulation at the instant k can be expressed by the following constrained optimisation problem: known the prediction x¯k − N and the information I t N . The problem (20) re-frames the formulation of the predictive controller (3) and for this reason, the MHE is often considered to be the dual problem of the MPC. Interesting to notice that for the estimation problem, eventual inequality constraints are unnecessary, since the solution does not aim to track a reference, but a signal which is already bounded.
Problem (20) can be transformed in a condensed QP formulation, following the procedure exposed in Section 3 and a closed-form for the optimal solution can be computed as for (12). The resulting estimated disturbance q addresses the various nonidealities affecting the drive over the time, in particular either slow varying disturbances, such as saturation and temperature effects, and fast varying disturbances, such as time and space harmonics [13].

Experimental results
Finally, in this last part, in order to prove the validity of our proposal, different experiments are conducted at the test bench using dSPACE DS1104. The MPC and MHE formulations presented in the previous sections are finally integrated in the current control. At each sampling, the MHE estimates the actual value of the disturbance which is fed directly to the predictive controller for choosing the optimal voltages to apply at the drive during the next sampling. The overall control strategy is shown in Fig. 3.
The machine under test is an SPM motor, which means that the rotor does not exhibit any reluctance effect. The machine parameters are reported in Table 1. The proposed controller is plugged into the field-oriented-control framework, and the motor is excited with a SVPWM at a fixed frequency of 10 kHz. For simplification, the horizon is fixed to N = 1 both for the estimation and the prediction. The first experiment is reported in Fig. 4, and it shows the effectiveness of the MHE in eliminating the steady-state error. The contribution of the MHE is activated at around 40 ms and clearly it is possible to see in the dq current that the minor steady-state error is precisely compensated in terms of stationary offset and it is also achieved an improved ripple rejection.
In Fig. 5, the sensitivity to the inductance variation is reported, in fact besides the variation of other parameters such as the resistance of the motor and the permanent flux, the inductance directly influences the stability of the control feed-back loop. The latter is due to the fact that in case exists a relevant mismatch between the real machine inductance and the modelled in the controller (20), the MHE generates an over-voltage compensation q for closing the parameter mismatch, since it is the only degree of freedom at disposal; however, this excessive compensation is propagated to the MPC leading to potential instability. In Fig. 5, an operative point is maintained fixed and the modelled inductance is increased linearly of 135% of its nominal value, which is 3 mH. It is possible to notice that the tracking performances are reduced as expected, but stability is hold without any problem. From our experience the range of stability of the MHE is quite wide and a simple update of the modelled inductances in function of the load would be enough to guarantee stability on the full operative range.
In Fig. 6, the dynamical performances of the proposed controller are shown. A ramp speed is given from standstill up to 1000 rpm, which consequently generates the reference q -axis current through a standard PI within a speed loop, while the daxis current is set to 0. The q axis current perfectly tracks the reference without overshoot and also the d axis current is  slightly affected by the cross-coupling, since the MHE reacts immediately to the disturbance. Finally, in the last experiment, our proposed cost-function is tested and compared with a standard over-voltage protection method. In a classical MPC which does not account for the voltage limitation, a projection step is commonly taken after the computation of the optimal solution, in fact if the voltage vector exceeds its limit, the dq-axis components are projected on the constraint, as follows Fig. 7 represents a quarter of the dq voltage plane where the constraint is marked. The motor, rotating at 500 rpm, is pushed from an operative point well inside the machine limits, with i d = −1.9 A and i q = 2.6 A, to a second working point at the voltage limit, where i d = −1.4 A and i q = 1.6 A. The trajectory described by the blue line is the output of the standard MPC before the projection step takes place, namely (3), while the green one is the trajectory of our proposed cost function (13). Clearly, the voltage constraint is well accounted in the second case, while in the first case, the voltage settles at an unfeasible point requiring the projection of the vector on the voltage circumference.

Conclusions
In this work, a novel robust model predictive current control scheme for permanent magnet synchronous machine has been presented. Traditional predictive schemes based on observer compensation exhibit high dynamic as well as strong disturbance rejection but suffer from control complexity and tuning effort. Thanks to as easy as effective modification of the traditional MPC formulation, the proposed structure represents a suitable trade-off between the aforementioned aspects. In particular, using the closed-form solution of the MPC, it allowed to incorporate within the main controller a MHE-based observer. This led us to reach high tracking capabilities, error-free steady-state and strong disturbance rejection performances. The improved behaviour of the system has been demonstrated with several critical test-bed experiments, showing the correct behaviour also under strong uncertainties between the predictive model and the real electrical machine. Moreover, the proposed scheme completely avoid any calibration effort, requiring only a rough knowledge of the nominal machine parameters. These features make it ready-to-use for many industrial applications.