Hardware–Software Embedded System for Real-Time Trajectory Planning of Multi-Axis Machine Using B-Spline Curve Interpolation Algorithm
Abstract
:1. Introduction
- An analysis of the B-spline curve algorithm and the use of control points to generate smooth trajectory running curves.
- The constant speed control strategy is used in the B-spline curve algorithm, so that the spline curve can achieve constant speed coherence during trajectory operation.
- The research and development of motion control system: The system uses STM32 hardware architecture, the software is designed in C language, and the software logic realizes the B-spline curve constant speed motion algorithm. The research and development work includes hardware design and software algorithm design, and the control system is verified and run on the three-axis CNC polishing machine.
2. Model of B-Spline Curves
3. Principle of the Proposed B-Spline Curve Interpolator Control Method
- (1)
- Keep the increase, ∆u, in parameter u constant and calculate the feed in each interpolation cycle;
- (2)
- According to the actual feed rate and the theoretical interpolation accuracy, ∆u is selected reasonably to ensure the consistency of speed in the interpolation process.
3.1. Equal-Parameter Segmentation and Interpolation Algorithm for Third-Degree B-Spline
3.1.1. Interpolation Recursive Formula
3.1.2. Precision Analysis of ISO Parametric Segmentation Interpolation Algorithm
3.1.3. Feed Rate Analysis
3.2. Constant Feed Interpolation Algorithm for Cubic Splines
- (1)
- The length of each segment chord is not equal, and the tool must pass through them in the same interpolation cycle, so the interpolation speed along the curve is not constant. As a result, the tool vibrates on the machining surface of parts at the end of machining, which unnecessarily prolongs the machining time and reduces the machining quality.
- (2)
- It is difficult to obtain a reasonable value of ∆u because the optimization value of the parameter ∆u increment is not known in advance. If ∆u is too small, the string step will be too small and the system will slow down; conversely, if ∆u is too large, the string step size will be too large, and the position accuracy will not be satisfied.
- (3)
- Because it is a recursive method, there is a cumulative error.
3.2.1. Establishment of Constant-Speed Real-Time Interpolation Algorithm
3.2.2. Interpolation Preprocessing
- (1)
- Trajectory expression coefficient calculation
- (2)
- calculation of coefficients
- (3)
- Precision analysis of constant-speed real-time interpolation
- (4)
- Feed Rate analysis
4. Controller Software and Hardware Design
4.1. Hardware System Design
- The digital input uses an optical coupling isolation chip (LTV-814S-TA1) for input interference isolation. The first eight digital input channels are directly connected to the CPU. For the final 16 digital inputs, due to limited CPU interface resources, a parallel conversion and series chip (SN74HC165PWR) is set for conversion, and the IIC protocol is used for digital reading.
- The digital output uses an optical coupling isolation chip (LTV-816S-TA1-D-CU) for output anti-interference isolation and, due to the limited interface resources, a parallel-to-serial chip (SN74AHCT595PWR) for output. The CPU uses a serial protocol for 24 digital output control.
- The analog input uses the analog input interface of the CPU. The channel is selected through the channel selection chip (SN74LV4051ADR) and directly accesses the CPU.
- In order to save CPU resources, the two analog outputs are sampled using a special analog input chip (AD5306BRU), and the control accuracy is of a 12-bit resolution.
- The controller design is a two-RS485 interface, using CPU internal USART1 and USART2 realization. Two interfaces are used, one of which realizes human–computer interactive communication with the touch screen. The other is used to realize offline program upgrades and downloads.
- The controller is designed with a 100 M Ethernet interface and uses a PHY chip (KSZ8041FTLI) to realize Ethernet communication.
- The multi-axis motor control uses a high-speed CPU timer. The timer output interface runs through the isolation chip (ADUM1400ARWZ) and differential conversion chip (AM26LS31A) output. The control mode is pulse and direction differential control, and the highest output frequency is 200 KHz.
4.2. Software System Design
5. Simulation
6. Experiment
7. Discussion
8. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A
Appendix B
References
- Campos, J.G.; Miguez, L.R. Standard process monitoring and traceability programming in collaborative CAD/CAM/CNC manufacturing scenarios. Comput. Ind. 2011, 623, 311–322. [Google Scholar] [CrossRef]
- Shibata, T.; Yano, M.; Kodama, F. Empirical analysis of evolution of product architecture: Fanuc numerical controllers from 1962 to 1997. Res. Policy 2005, 341, 13–31. [Google Scholar] [CrossRef]
- Dubovska, R.; Jambor, J.; Majerik, J. Implementation of CAD/CAM System CATIA V5 in Simulation of CNC Machining Process. Procedia Eng. 2014, 69, 638–645. [Google Scholar] [CrossRef]
- Pawan Kumar, N.; Mangey, R.; Om Prakash, Y. 7 CNC Machine Programming Codes (G-Codes and M-codes). In Basics of CNC Programming; River Publishers: Aalborg, Denmark, 2018; pp. 73–128. [Google Scholar]
- Ji, S.A.; Hu, T.L.; Huang, Z.G.; Zhang, C.R. A NURBS curve interpolator with small feedrate fluctuation based on arc length prediction and correction. Int. J. Adv. Manuf. Technol. 2020, 111, 2095–2104. [Google Scholar] [CrossRef]
- Du, X.; Huang, J.; Zhu, L.M.; Ding, H. An error-bounded B-spline curve approximation scheme using dominant points for CNC interpolation of micro-line toolpath. Robot. Comput.-Integr. Manuf. 2020, 64, 101930. [Google Scholar] [CrossRef]
- Yang, H.P.; Wang, W.P.; Sun, J.G. Control point adjustment for B-spline curve approximation. Comput.-Aided Des. 2004, 367, 639–652. [Google Scholar] [CrossRef]
- Wang, X.D.; Liu, B.; Mei, X.S.; Hou, D.X.; Li, Q.; Sun, Z. Global smoothing for five-axis linear paths based on an adaptive NURBS interpolation algorithm. Int. J. Adv. Manuf. Technol. 2021, 114, 2407–2420. [Google Scholar] [CrossRef]
- Zhao, D.; Guo, H. A Trajectory Planning Method for Polishing Optical Elements Based on a Non-Uniform Rational B-Spline Curve. Appl. Sci. 2018, 8, 1355. [Google Scholar] [CrossRef]
- Wu, J.; Zhou, H.; Tang, X.; Chen, J. A NURBS interpolation algorithm with continuous feedrate. Int. J. Adv. Manuf. Technol. 2012, 595, 623–632. [Google Scholar] [CrossRef]
- Wang, T.Y.; Zhang, Y.B.; Dong, J.C.; Ke, R.J.; Ding, Y.Y. NURBS Interpolator with Adaptive Smooth Feedrate Scheduling and Minimal Feedrate Fluctuation. Int. J. Precis. Eng. Manuf. 2020, 212, 273–290. [Google Scholar] [CrossRef]
- Erwinski, K.; Paprocki, M.; Karasek, G. Comparison of NURBS trajectory interpolation algorithms for high-speed motion control systems. In Proceedings of the 2021 IEEE 19th International Power Electronics and Motion Control Conference (PEMC), Gliwice, Poland, 25–29 April 2021; pp. 527–533. [Google Scholar]
- Nam, S.H.; Yang, M.Y. A study on a generalized parametric interpolator with real-time jerk-limited acceleration. Comput.-Aided Des. 2004, 361, 27–36. [Google Scholar] [CrossRef]
- Ji, S.J.; Lei, L.G.; Zhao, J.; Lu, X.Q.; Gao, H. An adaptive real-time NURBS curve interpolation for 4-axis polishing machine tool. Robot. Comput.-Integr. Manuf. 2021, 67, 102025. [Google Scholar] [CrossRef]
- Heng, M.; Erkorkmaz, K. Design of a NURBS interpolator with minimal feed fluctuation and continuous feed modulation capability. Int. J. Mach. Tools Manuf. 2010, 503, 281–293. [Google Scholar] [CrossRef]
- Zhang, Y.; Zhao, M.; Ye, P.; Zhang, H. A G4 continuous B-spline transition algorithm for CNC machining with jerk-smooth feedrate scheduling along linear segments. Comput.-Aided Des. 2019, 115, 231–243. [Google Scholar] [CrossRef]
- Langeron, J.M.; Duc, E.; Lartigue, C.; Bourdet, P. A new format for 5-axis tool path computation, using Bspline curves. Comput.-Aided Des. 2004, 3612, 1219–1229. [Google Scholar] [CrossRef]
- Emami, M.M.; Arezoo, B. A look-ahead command generator with control over trajectory and chord error for NURBS curve with unknown arc length. Comput.-Aided Des. 2010, 427, 625–632. [Google Scholar] [CrossRef]
- Liu, X.B.; Ahmad, F.; Yamazaki, K.; Mori, M. Adaptive interpolation scheme for NURBS curves with the integration of machining dynamics. Int. J. Mach. Tools Manuf. 2005, 45, 433–444. [Google Scholar] [CrossRef]
- Ni, H.P.; Yuan, J.P.; Ji, S.; Zhang, C.R.; Hu, T.L. Feedrate Scheduling of NURBS Interpolation Based on a Novel Jerk-Continuous ACC/DEC Algorithm. IEEE Access 2018, 6, 66403–66417. [Google Scholar] [CrossRef]
- Du, D.S.; Liu, Y.D.; Yan, C.L.; Li, C.X. An accurate adaptive parametric curve interpolator for NURBS curve interpolation. Int. J. Adv. Manuf. Technol. 2007, 32, 999–1008. [Google Scholar] [CrossRef]
- Tajima, S.; Sencer, B. Online interpolation of 5-axis machining toolpaths with global blending. Int. J. Mach. Tools Manuf. 2022, 175, 103862. [Google Scholar] [CrossRef]
- Xu, B.; Ding, Y.; Ji, W. An interpolation method based on adaptive smooth feedrate scheduling and parameter increment compensation for NURBS curve. ISA Trans. 2022, 128, 633–645. [Google Scholar] [CrossRef]
- Du, X.; Wang, B. A C3-continuous NURBS transition scheme for the CNC machining of short linear segments. Precis. Eng. 2022, 73, 1–10. [Google Scholar] [CrossRef]
- Yang, Z.; Shen, L.-Y.; Yuan, C.-M.; Gao, X.-S. Curve fitting and optimal interpolation for CNC machining under confined error using quadratic B-splines. Comput.-Aided Des. 2015, 66, 62–72. [Google Scholar] [CrossRef]
- Tikhon, M.; Ko, T.J.; Lee, S.H.; Sool Kim, H. NURBS interpolator for constant material removal rate in open NC machine tools. Int. J. Mach. Tools Manuf. 2004, 442, 237–245. [Google Scholar] [CrossRef]
- Dharmawardhana, M.; Ratnaweera, A.; Oancea, G. STEP-NC Compliant Intelligent CNC Milling Machine with an Open Architecture Controller. Appl. Sci. 2021, 11, 6223. [Google Scholar] [CrossRef]
- Morales-Velazquez, L.; de Jesus Romero-Troncoso, R.; Osornio-Rios, R.A.; Herrera-Ruiz, G.; Cabal-Yepez, E. Open-architecture system based on a reconfigurable hardware–software multi-agent platform for CNC machines. J. Syst. Archit. 2010, 569, 407–418. [Google Scholar] [CrossRef]
- Yau, H.-T.; Lin, M.-T.; Tsai, M.-S. Real-time NURBS interpolation using FPGA for high speed motion control. Comput.-Aided Des. 2006, 3810, 1123–1133. [Google Scholar] [CrossRef]
- De Santiago-Perez, J.J.; Osornio-Rios, R.A.; Romero-Troncoso, R.J.; Morales-Velazquez, L. FPGA-based hardware CNC interpolator of Bezier, splines, B-splines and NURBS curves for industrial applications. Comput. Ind. Eng. 2013, 664, 925–932. [Google Scholar] [CrossRef]
- Jaen-Cuellar, A.Y.; De Santiago-Perez, J.J.; Romero-Troncoso, R.J.; Morales-Velazquez, L.; Benitez-Rangel, J.P.; Osornio-Rios, R.A. A hardware–software system for coordinated multi-axis control based on a non uniform rational B-splines interpolator applied to industrial computer numerically controlled machines. Proc. Inst. Mech. Eng. Part I J. Syst. Control. Eng. 2012, 2266, 831–840. [Google Scholar] [CrossRef]
- Fei, J.; Deng, R.; Zhang, Z.; Zhou, M. Research on Embedded CNC Device Based on ARM and FPGA. Procedia Eng. 2011, 16, 818–824. [Google Scholar] [CrossRef]
B-Spline Curve | Value |
---|---|
Number of control points | 20 |
Axis | 3 |
The control points | (313 312 310 305 300 295 288 276 262 251 238 218 209 199 188 179 169 164 154 143), (845 841 835 827 819 812 804 793 784 778 772 767 765 762 762 762 763 764 767 770), (180 178 175 171 168 162 159 152 145 141 133 127 122 111 110 110 100 100 98 94) |
Axis Number | Average Error | Maximum Error | Running Range |
---|---|---|---|
x-axis | 1.098 μm | 1.796 μm | 180 mm~94 mm |
y-axis | 1.284 μm | 1.489 μm | 845 mm~72 mm |
z-axis | 0.000876° | 0.001685° | 180°~94° |
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. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Tan, Q.; Mohd Basri, M.A. Hardware–Software Embedded System for Real-Time Trajectory Planning of Multi-Axis Machine Using B-Spline Curve Interpolation Algorithm. Machines 2023, 11, 1043. https://doi.org/10.3390/machines11121043
Tan Q, Mohd Basri MA. Hardware–Software Embedded System for Real-Time Trajectory Planning of Multi-Axis Machine Using B-Spline Curve Interpolation Algorithm. Machines. 2023; 11(12):1043. https://doi.org/10.3390/machines11121043
Chicago/Turabian StyleTan, Qitao, and Mohd Ariffanan Mohd Basri. 2023. "Hardware–Software Embedded System for Real-Time Trajectory Planning of Multi-Axis Machine Using B-Spline Curve Interpolation Algorithm" Machines 11, no. 12: 1043. https://doi.org/10.3390/machines11121043
APA StyleTan, Q., & Mohd Basri, M. A. (2023). Hardware–Software Embedded System for Real-Time Trajectory Planning of Multi-Axis Machine Using B-Spline Curve Interpolation Algorithm. Machines, 11(12), 1043. https://doi.org/10.3390/machines11121043