## 3 Proposed ESN-MPC Strategy for PMSM  
### Structure of ESN  
At each sampling instant, the predictive model utilizes the dq-axis currents (\(\mathbf{i}_{\text{sd}}(k)\), \(\mathbf{i}_{\text{sq}}(k)\)) and the inverter output voltages (\(\mathbf{v}_{\text{sd}}(k)\), \(\mathbf{v}_{\text{sq}}(k)\)) as inputs, and the outputs are the predicted value in the next control cycle. Therefore, for the ESN, the predictive model of FCS-MPC can be represented as a multivariate function \(F\):  
\[\Big{[}\mathbf{i}_{sd}^{\text{P}}(k+1),\ \mathbf{i}_{\text{sq}}^{\text{P}}(k+1)\Big{]}=F \big{[}\mathbf{i}_{sd}(k),\ \mathbf{i}_{sq}(k),\ \mathbf{v}_{sd}(k),\ \mathbf{v}_{sq}(k)\big{]}. \tag{13}\]  
The neural networks, such as ANNs and RNNs, demonstrate excellent performance in addressing nonlinear input-output mapping problems. One of the principal advantages of neural network algorithms lies in their ability to approximate intricate mathematical relationships via multi-layered representations. In the proposed ESN-MPC algorithm, the predictive model of FCS-MPC is replaced with an ESN to achieve real-time parameter adaptation during PMSM drive operation. Thus, the complex algorithm design typically associated with parameter identification techniques is alleviated by the offline training and online learning capabilities of the ESN.  
The ESN in this paper includes an input layer with corresponding input vector \(\mathbf{u}\), a reservoir with corresponding states \(\mathbf{x}\), and an output layer generating the output vector \(\mathbf{y}\). A standard \(tanh(\cdot)\) function is employed as the reservoir's nonlinear activation. The state and output equations of the ESN can be presented as  
\[\mathbf{x}_{k}=tanh[\mathbf{W}_{\text{res}}\mathbf{\cdot}\mathbf{x}_{k-1}+\bm  
selection and configuration of the training samples are necessary to prevent both overfitting and underfitting.  
The overall data generation and offline training procedure for the ESN are depicted in Figure 3. The dataset for ESN training is collected using the FCS-MPC model for PMSM drives, as discussed in Section 2. While the reference for \(i_{\text{sd}}\) is fixed at zero, the reference for \(i_{\text{sq}}\) can be determined via a PI controller. Based on the prediction model (10), the predicted values of the dq-axis currents corresponding to all possible input voltage are calculated. The optimal switching state is then selected and applied by evaluating the cost function. The input and output state datasets are obtained through sensor sampling and the prediction block of the FCS-MPC. Before training, the dataset is normalized to improve the convergence speed and accuracy of the algorithm. The normalization process is as follows:  
\[N_{i}=[\boldsymbol{y}_{i},\,\boldsymbol{u}_{i}]^{\text{T}} \tag{18}\]  
\[N_{i}=2\bigg{(}\frac{N_{i}-\text{min}(N_{i})}{\text{max}(N_{i})-\text{min}(N_{ i})}\bigg{)}-1 \tag{19}\]  
\[N^{norm}=[N_{1},N_{2},N_{3},\ldots,N_{k}]^{\text{T}} \tag{20}\]  
The training data spans various operating conditions, including wide ranges of dq-axis inductance values (\(L_{\text{d}}\), \(L_{\text{q}}\)), speed (\(\omega_{\text{r}}\)), and load torque (\(T_{\text{e}}\)). Both the input and output state data from the FCS-MPC controller are stored for training purposes.