# Research on Process Quality Prediction and Control of Spindle Housings in Flexible Production Lines
## 4 Optimization of Critical Process Quality Prediction Control Based on GM(1,1)-BP
### Process Quality Eigenvalue Prediction Model
#### 4.1.2 Verification of Dynamic Prediction of Work Process Quality Feature Values  
The machining quality data of the spindle hole, an essential process feature of spindle housing, referring to the test set below the data set is divided into 24 sets of data collection.and each group measures the spindle hole diameter size three times. Among the data, there are 24 groups of mean data, as shown in Table 9.  
The MATLAB2021b software platform is used to simulate the prediction effect of different length sequences to determine the best predicted original data length n. The variance ratio C values of the prediction model are shown in Table 10, and the trend of variance ratio change is shown in Figure 6.  
The n = 4-7 length original data series that meet this criterion are analyzed in Figure 6. When n = 5, the variance ratio is the smallest, and the model prediction achieves the highest accuracy. When the model length n is 6-10, the value of n gradually increases, the model is rich in information, and the model's prediction error rises steeply, so the GM(1,1) prediction model with sequence length five is chosen in this paper. This length is the original sequence length of the dynamic GM(1,1) model.  
The original sequence with n = 5 was input and trained for 24 data sets, and the trend of the predicted values was obtained, as shown in Figure 7.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**n** & \(C\) & **n** & \(C\) & **n** & \(C\) \\ \hline
4 & 0.0476 & 11 & 0.4399 & 18 & 0.4874 \\
5 & **0.0206** & 12 & 0.6895 & 19 & 0.5003 \\
6 & 0.1036 & 13 & 0.6807 & 20 & 0.5631 \\
7 & 0.2491 & 14 & 0.7328 & 21 & 0.6655 \\
8 & 0.5201 & 15 & 0.7012 & 22 & 0.6771 \\
9 & 0.4036 & 16 & 0.6247 & 23 & 0.7252 \\
10 & 0.5438 & 17 & 0.5412 & 24 & 0.7022 \\ \hline \hline \end{tabular}
\end{table}
Table 10: Prediction model variance ratios.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Serial** & **Raw** & **Serial** & **Raw** & **Serial** & **Raw** \\
**Number** & **Date/mm** & **Number** & **Date/mm** & **Number** & **Date/mm** \\ \hline
1 & 150.017 & 9 & 150.026 & 17 & 150.031 \\
2 & 150.018 & 10 & 150.021 & 18 & 150.028 \\
3 & 150.019 & 11 & 150.027 & 19 & 150.025 \\
4 & 150.022 & 12 & 150.019 & 20 & 150.023 \\
5 & 150.024 & 13 & 150.023 & 21 & 150.021 \\
6 & 150.023 & 14 & 150.021 & 22 & 150.024 \\
7 & 150.022 & 15 & 150.024 & 23 & 150.022 \\
8 & 150.020 & 16 & 150.028 & 24 & 150.026 \\ \hline \hline \end{tabular}
\end{table}
Table 9: Training model input data.  
Figure 6: Variance ratio c values for different lengths.  
Figure 7: Dynamic GM(1,1) predicted values.  
In Figure 7a, it can be seen that there is a specific difference between the curve trend of the original series and the predicted values, and by comparing the predicted values of the three series, it is found that the trend of the predicted data has a certain degree of advance. However, the analysis and comparison in Figure 7b reveal that the predicted value increases with the iteration of data error and the larger the residuals generated between the actual value. Therefore, the residuals of the dynamic GM(1,1) model prediction must be corrected.