Development of Fractal Pattern Making Application using L-System for Enhanced Machine Controller

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.


Introduction
Smid [1] stated that the CNC (Computer Numerically Controlled) machines are the development of manual machines which using a microprocessor to control it.CNC machine itself is a machine tool which is capable of automatically forming a pattern of computer-assisted design.The CNC machines use command code of the computer and no longer use human power to run it.
Equipped by CAM (Computer Aided Manufacturing) software, CNC machines can make the drawing design of objects, created by the help of CAD software (Computer Aided Design).Nevertheless Bovill [2] stated in conceptual design stage, the initial design stage, in which the process is characterized by uncertain idea, CAD (Computer Aided Design) is rarely used application.At the conceptual design stage, designers usually create many ideas and turn it into a drawing sketch by only the help of a paper and pencil.CAD (Computer Aided Design) is rarely used at this stage because it requires a complete definition, concrete, and precise for geometric design that is usually done at a later stage.Therefore, it should be sought the solution to integrate the conceptual design stage with CAD software to create drawing sketch of desired design using computer directly.
One solution, proposed by Soo [3], is integration of the conceptual design stage with CAD into one application software.This solution is come from the observation that many jewellery products are adopting attractive pattern of natural objects, which can be designed by fractal geometry.The proposed solution by Soo [3] is only for rapid prototyping, which the fractal geometry implemented using Iterated Function System, and the solutions have not been implemented in application software.
To generate the fractal design patterns, actually many methods that can be applied, one of them is L-System method, which can be implemented easily in programming by the help of the turtle geometry interpretation.By above reasoning, this research is intended to developing customized application software for CNC machines which can be used to create design patterns using fractal geometry automatically based on input from users.

Enhanced Machine Controller
Enhanced Machine Controller or abbreviated as EMC ref. [4] is computer software for controlling CNC machines such as milling machines, lathes, plasma cutters, cutting machines, robots, hexapods, and others.EMC is open source software which licensed under GNU General Public License and GNU Lesser General Public License (GPL and LGPL).
EMC2 is the progress of EMC software.There are four major components to the EMC2 software, namely: motion controller, controller I/O discrete modules to coordinate controllers and graphical user interface.And especially in EMC2, there is a facility called the HAL (Hardware Abstraction Layer) ref. [5] which allows adjustment without recompiling EMC2 configuration so that it will simplify the interface to the hardware.Because customization process for developing specific application software.
Figure 1 shows a simple block diagram showing the EMC2 system for 3-axis machine.The diagram shows the stepper motor system.PC with Linux as the operating system is used to control the stepper motors drive by sending a signal through the printer port (parallel).The signals (pulses) make the drive stepper motors moving.

Python Programming Language 2.6
Application software for L-System methods is developed using Python programming language 2.6.Python run on EMC2-AXIS over Ubuntu Linux operating system.Python ref. [6] is a dynamic programming language that supports object-oriented programming.In addition, the language is easy to use because it has a clear structure and grammar and also has extensive libraries.Besides Python language can be integrated with other languages such as C / C + + and Java.

G-Code
G-Code ref. [4] is a programming language for CNC machine which is closely related to graphics and vector.This language is used as a connector between the machine tool and CNC software that resides on computer.The machine will follow the movements of the design which written in G-Code.G-Code programming language is written in a file with the extension *.ngc (Numerical G-Code).Here are some examples of G-Code language along with their respective functions:

L-System Methods
According to Mandelbrot [7], fractal derived from the Latin adjective "fractus" which means crushed or cracked 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.Furtehrmore Prusinkiewicz [8] explains that the main concept of the L-System is rewriting.Rewriting mechanism in the L-System was introduced by Aristid Lindenmayer in 1968.The L-System consists of: symbols which can be used to create string, collection of production rules for transforming symbols to string, initial string value for the start of construction called as Axiom, and mechanism for translating the resulting string into the geometric structure.For the translation stage to the geometric structure, the developed application use turtle geometry interpretation ref. [9].

Turtle Geometry
Prusinkiewicz [8] explain that the turtle is defined as a triplet (x, y, α) where the Cartesian coordinates (x, y) represents the position of the turtle and the angle α indicates the direction for the turtle.If given step length d and angle δ, the turtle can interpret the symbols in Table 1 below: -Rotates to the right as δ..The next status turtle to (x, y, α -δ).

Table 1. Interpretation Turtle Table
According to the above rules, the turtle interprets the character string as a sequence of line segments.However, the plant or tree pattern is dominated by the branching structure ref. [8], so that two new symbols are introduced to define a branch that is '[' and ']' which their means described in Table 2: ] Retrieving the last saved position and moving again from there.
In addition to the symbols contained in Table 1 and Table 2, the turtle will not interpret into anything and just stand still when seeing the other symbols.

Implementation
For the implementation of the application software requires several steps ref. [10] of the nature of open source, the EMC2 facilitate the DOI: 10.1051/ C Owned by the authors, published by EDP Sciences,

Fig. 3 .
Fig. 3.The used CNC machine d steps.Status of the turtle turned into (x', y', α), where x'= x + d cos α and y' = y + d sin α.Line between the point (x, y) and (x', y') is drawn.f Moving Forward as d steps without drawing a line.+ Rotates to the left as δ..The next status turtle to (x, y, α + δ).Positive orientation is rotated clockwise.

4. 1 .
Developing Virtual Control Panel Developing the L-System GUI as in figure 4 required creation *.xml file to set the GUI display.PyVCP (Python Virtual Control Panel) is required to perform a virtualization panel on EMC2.The virtualization panel is needed because EMC2 only recognize the panel as an object.In our approach, the virtualization panel developed by PyVCP is used as connector between the EMC2 to the main program of L-System.Modification related this step in *.xml file is by adding <pyvcp> tag and closed with the </ pyvcp> tag.

Table 4 .
Results from CNC MachineFrom 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.