Abstract
This paper presents the design, implementation, and experimental validation of a novel canned cycle for CNC milling machines, enabling the precise and efficient cutting of threads with fixed or variable pitch and radius. Conventional canned cycles are limited to fixed pitch threads, restricting the versatility of CNC milling machines in thread machining applications.
The development process involves integrating a sophisticated control algorithm into the CNC milling machine's software, giving the operator remarkable control over the thread cutting process. This algorithm allows the operator to choose between external or internal threads, set both initial and final radii, determine initial and final pitches, specify the number of turns, and select the left or right-hand thread type. Such flexibility enables the creation of threads with diverse geometries. Furthermore, the proposed canned cycle provides the capability to switch between roughing and finishing passes by adjusting the step motion along the prescribed helical curve.
Simulation tests conducted under various threading cases clearly demonstrate the efficiency of the proposed canned cycle. These results showcase its capability to address a wide range of machining scenarios, offering practical solutions applicable across a spectrum of applications.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
The evolution of Computer Numerical Control (CNC) machining has brought about a revolution in manufacturing processes, not only enhancing precision and efficiency but also addressing the challenges posed by complex geometries and demanding machining applications. This paper deals with the domain of CNC thread milling, introducing an innovative approach through the development and implementation of a comprehensive canned cycle.
A canned cycle is a predefined machining operation that entails a sequence of machine movements to perform various machining tasks like drilling, pocketing, slotting, boring, and tapping. It aims to simplify programming by consolidating multiple commands into a single block, utilizing G-code to define machining operations that would typically necessitate multiple blocks [1, 2]. Continuous efforts are made by CNC manufacturers to incorporate new canned cycles into their controllers, specifically designed to handle intricate and complex geometries [3, 4]. This is easily concluded by comparing the canned cycles available nowadays with the older ones.
Centered on programming and facilitating the precise and efficient cutting of threads within a user-friendly environment, incorporating both fixed and variable pitch and radius, the presented canned cycle addresses limitations posed by conventional canned cycles, which primarily target fixed pitch threads. In the precise domains of engineering and manufacturing, the use of variable pitch threads is necessitated by diverse potential applications. These applications encompass manufacturing components for automotive vehicle engines, fasteners for aerospace systems, industrial devices, robots manufacturing parts [5,6,7,8] and the creation of medical implants [9,10,11,12]. The mentioned references constitute a sample of recent related research work.
The foundation of work’s innovation lies in the integration of a sophisticated control algorithm into the CNC milling machine's software. This integration empowers operators with an unprecedented level of control over the thread cutting process. Operators can seamlessly choose between external or internal threads, define initial and final radii, determine initial and final pitch, specify the number of turns, and even select the thread's direction. This flexibility allows for the creation of threads with diverse geometries, significantly broadening the applicability of CNC milling machines in thread machining applications. Furthermore, the proposed canned cycle provides the means to switch between roughing and finishing passes. This is achieved through precise regulation of the step motion along the prescribed helical curve, adding another layer of adaptability to the machining process.
To validate the effectiveness of the approach, extensive simulation tests have been conducted under various threading cases. The results clearly demonstrate the efficiency of the proposed canned cycle, showcasing its capability to address a wide spectrum of machining scenarios.
The present study represents an evolution of prior research [13], wherein plans were discussed to extend the scope by incorporating cases with variable radius and pitch, along with predefined initial and final radii and pitches, with the number of turns also pre-selected. The current work builds upon and extends the findings from the previous research, resulting in a significant expansion of the capabilities of the proposed new canned cycle.
In the following sections, the paper presents the mathematical formulation of helix equations (Section 2), CNC parametric programming (Section 3), and the design and formulation of the interpolation algorithm (Sections 4 and 5). Implementation issues (Section 6) and comprehensive test results (Section 7) are then discussed. In the conclusion (Section 8), the paper highlights the innovative canned cycle's contribution to advancing CNC thread milling.
2 Mathematical formulation of helix equations
To facilitate the cutting of threads with constant or variable radius and pitch on a 3-axis CNC milling machine, it is crucial to have the ability to generate 3D motion along a helix with the specific characteristics. This involves solving the parametric equations x(t), y(t), z(t) of the helix within the framework of an interpolation algorithm.
When examining a conical helix, which is a helix situated on the curved surface of a cone, its parametric equations can be formulated as follows [14, 15]
where,
- tf:
-
the time it takes the cutting tool to complete the process.
- t:
-
the time variable, with \(0\le t\le {t}_{f}\).
- r(t)-:
-
the radius of the helix at time \(t\).
- n(t)-:
-
the number of turns of a helix at time \(t\).
- m-:
-
the slope of the cone’s lines with respect to the \(x-y\) plane.
- z0-:
-
a constant\(.\)
In the following stage of the modeling process, the definition of a function, labeled as r(t), is undertaken to embody ideal construction specifications. The preferred input parameters for the model, as illustrated in Fig. 1, include:
- Ri:
-
the initial radius of the helix.
- Rf:
-
the final radius of the helix.
- pi:
-
the initial pitch of the helix.
- pf:
-
the final pitch of the helix.
- n:
-
the number of turns.
Then \(r\left(t\right)\) should be calibrated accordingly accommodating these special parameter values. Assuming linear increase of the pitch from \({p}_{i}\) to \({p}_{f}\), \(p\left(t\right)\) can be expressed in the form:
If T represents the time required for traversing a complete revolution, then \(z\left(t\right)\) at time \(t\) is given by:
Supposing that \(z\left(0\right)=0\), then obtain that \(C=0\). As a result:
Assuming that the helix is traversed with constant angular velocity, \({n}_{0}\) (rev/min), implies that \(T=\frac{1 }{{n}_{0}}\), and \({t}_{f}=\frac{n }{{n}_{0}}\), which gives that \(\frac{T }{{t}_{f}}=\frac{1 }{n}\). Given this, Eq. (6) simplifies to:
Equation (3) suggests that the radius \(r\left(t\right)\) can then be expressed as:
Given that \(r\left(0\right)={R}_{i}\) and that \(r\left({t}_{f}\right)={R}_{f}\), obtain that:
A simple calculation then gives that:
Given the constant angular velocity \({n}_{0}\), one can also derive \(n\left(t\right)={n}_{0}t\). Thus, the corresponding equations of motion are given by:
Since \(0\le t\le {t}_{f},\) dividing by \({t}_{f}\) gives that \(0\le \frac{t}{{t}_{f}}\le 1\) and thus define \(\tau =\frac{t}{{t}_{f}}=\frac{{n}_{0}t}{n}\). Thus, the equations of motion in terms of the new variable \(\tau\) with \(0\le \tau \le 1\), can be written as follows:
Notice that the final height of the workpiece H is given by \(H=z\left(1\right)=n\frac{{p}_{f}+{p}_{i}}{2}\).
It can be easily shown that these equations are also valid for \({R}_{i}={R}_{f}\) as the equations of motion reduce to:
Moreover, swapping the sine and cosine functions in the initial two Eqs. (12a) and (12b), allows for either a left-hand or right-hand thread type. The validation of Eqs. (12) is illustrated in the plots of Figs. 2, 3, 4, 5, 6 and 7 using representative values for pitch, radius and number of turns.
3 CNC parametric programming
CNC parametric programming serves as a flexible platform accessible in widely adopted controllers, known by various names depending on the provider controller. Fanuc custom macro B, Fadal macro, Okuma user task, Sinumeric and Heidenhain parametric technique are among the most widely used. Numerous research studies [16,17,18,19,20] have utilized this platform to resolve complex machining cases. This section aims to provide a detailed explanation of Heidenhain's parametric programming, the chosen programming language for this study. For a comprehensive understanding of the language, readers are directed to Lynch's in-depth book on the subject [21].
Within the Heidenhain control system, parameters are denoted by the letter Q followed by an integer. These parameters can be assigned numerical values directly or via arithmetic or trigonometric operations. Furthermore, the Q parameters can undergo dynamic updates during program execution and continuous checks to determine adherence to specific conditions, thereby influencing the program flow. In addition to the Q parameters, the letter D is employed to encode various functions, with specific functions represented by numbers 1 to 13 (refer to Table 1). The table presented herein has been adopted from the reference [13] mentioned earlier in the introduction. To illustrate the language's structure, the table provides examples and explanations for each individual D code. It is significant to emphasize that Q parameters and fixed numerical values can coexist within the same function, allowing enhanced flexibility in programming.
4 Design of the interpolation algorithm
The interpolation algorithm is designed to handle a broad spectrum of thread geometries under desired cutting conditions. In this regard, the operator is empowered with the capability to define any of the features outlined in Table 2. Each feature is correspondingly assigned to a Q parameter, constituting the input values for the algorithm.
The development of the G-code algorithm is achieved through a main program and two subprograms. The main program initiates thread data by configuring parameters Q1-Q11 (refer to Table 2), positions the cutter at the starting point, and directs the execution flow to one of the two subprograms. These subprograms are formulated to address either a right-hand or a left-hand thread. The structure of the main program and the two subprograms is depicted in the flowcharts of Figs. 8 and 9 respectively.
While the flowchart of the subprogram (Fig. 9) illustrates the scenario of a right-hand thread, a similar flowchart can be easily created for the left-hand thread case by interchanging the sine and cosine functions in the first two Eqs. (12a) and (12b).
5 Formulation of the G-code algorithm
The G-code algorithm is developed within the Heidenhain control framework. Furthermore, it can be effortlessly adapted for integration with any other CNC control system supporting parametric programming. Entering the necessary thread data and cutting conditions into the G-code algorithm is achieved through the utilization of Q parameters, as detailed in Section 4.
The flowcharts presented in Figs. 8 and 9 serve as the foundation for developing the G-code parametric algorithm, illustrating the logical structure of both the main program and the two subprograms. The corresponding code, along with accompanying comments, can be found in Tables 3 and 4. Table 3 outlines the main program, while Table 4 details subprogram 1. Subprogram 2 maintains the same structure but exchanges the sine and cosine functions in the first two Eqs. (12a and 12b).
6 Implementation
6.1 Practical aspects
A suitable cutter for threading on a CNC milling machine is the single form cutter depicted in Fig. 10. Figures 11 and 12 illustrate the same cutter during the milling process for an external and internal thread respectively.
The zero-reference point is located at the upper surface of the workpiece, aligning with the center of the helix. The algorithm directs the rotating cutter differently based on the thread type, whether internal or external. For internal threads, the cutter is moved linearly to the starting position with coordinates X = Ri – r, Y = 0, Z = 0. Alternatively, for external threads, the starting position is at coordinates X = Ri + r, Y = 0, Z = 0. The starting position is indicated in Figs. 13 and 14 for cases involving a constant and variable radius, respectively.
After positioning the cutter at the starting position, the algorithm directs the flow to one of the two subprograms based on the desired thread direction. Upon completion of the machining process, the tool first retracts from the workpiece before moving to a safe height above the top surface.
6.2 G-codification
Typically, canned cycles are standardized and encoded using a G-code accompanied by a set of parameters. It's essential to highlight that CNC controllers deliberately reserve certain G-codes for potential future applications, enabling customized implementations and enhanced flexibility. Specifically, within the Heidenhain control framework, the unassigned G101 code has been chosen for the proposed implementation. The required supplemental data for the canned cycle can be conveyed through parameters P01 to P10 in a statement following the structure given in Fig. 15.
7 Test results
Simulation tests (depicted in Figs. 16, 17, 18, 19, 20, 21, 22 and 23) have been carefully chosen to showcase the efficiency of the proposed canned cycle, encompassing all possible threading cases it is capable of handling. TEST-1 and TEST-2 simulate the same threading scenario but with different precision steps, offering a valuable capability for both roughing and finishing passes. TEST-3 represents a left-hand thread with a variable radius and increasing pitch, while TEST-4 demonstrates a right-hand thread with a variable radius and decreasing pitch. TEST-5 maintains the settings of TEST-4 but incorporates an increased number of turns. TEST-6 focuses on a left-hand thread with a variable radius and constant pitch. TEST-7 examines a case of a left-hand thread with an initial radius set to zero and a variable increasing pitch. While all previous tests relate to external threads, the final TEST-8 illustrates a case of an internal thread. In all instances, the traced path displayed in the graphical simulation corresponds to the center of the cutting tool.
8 Conclusions
The work presented in this paper built upon the foundations laid in previous mentioned research. As predicted in that earlier work, the present study advanced and extended the capabilities of the thread canned cycle to encompass threads with predefined start and ending radii, start and ending pitches, and the desired number of turns, applicable to both left- or right-hand, internal or external threads. Moreover, the proposed canned cycle seamlessly transitions between roughing and finishing passes, allowing precise regulation of step motion along the prescribed helical curve. The introduced canned cycle surpasses the limitations of conventional cycles, which are confined to fixed pitch threads, by providing a comprehensive solution for diverse threading requirements.
Simulation tests confirm the adaptability of the proposed canned cycle across diverse threading conditions. The graphical outputs, combined with the mathematical formulation of helix equations and CNC milling machine simulations across various threading cases, collectively verify the efficiency, and validation of the proposed canned cycle.
Abbreviations
- H:
-
Height of the spiral, mm
- \(m\) :
-
Slope of the cone’s lines with respect to the \(x-y\) plane
- \(n\) :
-
Total number of turns
- \({n}_{0}\) :
-
Angular velocity, rev/min
- \(n\left(t\right)\) :
-
Number of turns of a helix at time \(t\)
- \({p}_{f}\) :
-
Final pitch of the helix, mm
- \({p}_{i}\) :
-
Initial pitch of the helix, mm
- \(p\left(t\right)\) :
-
Pitch of the helix at time t, mm
- \({R}_{f}\) :
-
Final radius of the helix, mm
- \({R}_{i}\) :
-
Initial radius of the helix, mm
- \(r\left(t\right)\) :
-
Radius of the helix at time \(t\), mm
- T:
-
Time required for traversing a complete revolution, min
- \(t\) :
-
Time variable, min
- \({t}_{f}\) :
-
Time it takes the cutting tool to complete the process, min
- \(x\left(t\right)\) :
-
x – Axis position of the cutting tool at time t, mm
- \(y\left(t\right)\) :
-
y – Axis position of the cutting tool at time t, mm
- \({z}_{0}\) :
-
Calibration constant for the initial position on the z axis
- \(z\left(t\right)\) :
-
z – Axis position of the cutting tool at time t, mm
- \(\tau\) :
-
Normalized time
References
Kumar, K, Ranjan, C, Davim, J (2020) Canned Cycle. In: CNC Programming for Machining. Materials Forming, Machining and Tribology. Springer, Cham. https://doi.org/10.1007/978-3-030-41279-1_9
Sinha, SK (2010) Custom Canned Cycles. Chap. 10 in CNC Programming Using Fanuc Custom Macro B. 1st ed. New York: https://www.accessengineeringlibrary.com/content/book/9780071713320/chapter/chapter10. Accessed 5 June 2024
Martinova L, Fokin N, (2023) Development of a Universal Software Application for Programming Canned Cycles on CNC Turning and Milling Machine Tools, 2023 International Russian Automation Conference (RusAutoCon), Sochi, Russian Federation, pp. 198–203, https://doi.org/10.1109/RusAutoCon58002.2023.10272910
Mohamed A (2015) Enhancement of the Capabilities of CNC Machines via the Addition of a New Counter boring Cycle with a Milling Cutter, Mechanical Engineering Research, Vol. 5, No. 2. https://doi.org/10.5539/mer.v5n2p45
Keran C, Dongli M et al (2023) Design and Analysis of passive variable pitch propeller for VTOL UAVs in Aerospace Science and Technology, Elsevier, vol. 132. https://doi.org/10.1016/j.ast.2022.108063
Tao R, Qingyou L, Yonghua C et al (2016) Variable pitch helical drive in-pipe robot. Int J Rob Autom 31(3):263–271. https://doi.org/10.2316/Journal.206.2016.3.206-4774
Alizade Rasim (2019) Structural Synthesis of Robot Manipulators by Using Screw with Variable Pitch. Universal J Mechanical Eng 7(2):50–63. https://doi.org/10.13189/ujme.2019.070203
Alabi Kehinde, Busari Rasheed (2022) Development and Performance Evaluation of a Variable-Pitch Tapered-Shaft Screw Press for Palm Oil Extraction. J Sci, Part A: Eng Innov 9(2):49–61. https://doi.org/10.54287/gujsa.1069996
Pravin Salunke, Madhivanan Karthigeyan, et. al., (2023) A Novel Pedicle Screw Design with Variable Thread Geometry: Biomechanical Cadaveric Study with Finite Element Analysis World Neurosurgery, Volume 172, pages e144-e150, ISSN 1878–8750, https://doi.org/10.1016/j.wneu.2022.12.120
Gustafson PA, Veenstra JM, Bearden CR, Jastifer JR (2019) The Effect of Pitch Variation and Diameter Variation on Screw Pullout 2(3):258–263. https://doi.org/10.1177/1938640018789999
Austin J, Roebke BS, Logan J et al (2018) Fracture Gap Reduction With Variable-Pitch Headless Screws. The J Hand Surgery 43(4):385.e1-385.e8. https://doi.org/10.1016/j.jhsa.2017.10.018
Veenstra J, Gustafson P, Bearden C, Jastifer J (2018) The Effect of Pitch Variation and Diameter Variation on Screw Pullout in 3D Printed Screws Foot & Ankle Orthopaedics. 3(3). https://doi.org/10.1177/2473011418S00503
Omirou SL, Chasos CA (2024) Design and implementation of an innovative canned cycle for variable pitch thread cutting on CNC milling machines. Int J Adv Manuf Technol. https://doi.org/10.1007/s00170-024-12960-x
Günther S, von Braunmühl EA, Wieleitner H (1921) Geschichte der mathematik. G. J. Göschen, p 92. https://books.google.com.cy/books/about/Geschichte_der_mathematik_t_Von_Cartesiu.html?id=Gy5kzwEACAAJ&redir_esc=y. Accessed 5 June 2024
https://en.wikipedia.org/wiki/Conical_spiral Retrieved 21 February 2024
Wang, BW, Xu, BS, Sun, YH (2011) Machining Process Analysis and Parametric Programming of Parts with Complex Surfaces Advanced Materials Research (Vols. 418–420, pp. 1851–1855). Trans Tech Publications, Ltd. https://doi.org/10.4028/www.scientific.net/amr.418-420.1851
Joshi V, Desai K, Raval H (2016) Machining of archimedean spiral by parametric programming. Int J Modern Manufact Technol 8(2):25–30. Elsevier. https://modtech.ro/international-journal/vol8no22016/04_Vratraj_Joshi.pdf. Accessed 5 June 2024
Rodriguez-Alabanda O, Romero PE, Guerrero-Vaca G (2019) “Application of Custom Macro B high level CNC programming language in a five-axis milling machine for drilling holes distributed in axi-symmetric working planes”, Procedia Manufacturing, Volume 41. ISSN 976–983:2351–9789. https://doi.org/10.1016/j.promfg.2019.10.023
Omirou S, Fyrillas M (2015) A general G-code algorithm for deep hole drilling. J Manufact Sci Product 15(2):225–237. https://doi.org/10.1515/jmsp-2014-0028
Omirou S (2016) A CNC Parametric Programming Method for Manufacturing of Axisymmetric Mould Cavities. J Manufact Sci Product 16(3):173–181. https://doi.org/10.1515/jmsp-2016-0017
Mike Lynch (1997) Parametric programming for computer numerical control machine tools and touch probes. Soc Manufact Eng
Funding
Open access funding provided by the Cyprus Libraries Consortium (CLC). No funding was received to assist with the preparation of this manuscript.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Competing of interests
The authors have no competing interests to declare that are relevant to the content of this article.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Omirou, S., Charalambides, M. & Chasos, C. Advanced CNC thread milling: a comprehensive canned cycle for efficient cutting of threads with fixed or variable pitch and radius. Int J Adv Manuf Technol 133, 2219–2233 (2024). https://doi.org/10.1007/s00170-024-13970-5
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00170-024-13970-5