05_Development_of_Fractal_Pattern_Making_Application_using_L_System
05_Development_of_Fractal_Pattern_Making_Application_using_L_System
Abstract. One big issue facing the industry today is an automated machine lack of flexibility for
customization because it is designed by the manufacturers based on certain standards. In this research, it is
developed customized application software for CNC (Computer Numerically Controlled) machines using open
source platform. The application is enable us to create designs by means of fractal patterns using L-System,
developed by turtle geometry interpretation and Python programming languages. The result of the application
is the G-Code of fractal pattern formed by the method of L-System. In the experiment on the CNC machine,
the G-Code of fractal pattern which involving the branching structure has been able to run well.
This is an Open Access article distributed under the terms of the Creative Commons Attribution License 2.0, which permits unrestricted use, distribution, and
reproduction in any medium, provided the original work is properly cited.
Code Description
G0 Rapid motion
G1 Coordinated motion ("Straight feed")
G2, G3 Coordinated helical motion ("Arc feed")
G4 Dwell (no motion for P seconds)
G38.2…G38.5 Straight probe
G80 Cancel motion mode
G81, G82 Drilling cycle without (with) dwell
G83, G73 Peck and Chip-break drilling cycles
G85, G89 Boring cycle without (with) dwell
G33 Spindle-synchronized motion
G33.1 Rigid tapping
G76 Multiphase lathe threading cycle
Fig. 1. EMC2 Controlled Machine
00032-p.2
ICASCE 2013
3 L-System Methods
In addition to the symbols contained in Table 1 and Table
According to Mandelbrot [7], fractal derived from the 2, the turtle will not interpret into anything and just stand
Latin adjective "fractus" which means crushed or cracked still when seeing the other symbols.
and then he defines a fractal as "the set which the
Hausdorf dimension exceed its topological dimension".
L-System is one of techniques for implementing fractals. 4 Implementation
Furtehrmore Prusinkiewicz [8] explains that the main
For the implementation of the application software
concept of the L-System is rewriting. Rewriting
requires several steps ref. [10]:
mechanism in the L-System was introduced by Aristid
Lindenmayer in 1968. The L-System consists of: symbols 1. Developing Virtual Control Panel, integrated with
which can be used to create string, collection of AXIS through PyVCP. This step produces a file with
production rules for transforming symbols to string, the extension *.xml
initial string value for the start of construction called as 2. Connecting PyVCP with EMC2 through the facilities
Axiom, and mechanism for translating the resulting string of HAL (Hardware Abstraction Layer). This step
into the geometric structure. For the translation stage to results in file with extension *.hal
the geometric structure, the developed application use 3. Resetting the configuration file axis_mm.ini of CNC
turtle geometry interpretation ref. [9]. machine in order to read the *.xml and *.hal files,
produced in (1) and (2). Modification is performed
3.1. Turtle Geometry on PYVCP and POSTGUI_HALFILE.
4. Developing the L-System program in the Python
Prusinkiewicz [8] explain that the turtle is defined as a programming language, which generate G-Code in a
triplet (x, y, α) where the Cartesian coordinates (x, y) file with the extension *.ngc
represents the position of the turtle and the angle α
5. Executing *.ngc file from AXIS Interface.
indicates the direction for the turtle. If given step length d
and angle δ, the turtle can interpret the symbols in Table These steps are explained further in the following section:
1 below:
Table 1. Interpretation Turtle Table
4.1. Developing Virtual Control Panel
Developing the L-System GUI as in figure 4 required
Symbol Interpretation creation *.xml file to set the GUI display. PyVCP
(Python Virtual Control Panel) is required to perform a
Moving forward as d steps. virtualization panel on EMC2. The virtualization panel is
Status of the turtle turned into
needed because EMC2 only recognize the panel as an
(x', y', α), where x'= x + d cos α
F, X object. In our approach, the virtualization panel
and y' = y + d sin α. Line
between the point (x, y) and (x', developed by PyVCP is used as connector between the
y') is drawn. EMC2 to the main program of L-System. Modification
Moving Forward as d steps related this step in *.xml file is by adding <pyvcp> tag
f and closed with the </ pyvcp> tag.
without drawing a line.
Rotates to the left as δ.. The next
status turtle to (x, y, α + δ).
+
Positive orientation is rotated
clockwise.
Rotates to the right as δ.. The
–
next status turtle to (x, y, α - δ).
00032-p.3
EPJ Web of Conferences
to the connecting signal through specific ports on EMC2 After *.ngc which contains G-Code created then it can be
can get to CNC machine. invoked via MDI commands in HALUI (Hardware
Abstraction Layer) and execute G-Code commands:
O101 ... O199 (Call subroutines). To do this, the user can
4.3. Resetting the configuration file of CNC
simply click the Run button in figure 4 L-System GUI.
machine
In EMC2-Axis software, there is *.ini (initial) files which
5 Results
storing and calling all existing settings for initiating the
EMC2-Axis software. This file can be accessed and
modified by the user. For the implementation of the For simulation, there are eleven fractal design patterns for
application software, it is used axis_mm.ini file and testing the application, which running well. The
modifies this file. Modification is mainly intended to following table are some examples of fractal design
allow EMC2 software can read the *.xml and *.hal patterns obtained after running L-System program using
produced in previous steps. This modification is the specified rule in Table 3 below:
performed on PYVCP and POSTGUI_HALFILE.
Table 3. Results of Program Testing
4.4. Developing the L-System Program
Fractals Type Result
L-System methods are implemented via Python Box
programming language 2.6 in Ubuntu Linux operating (n = 3)
system. In addition, it is used Tkinter ref. [11] for
creating Python GUI to input the data on L-System. Axiom:
Further EMC2-Axis is calling a Python program through F-F-F-F
MDI facility commands on HALUI (Hardware
Abstraction Layer) and then executes the G-Code Rule:
command: M101 M199 (User-defined M-codes). F→FF-F-F-F-FF
Axiom:
F+F+F+F
Rule:
F→F+f–
FF+F+FF+Ff+FF
– f+FF– F– FF–
Ff–FFF
f→ffffff
00032-p.4
ICASCE 2013
Table 4. Results from CNC Machine World Academy of Science, Engineering and
Technology 34 (2007)
Fractals Type Result
Bushy Tree 10. A.A.S Gunawan, J. Linggarjati, Pengembangan
(n = 3) Program Aplikasi Enhanced Machine Control
dengan Python untuk Metode Interpolasi Newton,
Axiom : F Jurnal ComTech, Vol 03 / No 01 / June 2012
Rule: F -> FF-[- 11. J.W. Swipman, Tkinter 8.4 Reference: a GUI for
F+F+F]+[+F-F-F] Python, Mexico: New Mexico Tech (2010)
Time making:
25.6 menit
6 Conclusions
From the results of the application software, some
conclusions are obtained as follows:
a. EMC2 can be used to run CNC machines well and
because it is open source, users can make the
customization to adjust EMC2 according to their
needs.
b. L-System methods with the help of turtle geometry
interpretation can be used to form a fractal design
patterns. The design patterns are useful in conceptual
design stage which consuming time and cost.
References
1. P. Smid, CNC Programming Handbook 2nd Edition,
New York: Industrial Press Inc (2003)
2. C. Bovill, Fractal Geometry as Design Aid, Journal
for Geometry and Graphics Volume 4 No 1, 71-78
(2000)
00032-p.5