# Surface Quality Evolution Model and Consistency Control Method of Large Shaft Multi-Pass Grinding
## 3 Surface Quality Evolution Model Based on Elman Neural Network  
The analysis in Section 2.2 reveals that the surface quality has evolutionary characteristics. Therefore, the surface quality evolution model is established based on Elman neural network, which is suitable to process data with evolutionary characteristics. Elman neural network consists of input layer, hidden layer, undertake layer, and output layer, and its architecture is shown in Figure 7.  
Assuming that the input of the network is \(u(k-1)\), the output is \(y(k)\), the input of the hidden layer is \(x(k)\), and the output of the undertake layer is \(x_{c}(k)\), the state space of the Elman neural network can be expressed as:  
\[x(k)=f(w_{k}^{1}x_{c}(k)+w_{k}^{2}u(k-1)) \tag{3}\]  
\[x_{c}(k)=x(k-1) \tag{4}\]  
\[y(k)=g(w_{k}^{3}x(k)) \tag{5}\]  
where \(w_{k}^{1}\), \(w_{k}^{2}\) and \(w_{k}^{3}\) are the weight matrices of the undertake layer, input layer, and hidden layer, respectively; \(f(\cdot)\) and \(g(\cdot)\) are the transfer functions of the input layer and the hidden layer, which are tansig function and purelin function, respectively. As can be seen from Equations (2)-(4), the input of the network includes not only the input of the input layer, but also the previous output value of the hidden layer, which makes the network sensitive to the historical state data and suitable to process data with evolutionary characteristics.  
Based on the above analysis, the surface quality evolution model based on Elman neural network is developed. The models for surface roughness and glossiness are established respectively. For the model of surface roughness, Elman neural network is trained by the data from the full factor experiments. The input layer of the network has five nodes, which respectively correspond to the four grinding parameters of the current grinding pass, i.e., the actual grinding depth, grinding wheel speed, shaft speed and pallet speed, and the surface roughness of the previous grinding pass. The output of the network has one node that corresponds to the surface roughness of the current pass. The model of glossiness is similar to the model of surface roughness, except that the surface quality index of input and output is glossiness.  
The surface quality evolution models for surface roughness and glossiness are trained using the data from the full factor experiment. The full factor experiments consist of 144 grinding passes, each of which contained six measuring points, resulting in a total of 864 samples. 700 samples are used for training and 164 samples for testing. After the training of 20,000 epochs, the prediction errors of surface roughness and glossiness reach  
Figure 7: Architecture of Elman neural network.  
5.5% and 5.1%, respectively. The actual values of surface roughness and glossiness and predicted values from surface quality evolution models are shown in Figure 8.  
In order to verify the superiority of the proposed model, the prediction accuracy of different modeling methods for surface roughness and glossiness is compared. Elman neural network is used in Models 1 to 3. The training samples and parameters are consistent with the proposed model, but there are some differences in the input and output of the model. Model 1 uses nominal grinding depth. Model 2 ignores the influence of the previous grinding surface quality; Model 3 uses nominal grinding depth and ignores the effect of the previous grinding surface quality. The prediction performance of these three models is shown in Table 3.  
It can be seen from Table 3 that the prediction errors of the proposed model for surface roughness and glossiness are minimal. This proves that the grinding surface quality index is affected by the actual grinding depth and the quality of the previous grinding, and also proves the superiority of the proposed model.