A Novel Ant Colony Algorithm for Optimizing 3D Printing Paths
Abstract
:1. Introduction
- (1)
- A novel K-means clustering algorithm for 3D printing model section data;
- (2)
- By using the novel K-means clustering algorithm designed in this paper to segment the printing area of the 3D printing model section, the ant colony algorithm is optimized to obtain a better 3D printing head motion path.
2. Related Work
2.1. TSP Problem in 3D Printing
2.2. Mathematical Model of TSP Problem
2.3. Summary of Previous Works
3. Algorithm
3.1. Principle of Ant Colony Algorithm
3.2. Main State Calculation
3.3. Clustering Algorithm
3.3.1. K-Means Clustering
- (1)
- Select a reasonable k initial clustering centers ;
- (2)
- Calculate the Euclidean distance between the image center and each pixel according to Equation (1):
- (3)
- Assign all pixels to the nearest center based on the distance ;
- (4)
- Recalculate new clustering centers according to Equation (2) after all pixels have been assigned:
- (5)
- Repeat the iterative calculation until the determined threshold value is satisfied and then stop the calculation.
- Initialization: randomly select k data points as initial centroids;
- Assignment: assign each data point to the cluster of the nearest centroid;
- Update: recalculate the centroid of each cluster as the mean of all data points in the cluster;
- Convergence: repeat the assignment and update the steps until the centroids no longer change or a preset number of iterations is reached.
- (1)
- The initial selection of cluster centers has a significant impact on the results: The K-means algorithm requires the selection of initial cluster centers at the beginning, and this choice can greatly influence the final clustering results. Improper initial center selection may lead to inaccurate or unstable clustering results;
- (2)
- Sensitivity to initial cluster centers: The K-means algorithm is highly sensitive to the choice of initial cluster centers. Different initial center selections may result in different clustering outcomes. This means that when applying the K-means algorithm, it is necessary to try different initial centers multiple times to obtain better clustering results;
- (3)
- Sensitivity to cluster shapes and sizes: The K-means algorithm assumes that each cluster has a convex shape, and the size differences between clusters are not significant. This implies that if there are clusters with non-convex shapes or clusters with large differences in sizes in the dataset, the K-means algorithm may not accurately capture the structure of these clusters;
- (4)
- Sensitivity to noise and outliers: The K-means algorithm is highly sensitive to noise and outliers. Individual noise points or outliers can affect the entire clustering result, leading to inaccurate clustering results;
- (5)
- Requires pre-specification of the number of clusters: The K-means algorithm requires the pre-specification of the number of clusters, denoted as K. However, in practical applications, we often do not know the optimal number of clusters. Choosing an inappropriate number of clusters can result in inaccurate clustering results;
- (6)
- Not suitable for handling nonlinear data: The K-means algorithm is based on the Euclidean distance, which makes it perform well on linearly separable data; however, for nonlinearly separable data, the K-means algorithm may not produce reasonable clustering results.
3.3.2. Novel K-Means Clustering
- (1)
- Calculate the density of each data point i:
- (2)
- Based on the density values calculated in the previous step, the density point set is divided. The division method first calculates the number of points within each unit range for each density value , and then divides the dataset into datasets based on the density value where the number of points in the unit range is less than the number of points in two adjacent unit ranges. is a unit scale of in the partition Formula (10), which can be optimized through the backpropagation algorithm;
- (3)
- For the dataset in the previous step, K-means cluster analysis is performed while the cluster centers are calculated from 2 to m to obtain the classification results for the corresponding pairs, and then their contour coefficients are calculated separately; the corresponding contour coefficients are calculated as follows:
- (4)
- Finally, the classification results of all datasets are aggregated to obtain the final clustering results:
3.4. Novel Ant Colony Algorithm
Algorithm 1 Novel ant colony algorithm |
1: Select a collection of large-scale 3D printing data points; |
2: Use Equation (10) to calculate the density for each data point i; |
3: Based on the density values calculated in the previous step, the density point set is divided; |
4: K-means clustering analysis is performed for the dataset in the previous step, while the cluster centers are calculated from 2 to m to obtain the classification results for the corresponding; |
5: The contour coefficients are calculated using Equation (11), and the optimal number of clusters is selected by the contour coefficients to obtain the classification result of the dataset ; |
6: Aggregate the classification results of all datasets to obtain the final clustering segmentation results; |
7: The ant colony algorithm solves the paths for all the clustering centers and obtains the printing order between the regions; |
8: Based on the printing order, the path is solved for each of the K regions of each cut separately using the ant colony algorithm; |
9: Aggregate the print head motion paths for all areas. |
4. Results
4.1. Test Platform
4.2. Experiment I
4.3. Experiment II
4.4. Discussion
5. Conclusions
6. Recommendations for Future Research
- Integration with machine learning: exploring the integration of machine learning techniques with our proposed algorithms to enhance the adaptability and efficiency of the optimization process;
- Real-time path optimization: developing real-time path optimization algorithms that can dynamically adjust to changes during the printing process, ensuring continuous optimization;
- Multi-material printing: investigating the application of our optimization techniques in multi-material 3D printing scenarios to address the unique challenges posed by different material properties.
- Scalability: testing the scalability of our algorithms with larger and more complex datasets to ensure they can handle industrial-scale 3D printing tasks.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Romeo, J. Plastics Engineering’s New Frontier: Embracing the Brave New World of 3D Printing. Plast. Eng. 2019, 75, 22–27. [Google Scholar] [CrossRef]
- Podsiadły, B.; Bezgan, L.; Słoma, M. 3D Printed Electronic Circuits from Fusible Alloys. Electronics 2022, 11, 3829. [Google Scholar] [CrossRef]
- Padole, M.; Gharde, S.; Kandasubramanian, B. Three-dimensional printing of molluscan shell inspired architectures via fused deposition modeling. Environ. Sci. Pollut. Res. 2021, 28, 46356–46366. [Google Scholar] [CrossRef]
- Lee, M.P.; Cooper, G.J.T.; Hinkley, T.; Gibson, G.M.; Padgett, M.J.; Cronin, L. Development of a 3D Printer Using Scanning Projection Stereolithography. Sci. Rep. 2015, 5, 9875. [Google Scholar] [CrossRef] [PubMed]
- Ventola, C.L. Medical Applications for 3D Printing: Current and Projected Uses. Pharm. Ther. 2014, 39, 704–711. [Google Scholar]
- Berman, B. 3-D Printing: The New Industrial Revolution. Bus. Horiz. 2012, 55, 155–162. [Google Scholar] [CrossRef]
- Yu, Y.; Liu, F.; Liu, J. Direct 3D Printing of Low Melting Point Alloy via Adhesion Mechanism. Rapid Prototyp. J. 2017, 23, 642–650. [Google Scholar] [CrossRef]
- Warrier, N.; Kate, K.H. Fused Filament Fabrication 3D Printing with Low-Melt Alloys. Prog. Addit. Manuf. 2018, 3, 51–63. [Google Scholar] [CrossRef]
- Salo, T.; Di Vito, D.; Halme, A.; Vanhala, J. Electromechanical Properties of 3D-Printed Stretchable Carbon Fiber Composites. Micromachines 2022, 13, 1732. [Google Scholar] [CrossRef]
- Tang, Z.; Jia, S.; Zhou, C.; Li, B. 3D printing of highly sensitive and large-measurement-range flexible pressure sensors with a positive piezoresistive effect. ACS Appl. Mater. Interfaces 2020, 12, 28669–28680. [Google Scholar] [CrossRef]
- Kim, E.; Khaleghian, S.; Emami, A. Behavior of 3D Printed Stretchable Structured Sensors. Electronics 2023, 12, 18. [Google Scholar] [CrossRef]
- Mazzanti, V.; Malagutti, L.; Mollica, F. FDM 3D printing of polymers containing natural fillers: A review of their mechanical properties. Polymers 2019, 11, 1094. [Google Scholar] [CrossRef] [PubMed]
- Shang, J.; Tian, X.; Luo, M.; Zhu, W.; Li, D.; Qin, Y.; Shan, Z. Controllable inter-line bonding performance and fracture patterns of continuous fiber reinforced composites by sinusoidal-path 3D printing. Compos. Sci. Technol. 2020, 192, 108096. [Google Scholar] [CrossRef]
- Li, N.; Link, G.; Wang, T.; Ramopoulos, V.; Neumaier, D.; Hofele, J.; Walter, M.; Jelonnek, J. Path-designed 3D printing for topological optimized continuous carbon fibre reinforced composite structures. Compos. Part B Eng. 2020, 182, 107612. [Google Scholar] [CrossRef]
- Liu, H.H.; Zhao, T.; Li, L.Y.; Liu, W.J.; Wang, T.Q.; Yue, J.F. A path planning and sharp corner correction strategy for wire and arc additive manufacturing of solid components with polygonal cross-sections. Int. J. Adv. Manuf. Technol. 2020, 106, 4879–4889. [Google Scholar] [CrossRef]
- Zhen, X.; Seng, J.C.Y.; Somani, N. Adaptive automatic robot tool path generation based on point cloud projection algorithm. In Proceedings of the 2019 24th IEEE International Conference on Emerging Technologies and Factory Automation (ETFA), Zaragoza, Spain, 10–13 September 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 341–347. [Google Scholar]
- Kraljić, D.; Kamnik, R. Trajectory planning for additive manufacturing with a 6-dof industrial robot. In Advances in Service and Industrial Robotics: Proceedings of the 27th International Conference on Robotics in Alpe-Adria Danube Region (RAAD 2018), Bucharest, Romania, 27–29 May 2015; Springer: Cham, Germany, 2018; pp. 456–465. [Google Scholar]
- Zhao, G.; Ma, G.; Feng, J.; Xiao, W. Nonplanar slicing and path generation methods for robotic additive manufacturing. Int. J. Adv. Manuf. Technol. 2018, 96, 3149–3159. [Google Scholar] [CrossRef]
- Yang, J.; Bin, H.; Zhang, X.; Liu, Z. Fractal scanning path generation and control system for selective laser sintering (SLS). Int. J. Mach. Tools Manuf. 2003, 43, 293–300. [Google Scholar] [CrossRef]
- Li, J.; Chen, Z.; Harabor, D.; Stuckey, P.J.; Koenig, S. Anytime multi-agent path finding via large neighborhood search. In Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI), Montreal, QC, Canada, 19–27 August 2021. [Google Scholar]
- Li, Z. Research on K-Means Algorithm and Its Integration with Intelligent Algorithms; Anhui University: Hefei, China, 2016. [Google Scholar]
- Zheng, F.; Zhou, J. K-means Clustering ant Colony Algorithm for Large-scale TSP Problems. Logist. Technol. 2018, 2, 37–40. [Google Scholar]
- Fok, K.Y.; Cheng, C.T.; Ganganath, N.; Iu, H.H.C.; Chi, K.T. An ACO-based Tool-Tath Optimizer for 3-D Printing Applications. IEEE Trans. Ind. Inform. 2018, 15, 2277–2287. [Google Scholar] [CrossRef]
- Thompson, B.; Yoon, H.S. Efficient path planning algorithm for additive manufacturing systems. IEEE Trans. Compon. Packag. Manuf. Technol. 2014, 4, 1555–1563. [Google Scholar] [CrossRef]
- Thompson, B.; Yoon, H.S. Velocity-regulated path planning algorithm for aerosol printing systems. J. Manuf. Sci. Eng. 2015, 137, 20–31. [Google Scholar] [CrossRef]
- Ganganath, N.; Cheng, C.T.; Fok, K.Y.; Tse, C.K. Trajectory planning for 3D printing: A revisit to traveling salesman problem. In Proceedings of the 2016 2nd International Conference on Control, Automation and Robotics (ICCAR), Hong Kong, China, 28–30 April 2016; pp. 287–290. [Google Scholar]
- Fok, K.Y.; Ganganath, N.; Cheng, C.T.; Tse, C.K. A 3D printing path optimizer based on christofides algorithm. In Proceedings of the 2016 IEEE International Conference on Consumer Electronics-Taiwan (ICCE-TW), Nantou County, Taiwan, 27–29 May 2016; pp. 1–2. [Google Scholar]
- Ultimaker. Cura 3D Printing Slicing Software. Available online: https://ultimaker.com/en/products/cura-software (accessed on 1 July 2016).
- Dong, B.; Wang, Y.; Lu, Y. A Slicing and Path Generation Method for 3D Printing of Periodic Surface Structure. J. Manuf. Process. 2024, 120, 694–702. [Google Scholar] [CrossRef]
- Liu, B.; Feng, J.; Lin, Z.; Wu, S.; He, Y.; Fu, J. Spherical Path Planning for Multi-Axis Support-Free Additive Manufacturing of Truss Structures. J. Manuf. Processes. 2024, 109, 198–212. [Google Scholar] [CrossRef]
- Lechowicz, P.; Koszalka, L.; Pozniak-Koszalka, I.; Kasprzak, A. Path Optimization in 3D Printer: Algorithms and Experimentation System. In Proceedings of the 2016 4th International Symposium on Computational and Business Intelligence (ISCBI), Olten, Switzerland, 5–7 September 2016; IEEE: Piscataway, NJ, USA, 2016; pp. 137–142. [Google Scholar]
- Merzah, A.; Celebi, F.V. Tool-Path Optimization in FFF 3D Printing Machine Using Lines Approach Algorithms. Doctoral Dissertation, Ankara Yıldırım Beyazıt Üniversitesi Fen Bilimleri Enstitüsü, Ankara, Türkiye, 2018. [Google Scholar]
- Iori, M.; Novellani, S. Optimizing the Nozzle Path in the 3D Printing Process. In Design Tools and Methods in Industrial Engineering: Proceedings of the International Conference on Design Tools and Methods in Industrial Engineering, ADM 2019, Modena, Italy, 9–10 September 2019; Springer International Publishing: Berlin/Heidelberg, Germany, 2019; pp. 912–924. [Google Scholar]
- Liu, H.; Liu, R.; Liu, Z.; Xu, S. Minimizing the Number of Transitions of 3D Printing Nozzles Using a Traveling-Salesman-Problem Optimization Model. Int. J. Precis. Eng. Manuf. 2021, 22, 1617–1637. [Google Scholar] [CrossRef]
- Pinochet, D.; Tsamis, A. Path Optimization for Multi-material 3D Printing Using Self-Organizing Maps. In Proceedings of the International Conference on Computer-Aided Architectural Design Futures, Delft, The Netherlands, 5–7 July 2021; Springer Singapore: Singapore, 2021; pp. 329–343. [Google Scholar]
- Riabko, A.V.; Zaika, O.V.; Kukharchuk, R.P.; Vakaliuk, T.A.; Hordiienko, I.V. Algorithm of Ant Colony Optimization (ACO) for 3D Variation Traveling Salesman Problem. In Journal of Physics: Conference Series; IOP Publishing: Bristol, UK, 2022; Volume 2288, p. 012001. [Google Scholar]
- Hartigan, J.A.; Wong, M.A. Algorithm AS 136: A K-Means Clustering Algorithm. J. R. Stat. Soc. Ser. C (Appl. Stat.) 1979, 28, 100–108. [Google Scholar] [CrossRef]
- Wang, T.; Wu, S.; Cao, L.; Du, K.; Zhao, Z.; He, Z. A Novel Possibilistic Clustering Algorithm for Measurement Data of Vehicle MMW Radar. IEEE Sens. J. 2023, 23, 17103–17116. [Google Scholar] [CrossRef]
Study | Focus | Methodology | Key Findings |
---|---|---|---|
Lechowicz et al. [31] | Path optimization in 3D printing | Hybrid algorithms (greedy and annealing algorithms) | Reduced total length of print paths, lowering print time. |
Fok et al. [23] | ACO-based tool-path optimizer | Ant colony optimization | Improved computation time, print time, and visual quality of printed objects. |
Merzah et al. [32] | Tool-path optimization in FFF 3D printing | Linear greedy algorithm and linear two-opt algorithm | Proposed a hybrid algorithm that shows promise in path optimization. |
Iori et al. [33] | Optimizing nozzle path in 3D printing | Heuristic algorithms | Achieved significant reductions in print time and proposed future research directions. |
Liu et al. [34] | Minimizing transitions of print nozzles | Genetic algorithm | Generated paths with fewer transitions, improving print quality. |
Pinochet et al. [35] | Path optimization for multi-material 3D printing | Self-organizing maps | Generated optimized print paths based on material behavior, improving G-code generation. |
Riabko et al. [36] | 3D TSP optimization | Ant colony optimization | Achieved execution times similar to 2D TSP for 3D TSP problems. |
Name of the Algorithm | Circumference | Exterior Profile | Internal Padding | Total Time (s) | |||
---|---|---|---|---|---|---|---|
Time (s) | Percentage (%) | Time (s) | Percentage (%) | Time (s) | Percentage (%) | ||
Linear | 28 | 7.0 | 46 | 11.7 | 320 | 81.3 | 394 |
Loopback algorithm | 28 | 7.5 | 43 | 11.4 | 316 | 81.1 | 387 |
Archimedean spiral | 26 | 6.8 | 41 | 10.6 | 319 | 82.6 | 386 |
Hilbert curve | 28 | 4.6 | 41 | 6.7 | 589 | 88.7 | 658 |
Proposed algorithm | 26 | 7.2 | 36 | 10.5 | 294 | 82.3 | 356 |
Name of the Algorithm | Circumference | Exterior Profile | Internal Padding | Total Time (s) | |||
---|---|---|---|---|---|---|---|
Time (s) | Percentage (%) | Time (s) | Percentage (%) | Time (s) | Percentage (%) | ||
Linear | 82 | 7.3 | 151 | 11.2 | 758 | 81.5 | 991 |
Loopback algorithm | 89 | 7.8 | 173 | 12.0 | 714 | 80.2 | 976 |
Archimedean spiral | 80 | 7.4 | 149 | 10.6 | 760 | 82.0 | 989 |
Hilbert curve | 82 | 4.8 | 156 | 6.9 | 1244 | 88.3 | 1482 |
Proposed algorithm | 79 | 7.4 | 127 | 10.8 | 681 | 81.8 | 887 |
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. |
© 2024 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
Lin, X.; Huang, Z.; Shi, W.; Guo, K. A Novel Ant Colony Algorithm for Optimizing 3D Printing Paths. Electronics 2024, 13, 3252. https://doi.org/10.3390/electronics13163252
Lin X, Huang Z, Shi W, Guo K. A Novel Ant Colony Algorithm for Optimizing 3D Printing Paths. Electronics. 2024; 13(16):3252. https://doi.org/10.3390/electronics13163252
Chicago/Turabian StyleLin, Xinghan, Zhigang Huang, Wentian Shi, and Keyou Guo. 2024. "A Novel Ant Colony Algorithm for Optimizing 3D Printing Paths" Electronics 13, no. 16: 3252. https://doi.org/10.3390/electronics13163252