Intelligent Decoupling Control Study of PMSM Based on the Neural Network Inverse System

This study obtains the analytical inverse system of a permanent magnet synchronous motor (PMSM) model based on the traditional magnetic field orientation decoupling control mode by analyzing the inverse quality of the PMSM. Using the neural network’s excellent approximation ability and well learning functions, a neural network inverse system (NNIS) of the decoupling control system was established by identifying and offline training the back propagation neural network (BPNN) and radial basis function neural network (RBFNN). The data collected from the analytical inverse system of the PMSM model are used to analyze and compare the prediction accuracy and running time of the neural network, so as to optimize the structure and parameters of the neural network. The simulation results of three PMSM decoupling control systems show that the PMSM decoupling control system based on RBF NNIS has good dynamic and static decoupling performance, and robustness.


INTRODUCTION
PMSM is an efficient and energy-saving motor, and it is a nonlinear, multivariable, and strongly coupled control object (Bu et al., 2015;Sun et al., 2016;Bu et al., 2019a). The control effect of traditional motor control methods is not ideal. Various control methods of modern motors are essentially decoupling control. At present, the industry adopts field-oriented control to realize decoupling control through id = 0. This is a decoupling method based on an accurate mathematical model, which has good performance in steady-state decoupling. However, the system performance in the dynamic process and when the motor parameters change is not very ideal, and intelligent control is the development trend in the future. This kind of the control method does not have high requirements for the mathematical model. At present, it has many successful applications (Li et al., 2019a;Jie et al., 2020), such as NNIS. This method is an important branch of intelligent decoupling control of the PMSM.
In the decoupling strategy of the NNIS, the key is the design and construction of the neural network, but the relevant research and literature have not been discussed too much. A typical error in the back-propagation feed-forward neural network (BPNN) is selected in many documents to identify the inverse system (Bu et al., 2019b;Xie and Xie, 2020). There is no detailed description on how to select the parameters and algorithm in the BPNN. Similarly, RBFNN with good approximation and fitting ability has not been used to identify the inverse system, let alone compare the decoupling performance of two different neural network structures.
This study deeply discusses the structural design of the BPNN, compares the decoupling effect between RBFNN and BPNN inverse systems, and finally obtains a PMSM decoupling system with excellent dynamic and static performance, and strong robustness when the parameters change and load disturbances occur.

NEURAL NETWORK IDENTIFICATION AND SAMPLE COLLECTION
The original training data of neural networks can be obtained through MATLAB simulation experiment of closed-loop analytical inverse decoupling control. Each group of training data of neural networks includes 5 input signals y 1 , y 1 , y 2 , y 2 ', and y 2 ″, and 2 output signals u d and u q of the neural network (Wang et al., 2018;.
The stator current input is given as 0, the speed input is given as a random quantity with amplitude ranging from 40 rad/s to 140 rad/s, and the sampling system of the PMSM NNIS is shown in Figure 1.

DESIGN AND DECOUPLING OF BP NNIS FOR THE PERMANENT MAGNET SYNCHRONOUS MOTOR BPNN (Back Propagation Neural Network)
BPNN is an error back propagation feedforward neural network. The structure of the BPNN is shown in Figure 2. The sample input vector p=(p 1 , p 2 , . . . , p n ) is normalized to obtain the input layer vector x∈(x 1 , x 2 , . . . , x n ) T . There are m neurons in the hidden layer, and the hidden layer output h=(h 1 , h 2 , . . . , h m ) T is obtained. There are k neurons in the output layer, and the output y=(y 1 , y 2 , . . . , y k ) T of the output layer is obtained. The output is de-normalized to obtain q=(q 1 , q 2 , . . . , q k ) T sample training output. The weight between the input layer and the hidden layer is w ij , and the threshold is θ j . The weight between the hidden layer and the output layer is v jh , and the threshold is τ h .
The output of neurons in each layer meets the following requirements:

Number of Hidden Layer Nodes
There is a relationship among the number of hidden layer neurons J, the input vector dimension n, and the number of partitions M (Yin et al., 2004). Given the other two of them, one of the three parameters can be calculated. In the n-dimensional input space, the maximum number of linearly divisible J hidden layer neurons is Now consider the case that the size of hidden layer nodes is small, when n ≥ J, It is concluded that the hidden layer with 3 nodes will be able to provide classification, but when J ≥ n, the scale of the input vector must be larger than 3.
According to the above formula, J required to complete the classification as M in the n-dimensional pattern space can be found. This M constitutes the solution of the equation: According to the previous section, the BPNN to be trained has 5 inputs and 2 outputs. Set the number of training iterations at net. trainparam. epochs: 2000, net. trainparam. goal: 10e-6 when using MATLAB training. The relationship between prediction error and the number of hidden layer nodes M is shown in Table 1.
The accuracy of neural network prediction decreases first and then increases with the number of nodes increasing. When the number of nodes is 12, the mean square error of prediction is minimum, so the number of nodes in the hidden layer is determined to be 12.

Hidden Layers of the Back Propagation Neural Network
According to Kolmoagorov's theorem (the representation theorem for continuous functions), given a continuous function: E m is a unit cube, then V can be precisely realized by a threelayer neural network (Zhao and Wang, 2022a), the first layer of the neural network has 5 processing units, the middle layer has 12 processing units, and the third layer has 2 processing units. The continuity theorem guarantees that any continuous function and mapping can be implemented by a three-layer neural network (Ting, 2017).
When using the single-layer hidden layer BPNN for training, the optimal number of hidden layer nodes is determined to be 12 (Zhao and Wang, 2022a). Now consider using the multi-layer hidden layer, and the prediction error of single-layer and duallayer BPNN is shown in Table 2.
Compared with the single hidden layer, the multi-hidden layer has stronger generalization ability and higher prediction accuracy, but the training time is longer. When choosing the number of hidden layers, both network precision and training time should be considered. When the network precision meets the requirement, the single hidden layer can be selected to speed up the process (Li et al., 2021a). The comparative analysis not only verifies the reliability of the continuity theorem but also determines the use of the single hidden layer in training.

Back Propagation Neural Network Transfer Function
The transfer function is used to calculate the output of the hidden layer and the output layer, and logsig (S-shaped transfer function) is available: tansig (hyperbolic tangent S transfer function): purelin (linear transfer function): The default settings tansig and purelin are used for offline training using MATLAB/Simulink as shown earlier. After repeated comparison of different transfer functions, the prediction accuracy is greatly improved when tansig and tansig are used for the transfer functions of the hidden layer  and output layer. The prediction errors of the BPNN with different activation functions are shown in Table 3. Therefore, the BPNN is used to select the hyperbolic tangent S transfer function for function fitting approximation (Yin et al., 2004).
The parameter setting of PI and PD regulator of BP NNIS is shown in Table 4.
At 0-0.2 s, the given load torque TL is 6 N m, and at 0.4 s, the load torque mutates to 12 N m; at 0-0.4 s, the given rotor speed ωr is 40 rad/s, in 0.4 s, ωr changes to 140 rad/s. Torque and speed response curves under inverse control mode are shown in Figure 4, and Figure 5 shows the torque and speed response curves of the inverse system based on the BPNN under the same conditions (Zhang, 2010).
Comparing Figure 4 and Figure 5, it can be found that when the set load torque changes suddenly, both controls can maintain the stability of load speed, but the inverse system control method has long torque response time and large peak value, and the peak value of torque reaches 17 N m. The overshoot is 41%, while the torque response time of BP NNIS is short and the peak value is small, and the overshoot is only 16%. When the set speed changes suddenly, the speed response of the two control modes is relatively fast, and there is basically no overshoot. However, in the inverse system control mode, the torque fluctuation is large and the adjustment time is long, while in the BP NNIS, the torque fluctuation is small and the recovery time is short.
In the test, the speed is kept at 90 rad/s, and the load has periodic step change between 6 N m and 12 N m rated load torque. The response curve of speed and torque under inverse control mode is shown in Figure 6. Figure 7 shows the speed and torque response curves of the inverse system based on the BPNN under the same conditions.
Comparing Figure 6 and Figure 7, it is not difficult to find that when the rated load torque changes periodically, the two control modes can maintain the speed stability, but under the inverse system control mode based on BPNN, the torque response overshoot is smaller and the adjustment time is shorter.

Radial Basis Function Neural Network
RBFNN as a feedforward network can approximate analytic nonlinear relations with arbitrary accuracy Yang et al., 2020). It is a powerful tool to deal with complex nonlinear, uncertain, and coupling problems in MIMO systems. Now a PMSM decoupling control system based on the RBF NNIS     is established (Zhao and Wang, 2022b), which makes the system have good dynamic and static characteristics. The RBF neural model is shown in Figure 8. Before using the RBFNN, it is necessary to determine the number of hidden layer neurons, the center of transfer function, expansion constant, and a set of corresponding weights.

Structure of the Radial Basis Function Neural Network
The design methods of the RBFNN can be divided into two categories (Li et al., 2020;Li et al., 2021b;Huang et al., 2022).
1) The function center is randomly selected from the sample data and the center is fixed. After the RBF center is determined, the output of hidden layer is known (Chen, 2021).
Gaussian function is selected as radial basis function, so the transfer function of radial basis function neural network can be expressed as In the formula, M is the number of neurons in the hidden layer; d m is the maximum distance between the selected centers. In this case, the mean square deviation of Gaussian RBF is fixed as The connection weight of the network can be directly calculated by the previous formula: In the formula, d is the desired response vector. R + is the pseudo inverse of matrix R, and R is determined by R r ji (12) In the formula, X j is the data quantity of the jth input sample, and the singular value decomposition method can be used to calculate the pseudo inverse of the matrix. This method corresponds to the MATLAB/newrb construction method.
2) In the dynamic adjustment method of function center, the center of RBF is moved, and its position is determined by self-  organizing learning, while the linear weight of the output layer is calculated by supervised learning rules. The purpose of learning is to have the center of RBF located in the important area of input space. The specific steps are as follows: 1) Initialize the cluster center c i . Generally, M samples are selected from the input sample X i as the clustering center. 2) The input samples are grouped according to the nearest neighbor rule (Zuo et al., 2014); that is, M samples in Xi are assigned to the input sample cluster set θ i with center c i , that is, X j ∈θ i , and meet where d i represents the minimum Euclidean distance.
3) Calculate the mean value of samples in θ i (i.e., clustering center c i ) where M i is the number of input samples in θ i . Calculate according to the aforementioned steps until the distribution of cluster center no longer changes. After the center of RBF is determined, if RBF is a Gaussian function, its mean square deviation σ can be calculated by Eq. 18. The output of the hidden layer can then be calculated. This method corresponds to the MATLAB/newrbe construction method. Newrb and newrbe were, respectively, used to establish two kinds of RBFNNs. The error of the sum of squares was set as 10e-4 pairs of neurons. By comparing the sum of square error, the structure prediction error of different RBFNNs is shown in Table 5.
By comparison, it is concluded that newrbe can only be stopped when the number of neurons reaches the number of training samples. Although the required error precision is reached, the running time is too long. On the contrary, newrb can use fewer neurons to achieve the error precision, and the running time is shorter.

The Spread of the Radial Basis Function Neural Network
When applying the newrbe function to the design of the radial basis function neural network, the spread needs to cover as many input intervals as possible (Li et al., 2019b;Yang et al., 2019), so it needs to be  set as large as possible. However, too large spread will lead to the difficulty of numerical calculation, and the corresponding regions cross too much, which will reduce the accuracy. Reasonable selection of spread values has great influence on the prediction accuracy of the RBFNN. Newrb is used to construct the RBFNN and spread is set as different values for comparison (Wang and Xu, 2012;Pang et al., 2020). The prediction errors of different RBF spreads are shown in Table 6.

Generating Optimized Back Propagation Neural Network Module
In addition, the display interval was set as 1, the maximum number of neurons was set as 600, and the neural network module generated by training was used to replace the inverse system for the decoupling offline simulation of the inverse system of the RBFNN of the PMSM. The main parameters of the program to generate the RBFNN (Zuo et al., 2014) are as follows: goal = 0.0001; spread = 1; MN = 600; DF = 1; net = newrb (pn, tn, goal, spread, MN, DF); By replacing the inverse system module with the generated RBFNN module, and adding the normalized and anti-normalized modules in the front and back to the neural network module, a PMSM decoupling control system based on the NNIS can be constructed, as shown in Figure 3.
The parameter setting of PI and PD regulator of RBF NNIS is shown in Table 7.
1) Static decoupling experiment under the same conditions as section 3: Figure 10 shows the torque and speed response curves under the RBF NNIS control mode under the same conditions.
Comparing Figure 10A with Figure 5A, it can be found that when the speed remains unchanged and the torque changes suddenly, the control mode based on the RBF NNIS has faster response speed and shorter system stability time than BPNN. When the speed changes suddenly, the RBF NNIS also has a faster response speed.
2) Dynamic decoupling experiment against load disturbance under the same conditions as in Section 3: Figure 11 shows the torque and speed response curves under the RBF NNIS control mode under the same conditions.
Comparing Figure 7A with Figure 11A, it can be found that when the set speed remains unchanged and the torque changes step periodically, the control method based on the RBF NNIS has faster response speed, smaller overshoot, and more stable torque in a steady state than BPNN torque regulation. Comparing Figure 11B with Figure 7B, it can be found that when the torque changes suddenly, the speed of the RBF NNIS is also more stable.

Decoupling Performance Analysis
The static decoupling test can verify the static decoupling performance of the system, that is, the stability of one variable when the other variable changes. It can be seen from Figure 5 that the inverse decoupling control system based on the RBFNN has a very small overshoot, basically no oscillation, and the fastest response time when the speed and torque change.
The anti-load disturbance experiment can verify the dynamic decoupling performance of the system, and the dynamic decoupling performance is an important criterion for evaluating the advantages and disadvantages of the decoupling system. As can be seen from Figure 7, the inverse decoupling control system based on the RBFNN responds rapidly and is basically synchronized with the given load. The speed response under the control mode of the inverse system decoupling control system based on the RBFNN has no overshoot, the oscillation amplitude is very small, and the stability value is quickly restored. The speed response of the inverse system decoupling control system based on the BPNN has overshoot and large oscillation amplitude. Under the control mode of the inverse system decoupling control system (Bu et al., 2018), speed has a long-time jitter, and the recovery to the stable value is slow.