Error optimization using Bat and PSO algorithms for ... - IEEE Xplore

3 downloads 421 Views 159KB Size Report
Page 1 ... of lathe tool positional error in a developed machine vision system for determination of ... and PSO, are proposed for optimization of lathe tool position.
Error optimization using Bat and PSO algorithms for machine vision system based tool movement Anu Garg1,2 , Prasant Kumar Mahapatra1*, Member, IEEE, Amod Kumar1 1

Biomedical Instrumentation Division, CSIR-Central Scientific Instruments Organisation, Chandigarh, India 2 Department of Optical Engineering / Applied Physics, Guru Jambheshwar University of Science and Technology, Hisar, Haryana, India e-mail: [email protected] (A.Garg); [email protected] (P.K.Mahapatra); [email protected] (A.Kumar) * Corresponding Author

Abstract-This paper presents a comparison of Bat and Particle Swarm Optimization (PSO) algorithms for optimization of lathe tool positional error in a developed machine vision system for determination of lathe tool position and verification. Bat algorithm is based on echolocation behavior of bats while PSO is inspired by social behavior of birds flocking in search for food. Both metaheuristic algorithms were tested on lathe tool movement ranging from 0.020 mm to 7 mm. The results for various lathe tool movements have demonstrated that Bat algorithm outperforms the PSO algorithm. Keywords- Bat Algorithm; PSO Algorithm; Error optimization; Bio-inspired Algorithms; Machine Vision System

I.

INTRODUCTION

The term 'Soft Computing' was proposed by Lofti A. Zadeh who is the inventor of fuzzy logic. According to him, '' Soft Computing (SC) is tolerant of imprecision, uncertainty, partial truth and approximation. The role model of SC is human mind"[1]. SC is creating an evolution in fields of science and engineering as it is able to solve a number of problems which can not be solved with traditional analytic methods. A review on industrial applications of Soft Computing techniques is presented in [2]. SC is also playing a vital role in the field of machining. Various evolutionary techniques such as Ant Colony Optimization (ACO) [3], Genetic Algorithm (GA) [4], Particle Swarm Optimization (PSO) [5], Simulated Annealing (SA) [6] etc. have been employed by researchers in various machining processes. A review of evolutionary techniques in optimizing machining parameters like surface roughness, machining time, geometrical accuracy etc is presented in [7]. A literature review on applications of Soft Computing techniques for predicting performance of machining process and their optimization is presented in [8]. In [9], PSO is proposed to minimize the operating path for automated drilling operations. [10] presents an overview of PSO algorithm for optimization of various process parameters like cutting speed, depth of cut, feed rate etc. of machining. In this paper, two bio-inspired soft computing techniques, Bat and PSO, are proposed for optimization of lathe tool position error in developed machine vision system. This paper is organized as follows: Section II presents a brief overview of developed machine vision system for tool

positioning and verification. Section III describes the problem in developed vision system. PSO and Bat algorithms are discussed briefly in section IV and V respectively. Proposed Methodology is presented in section VI. Section VII presents the various experimental results. Conclusion and future work are discussed in section VIII. II.

A. Machine vision system In various machining processes such as milling, grinding, drilling, turning etc. tool (or workpiece) is to move in X, Y or Z direction with respect to workpiece (tool). During these processes, tool deviates from its original position due to machining errors, controller dynamics, process effects etc and results in tool positioning error. Tool positioning and its verification becomes quite essential in these cases. In order to perform this task a machine vision system was developed for positioning and verification of lathe tool. A single monochrome CCD (Stingray F-125B, resolution 1.3 megapixel) camera mounted on a lens with 0.75 magnification was used to capture images of lathe tool. Advanced illumination LED backlight was used for excellent contrast between background and tool as it improves threshold of images. Camera was interfaced with a Personal Computer (PC) through an IEEE interface card. From this PC through a software window, tool movement command was given to motion controller. Conventional motion controller was used to perform lathe tool movement and it was assumed that motion controller was working ideally (no positional error). This whole setup was placed on a vibration isolation table. Through a developed algorithm, vision based movement of tool was measured in pixels. In order to calculate vision based movement in real world units (mm), the vision system was calibrated to determine conversion factor. Calibration grid of 10 * 10 mm with dot diameter 0.25 mm and dot spacing 0.125 mm was placed under camera. Total number of pixels was calculated and then conversion factor was measured which came out to be 0.010152 mm/pixel.

Sponsored by Council of Scientific & Industrial Research (CSIR, India), New Delhi under the Network programme (ESC-0112)

c 978-1-4799-3080-7/14/$31.00 2014 IEEE

METHODOLOGY

2689

B. Problem with developed vision system During performance evaluation of developed vision system, a number of experiments showed that the actual movement of tool (motion controller movement) was not equal to vision based movement of tool. This inequality gives the tool positional error. A number of parameters are responsible for this error such as environmental effects, illumination (location, light intensity), reflectance characteristics (object and background texture), image measurement error etc. In order to make this developed vision system more robust and error free, tool positional error must be optimized. In this paper, Bat and PSO algorithms were employed to optimize (minimize) the positional error using Image processing toolbox of MATLAB 2013b . C. Particle Swarm Optimization (PSO) PSO is a stochastic, population-based optimization technique. It is inspired by behavior observed in flock of birds, swarm of bees etc. [11] . In PSO, population is termed as 'swarm' and individuals are termed as 'particles'. These particles move through search space. Their search is influenced by their own behavior (particles own best solution) and behavior of their neighbors (best solution in the swarm). Let us say P is the size of swarm. Take a particle k (1”k”P), it has three attributes: a current position xk, a current velocity vk, k's own best value (L_bestk). All the particles have above three attributes. G_best (Global Best) is the best solution provided by the whole swarm. During each iteration the position and velocity of each particle is updated using (1) and (2) [12, 13]: vk

w v kt  c1 rand () L _ best k  x kt  c2 Rand ()

t 1

G _ best  x t k

x vk

t1 k t 1

x

t k

(1)

 v

t1 k

t k

(2) th

and v are the velocities of k particle for t+1 and t

iterations respectively. c1 and c2 are positive coefficients of self-recognition and social component respectively with c1  c 2 d 4 [14]. Rand () and rand () are random numbers uniformly distributed in range [0, 1]. The inertia weight factor w was not present in original PSO. It was introduced by Shi and Eberhart and set according to following [15] [16]: § w max  w min · (3)  ¨

iter ¸ w w max

¨ ©

iter

max

¸ ¹

wmax =0.9 and wmin =0.4 are preferably used. iter is the current number of iteration and iter max is maximum number of iterations. After velocity and position update, L_best and G_best particles are also updated with following equations: L_bestk(t+1)=L_bestk(t) if f(L_bestk (t))”f(L_bestk(t+1)) (4) L_bestk (t+1) if f ((L_bestk (t+1)) ”f (L_bestk (t))

2690

where f is the fitness function to be optimized. G_best is given as the minimum of L_best of all the particles. G_best= argmin (L_best) (5) whole process is repeated till iter becomes equal to itermax . G _ best achieved so far would be the optimized result.

D. Bat Algorithm Bat is a recently proposed metaheuristic algorithm. It is inspired from exploration of bats seeking for their food. Bats have fascinating property of echolocation, they send pulses to the environment and then listen to the echoes. On basis of received echoes further decisions are being taken. Bat algorithm is mainly composed of three idealized rules [17]: 1. Echolocation is being used to sense the distance and difference between food/prey and background barriers is known in some mysterious way. 2. Each bat flies randomly with velocity vi at position xi with fixed frequency fmin and loudness A0 to search for prey. Depending on proximity of the targets, bat adjusts the frequency fi and pulse rate ri H [0, 1] of the emitted pulses in an automatic way. 3. It is assumed that loudness varies from a large (positive) A0 to a minimum constant value Amin. Initially all bats fly randomly in the search space with random position, velocity and pulses. After each fly position and velocity of each bat are updated with following equations [17-19]:

f min 

fi vi

t 1

xi

t 1

f max



t

 f min



t

˜ E

vi  xi  x * ˜ fi t

xi  vi

(6) (7)

t

(8) fmax and fmin are maximum and minimum frequencies, ȕ is a random value in range [0, 1] and x* is the global best bat evaluated on the basis of fitness. If the value of ȕ is larger than ri for each iteration, then a new solution around xi is generated [19-21]: xi

new

xi

old

_

 H A t

(9)

_

A t is the average loudness of all the bats and H is a random number in the range [-1, 1]. A0 = 1 and Amin = 0 are used where Amin = 0 shows that a bat has just found the prey and temporarily stops emitting any sound. But if the value of ȕ is lower than ri, then randomly a new solution is generated. This solution is accepted if following condition is satisfied:

(ȕ < Ai) & (f (xi) < f (x*))

(10)

If the solution is accepted then loudness and pulse rate are also updated [20, 21]: (11) Ait 1 D Ait , ri t 1 ri 0 >1  exp(  J t ) @

here D and J are the constants, D = the number of iteration.

J can be used; and t is

E. Proposed Methodology As described in section II, desired tool movement command was given to lathe tool from a personal computer (PC),

2014 International Conference on Advances in Computing,Communications and Informatics (ICACCI)

through a software command window. Before application of error optimization algorithms, the various steps after the lathe tool movement are explained below: 1. Images of lathe tool (before and after the lathe tool movement) were captured.

2. Evaluate fitness of all particles. 3. For each particle, compare the new fitness value with its Local best fitness values and update L_best using (4). 4. Best particle among all the local best particles is searched and termed as Global best (G_best) particle using (5).

2. Contrast-limited adaptive histogram equalization was applied to enhance the contrast of captured grayscale images.

5. Update the velocity and position of all the particles according to (1) and (2).

3. Enhanced images were segmented to isolate the tool (dark region) from the background (bright region) using Otsu's threshold [22].

6. If the current number of iteration is equal to maximum number of iterations, then stop. Current G_best particle is the optimized result. Otherwise go to step 2.

4. Pixel coordinates of reference and tool moved images were extracted using Euclidian distance formula [13, 23] to find out tool movement in pixels: (12) ED ( x 2  x1) 2  ( y 2  y 1) 2 here x1, y1 and x2, y2 are the pixel coordinates of reference and tool moved images.

2. Bat Algorithm for Tool position error optimization

1. Initialize the bats with vision based tool movement as position xi ,random velocity vi , pulse rate ri, loudness Ai and so on. 2. Evaluate objective function values for the population. 3. Find Global best solution x* and store it.

5. Vision based mean movement of tool (in pixels) was calculated as below: k ED i (13) Mean Movement (in pixels) = ¦ k i 1 here ED is the Euclidian distance of image coordinates and k is the total number of Euclidian distances. 6. Image based mean movement of tool (in mm) was determined as: Mean movement (mm) = Mean Movement (pixels) * Conversion factor (0.010152 mm/pixel) (14) 7. Mean error for vision based tool movement was calculated as: Mean Error (mm) = Desired movement- Mean movement (mm) (15) Desired (Expected) movement is the movement of tool given by tool movement command through a software window. Negative mean error indicates movement of tool lower than desired tool movement. 8. Bat and PSO algorithms were applied to optimize this mean error. 1. PSO for Tool position error optimization

1. Initialize the particles of swarm containing maximum number of iterations, size of swarm, inertia weight factor, self-recognition and social component, velocity matrix v(t), vision based movement of tool as position matrix x(t) etc.

4. Update the frequency, position and velocity of all the bats using (6-8). 5. If ȕ in equation (6) is greater than pulse rate then a local solution is generated around selected solution using (9). 6. A new solution is generated by flying randomly. 7. Solution in step 6 is accepted if condition (ȕ < Ai) & (f (xi) < f (x*)) is satisfied. Pulse rate and loudness are also updated using (11). 8. Now the Global best solution is updated. If maximum number of iterations have been reached, then stop the iterations and current Global best solution (x*) is the optimized result, otherwise go to step 4. III.

EXPERIMENTAL RESULTS

The experiment was performed on lathe tool in a light proof chamber. 5 micron was taken as least movement of tool. The developed vision system was showing nominal error for tool movement lower than 0.020 mm and can be neglected. Both optimization algorithms (Bat and PSO) were applied on tool movement for 0.020 mm to 7 mm. Table 1 is showing the desired tool movement, original and threshold images of tool. Table 2 is showing comparison of Bat and PSO algorithms error with mean error for different tool movements. Graphical comparison of Bat and PSO algorithms is shown in figure 1.

2014 International Conference on Advances in Computing,Communications and Informatics (ICACCI)

2691

TABLE 1. Desired Tool movement with original and threshold images of tool Desired(Expected) Movement

Original Image

Threshold Image

Reference 0.10

4.75 5.5 5.75 6 6.25 6.5 6.75 7

-0.2668

0.0025

-0.0012

-0.0392 -0.1596 -0.3830 -0.3227 -0.3511 -0.3796 -0.4081

0.0025 0.0055 0.0130 0.0616 0.0021 -0.0050 -0.0017

-0.0011 -0.0028 -0.0022 -0.0019 0.0004 -0.0013 -0.0010

1.0 4.00 7

TABLE 2. Comparison of mean, Bat and PSO algorithms error for different tool movements Expected Movement (mm)

Mean Error (mm)

PSO Error (mm)

Bat Error (mm)

0.020 0.040 0.060 0.080 0.1 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.25 1.5 1.75 2 2.25 2.5 3 3.25 3.75 4 4.25 4.5

-0.0003 -0.0006 0.0042 0.0039 -0.0015 0.0107 .0193 0.0223 0.0315 0.0300 0.0386 0.0472 0.0660 0.0927 0.1346 0.1714 0.0973 0.1235 0.1556 0.1683 -0.0176

-0.0001 -0.0002 -0.0009

-0.0001 -0.0001 -0.0003 -0.0002 0.0003 -0.0002 -0.0004 -0.0001 -0.0002 -0.0004 -0.0001 0.0006 -0.0003 -0.0001 -0.0002 -0.0010 -0.0030 -0.0027 0.0007 -0.0007 0.0013

2692

0.0002

-0.0004 0.0003 0.0009 -0.0007 0.0010 -0.0005 0.0020 0.0016

-0.0049 0.0013 -0.0018 0.0019 0.0073 0.0064 0.0013 0.0020 -0.0030

Fig. 1. Comparative analysis of tool movement error between PSO and Bat algorithms IV.

In this paper, Bat and PSO algorithms were implemented to optimize the tool position error in the developed machine vision system. Both algorithms were tested for different tool movements. Experimental results confirmed that Bat algorithm performed better than PSO algorithm. Developed machine vision system along with Bat algorithm showed satisfactory results for a number of tool movements. For achieving higher accuracy, hybrid of various swarm and bio inspired techniques is proposed for future work. ACKNOWLEDGMENT This work is supported by the Council of Scientific & Industrial Research (CSIR, India), New Delhi under the Network programme (ESC-0112) in collaboration with CSIRCMERI, Durgapur. Authors would like to thank Director, CSIR-CSIO for his guidance during investigation. REFERENCES [1]

[2]

[3] -0.0997 0.0576 -0.1052 -0.3297

-0.0036 -0.0030

0.0029 0.0027

0.0023 0.0004 -0.0018 -0.0013

CONCLUSION AND FUTURE WORK

L. A. Zadeh, "Fuzzy logic, neural networks, and soft computing," Communications of the ACM, vol. 37, pp. 77-84, 1994. Y. Dote and S. J. Ovaska, "Industrial applications of soft computing: a review," Proceedings of the IEEE, vol. 89, pp. 1243-1265, 2001. M. Dorigo, Ant Colony Optimization and Swarm Intelligence: 5th International Workshop, ANTS 2006, Brussels, Belgium, September 4-7, 2006, Proceedings vol. 4150: Springer, 2006.

2014 International Conference on Advances in Computing,Communications and Informatics (ICACCI)

[4]

[5]

[6]

[7]

[8]

[9]

[10]

[11]

[12]

[13]

[14]

[15]

D. E. Goldberg, Genetic algorithms in search, optimization, and machine learning vol. 412: Addison-wesley Reading Menlo Park, 1989. J. Kennedy and R. Eberhart, "Particle swarm optimization," in Proceedings of IEEE international conference on neural networks, 1995, pp. 1942-1948. S. Kirkpatrick, "Optimization by simulated annealing: Quantitative studies," Journal of statistical physics, vol. 34, pp. 975-986, 1984. N. Yusup, A. M. Zain, and S. Z. M. Hashim, "Evolutionary techniques in optimizing machining parameters: Review and recent applications (2007– 2011)," Expert Systems with Applications, vol. 39, pp. 9909-9927, 2012. M. Chandrasekaran, M. Muralidhar, C. M. Krishna, and U. Dixit, "Application of soft computing techniques in machining performance prediction and optimization: a literature review," The International Journal of Advanced Manufacturing Technology, vol. 46, pp. 445-464, 2010. G. Onwubolu and M. Clerc, "Optimal path for automated drilling operations by a new heuristic approach using particle swarm optimization," International Journal of Production Research, vol. 42, pp. 473-491, 2004. N. Yusup, A. M. Zain, and S. Z. M. Hashim, "Overview of PSO for optimizing process parameters of machining," Procedia Engineering, vol. 29, pp. 914-923, 2012. R. Muangsong, D. Koolpiruck, A. Khantachawana, and P. Niranatlumpong, "A particle swarm optimization approach for optimal design of PID controller for position control using shape memory alloys," in Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology, 2008. ECTI-CON 2008. 5th International Conference on, 2008, pp. 677-680. V. G. Gudise and G. K. Venayagamoorthy, "Comparison of particle swarm optimization and backpropagation as training algorithms for neural networks," in Swarm Intelligence Symposium, 2003. SIS'03. Proceedings of the 2003 IEEE, 2003, pp. 110117. P. K. Mahapatra, Spardha, I. K. Aulakh, A. Kumar, and S. Devi, "Particle Swarm Optimization (PSO) based Tool Position Error Optimization," International Journal of Computer Applications, vol. 72, 2013. M. G. Epitropakis, V. P. Plagianakos, and M. N. Vrahatis, "Evolving cognitive and social experience in Particle Swarm Optimization through Differential Evolution: A hybrid approach," Information Sciences, vol. 216, pp. 50-92, 2012. Y. Shi and R. Eberhart, "A modified particle swarm optimizer," in Evolutionary Computation Proceedings, 1998. IEEE World Congress on

[16]

[17]

[18]

[19]

[20]

[21]

[22]

[23]

Computational Intelligence., The 1998 IEEE International Conference on, 1998, pp. 69-73. Y. Shi and R. C. Eberhart, "Parameter selection in particle swarm optimization," in Evolutionary Programming VII, 1998, pp. 591-600. X. S. Yang and X. He, "Bat algorithm: literature review and applications," International Journal of Bio-Inspired Computation, vol. 5, pp. 141-149, 2013. T. C. Bora, L. d. S. Coelho, and L. Lebensztajn, "Batinspired optimization approach for the brushless DC wheel motor problem," Magnetics, IEEE Transactions on, vol. 48, pp. 947-950, 2012. H. Chen, "A novel bat algorithm based on differential operator and Lévy flights trajectory," Computational intelligence and neuroscience, vol. 2013, 2013. X.-S. Yang, "A new metaheuristic bat-inspired algorithm," in Nature inspired cooperative strategies for optimization (NICSO 2010), ed: Springer, 2010, pp. 65-74. X.-S. Yang, "Bat algorithm for multi-objective optimisation," International Journal of Bio-Inspired Computation, vol. 3, pp. 267-274, 2011. N. Otsu, "A threshold selection method from graylevel histograms," Automatica, vol. 11, pp. 23-27, 1975. F. Y. Shih and Y.-T. Wu, "Fast Euclidean distance transformation in two scans using a 3× 3 neighborhood," Computer Vision and Image Understanding, vol. 93, pp. 195-205, 2004.

2014 International Conference on Advances in Computing,Communications and Informatics (ICACCI)

2693

Suggest Documents