Tool Path Generation For CNC Milling Based On STL File: Nadia Sami Hasan Dr. Laith Abdullah Mohammed
Tool Path Generation For CNC Milling Based On STL File: Nadia Sami Hasan Dr. Laith Abdullah Mohammed
Tool Path Generation For CNC Milling Based On STL File: Nadia Sami Hasan Dr. Laith Abdullah Mohammed
2, 2015
ABSTRACT
This paper proposes and develops algorithms to read (STL) files and extract
engineering entities required in CNC milling processes. The proposed algorithms are
dependent on some mathematical modeling and manipulations of the engineering models
by slicing an (STL) file to many slices and then building the required algorithms to adopt
these slices to generate machining paths for CNC milling machines as (G-Codes).
The proposed system is divided into three parts, in the first part, an algorithm proposed to
extract engineering object entities to some proposed models based on their (STL) files
using Matlab program. The proposed models include cube, cylinder, dome, cone and
cavity models. In the second part, a slicing algorithm is proposed to enable the slices
along the proposed models z-axis to find and navigate the required manufacturing data.
UGS program was used also to generate the tool paths and to simulate the machining
process and then generate NC part program of the proposed objects (G-Code). Finally,
the third part of this work includes comparing results produced based on both (STL) and
(UGS), to achieve the required aim of this paper by experimentally comparing objects
surface roughness, resulted values show that the maximum difference in average R a is
equal to (0.27µm).
350
Eng. &Tech.Journal, Vol.33,Part (A), No.2, 2015 Tool Path Generation for CNC Milling Based
on ST File
اﻟﺠﺰء اﻟﺜﺎﻟﺚ ﺗﻀﻤﻦ ﻣﻘﺎرﻧﺔ.ﻟﺘﻮﻟﯿﺪ ﻣﺴﺎرات اﻟﻘﻄﻊ وﻣﺤﺎﻛﺎة ﻋﻤﻠﯿﺔ اﻟﺘﺸﻐﯿﻞ وﻣﻦ ﺛﻢ ﺗﻮﻟﯿﺪ ﺑﺮاﻣﺞ اﻟﺘﺸﻐﯿﻞ ﻟﮭﺬه اﻟﻨﻤﺎذج
( ﻣﻦ ﺧﻼل اﻟﻤﻘﺎرﻧﺔ اﻟﻌﻤﻠﯿﺔ ﻟﻘﯿﻢUGS) ( واﻋﺘﻤﺎد ﻣﻠﻔﺎت ﺑﺮﻧﺎﻣﺞSTL) اﻟﻨﺘﺎﺋﺞ اﻟﻤﺘﻮﻟﺪة ﻣﻦ ﻛﻞ ﻣﻦ اﻋﺘﻤﺎد ﻣﻠﻔﺎت
.(0.27µm) ﺣﯿﺚ ﺑﯿﻨﺖ اﻟﻨﺘﺎﺋﺞ أن أﻛﺒﺮ ﻓﺮق ﻓﻲ ﻣﻌﺪﻻت ﻗﯿﻢ اﻟﺨﺸﻮﻧﺔ اﻟﺴﻄﺤﯿﺔ ﯾﺴﺎوي،اﻟﺨﺸﻮﻧﺔ اﻟﺴﻄﺤﯿﺔ
INTRODUCTION
351
Eng. &Tech.Journal, Vol.33,Part (A), No.2, 2015 Tool Path Generation for CNC Milling Based
on ST File
352
Eng. &Tech.Journal, Vol.33,Part (A), No.2, 2015 Tool Path Generation for CNC Milling Based
on ST File
Ax + By + Cz + D = 0
where: A = (y2 – y1) (z3 – z1) - (z2 – z1) (y3 – y1)
B = (z2 – z1) (x3 – x1) - (x2 – x1) (z3 – z1)
C = (x2 – x1) (y3 – y1) - (y2 – y1) (x3 – x1)
Hence;
Using Equation (1) for the plane in 3D space, it is possible to determine the
intersection point (x i, yi, zi) using Equation (2).
N = - (A ×xs + B×ys + C ×zs + D)
M = A (xe – xs) + B (ye – ys) + C (ze – zs)
N
S=
M
−
= S× − + ….. (2)
−
Using Equation (2) one can determine the point of intersection coordinates between the
line and the triangular plane, accordingly, Figure (6) represents the cube, the cylinder, the
dome, the cone, and the cavity models respectively including the normal vectors for each
triangular mesh.
353
Eng. &Tech.Journal, Vol.33,Part (A), No.2, 2015 Tool Path Generation for CNC Milling Based
on ST File
coordinates of vertex are identified and stored in the data array, then facets that are
intersected by the slicing plane are to be found. The search is done through the facet
index. The slicing algorithm can be explained as follows in the flowchart shown in Figure
(8).
In order to minimize searching and manipulating time and to avoid stair case, this
algorithm is performed by checking each triangular facet, which has a normal vector
parallel to the slicing plane, whether intersected by the slicing plane or not. If it is
intersected, the intersection point coordinates is stored in an array data. Intersection
checking with each facet was conducted for each slicing plane along the slicing axis.
Figure (9) represents the resulting slicing process achieved on faceted cube, cylinder,
dome, cone and cavity models respectively. Accordingly, these obtained figures represent
the array manufacturing data for the suggested models, which is then exported to the
UGS package as .dat file to achieve the machining process including tool path and g-code
generation. Figure (10) represent the machined objects using the proposed algorithm.
CONCLUSIONS
On the basis of this study, and observations recorded experimentally, the following
findings can be concluded:
1- STL file format consists of unordered list of triangular facets.
2- According to the conducted experiments and the plotted results, one can observe
that the objects produced using STL models are clearly have rough surfaces compared
with the surfaces produced by UGS with average percentage of 13µm.
3- The main cause of the high surface roughness values of the objects produced by
STL is the cutting tool length and this motive increases the vibration in the tool axis
leading to increase the magnitude of (R a).
4- The proposed system gives less number of machining blocks and minimum
machining time as compared with those resulted from the UGS system, this is because
the proposed algorithm is performed by checking each triangular facet, which has a
normal vector parallel to the slicing plane, whether intersected by the slicing plane or not.
If it is intersected, the intersection point coordinates are stored in a manufacturing array
data.
5- The points close to the object top are more prone to false feature extraction than
the points around the object surface area, this can be seen clearly in both dome and cone
shaped objects respectively.
354
Eng. &Tech.Journal, Vol.33,Part (A), No.2, 2015 Tool Path Generation for CNC Milling Based
on ST File
Start
Stl File
Slicing Process
Slice 1
Slice Tracing
Slice 2
Finding Machining Points
Slice 3
Machining
Path file
Slice n
Figure (1) Flowchart describing the main steps of the algorithms achieved in this work
355
Eng. &Tech.Journal, Vol.33,Part (A), No.2, 2015 Tool Path Generation for CNC Milling Based
on ST File
(d) (e)
Figure (2) The Main Wireframe Models for the (a) Cube,
(b) Cylinder, (c) Dome, (d) Cone, and (e) Cavity
(d) (e)
Figure (3) The Models Triangular Mesh for the (a) Cube,
(b) Cylinder, (c) Dome, (d) Cone, and (e) Cavity
356
Eng. &Tech.Journal, Vol.33,Part (A), No.2, 2015 Tool Path Generation for CNC Milling Based
on ST File
(d) (e)
Figure (4) The Triangular Surface Models for the (a) Cube, (b) Cylinder,
(c) Dome, (d) Cone, and (e) Cavity
End (E)
(xe, ye, ze) Intersection
(xi, yi, zi)
Start (S)
(xs, ys, zs)
357
Eng. &Tech.Journal, Vol.33,Part (A), No.2, 2015 Tool Path Generation for CNC Milling Based
on ST File
(d) (e)
Faceted
Model
Slicing
Axis Slicing
Plane
358
Eng. &Tech.Journal, Vol.33,Part (A), No.2, 2015 Tool Path Generation for CNC Milling Based
on ST File
Start
No
Zmin<Zslice<Zmax
Yes
359
Eng. &Tech.Journal, Vol.33,Part (A), No.2, 2015 Tool Path Generation for CNC Milling Based
on ST File
Slicing Planes
(d) (e)
(d) (e)
360
Eng. &Tech.Journal, Vol.33,Part (A), No.2, 2015 Tool Path Generation for CNC Milling Based
on ST File
REFERENCES:
[1] J. W. Gunnick, “Multi-Axis High Speed Milling: How to Speed up Prototyping &
Tooling Process by Using STL Technology”, Proceedings TCT Conference 1998,
Nottingham, pp.43-65,Oct. 1998.
[2] L. Lennings, “Selecting Either Layered Manufacturing or CNC Machining to Build
Your Prototype”, Rapid Prototyping and Manufacturing Conference,
Rosemont(Chicago), April 2000.
[3] M. Löwdin, “Time Reducing Actions With Freeform Fabrication and Rapid
Prototyping”, M.Sc. Thesis, Örebro University,Sweden, 2004.
[4] R. Lin and C. Ye, “Accurate Trajectory Control for Five-Axis Tool-Path Planning”,
Proceeding of the international Multi conference of engineers and computer scientists,
Vol. II, Hong Kong, March. 14-16, 2012. [www.ivsl.org].
[5] M. Li, L. Zhang, J. Mo, and Y. Lu, “Tool-path generation for sheet metal incremental
forming based on STL model with defects”, International Journal of Advanced
Manufacturing Technology, pp. 535–547, (2012). [www.ivsl.org].
[6] G. Kiswanto and M. Azka, “Automatic Part Primitive Feature Identification Based on
Faceted Models”, International Journal of Computer Science Issues, Vol. 9, Issue 5, No
2, September 2012. [www.ivsl.org].
[7] Y. Chen, J. Gao, H. Wen and X. Chen, “Estimation Normal Vector of Triangular
Mesh Vertex by Angle and Centroid Weights and its Application”, TELKOMNIKA, Vol.
11, No. 4, pp. 1841-1848, April 2013. [www.ivsl.org].
361