Skip to main content
Log in

Contour error modeling and compensation of CNC machining based on deep learning and reinforcement learning

  • ORIGINAL ARTICLE
  • Published:
The International Journal of Advanced Manufacturing Technology Aims and scope Submit manuscript

Abstract

Contour error compensation of the computer numerical control (CNC) machine tool is a vital technology that can improve machining accuracy and quality. To achieve this goal, the tracking error of a feeding axis, which is a dominant issue incurring the contour error, should be firstly modeled and then a proper compensation strategy should be determined. However, building the precise tracking error prediction model is a challenging task because of the nonlinear issues like backlash and friction involved in the feeding axis; besides, the optimal compensation parameter is also difficult to determine because it is sensitive to the machining tool path. In this paper, a set of novel approaches for contour error prediction and compensation is presented based on the technologies of deep learning and reinforcement learning. By utilizing the internal data of the CNC system, the tracking error of the feeding axis is modeled as a Nonlinear Auto-Regressive Long-Short-Term Memory (NAR-LSTM) network, considering all the nonlinear issues of the feeding axis. Given the contour error as calculated based on the predicted tracking error of each feeding axis, a compensation strategy is presented with its parameters identified efficiently by a Time-Series Deep Q-Network (TS-DQN) as designed in our work. To validate the feasibility and advantage of the proposed approaches, extensive experiments are conducted, testifying that our approaches can predict the tracking error and contour error with very good precision (better than about 99% and 90% respectively), and the contour error compensated based on the predicted results and our compensation strategy is significantly reduced (about 60~85% reduction) with the machining quality improved drastically (machining error reduced about 50%).

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21
Fig. 22
Fig. 23
Fig. 24
Fig. 25
Fig. 26

Similar content being viewed by others

References

  1. Song DN, Zhong YG, Ma JW (2019) Third-order contour-error estimation for arbitrary free-form paths in contour-following tasks. Precis Eng 60:85–92. https://doi.org/10.1016/j.precisioneng.2019.07.009

    Article  Google Scholar 

  2. Hu Q, Chen Y, Yang J (2020) On-line contour error estimation and control for corner smoothed five-axis tool paths. Int J Mech Sci 171:105377. https://doi.org/10.1016/j.ijmecsci.2019.105377

    Article  Google Scholar 

  3. Jun LT, Hui YJ, Min ZY, Yu ZC (2020) Time-varying reliability prediction modeling of positioning accuracy influenced by frictional heat of ball-screw systems for CNC machine tools. Precis Eng 64:147–156. https://doi.org/10.1016/j.precisioneng.2020.04.002

    Article  Google Scholar 

  4. Yang L, Zhang L, Li D (2019) Five-axis CNC machine tool contour error control method. ACM Int Conf Proceeding Ser 12–16. https://doi.org/10.1145/3366194.3366197

  5. Yang S, Ghasemi AH, Lu X, Okwudire CE (2015) Pre-compensation of servo contour errors using a model predictive control framework. Int J Mach Tools Manuf 98:50–60

    Article  Google Scholar 

  6. Chin J, Lin T (1997) Cross-coupled precompensation method for the contouring accuracy of computer numerically controlled machine tools. Int J Mach Tools Manuf 37:947–967

    Article  Google Scholar 

  7. Yang M, Yang J, Zhu L, Yu X (2020) A novel curvature circle iterative algorithm for contour error control of multi-axis CNC machine tools. Precis Eng 65:23–31. https://doi.org/10.1016/j.precisioneng.2020.05.005

    Article  Google Scholar 

  8. Koren Y (1980) Cross-coupled biaxial computer control for manufacturing systems. ASME J Dyn Syst Meas Control 102:265–272. https://doi.org/10.1115/1.3149612

    Article  MATH  Google Scholar 

  9. Srinivasan K, Kulkarni PK (1990) Cross-coupled control of biaxial feed drive servomechanisms. J Dyn Syst Meas Control Trans ASME 112:225–232. https://doi.org/10.1115/1.2896129

    Article  Google Scholar 

  10. Koren Y, Lo CC (1991) Variable-gain cross-coupling controller for contouring. CIRP Ann Manuf Technol 40:371–374. https://doi.org/10.1016/S0007-8506(07)62009-5

    Article  Google Scholar 

  11. Yeh SS, Lo HP (2002) Estimation of the contouring error vector for the cross-coupled control design. IEEE/ASME Trans Mechatronics 7:44–51. https://doi.org/10.1109/3516.990886

    Article  Google Scholar 

  12. Zhang D, Yang J, Chen Y, Chen Y (2015) A two-layered cross coupling control scheme for a three-dimensional motion control system. Int J Mach Tools Manuf 98:12–20. https://doi.org/10.1016/j.ijmachtools.2015.08.001

    Article  Google Scholar 

  13. Lu H, Fan W, Zhang Y, Ling H, Wang S, Alghannam E, Duan M (2018) Cross-coupled fuzzy logic sliding mode control of dual-driving feed system. Adv Mech Eng 10:1–17. https://doi.org/10.1177/1687814018755518

    Article  Google Scholar 

  14. Liu W, Ren F, Sun Y, Jiang S (2018) Contour error pre-compensation for three-axis machine tools by using cross-coupled dynamic friction control. Int J Adv Manuf Technol 98:551–563. https://doi.org/10.1007/s00170-018-2189-1

    Article  Google Scholar 

  15. Du F, Feng X, Li P et al (2018) Cross-coupled intelligent control for a novel two-axis differential micro-feed system. Adv Mech Eng 10:1–17. https://doi.org/10.1177/1687814018774628

    Article  Google Scholar 

  16. Huo F, Xi XC, Poo AN (2012) Generalized Taylor series expansion for free-form two-dimensional contour error compensation. Int J Mach Tools Manuf 53:91–99. https://doi.org/10.1016/j.ijmachtools.2011.10.001

    Article  Google Scholar 

  17. Zhu L, Zhao H, Ding H (2013) Real-time contouring error estimation for multi-axis motion systems using the second-order approximation. Int J Mach Tools Manuf 68:75–80. https://doi.org/10.1016/j.ijmachtools.2013.01.008

    Article  Google Scholar 

  18. K E, Y A (1998) High speed contouring control algorithm for CNC machine tools. Proc ASME Dyn Syst Control Div november:463–469

  19. Li X, Zhao H, Zhao X, Ding H (2017) Contouring compensation control based on high accuracy contour error estimation for multi-axis motion systems. Int J Adv Manuf Technol 93:2263–2273. https://doi.org/10.1007/s00170-017-0689-z

    Article  Google Scholar 

  20. Hu C, Wang Z, Zhu Y, Zhang M (2018) Accurate three-dimensional contouring error estimation and compensationscheme with zero-phase filter. Int J Mach Tools Manuf 128:33–40. https://doi.org/10.1016/j.ijmachtools.2018.01.001

    Article  Google Scholar 

  21. Huo F, Poo AN (2013) Precision contouring control of machine tools. Int J Adv Manuf Technol 64:319–333. https://doi.org/10.1007/s00170-012-4015-5

    Article  Google Scholar 

  22. Huo F, Poo AN (2013) Nonlinear autoregressive network with exogenous inputs based contour error reduction in CNC machines. Int J Mach Tools Manuf 67:45–52. https://doi.org/10.1016/j.ijmachtools.2012.12.007

    Article  Google Scholar 

  23. Erwinski K, Paprocki M, Wawrzak A, Grzesiak LM (2016) Neural network contour error predictor in CNC control systems. 2016 21st Int Conf Methods Model Autom Robot MMAR 2016 537–542. https://doi.org/10.1109/MMAR.2016.7575193

  24. Zhang D, Chen Y, Chen Y (2016) Iterative pre-compensation scheme of tracking error for contouring error reduction. Int J Adv Manuf Technol 87:3279–3288. https://doi.org/10.1007/s00170-016-8735-9

    Article  Google Scholar 

  25. Yang M, Yang J, Ding H (2018) A two-stage friction model and its application in tracking error pre-compensation of CNC machine tools. Precis Eng 51:426–436. https://doi.org/10.1016/j.precisioneng.2017.09.014

    Article  Google Scholar 

  26. Kono D, Inagaki T, Matsubara A, Yamaji I (2013) Stiffness model of machine tool supports using contact stiffness. Precis Eng 37:650–657. https://doi.org/10.1016/j.precisioneng.2013.01.010

    Article  Google Scholar 

  27. Lu L, Zhao H, Zhang P (2019) The position control of machine tool based on fuzzy adaptive PID control. 2019 IEEE 8th Int Conf Fluid Power Mechatronics. https://doi.org/10.1109/FPM45753.2019.9035742

  28. Shi S, Lin J, Wang X, Xu X (2015) Analysis of the transient backlash error in CNC machine tools with closed loops. Int J Mach Tools Manuf 93:49–60. https://doi.org/10.1016/j.ijmachtools.2015.03.009

    Article  Google Scholar 

  29. Jiang Y, Chen J, Zhou H, Yang J, Xu G (2020) Nonlinear time-series modeling of feed drive system based on motion states classification. J Intell Manuf 31:1935–1948. https://doi.org/10.1007/s10845-020-01546-5

    Article  Google Scholar 

  30. Mnih V, Kavukcuoglu K, Silver D, Rusu AA, Veness J, Bellemare MG, Graves A, Riedmiller M, Fidjeland AK, Ostrovski G, Petersen S, Beattie C, Sadik A, Antonoglou I, King H, Kumaran D, Wierstra D, Legg S, Hassabis D (2015) Human-level control through deep reinforcement learning. Nature 518:529–533. https://doi.org/10.1038/nature14236

    Article  Google Scholar 

  31. Kiumarsi B, Vamvoudakis KG, Modares H, Lewis FL (2018) Optimal and autonomous control using reinforcement learning: a survey. IEEE Trans Neural Networks Learn Syst 29:2042–2062. https://doi.org/10.1109/TNNLS.2017.2773458

    Article  MathSciNet  Google Scholar 

  32. Dong X, Shen J, Wang W et al (2018) Hyperparameter optimization for tracking with continuous deep Q-learning. Proc IEEE Comput Soc Conf Comput Vis Pattern Recognit:518–527. https://doi.org/10.1109/CVPR.2018.00061

  33. Zhu H, Wang M, Wang B (2020) Research on interpolation of NURBS curve based on fractional power. J Phys Conf Ser 1633:012005. https://doi.org/10.1088/1742-6596/1633/1/012005

    Article  Google Scholar 

  34. Hiemstra RR, Shepherd KM, Johnson MJ, Quan L, Hughes TJR (2020) Towards untrimmed NURBS: CAD embedded reparameterization of trimmed B-rep geometry using frame-field guided global parameterization. Comput Methods Appl Mech Eng 369:113227. https://doi.org/10.1016/j.cma.2020.113227

    Article  MathSciNet  MATH  Google Scholar 

  35. Gers FA, Schmidhuber J, Cummins F (2000) Learning to forget: continual prediction with LSTM. Neural Comput 12:2451–2471. https://doi.org/10.1162/089976600300015015

    Article  Google Scholar 

  36. Gupta A, Müller AT, Huisman BJH, Fuchs JA, Schneider P, Schneider G (2018) Generative recurrent networks for de novo drug design. Mol Inform 37. https://doi.org/10.1002/minf.201700111

Download references

Funding

This work is supported by the Major Science and Technology Project of Hubei Province (Grant No. 2020AGA018-01).

Author information

Authors and Affiliations

Authors

Contributions

Yakun Jiang implemented all the algorithms and drafted the paper; Jihong Chen, Huicheng Zhou, and Jianzhong Yang helped design the algorithm and experiments of this paper; Pengcheng Hu proposed the original idea and revised the paper; Junxiang Wang helped implement the experiments.

Corresponding author

Correspondence to Pengcheng Hu.

Ethics declarations

Conflict of interest

The authors declare no competing interests.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendix

Appendix

1.1 Geometric parameters of four contours

Heart contour: NURBS curve with order k = 4, knot vector: {0, 0, 0, 0.15, 0.5, 0.5, 0.85, 1, 1, 1}; control points (x, y): {(0.0, 0.0), (−20.0, 50.0), (40.0, 20.0), (75.0, 0.0), (40.0, −20.0), (−20.0, −50.0), (0.0, 0.0)}; weights: {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}.

Goggles contour: NURBS curve with order k = 4, knot vector: {0, 0, 0, 0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1, 1, 1}; control points (x, y): {(0.0, 0.0), (10.0, −40.0), (40.0, −10.0), (70.0, −40.0), (80.0, 0.0), (70.0, 10.0), (40.0, 20.0), (10.0,10.0), (0.0, 0.0)}; weights: {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}.

Rhombus contour: Polygon with 4 points: {(350.0, −200.0), (380.0, −200.0), (400.0, −150.0), (370.0, −150.0), (350.0, −200.0)}.

Star contour: NURBS curve with order k = 4, knot vector: {0, 0, 0, 0.111, 0.222, 0.333, 0.444, 0.555, 0.666, 0.777, 0.888, 1, 1, 1}; control points (x, y): {(0.0, 60.0), (30.0, 20.0), (80.0, 20.0), (40.0, −20.0), (50.0, −60.0), (0.0, −30.0), (−50.0, −60.0), (−40.0, −20.0), (−80.0, 20.0), (−30.0, 20.0), (0.0, 60.0)}; weights: {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Jiang, Y., Chen, J., Zhou, H. et al. Contour error modeling and compensation of CNC machining based on deep learning and reinforcement learning. Int J Adv Manuf Technol 118, 551–570 (2022). https://doi.org/10.1007/s00170-021-07895-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00170-021-07895-6

Keywords

Navigation