TOOL PATH OPTIMIZATION OF A 3 D PRINTER VIA AN ENHANCED ELECTROMAGNETISM-LIKE MECHANISM ALGORITHM FOR SOLAR PANEL BRACKETS FABRICATION

There is a growing consensus that 3D printing technologies will be one of the next major technological revolutions. Over the past few years, many studies and researches have been carried out to improve and enhance the functions and performance of the 3D printers. In this paper, a modified Electromagnetism-like Mechanism (EM) algorithm is proposed to search for the optimum printing path of a 3D printer. The machine is set to fabricate the bracket of a photovoltaic solar energy harvesting panel. Instead of randomly setting the search step size, the improved EM systematically fine-tunes the steps to search for the best printing path. The performance of the enhanced EM is benchmarked with the conventional EM and Genetic Algorithm (GA). The results presented in this paper shows that the modified EM outperformed all other optimization techniques in terms of time taken, distance traveled and overall convergence process. We can thus conclude that the proposed modified EM performs well in optimizing the path planning sequence of a 3D printer.


INTRODUCTION
Rapid prototyping, or better known as the 3D printing technologies have progressively taken more attention in the manufacturing research around the world as the process has proven to be compatible with industrial manufacturing beyond Prototyping [1][2][3].The 3D printing technology evolved during the mid-1980s when computing and control systems progressed [4].3D printing is a form of "build-up" manufacturing, where an object is constructed and fabricated by adding layer after layer of a particular material.This is different from the conventional "cut-off" fabrication, in which an object is carved out of a block of raw material [5].The systems are usually associated with the Computer-Assisted Design (CAD) software to digitally model the objects to be printed.It is widely recognized that the 3D printer offers significant advantages in terms of design freedoms, mass customization, and co-creation [6][7][8].The study on the 3D printing technology can be split into several divisions.Among others is the tool path planning [9].A primary goal in planning the tool path is to avoid tool collision.Solving the optimization problem of tool path has an important role because reducing the time to perform one piece ultimately leads to a significant reduction in cost of the entire series of fabrication.Several reports can be found in the literature on the tool path planning and optimization.In [10], the authors employed a hybrid algorithm to reduce the length of the tool path.A mathematical model for calculating the processing time was developed.The algorithm finds an optimal tool path, which has a proven effect on the process productivity.Some optimization mechanism, such as Ant Colony Optimization algorithm [11][12][13], Genetic Algorithm (GA) and Hill-Climbing [14,15] were also attempted in the optimization of the tool path.This paper presents an enhanced Electromagnetism-Like Mechanism algorithm (EM) for the tool path optimization of a 3D printer.In this research, the 3D printer is set to fabricate a bracket for a photovoltaic solar panel.The breakdown of the paper can basically be divided into 4 major sections.The second section of the paper presents the implementation method of the EM algorithm and the proposed modification.The experimental results are shown in section 3, along with the analysis and some discussions.The final section of the paper offers the conclusion made from the research.

ELECTROMAGNETISM-LIKE MECHANISM ALGORITHM
This section presents the implementation procedure of a global optimization algorithm known as Electromagnetic-like Mechanism (EM) in minimizing the traveling path of the 3D printer tool.The EM is a global optimization search mechanism proposed by Birbil and Fang in 2003 [16].The EM imitates the attraction-repulsion mechanism of electromagnetic charges in the search for a global optimal solution.In the EM, all solutions are known as particles in the search space and the charge of each reflects the objective value of each.Particles with better objective attract other particles.Particles with worse objective values, on the other hand, repulse other particles so that they move away from the known bad solutions [17].The magnitudes of the forces are in proportion to the objective values.The particles are then moved based on superposition theorem.There are five important operations in the EM, namely the initialization, the local search, the charge calculation, the force calculation, and the movement of particles.In the initialization stage, the feasible ranges of all the tuning parameters are defined.Then, m sample of initial particles are randomly picked from the feasible solution domain, each represents an N dimensional hyper-solid.Each value of dimension in each particle is assumed to be uniformly distributed inside the upper and lower bound.Since this research shows a minimization problem, the particle with the lowest tool travel path distance is marked as the best particle.Table 1 shows the pseudocode of the original EM proposed by Birbil and Fang in 2003 [16].The mechanism is further illustrated in the flowchart shown in Figure 2.2.Local (LSITER, δ) 5: F CalcF ( ) 6: Move (F) 7: iteration iteration + 1 8: end while The original local search procedure in a conventional EM employs a random line search within the feasible range of a solution.This simple line search involves a particle being tuned along its dimensions one by one, restricted by a maximum feasible random step length of  ∈ (0,1).For each of the iterations, a new random step length is generated.The overall local search procedure is immediately terminated upon achieving any better objective value.Table 2 shows the pseudocode of the original local search procedure in the original EM.The flow of the original local search mechanism is as illustrated in Figure 2   The total force vector exerted onto each particle is calculated based on the Coulomb's Law.The charge of each particle is evaluated by its current objective value compared to the best particle in the iteration.The computed charge of a particle, qi , when compared to that of other particles, will determine if it is a repulsive or attractive force to the respective particles.The calculation of qi is shown in equation ( 1 ) , ∀ where n refers the total dimension of the particle and m denotes the population size.f(xbest) represents the objective value of the best particle.
With the charges calculated for all particles, forces generated by one particle onto another can be computed.According to the electromagnetic theory, the force of one particle onto another is inversely proportional to the distance between the two particles and directly proportional to the product of their charges.The force vector for a particle can be determined using equation (2).
where f(xj) < f(xi) denotes attraction and f(xj) ≥ f(xi) refers to repulsion.The movement stage in EM involves relocation of all particles but the best to a new location in space.This step is crucial to ensure better global exploration of other possible routes.The calculation for the movement of a particle is as shown in equations ( 3), where  represents the global particle movement step length.It is a random value between 0 and 1, assumed to be uniformly distributed between the upper boundary (uk ) and the lower boundary (lk ).
←    +    (  −    ) ;   ≥ 0    ←    +    (   −   ) ;   < 0 (3) Holding the absolute power of attraction towards all other particles, the best particle of the iteration does not move.After a pre-fixed number of iterations, the best optimized tool path is then fed back as the result.

The Enhanced EM
In this research, a modification on the EM is proposed.This enhanced algorithm is named as Regulated Step EM (ReSEM).ReSEM is a modified version of EM that can grant the algorithm the ability to hit a more accurate result without heavily slowing down the entire convergence process.The idea of ReSEM is to replace the local search segment of a conventional EM with the procedure as shown in Table 3. ReSEM applies a nonlinear equation to dynamically adjust the step size as iterations go.The step λ is calculated using equation (4). = Figure 2.4 shows the modified workflow and decision making process of the enhanced ReSEM for the implementation in this research, where D represents the current solution in a particular dimension of an iteration and λ refers to the search step calculated using equation ( 4).The flow systematically checks the direction and the magnitude of the convergence movement of each iteration and change accordingly.This ensure the algorithm search in relatively larger steps in the beginning of the iterations and move towards a more fine-tuned search as the iteration goes.

ReSEM Procedures
Step 1 Set maximum number of iterations as terminating criteria.
Step 2 Calculate the step size according to equation 4.
Step 3 Tune the current tile angle by adding and subtracting it with λ separately.Calculate the new output power with the new solutions obtained.
Step 4 Adapt the newfound tilt angle value if a higher output power is achieved.
Step 5 Repeat Steps 3 and 4 until no higher output power is obtained.
Step 6 Exit if the iteration number reaches termination criteria.Otherwise move on to the next iteration (i = i + 1) and repeat from Step 2. The enhanced algorithm is then implemented to search for the shortest and quickest path in the simulation runs of a 3D printer to print the bracket.

EXPERIMENTAL RESULTS
The performance of the enhanced EM is benchmarked with that of the conventional EM.Also, in order to show a better picture on the performance of the enhance EM compared to other optimization algorithms, a standard Genetic Algorithm (GA) is also included in the benchmarking process.Figure 3.1 shows the flow of the GA used in the benchmarking.The experiment is conducted in 10 individual runs for each of the algorithms.The results are shown in Table 4 in the form of best distance, worst distance, average distance, average time and average iteration needed to reach best optima results of the 10 individual runs.
From Table 4, it can be observed that the enhanced ReSEM shows relatively better results as it found shorter distance to travel compared to the conventional EM and the GA.Also, notice that this led to a shorter time needed to travel in order to complete the task.In order to investigate the overall convergence performance of the algorithms, some convergence processes of the experiment are sampled and analyzed.The iterationby-iteration comparison of the sampled convergence processes are showed in Table 5. Figure 3.1 provides a better illustration of the iteration movement comparison of each algorithm.It can be observed from Figure 3.2 that the modified ReSEM shows rapid convergence process at the beginning of the iterations.Relatively, the conventional EM and the GA show slower convergence rates.The enhanced ReSEM also manages to hit lower distance value compared to that of the conventional EM and the GA.convergence processes are showed in Figure 3.2.

CONCLUSION
The size of the search steps has been a common issue in the development of optimization algorithms.Larger search steps enable quicker search, but return with less accurate solutions.Scrutinized search, on the other hand, can ensure the algorithm to hit solutions with higher accuracies.The trade-foo, however, is that the search takes relatively longer time.In this research, an enhanced Electromagnetism-Like Mechanism algorithm has been developed for the optimization of the tool path of a 3D printing system.A regulated search step mechanism has been introduced into the local search segment of a conventional EM.This regulated search EM (ReSEM) begins the search with a relatively large search step to speed up the convergence process.As the search iterations go, the algorithm then automatically adjust and fine-tunes the search step in order to achieve solutions with higher accuracies.This provides the search algorithm both the advantages in terms of speed and accuracies.Experiments have been carried out to verify and examine the performance of the proposed algorithm.The results indicated that the proposed ReSEM showed significant improvement over the conventional EM and outperformed the GA in the search for the shortest and quickest tool path for the 3D printing system.In the future, this enhanced global optimization search mechanism can also be implemented to solve other engineering optimization and scheduling problems.
Figure 2.1 shows an example of the forces applications.

Figure 2 . 3 .
Figure 2.3.The flow of the original local search mechanism.

Figure 2 . 4 .
Figure 2.4.The proposed modification on the local search sequence of the modified EM.
Figure 2.5 shows an example of the printing layers which the experiment is conducted on.The enhanced algorithm is set to search for the optimized tool path to print the shaded areas.

Figure 3 . 1 .
Figure 3.1.The general flow of the Genetic Algorithm used in the benchmarking.

Table 3 .
Local search procedures for the proposed ReSEM.

Table 5 .
Comparison on the examples of the convergence process for ReSEM, Conventional EM and GA.