Next Article in Journal
A Memristor Neural Network Based on Simple Logarithmic-Sigmoidal Transfer Function with MOS Transistors
Previous Article in Journal
Intelligent High-Awareness and Channel-Efficient Adaptive Beaconing Based on Density and Distribution for Vehicular Networks
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Feed Error Prediction and Compensation of CNC Machine Tools Based on Whale Particle Swarm Backpropagation Neural Network

School of Mechanical Engineering, Hubei University of Technology, Wuhan 430068, China
*
Author to whom correspondence should be addressed.
Electronics 2024, 13(5), 892; https://doi.org/10.3390/electronics13050892
Submission received: 31 January 2024 / Revised: 19 February 2024 / Accepted: 21 February 2024 / Published: 26 February 2024

Abstract

:
Current modeling methods of machine tool feed error are challenging to meet the demand of high-precision machining when facing complex machining conditions. To enhance the model’s predictive accuracy and the effectiveness of actual compensation, the Whale Particle Swarm Optimization (WPSO) algorithm is proposed to optimize the Backpropagation Neural Network (BPNN). Subsequently, the optimized network incorporates screw elongation and feed position as inputs to establish a feed-error prediction model. Ultimately, the established model was compared with other models and applied to real-time compensation experiments. The research results show that the proposed prediction model outperforms the BPNN model, the particle swarm-optimized BPNN model, and the whale-optimized BPNN model in various indicators. The accuracy of the prediction model was 93.12%, and the errors ranged from −3.80 μm to 4.57 μm with an average error of −0.30 μm. Under different operating conditions, the maximum backward and forward errors are reduced by 33.21% and 87.21%, and the average backward and forward errors are reduced by 57.15% and 84.37%, respectively. The error range is reduced by 67.41%. Beyond elevating prediction accuracy and compensation efficacy, the proposed model offers robust theoretical guidance for practical production.

1. Introduction

As a pivotal component in manufacturing, numerical control (NC) machine tools play a crucial role, and their feed errors directly impact the machining quality of various mechanical components. In many cases, addressing machine tool feed errors through modeling and compensation methods has proven to be a more economically effective approach to enhancing feed precision [1,2].
In studying machine tool errors, some scholars have observed that the inherent geometric errors of machine tools adversely affect machining accuracy and product quality [3]. Shaowei Zhu [4] treated the machine tool as a rigid multibody system to establish a geometric error model and proposed a new method for identifying geometric errors. Subsequently, these errors were compensated by adjusting the corresponding NC codes. Ding Shuang [5] introduced a digitized and structurally adaptive definition and modeling method for geometric errors to rapidly respond to structural changes in Rapid Manufacturing Technologies (RMT). Based on multibody system theory, Niu Peng [6] established a spatial error model, analyzing the local impact of geometric errors on machining accuracy. In addition to inherent geometric errors, thermal errors have a more detrimental effect on machine tool feed accuracy, accounting for 50–60% of the total machining error [7]. To mitigate the impact of thermal errors, Liu Puling [8] proposed a four-layer model framework for predicting and compensating workpiece cutting thermal errors, achieving an average depth variation reduction from 50 μm to below 2 μm and an 85% decrease in maximum depth variation. Hu Shi [9] introduced a new model based on Bayesian neural networks, reducing the thermally induced errors of the CNC machine tool feed drive system from approximately 18.2 μm to 5.14 μm, resulting in a 71% error reduction. Wenhua Ye [10] presented a novel modeling method to determine the thermal deformation coefficients of machine tool dynamic axes. They used regression theory to establish a thermal error correction model for machine tool positioning and straightness, validating its accuracy on the QLM27100-5X experimental platform of a five-axis linked gantry machine tool sourced from Xiqiao Lian CNC Machine Tool Sales Co., Ltd., located in Wuxi, China. Combining principal component analysis and fuzzy clustering analysis, Grama [11] established a compensation model within a linear regression framework using selected temperature sensors. Based on the analysis of heat generation and transfer in a ball screw system, Hu Shi [12] mathematically modeled the axial thermal expansion of the screw, expressing the relationship between thermal errors and axial elongation rates to characterize the distribution of thermal errors. Feng Gao [13] implemented a thermal error model using a BP neural network to establish the temperature and thermal deformation relationship. A composite model was obtained for predicting positioning errors by combining these two error models. Yang Liu [14] studied thermal errors in a five-axis machining center, establishing a temperature-rise-thermal-deformation model for a thin-walled annular rotating elastic body based on thermal elasticity. They introduced the BP neural network algorithm for predicting thermal errors in a five-axis machining center, conducting a comparative analysis of the predictive accuracy of these models. Considering the insufficient predictive accuracy of single-error modeling, Ziling Zhang [15] proposed a general method that simultaneously considers geometric and thermal errors to allocate part geometry accuracy, improving machining accuracy and reliability under specific design requirements.
In the research above, individual modeling of geometric or thermal errors did not achieve high predictive accuracy, and the computational complexity of comprehensive modeling was too large, hindering real-time compensation and affecting actual compensation accuracy. To improve actual compensation accuracy, Kuo Liu [16] researched the prediction and compensation of time-varying errors in the motion axes of NC machine tools, applying the advantages of digital twinning to predict physical entity changes. Through real-time time-varying error compensation, the fluctuation range of hole spacing errors was reduced by 69.19%. Wu Hao [17] proposed a thermal error model based on a genetic algorithm-backed backpropagation neural network, predicting thermal deformations based on five key temperature points. This approach improved the accuracy of predicting turning center thermal deformation, reducing computational costs. Based on the proposed model, a real-time thermal error compensation system was developed. Jilan Liu [18] introduced a high-speed precision five-axis machine tool thermal error compensation method based on homogeneous transformation. They predicted thermal errors under new conditions, conducted error compensation, and performed actual processing. The results showed that compared to no error compensation and no traditional error compensation, processing errors were reduced by 85% and 37%, respectively. However, the models established in the above studies had excessive computational complexity, making them unable to respond quickly, leading to insufficient feed accuracy after real-time compensation.
This paper employs a Backpropagation Neural Network (BPNN) to establish a feed-error prediction model. Additionally, a WPSO algorithm is proposed to optimize the weights and thresholds of BPNN. By identifying the impacts of geometric and thermal errors on feed accuracy, screw elongation and feed position are selected as input variables for the comprehensive modeling of feed errors. The established prediction model is compared with other prediction models, and finally, the model is integrated into the CNC system for real-time compensation validation. The proposed model and compensation method not only furnish effective theoretical guidance for practical production but also underscore the model’s outstanding performance in real-world applications. This research contributes a viable real-time compensation solution to the manufacturing industry.

2. Principles of WPSO-BPNN

A WPSO algorithm is proposed to optimize the weights and thresholds of BPNN and thus enhance the performance of BPNN. In the model training process, a nested loop is employed, where the outer loop represents the iteration count for training, and the inner loop corresponds to the iteration count for the WPSO algorithm. In each iteration, the weights and thresholds of the BPNN are optimized using the WPSO algorithm to enhance the predictive performance of the neural network. The specific process of establishing the feed-error prediction model using WPSO-BPNN is illustrated in Figure 1.
Initially, the collected data is divided into training and testing sets. The required population size and data point quantity are set, and various parameter values are initialized. Subsequently, all individuals are evenly distributed into two subgroups, A and B. The initial weights and thresholds of A and B subgroups are input into the neural network, and training is performed using the training set. The fitness values for the current parameters of the A and B subgroups are computed and compared. The top 50% of individuals in fitness values are selected as the new A and B subgroups, and the optimal solution is updated. Positions of A and B subgroups are updated, and it is checked whether the set number of iterations or the target error is reached. If not reached, the calculation of fitness values is returned; if reached, the best weights and thresholds are output.
In the neural network training, the fitness value represents the network error, and the calculation expression is given by Equation (1).
f i t n e s s = i = 1 s i z e p i r i
Here, size denotes the data point quantity, p represents the predicted value, and r represents the actual value.
The specific update process of subgroup A in the flowchart includes three crucial stages: rounding up prey, bubble net hunting, and searching for prey. The expressions for rounding up prey, bubble net hunting, and searching for prey are shown in Equations (2), (3) and (4), respectively.
Rounding up prey:
X t + 1 = X b e s t t ω A C X b e s t t X t
Bubble net hunting:
X t + 1 = X b e s t t + ω X b e s t t X t e b l cos 2 π l
Searching for prey:
X t + 1 = X r t A C X r t X t
Here, X t represents the position vector, X t + 1 is the updated position vector, X best t is the position vector of the currently obtained best solution, b is the spiral shape parameter, and X r t is the position of the current random individual.
The vectors A and C in Equations (2) and (4) are coefficient vectors, and their expressions are given by Equations (5) and (6).
A = 2 a r 1 a
C = 2 r 2
Here, r 1 and r 2 are random vectors between [0, 1], a decrease from 2 to 0 during the iteration process, with the specific expression given by Equation (7), where t is the current iteration count, tmax is the maximum iteration count, μ and φ are related parameters.
a = 2 2 sin μ t t max π + φ
The ω  Equations (2) and (3) is the A subgroup algorithm weight, and its expressions are given by Equation (8).
ω = 1 e t t max 1 e 1
In Equation (3), l is a uniformly distributed random number in the range [−1, 1], and its expression is given by Equation (9), where rand represents a random number between [0, 1].
l = 1 + r a n d 2 t t max
The specific update expressions for the position and velocity of subgroup B in the flowchart are given by Equations (10) and (11).
X i j = X i j + v i j
v i j = ω P S O v i j + c 1 r a n d X p b X i j + c 2 r a n d X g b X i j
Here, X ij represents the current particle’s position, V ij represents the current particle’s velocity, X pb is the current individual optimal position, and X gb is the current global optimal position.
In Equation (11), ω PSO is the inertia weight of subgroup B, c 1 and c 2 are learning factors, and their expressions are given by Equations (12)–(14).
ω P S O = ω max ω min t max t t max 2 + ω min
c 1 = c 1 max c 1 min t t max 2 + c 1 min c 1 max 2 t t max + c 1 max
c 2 = c 2 min c 2 max t t max 2 + c 2 max c 2 min 2 t t max + c 2 min
Through the above process, the optimal weights and thresholds are ultimately obtained. These values are then input into the neural network for training, resulting in the best model. The model subsequently predicts the testing set, producing the predicted results.

3. Feed Error Modeling Based on WPSO-BPNN

3.1. Data Collection and Analysis

In order to achieve better prediction accuracy under different operating conditions, data on feed errors and related factors were collected in seven machine tool experiments conducted at different ambient temperatures and operating durations. Measurements were started with the end of the screw as the origin with a stroke of 2070 mm. In this study, the direction from the end of the screw toward the end of the motor was defined as forward, and the direction from the end of the motor toward the end of the screw was defined as backward. The machine tool was kept in working condition during the intervals between measurements of each data set.
Figure 2a illustrates the variation in machine tool feed position and feed error. The figure shows that in each independent test, the feed error exhibits an upward nonlinear trend with the increase in feed position. The graph’s upward error corresponds to the machine tool’s forward error. The rise in feed error is more pronounced in the latter half of the measured positions, caused by the geometry of the machine’s feed axes. The feed error shifts downward with increased ambient temperature and working duration at the same feed position. This shift is attributed to the expansion of the machine tool from the motor end to the screw end after heating, resulting in a backward error. The figure’s downward error corresponds to the machine tool’s backward error. Figure 2b depicts the changes in ambient temperature and working duration during the testing process.
Feed errors mainly include thermal and geometric errors. Geometric error is closely related to feed position, while thermal error is associated with machine tool working duration and ambient temperature. Therefore, collected data on the screw elongation and relevant data are significantly influenced by the working duration and ambient temperature. Figure 3a shows the pattern of screw elongation with the variation of feed error. At the same feed position, with an increase in screw elongation, the machine tool’s feed error increases downward, exhibiting a regular nonlinear trend. At different positions, under the same elongation, the feed error increases upward with the increase of feed position. Figure 3b shows the variation of screw elongation with working duration and ambient temperature. The increase in screw elongation is a deformation due to the thermal influence of increased working duration and ambient temperature.
As material properties and ambient conditions undergo transformations, thermal errors manifest within the machinery. Concurrently, the fluctuation in screw elongation dynamically alters the predicted values, adeptly accommodating the evolving thermal errors. Therefore, incorporating screw elongation as an input to the prediction model also serves as an effective strategy to mitigate these effects, consequently enhancing the sustained robustness of the model.

3.2. Prediction of Feed Error

Based on the comprehensive analysis of feed error and associated data, we have developed a Backpropagation Neural Network (BPNN) model, utilizing feed position and screw elongation as input variables and feed error as the output. To ensure the precision of the BPNN model while minimizing computational complexity, we have designed a structured architecture, as illustrated in Figure 4. The input layer contains two nodes, which represent the feed position (Pt) and the screw elongation (X). The implicit layer consists of five nodes, and the output layer contains one node for predicting the feed error (E). The input-to-output transfer of the BPNN is mapped using the Sigmoid activation function.
To improve the model’s prediction performance, a large amount of sample data was collected for training. During machine operation, data points were collected at 30 mm intervals, covering 2070 mm per stroke for 70 points. A total of 32 strokes were collected, totaling 2520 points. The training set consists of 2030 data points, and the test set consists of 490. The parameters of the WPSO algorithm are set as shown in Table 1.
The comparison of the WPSO-BPNN model prediction results with the expected results is shown in Figure 5a. The predicted results are highly consistent with the expected results, and the prediction accuracy reaches 93.12%, showing satisfactory accuracy. Accuracy, a pivotal metric for gauging the disparity between model predictions and actual observations, serves as a key indicator. Higher accuracy values signify enhanced predictive precision, allowing for more reliable estimates of the target variables.
The ideal compensation result after prediction is shown in Figure 5b. The error range after compensation is from −3.80 μm to 4.57 μm, with an average of −0.3 μm, which indicates the reliable prediction performance. The error range provides valuable insights into the predictive stability of the model across diverse contexts. A narrow error range indicates consistent predictive ability under varying conditions, while a broader range may suggest fluctuations in the model’s performance in specific situations.

3.3. Comparison of Model Prediction Performance

The WPSO-BPNN model was compared with the non-optimized BPNN model, Particle Swarm Optimization (PSO)-BPNN model, and Whale Optimization Algorithm (WOA)-BPNN model. The training set, testing set, and various parameters were consistent during the comparison test. Evaluation metrics included mean absolute error (MAE), mean squared error (MSE), root mean square error (RMSE), and prediction model accuracy. The expression for prediction accuracy is given by Equation (15).
a c c u r a c y = 1 i = 1 n r i p i i = 1 n r i
Here, n is the number of samples, r is the actual value, and p is the predicted value.
Figure 6a–c, compare the prediction results with the expected values for the non-optimized BPNN model, PSO-BPNN model, and WOA-BPNN model, respectively. The figures show that all three models exhibit acceptable prediction performance, with predicted values closely matching the expected values. It indicates that establishing a predictive model using screw elongation and feed position as inputs is feasible. The specific results are presented in Table 2, where the MAE for the WPSO-BPNN model is 1.19 μm, MSE is 2.27, RMSE is 1.51, and the prediction accuracy is 93.12%. These four indicators outperform the other three models. While the prediction performance of the other three models is good, they still fall short in specific indicators compared to the WPSO-BPNN model, confirming the effectiveness of the proposed model.
Figure 7a,b show the variation in fitness values during the iteration process for three optimization algorithms and the final errors after prediction and ideal compensation for the four models. Starting from the same initial value, the WPSO algorithm achieved the smallest fitness value after the same number of iterations, demonstrating better iteration performance than other optimization algorithms. The WPSO-optimized model exhibited the best performance in prediction and ideal compensation among the four models, with the smallest error range between −3.80 μm and 4.57 μm. The specific numerical values are presented in Table 3, where the WPSO-optimized model outperforms the other three models in all four indicators, confirming the superiority of the WPSO algorithm and the proposed model.

4. Experimental Results

The proposed prediction model was integrated into the machine tool feed error compensation system, and practical compensation verification was conducted on the X-axis of the BF-2016L machine tool manufactured by Hubei Baoke Intelligent Equipment Co., Ltd., located in Huangshi, China. The experimental platform and related equipment are shown in Figure 8.
In the experiment, encoders and eddy current sensors monitored real-time data, which were then input into the prediction model to output predicted results. Subsequently, the expected results were input into the CNC control system, and the control system controlled the servo motor of the machine tool’s X-axis for compensation. While the motor was in operation, sensors continued to monitor real-time data. The flowchart of the feed error compensation scheme is illustrated in Figure 9.
To comprehensively evaluate the proposed model’s compensation effect under different working conditions, the feed error compensated by the proposed prediction model is compared with the feed error compensated by FANUC pitch compensation and the uncompensated feed error, and the three methods are compared under the same working conditions. Four experiments were conducted, each group of experiments at an interval of 30 min, and the machine tool was kept in working condition during the interval. Among them, the FANUC pitch compensation method compensates for the difference between the theoretical screw motion position and the actual screw motion position at each point in the CNC system to reduce the actual feed error.
Figure 10 compares errors before and after compensation at different ambient temperatures and operating durations. As can be seen from each figure, due to the machine’s geometry, the uncompensated feed error shifted upward with the increase of the feed position. The overall compensation value entered into the FANUC pitch compensation method exceeds the current error value. The negative value of the compensation is entered into the machine’s feed axes, shifting the compensated error downward. As the operating time and ambient temperature increase, the overall error shifts downward, and thus, the compensated error shifts downward. The overall change of the compensated error is relatively small, fluctuating around 0 μm, showing a good compensation effect.
A comparison of the errors before and after compensation at different ambient temperatures and working durations shows that the uncompensated error generally moves downward as the ambient temperature and working duration increase. This is due to the machine tool in the heating from the motor end to the screw end (backward) expansion, resulting in an error downward shift. FANUC pitch compensation method of compensation value is constant; with the increase in ambient temperature and working duration, the compensation effect gradually deteriorates, resulting in the compensation error continuing to grow downward. In contrast, the range of the compensated error of the proposed method is relatively small, ranging from −17.11 μm to 5.66 μm. The average errors in the backward and forward are −4.61 μm and 2.13 μm, respectively.
In the four sets of experiments, specific error parameters before and after compensation are presented in Table 4. Under four different operating conditions, the proposed method achieves higher feed accuracy after compensation than the FANUC pitch compensation method. Compared to before compensation, the proposed method reduces the maximum reverse and positive errors after compensation by 33.21% and 87.21%, respectively. The error range is reduced by 67.41%, and the average reverse and positive errors are reduced by 57.15% and 84.37%, respectively, demonstrating the accuracy of the WPSO-BPNN prediction model, its robustness under different operating conditions, and its effectiveness for real-time compensation.
The reduction in both maximum and average errors across various operating conditions serves as evidence that the utilization of the proposed model for real-time compensation enhances the feed accuracy of the machine tool in diverse operational environments. Consequently, this improvement significantly contributes to the enhancement of actual productivity and product quality.

5. Conclusions

In this paper, the screw elongation and feed position were used as input quantities, and the WPSO algorithm was used to optimize the BPNN. A prediction model of WPSO-BPNN for real-time compensation was established and applied to real-time compensation experiments. The main conclusions are as follows:
(1)
The WPSO-BPNN model achieved a post-prediction MAE of 1.19 μm, MSE of 2.27, RMSE of 1.51, and a prediction accuracy of 93.12%. The post-prediction error ranged from −3.80 μm to 4.57 μm, with an average error of −0.30 μm. Compared to the other three models, it demonstrated superior prediction performance, validating the superiority of the WPSO algorithm and the proposed model.
(2)
Compensation experiments under different ambient temperatures and working durations indicated that the proposed model’s compensated error fluctuates from −17.11 μm to 5.66 μm. The average backward and forward errors were −4.61 μm and 2.13 μm, respectively. The high average feed accuracy validated the robustness of the model established using the elongation of the screw and feed position as input.
(3)
By integrating the proposed model into the CNC system for real-time compensation, the maximum backward and forward errors were reduced by 33.21% and 87.21%, and the average backward and forward errors were reduced by 57.15% and 84.37%, respectively. The error range was reduced by 67.41%, demonstrating the proposed model’s applicability for real-time compensation and the excellent practical compensation effect.
(4)
The proposed prediction model and compensation method demonstrated notable advantages, including high prediction accuracy, low computational complexity, robustness, and effective real-world compensation outcomes. Through the more precise prediction and compensation of machine feed errors, this modeling approach enhanced both the efficiency and accuracy of machine tool machining. It offers dependable theoretical guidance for practical production.
Despite the research results, the development of the model faces persistent challenges, notably in striking a balance between achieving high accuracy and managing computational complexity. Subsequent research endeavors should delve into an in-depth exploration of the model’s application in varied manufacturing contexts to comprehensively assess its generalization capability.

6. Patents

This work resulted in a patent: Yingping Qian, Wenkang Fang, Xizhi Zhou, Dongqiao Zhang, Haihua Mei. Modeling method and system for machine tool positioning error compensation based on CWP-BPNN [P]. China (State Intellectual Property Office of the People’s Republic of China): ZL202310855793.4. Patent for invention. 2023.

Author Contributions

Conceptualization, W.F. and Y.Q.; methodology, W.F.; software, W.F.; validation, W.F.; formal analysis, W.F. and Y.Q.; investigation, W.F. and Y.Q.; resources, Y.Q.; data curation, W.F.; writing—original draft preparation, W.F.; writing—review and editing, W.F., Y.Q., Z.Y. and D.Z.; visualization, W.F., Y.Q., Z.Y. and D.Z.; supervision, W.F., Y.Q. and Z.Y.; project administration, Y.Q.; funding acquisition, Y.Q. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Research Program supported by the Science and Technology Department of Hubei Province, China. “Research and Development of Large Gantry Moving Column Type 5-axis CNC Heavy Cutting Intelligent Equipment” (2022BEC022).

Data Availability Statement

The data presented in this study are available in the article.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Tian, W.; Gao, W.; Zhang, D.; Huang, T. A general approach for error modeling of machine tools. Int. J. Mach. Tools Manuf. 2014, 79, 17–23. [Google Scholar] [CrossRef]
  2. Cai, L.; Zhang, Z.; Cheng, Q.; Liu, Z.; Gu, P.; Qi, Y. An approach to optimize the machining accuracy retainability of multi-axis NC machine tool based on robust design. Precis. Eng. 2016, 43, 370–386. [Google Scholar] [CrossRef]
  3. Chen, J.-x.; Lin, S.-w.; Zhou, X.-l. A comprehensive error analysis method for the geometric error of multi-axis machine tool. Int. J. Mach. Tools Manuf. 2016, 106, 56–66. [Google Scholar] [CrossRef]
  4. Zhu, S.; Ding, G.; Qin, S.; Lei, J.; Zhuang, L.; Yan, K. Integrated geometric error modeling, identification and compensation of CNC machine tools. Int. J. Mach. Tools Manuf. 2012, 52, 24–29. [Google Scholar] [CrossRef]
  5. Ding, S.; Zhang, H.; Wu, W.; Guo, E.; Zhang, Y.; Song, A. A digital and structure-adaptive geometric error definition and modeling method of reconfigurable machine tool. Int. J. Adv. Manuf. Technol. 2021, 112, 2359–2371. [Google Scholar] [CrossRef]
  6. Niu, P.; Cheng, Q.; Liu, Z.; Chu, H. A machining accuracy improvement approach for a horizontal machining center based on analysis of geometric error characteristics. Int. J. Adv. Manuf. Technol. 2021, 112, 2873–2887. [Google Scholar] [CrossRef]
  7. Li, Y.; Yu, M.; Bai, Y.; Hou, Z.; Wu, W. A Review of Thermal Error Modeling Methods for Machine Tools. Appl. Sci. 2021, 11, 5216. [Google Scholar] [CrossRef]
  8. Liu, P.-L.; Du, Z.-C.; Li, H.-M.; Deng, M.; Feng, X.-B.; Yang, J.-G. Thermal error modeling based on BiLSTM deep learning for CNC machine tool. Adv. Manuf. 2021, 9, 235–249. [Google Scholar] [CrossRef]
  9. Shi, H.; Jiang, C.; Yan, Z.; Tao, T.; Mei, X. Bayesian neural network–based thermal error modeling of feed drive system of CNC machine tool. Int. J. Adv. Manuf. Technol. 2020, 108, 3031–3044. [Google Scholar] [CrossRef]
  10. Ye, W.-H.; Guo, Y.-X.; Zhou, H.-F.; Liang, R.-J.; Chen, W.-F. Thermal error regression modeling of the real-time deformation coefficient of the moving shaft of a gantry milling machine. Adv. Manuf. 2020, 8, 119–132. [Google Scholar] [CrossRef]
  11. Grama, S.N.; Mathur, A.; Aralaguppi, R.; Subramanian, T. Optimization of High Speed Machine Tool Spindle to Minimize Thermal Distortion. Procedia CIRP 2017, 58, 457–462. [Google Scholar] [CrossRef]
  12. Shi, H.; Ma, C.; Yang, J.; Zhao, L.; Mei, X.; Gong, G. Investigation into effect of thermal expansion on thermally induced error of ball screw feed drive system of precision machine tools. Int. J. Mach. Tools Manuf. 2015, 97, 60–71. [Google Scholar] [CrossRef]
  13. Gao, F.; Hei, C.; Liu, J.; Li, Y.; Shui, L. Synthetic positioning error modelling of a feed axis for a precision CNC machine tool. Int. J. Adv. Manuf. Technol. 2021, 114, 1385–1394. [Google Scholar] [CrossRef]
  14. Liu, Y.; Wang, X.; Zhu, X.; Zhai, Y. Thermal error prediction of motorized spindle for five-axis machining center based on analytical modeling and BP neural network. J. Mech. Sci. Technol. 2021, 35, 281–292. [Google Scholar] [CrossRef]
  15. Zhang, Z.; Liu, Z.; Cheng, Q.; Qi, Y.; Cai, L. An approach of comprehensive error modeling and accuracy allocation for the improvement of reliability and optimization of cost of a multi-axis NC machine tool. Int. J. Adv. Manuf. Technol. 2016, 89, 561–579. [Google Scholar] [CrossRef]
  16. Liu, K.; Song, L.; Han, W.; Cui, Y.; Wang, Y. Time-Varying Error Prediction and Compensation for Movement Axis of CNC Machine Tool Based on Digital Twin. IEEE Trans. Ind. Inform. 2022, 18, 109–118. [Google Scholar] [CrossRef]
  17. Hao, W.; Hongtao, Z.; Qianjian, G.; Xiushan, W.; Jianguo, Y. Thermal error optimization modeling and real-time compensation on a CNC turning center. J. Mater. Process. Technol. 2008, 207, 172–179. [Google Scholar] [CrossRef]
  18. Liu, J.; Ma, C.; Wang, S. Data-driven thermally-induced error compensation method of high-speed and precision five-axis machine tools. Mech. Syst. Signal Process. 2020, 138, 106538. [Google Scholar] [CrossRef]
Figure 1. WPSO-BPNN feed-error prediction process.
Figure 1. WPSO-BPNN feed-error prediction process.
Electronics 13 00892 g001
Figure 2. Error and related data during testing. (a) Feed position and error variation for seven sets of experiments. (b) Measurement time and ambient temperature values.
Figure 2. Error and related data during testing. (a) Feed position and error variation for seven sets of experiments. (b) Measurement time and ambient temperature values.
Electronics 13 00892 g002
Figure 3. Error and related data during testing. (a) Relationship between elongation and error. (b) Elongation at different ambient temperatures and measurement times.
Figure 3. Error and related data during testing. (a) Relationship between elongation and error. (b) Elongation at different ambient temperatures and measurement times.
Electronics 13 00892 g003
Figure 4. Structure of the BPNN model. (Olive represents the input layer, aquamarine represents the middle layer, lavender represents the output layer, and orange represents the threshold).
Figure 4. Structure of the BPNN model. (Olive represents the input layer, aquamarine represents the middle layer, lavender represents the output layer, and orange represents the threshold).
Electronics 13 00892 g004
Figure 5. Prediction Results of WPSO-BPNN. (a) Comparison of prediction and compensation for WPSO-BPNN. (b) Errors after compensation of WPSO-BPNN.
Figure 5. Prediction Results of WPSO-BPNN. (a) Comparison of prediction and compensation for WPSO-BPNN. (b) Errors after compensation of WPSO-BPNN.
Electronics 13 00892 g005
Figure 6. Comparison of prediction results with expected values for three models. (a) Comparison of prediction and compensation for BPNN. (b) Comparison of prediction and compensation for PSO-BPNN. (c) Comparison of prediction and compensation for WOA-BPNN.
Figure 6. Comparison of prediction results with expected values for three models. (a) Comparison of prediction and compensation for BPNN. (b) Comparison of prediction and compensation for PSO-BPNN. (c) Comparison of prediction and compensation for WOA-BPNN.
Electronics 13 00892 g006
Figure 7. Comparison of algorithms and models. (a) Iterative comparison of three algorithms. (b) Errors after compensation of the four models.
Figure 7. Comparison of algorithms and models. (a) Iterative comparison of three algorithms. (b) Errors after compensation of the four models.
Electronics 13 00892 g007
Figure 8. Experimental platform and related equipment.
Figure 8. Experimental platform and related equipment.
Electronics 13 00892 g008
Figure 9. Flowchart of the feed error compensation scheme.
Figure 9. Flowchart of the feed error compensation scheme.
Electronics 13 00892 g009
Figure 10. Comparison of errors before and after compensation under different working conditions. (a) Feed error at 33.56 °C. (b) Feed error at 34.14 °C. (c) Feed error at 34.82 °C. (d) Feed error at 35.44 °C.
Figure 10. Comparison of errors before and after compensation under different working conditions. (a) Feed error at 33.56 °C. (b) Feed error at 34.14 °C. (c) Feed error at 34.82 °C. (d) Feed error at 35.44 °C.
Electronics 13 00892 g010
Table 1. Algorithm parameters of WPSO.
Table 1. Algorithm parameters of WPSO.
ParameterNumeric Value
tmax50
ωmax0.9
ωmin0.2
C1max2
C1min1.3
C2max1.7
C2min0.6
size10
φ0
μ0.5
b1
Table 2. Comparison of MSE, MAE, RMSE, and Accuracy.
Table 2. Comparison of MSE, MAE, RMSE, and Accuracy.
IndexBPNNPSO-BPNNWOA-BPNNWPSO-BPNN
MAE/μm1.97 μm1.60 μm1.47 μm1.19 μm
MSE5.573.763.622.27
RMSE2.361.941.901.51
Accuracy/%88.59%90.76%91.47%93.12%
Table 3. Indicators after prediction and compensation for four models.
Table 3. Indicators after prediction and compensation for four models.
IndexBPNNPSO-BPNNWOA-BPNNWPSO-BPNN
Min/μm−5.33−4.93−6.41−3.80
Max/μm5.306.436.144.57
Mean/μm−0.63−0.39−0.40−0.30
Range/μm10.3611.3612.558.37
Table 4. Specific error parameters before and after compensation.
Table 4. Specific error parameters before and after compensation.
Feed ErrorAverage Backward/Forward ErrorError Range
Before compensation (μm)−10.76/13.63[−25.62, 44.25]
After FANUC pitch compensation (μm)−23.60/None[−39.52, −9.13]
After proposed method compensation (μm)−4.61/2.13[−17.11, 5.66]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Fang, W.; Qian, Y.; Yu, Z.; Zhang, D. Feed Error Prediction and Compensation of CNC Machine Tools Based on Whale Particle Swarm Backpropagation Neural Network. Electronics 2024, 13, 892. https://doi.org/10.3390/electronics13050892

AMA Style

Fang W, Qian Y, Yu Z, Zhang D. Feed Error Prediction and Compensation of CNC Machine Tools Based on Whale Particle Swarm Backpropagation Neural Network. Electronics. 2024; 13(5):892. https://doi.org/10.3390/electronics13050892

Chicago/Turabian Style

Fang, Wenkang, Yingping Qian, Zhongquan Yu, and Dongqiao Zhang. 2024. "Feed Error Prediction and Compensation of CNC Machine Tools Based on Whale Particle Swarm Backpropagation Neural Network" Electronics 13, no. 5: 892. https://doi.org/10.3390/electronics13050892

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop