# Model Predictive Control for Six-Phase Induction Machines with Insight into Past Current Errors
## 4 Compensation of Accumulated Current Errors  
### The Proposed Solution: RAE-MPC  
Thanks to the error analysis developed in Section 3, a flaw in the FCS-MPC's behavior has been detected. However, one of the interesting capabilities of this type of controller is their inherent flexibility, which has been used in previous works to achieve different control objectives. Some examples are enhancing current tracking [28; 38], decreasing the VSC switching frequency [29] or mitigating common-mode voltages [30; 39]. It extends to reason that, by modifying (7) in such a manner that the individual accumulative errors of the different components are limited, a significant improvement in terms of reference tracking can be achieved. The enhancement would be especially noticeable in the secondary subspace, where the components becomes more sensitive due to the low impedance of this plane. Therefore, the underlying idea of the proposal is to find a method to diminish the high peak values observed in the preliminary test caused by the accumulation of notable errors during many cycles.  
To this end, the present work redefines the common cost function with the addition of a memory stage in order to reduce the accumulated error during the MPC's performance. The inner loop of the proposed control is described in Figure 5. The memory stage consists of a \"first in first out\" (FIFO) queue, which stores the difference between reference currents and the ones predicted by the algorithm for \(k+2\) during the last two cycles. These values are later added up to provide a measurement of the tendency of each component in the past, following this expression:  
\[\begin{split} e_{as}^{ms}&=e_{as}^{{}^{\prime}}+e_ {as}^{{}^{\prime\prime}}\\ e_{\beta s}^{ms}&=e_{\beta s}^{{}^{\prime}}+e_{ \beta s}^{{}^{\prime\prime}}\\ e_{xs}^{ms}&=e_{xs}^{{}^{\prime}}+e_{xs}^{{}^{ \prime\prime}}\\ e_{ys}^{ms}&=e_{ys}^{{}^{\prime\prime}}+e_{ys}^{{}^{ \prime\prime}}\end{split} \tag{9}\]  
where the superscripts \"\({}^{\prime\prime}\)\" and \"\({}^{\prime\prime}\)\" refer to the current errors produced by the optimal control actions estimated in the last cycle and two cycles ago, respectively. During the control action selection, these past errors are added to the ones produced by the vector being evaluated (designated with the superscript \"\(f\)\"):  
\[\begin{split} e_{as}^{acc}&=e_{as}^{f}+e_{as}^{ms},\\ e_{ps}^{acc}&=e_{ps}^{f}+e_{ps}^{ms},\\ e_{xs}^{acc}&=e_{xs}^{f}+e_{xs}^{ms},\\ e_{ys}^{acc}&=e_{ys}^{f}+e_{ys}^{ms}.\end{split} \tag{10}\]  
Figure 5: Control loop of the proposed RAE-MPC scheme.  
The accumulated errors are finally included in the designed cost function and regulated through the use of a weighting factor (\(K_{acc}\)) as follows:  
\[J=e_{\text{as}}^{2}+e_{\beta\text{s}}^{2}+K_{xy}(e_{\text{xs}}^{2}+e_{\text{ys} }^{2})+K_{acc}\,e_{\beta\text{xy}}^{acc2}, \tag{11}\]  
where  
\[e_{\alpha\beta\text{xy}}^{acc2}=(e_{\text{as}}^{acc})^{2}+(e_{\beta\text{s}}^{ acc})^{2}+(e_{\text{xs}}^{acc})^{2}+(e_{\text{ys}}^{acc})^{2}. \tag{12}\]  
With the objective of more clearly depicting the control action selection algorithm, Figure 6 is presented.