2017 3rd International Conference on Computer Science and Mechanical Automation (CSMA 2017) ISBN: 978-1-60595-506-3
Trajectory Optimization of Pneumatic Marking Needle
Based on Genetic Algorithm
Xiao-Ping YANG
a, Zhong-Hua LV
b, Hong-Jiang LING
cand Xuan-Pu DONG
*State Key Laboratory of Materials Processing and Die & Mould Technology, School of Materials Science and Engineering,
Huazhong University of Science and Technology, Wuhan 430074, China
a
[email protected], [email protected], [email protected]
Keywords: Pneumatic marking machine, Trajectory optimization, Simulation, Genetic algorithm.
Abstract. Due to the ability to print all types of characters and patterns on the surface of metal parts or components, pneumatic marking machine is widely used in machinery, automobile, aerospace and other fields. For reducing equipment wear and extending equipment life, reducing the printing time as well as printing distance are the key points. In this paper, path optimization objective function model is established which refers to the TSP model. And the genetic operations such as genetic coding, fitness function, selection operator, crossover operator and mutation operator are described. The simulation results show that the optimization of the pneumatic marking path by using genetic algorithm can significantly improve the marking efficiency.
Introduction
In modern industrial production, in order to identify products in a timely and accurate manner, the manufacturer often needs to mark signs or symbols on the products. Currently, the common marking methods are manual marking technology, two-dimensional code technology, RFID (Radio Frequently Identification) technology, laser marking technology and pneumatic marking technology. Pneumatic marking technology has the following characteristics: anti-interference ability, available in harsh environment; using gas as power source, low production costs, pollution-free [1, 2]; and can be mainly used for metal parts in special requirements of the pipeline operating occasions. Traditional handmade industrial labels are provided with low printing efficiency, unsightly, poor stability, and high scrap rate [3].
Considering of energy saving and efficiency, users want to not only print the characters in time but also minimize the running time of the marking machine to reduce the equipment wear and extend its lifetime. So the question is how to effectively sort the print order by using the minimum time and the shortest marking distance.
According to the above analysis, this paper applies genetic algorithm based on the TSPmodel to optimize the pneumatic marking needle path.
Mathematical Model of Marking Path Optimization
Print path optimization plays a vital role in printing process, efficient path optimization algorithm can optimize print needle movement trajectory, improve processing efficiency[15].
Assuming the speed of marking needle in x-axis direction isvx, and in the y-axis direction isvy.
The process of marking needle switch from point s(i xi,yi)to point sj(xj,yj)is: when it moves from
i x x= to
j
x
x= in the x-axis direction, it moves from
i y y= to
j
y
y= in the y-axis direction at the same
time.
As a stable gas pressure is provided, the marking needle sends the needle and retracts the needle take the same time t0each time. If the marking needle prints the points of the dot matrix geometry S
takes a period ofT0, whichT0=t0×(p1+ p2+...pn), 0
t is a constant value, and 1= 2=...= =1
n p p
p .
According to the above analysis, T0is a constant value, which is determined by the time of marking
a point required and the number of punctuation points.
After all the points in the matrix set S are printed, the marking needle will return to the reset position and then return to the initial position of the marking point. Since the combination of the needle reset position (xR,yR)and the initial position (x0,y0)does not affect the operation of the entire
system, and it can reduce the movement distance of the marking needle. The resetting time =0
R T
when(xR,yR)=(x0,y0), meanwhile the resetting distancedR=0.
The analysis of trajectory optimization based on the minimum time are as follows: the sum of the switching time of all the points in the set of markings S is assumedTsum, andTsum=T0+TR+TC,whichTC
is the total marking switching time,T0andTRare constant values. The optimization target is the
optimization of the switching time.
Above all, the trajectory optimization of the marking machine can be described as following: The points in the set of S are
{
s1(x1,y1),s2(x2,y2),...,sn(xn,yn)}
. The marking needle prints the above pointsfrom the initial position and finally returns to the initial position, requiring the design of the print trajectory route, so that the total print target function (time target, distance target) can achieve the minimum value, namely the track optimization.
According to Ref [8], the concept of time distance is referred: the pneumatic marking machine can run at maximum speed in the x and y axis direction, so the marking time depends on the distance from the point to another point called the time distance. That can be summed up the marking needle moves the shortest distance, i.e.at the same speed, marking time spend the shortest. So the shortest time distance function mentioned below still represents the shortest distance model. Assuming the pneumatic marking programming origin iss0=(x0,y0), the shortest time distance function is shown in
Eq.1 and Eq.2:
∑ = ∑ = = n i n j ij l ij d D in M 0 0 ) .
( (1)
= ∑ = = = ∑ = = = = | j y -i y | |, j x -i x | max ij d n i n j ij l n j n i ij l j i arc the through needle marking he T arc the through go t doesn' needle marking The ij l s.t 0 ,..., 1 , 0 , 1 0 ,..., 1 , 0 , 1 , 1
0, (,)
(2)
Where: n is the number of marked characters, (xi,yi)is the coordinate of the marking pointi. Here
The analysis of Trajectory Optimization Using Genetic Algorithm and Other Examples The Matrix Coordinates Extraction and Traditional Printing Methods Introduction
An example of the group calibration point in the system of pneumatic marking machine is shown in Fig.1:
Assume the distance between the close two points in the coordinate system is 1 mm. the origin of the coordinates is (32, 20), and the lower left corner of the small square is determined as the coordinate point.
After inputting the characters, the character generator will generate the file according to the order of the input points, the coordinates of each point are shown in Table 1:
[image:3.612.175.439.232.443.2]Based on the traditional line scanning methods, the target time distance is 225mm to print all the “TPCO” characters.
[image:3.612.87.531.488.657.2]Figure 1.: The map in the X0Y axis position.
Table 1. Coordinate values in the file.
No. (x, y) No. (x, y) No. (x, y) No. (x, y) No. (x, y)
1 (3,11) 12 (20,11) 23 (5,9) 34 (11,8) 45 (17,6)
2 (4,11) 13 (25,11) 24 (10,9) 35 (10,8) 46 (10,6)
3 (5,11) 14 (26,11) 25 (14,9) 36 (5,8) 47 (5,6)
4 (6,11) 15 (27,11) 26 (17,9) 37 (5,7) 48 (5,5)
5 (7,11) 16 (28,10) 27 (24,9) 38 (10,7) 49 (10,5)
6 (10,11) 17 (24,10) 28 (28,9) 39 (17,7) 50 (18,5)
7 (11,11) 18 (21,10) 29 (28,8) 40 (24,7) 51 (19,5)
8 (12,11) 19 (17,10) 30 (24,8) 41 (28,7) 52 (20,5)
9 (13,11) 20 (14,10) 31 (17,8) 42 (28,6) 53 (25,5)
10 (18,11) 21 (10,10) 32 (13,8) 43 (24,6) 54 (26,5)
11 (19,11) 22 (5,10) 33 (12,8) 44 (21,6) 55 (27,5)
Trajectory Analysis of Marker Path based on Genetic Algorithm
fitness function takes the reciprocal of the objective function, i.e.F=1/D.
Encoding usually includes binary coding, real number coding, symbol encoding, etc. This paper uses real coding, because the real number of coding is suitable for the global space search. In addition, the accuracy is higher than others. The difference between the real number coding and binary code is that the binary code is for genes or chromosomes, while the real number is encoded for the entire individual [4].
The selection operator uses a fitness proportional method in which the selection probability of each individual is proportional to the value of its fitness. The mathematical model is described as following: the population size isn, where the individual isi, whose fitness value isfi, then the
probability of ibeing selected is shown in Eq.3:
∑
=
=
n
i i i si f f
P
1
/
(3)
ProbabilityPsireflects the proportion of individual fitness in the overall fitness of the whole group.
The crossover operator randomly selects a pair of individuals from the new population and intersects randomly at a certain crossover probability. Firstly, randomly selects the intersection point, and then exchanges the partial genes of two individuals. The cross points are chosen between two different gene values of the loci, which can ensure that new individuals generate after crossing.
Mutation operator plays a dual role in the genetic algorithm. On the one hand, it provides and maintains the diversity in the population so that other operators can continue to work; on the other hand, it can also act as a search operator [17].
[image:4.612.105.503.434.642.2]Genetic algorithm parameter setting: population size is 1000, the crossover probability is 0.9, the mutation probability is 0.2. The termination condition is the maximum algebra of 600 generations or the difference between the average fitness value of the group and the optimal individual fitness is less than a small threshold. The Simulation results in Matlab using genetic algorithm are shown in Fig.2 and Fig.3:
Figure 3. The result of Genetic algorithm operation.
Assume the starting point in the genetic algorithm as the first point, the print number of points shouldminus 1, the order is as follows: starting point-14-13-17-27-18-12-11-10-19-26-2 0-9-8-7-6-21-24-5-4-3-2-1-22-23-36-37-47-48-49-46-38-35-34-33-32-25-31- 39-45-50-51-52-44-30 -40-43-53-54-55-42-41-29-28-16-15-starting point.
The objective function value is 89mm.
The Introduction of Trajectory Optimization Using Minimum Spanning Tree Method
[image:5.612.185.426.439.657.2]The method with minimum spanning tree used to trajectory optimization in Ref [18] is shown in Fig.4:
Figure 4. The track diagram in [18].
The order of printing is: starting point-15-14-13-17-27-30-40-43-53-54-55-42-41-29- 28-17-1 8-12-11-10-19-26-31-39-45-50-51-52-44-49-46-38-35-24-21-6-7-8-9-20-25-32-33-34-48-47-37- 36 -23-22-3-2-1-4-5-starting point.
The Introduction of the Current Commercial Markingequipmenttrajectory
The current trajectory of commercial marking equipment is shown in Fig.5:
Figure 5. The track diagram of commercial marking equipment.
The order of printing is: starting point-43-40-30-27-17-13-14-15-16-28-29-41-42-55-54- 53-4 3-44-52-51-50-45-39-31-26-19-10-11-12-18-34-33-32-25-20-9-8-7-6-21-24-35-38-46-49-48-47-37-36-23-22-3-2-1-4-5-starting point.
The calculated axial distance is 111mm.
Comparison of the Marking Trajectory Results
[image:6.612.184.430.119.331.2]The comparison results are shown in table 2.
Table 2. Comparison of results.
Comparison of algorithms Value_(mm) The number of steps saves compared to traditional progressive printing _(%)
Genetic algorithm 89 60.4
The minimum spanning tree method reported in [18]
111 50.7
Currently commercial printing
111 50.7
Conclusion
1) This paper compares the pneumatic marking machine printing to with the typical TSP traveling salesman problem, and establishes the mathematical model of path optimization in the shortest time distance.
References
[1] Zhou Yang-sheng, Tang Yi-ke, Yang Peng. Design of Portable Pneumatic Marking Machine Based on Single Chip Microcomputer [J]. Process Equipment.2009.
[2] Liu Xiao-ming, Zhao Yi, Han Shu. Design of Portable Industrial Pneumatic Marking Machine [J].China new communication.2010.05.
[3] Lu Jian-ping, Li Xiao-ning, Sun Jing. Development of Control System for Automatic Pneumatic Marking Machine [J]. China Manufacturing Information.2007.10.
[4] Wang Na, Solving TSP Problems Using an Improved Genetic Algorithm [D]. Northeast Normal University.2010.
[5] Liu Ning-zhong, Yang Jing-yu. Comparison and Analyse between Genetic Algorithm and Hopfield Network to Resolve TSP [J]. Computer Engineering and Applications. 2003, 39(4):95-97.
[6] Guo Wei-zeng. Optimization of Cutting Path Based on Genetic Algorithm [J]. Journal of Southwest Jiaotong University, 2005, 40(4):457-461.
[7] Liu Ling, Zhu Jian-rong, The Research of Optimizing Physical Distribution Routing Based on Genetic Algorithm [J].Computer Engineering and Applications, 2005, 41(27):227-229.
[8] Wang Yue-dong, LI Wei, Yang Wei-bo. Adaptive Genetic Algorithm for Solving GTSP Problem [J]. Computer Engineering and Application. 2011, 47 (27): 52-54.
[9] Ming Ping-song, Liu Jian-chang. Stochastic Multi-agent System Stability Summary [J]. Control and Decision.2016, 31 (3): 385-393.
[10]Achanta R, Shaji A, Smith K, et al. SLIC Superpixels Compared toState-of-the-art Superpixel Methods[J].IEEE Transactions on Pattern Analysis and Machine Intelligence. 2012, 34(11): 2274-2281.
[11]Zhou Yong, Gan Xin-nian, Hu Guang-bo, et al. Design of Multi-channel Control Weighted Algorithm for Torpedo Guidance Control System [J]. Modern Electronics Technology. 2014, 37 (19): 14-17.
[12]Xu Wei-min, Xu Pan. Robust Adaptive Sliding Mode Simultaneous Coordination Control of Double Lifting Brackets with Uncertain Perturbations [J]. Control & Decision.2016, 31 (7): 1192-1198.
[13]Zhao Shi-lei, Guo Hong, Liu Yu-peng. Fault-tolerant Control of Linear time-delay Systems Based on Trajectory Tracking [J]. Information and Control. 2015, 44 (4): 469-473.
[14]Zhao Zhen-yong, Wang Li, Wang Bao-hua et al. Study on Improvement Strategy of Genetic Agorithm [J]. Journal of Computer Applications.2006, 26 (12): 189-191.
[15]Shao Lei, Zuo Hai-Bin, Liu Nan, "GA Algorithm Implementation Path Optimization of Pneumatic Marking System", "Technologies of Mechanical Engineering Industry ICAME 2013", August, 2013.
[16]Wang Zi-bing. Study on Optimization of Milling Parameters of NC Machining Based on Improved Genetic Algorithm [J]. Modern Industrial Economics and Informatization.2017.03.
[17]Gao Wei-zeng, Zhang Bao-jian et al. Optimization of Cutting Path Based on Genetic Algorithm [J]. Journal of Xi'an Jiaotong University.2005.