Genetic algorithm based defect identification system

Genetic algorithm based defect identification system

Expert Systems with Applications PERGAMON Expert Systems with Applications 18 (2000) 17–25 www.elsevier.com/locate/eswa Genetic algorithm based defe...

136KB Sizes 0 Downloads 70 Views

Expert Systems with Applications PERGAMON

Expert Systems with Applications 18 (2000) 17–25 www.elsevier.com/locate/eswa

Genetic algorithm based defect identification system S.M. Tam*, K.C. Cheung Department of Mechanical Engineering, University of Hong Kong, Pokfulam Road, Hong Kong, People’s Republic of China

Abstract In this paper we develop a genetic algorithm based defect identification system for machined-parts inspection purposes. The system is based on genetic algorithm and knowledge system techniques. q 2000 Elsevier Science Ltd. All rights reserved. Keywords: Genetic algorithm; Inertial properties; Sensor

1. Introduction

2. Brief review of genetic algorithms

Parts inspection is usually required to ensure that a part is machined according to its specification. It often involves measuring various physical attributes of the part and comparing the measured values against those specified. Generally, a defective part will have a different mass as well as a different location of center of mass compared with a good part (Tam & Cheung, 1995), irrespective of the defect. Therefore, the authors developed a sensor to determine the location of the center of mass and the mass of a given part. Since the location of the center of mass and the mass of a defective part are different from those of a good part, the information obtained from the sensor can be used to distinguish defective parts from good ones. Simply identifying defective parts is often not sufficient for an inspection system (Aggarwal & Doiron, 1993; Babcock, 1991; Besl, 1989; Deriche & Faugeras, 1990; Ley, Klicker & Scheffe, 1993; Rowa, 1992). Certain defects can be remedied by re-working. For example, a hole too small can be redrilled to the correct diameter. Other defects may render the part unusable. For instance, there is no way to salvage a part that has holes drilled too big. It is therefore desirable to use the measured location of center of mass and the mass of a defective part to suggest possible defects. This paper mainly reports on the development of a genetic algorithm based defect identification system that uses the measured values to find the possible defects of a defective part.

I. Rechenberg introduced idea of evolutionary computing in the 1960s in his work “Evolution strategies” (Evolutionsstrategie in original). Genetic algorithms (GAs), a part of evolutionary computing, were invented by John Holland and developed by him and his students and colleagues (Holland, 1975). In 1992 John Koza has used genetic algorithm to evolve programs to perform certain tasks. He called his method “genetic programming” (GP). Genetic algorithms are inspired by Darwin’s theory about evolution. Solution to a problem solved by genetic algorithms is evolved. Algorithm is started with a set of solutions (represented by chromosomes) called population. Solutions from one population are taken and used to form a new population. This is motivated by a hope, that the new population will be better than the old one. Solutions which are selected to form new solutions (offspring) are selected according to their fitness—the more suitable they are the more chances they have to reproduce. Outline of the basic genetic algorithm

* Corresponding author. Tel.: 1852-2859-2824; Fax: 1852-2858-5415. E-mail address: [email protected] (S.M. Tam) 0957-4174/00/$ - see front matter q 2000 Elsevier Science Ltd. All rights reserved. PII: S0957-417 4(99)00046-9

Step 1. Generate random population of n chromosomes (suitable solutions for the problem). Step 2. Evaluate the fitness f …x† of each chromosome x in the population. Step 3. Create a new population by repeating the selection, crossover, and mutation until the new population is complete. Step 4. Use new generated population for a further run of algorithm. Step 5. If the end condition is satisfied, stop, and return the best solution in current population. Step 6. Go to step 2.

18

S.M. Tam, K.C. Cheung / Expert Systems with Applications 18 (2000) 17–25

Nomenclature Xg ; Yg ; Zg , the distances between the center of mass of the part and the center of the sensor platform along the x-, y- and zdirections, respectively m mass of part X g ; Y g ; Z g ; the coordinates of the center of mass of the part calculated from the dimensions contained in chromosome m the mass of the part calculated from the dimensions contained in chromosome 3. The inertial sensor The inertial sensor can convert the mass and the location of the center of mass of the object placed on its platform into static deflections of the sensor column and natural frequencies of vibration of the sensor. Being accurate, inexpensive and easy to install, strain gauges have been selected as the primary sensing elements. They are connected into two Wheatstone bridges and mounted on the sensor column as Fig. 1. The Wheatstone bridges are capable of measuring the deflections of the sensor column in the x–z and y–z planes when a part is placed on the sensor platform. In order to measure the natural frequencies of vibration of the sensor column in the x–z and y–z planes, a solenoid actuated bolt is used to deliver a horizontal impact on the sensor platform. The strain gauges then pick up the vibration of the sensor column. The operation of the inertial sensor can be summarized by the following three steps: Step 1. Measure the static deflections of the sensor column in the x–z and y–z planes after a part is placed on the sensor platform at a fixed position and orientation. Step 2. Energize the solenoid actuated bolt to deliver an impact to the sensor platform. Step 3. Measure the natural frequencies of vibration of the sensor column after the sensor has been set into free vibration. The proposed sensor was developed as shown in Fig. 2. It consists of six components: power supply, solenoid, sensor

body, signal measurement and conditioning system, interface system and PC. The block diagram of the measurement hardware is shown in Fig. 3. Results of measurement show that the sensor can accurately determine the mass and the location of the center of mass of an object placed on it. Furthermore, the effects of the small differences in the dimensions of the test pieces are reflected in the measured values of Xg ; Yg ; Zg and m. This indicates that the measured values of Xg ; Yg ; Zg and m can be used to determine whether the part contains any machining defects. But identifying defective parts is often not sufficient for an inspection system. A genetic algorithm based defect identification system is therefore developed.

4. Genetic algorithm based defect identification system A part is considered as defective if the measured mass and/or the measured location of the center of mass differ from those of a standard part. The dimensions of the part and its machined features affect the mass and the location of the center of mass of a part. For example, a vertical hole that is drilled too big will cause a decrease in the mass and a shift of the x- and y-coordinates of the center of mass. The zcoordinate of the center of mass, however, is not affected. The mass and the coordinates of the center of mass can be expressed in terms of the dimensions of the part. The objective of the system is to find suitable combinations of the dimensions of the part that produce the measured values of the mass and the coordinates of the center of mass. These dimensions are then compared with those of a

Fig. 1. The schematic view of proposed sensor body and the mounting of strain gauges.

S.M. Tam, K.C. Cheung / Expert Systems with Applications 18 (2000) 17–25

Fig. 2. The photograph of the sensor.

standard part to find out the nature and the magnitudes of the defects.

4.1. Genetic algorithm search Genetic algorithm (GA) is a directed random search and optimization technique modeled on natural evolution. The GA employs the operators that inspire the natural evolution process. These operators manipulate individuals over several generations to improve their fitness gradually. In the defect identification system, individuals in a population are likened to chromosomes represented by a string of real numbers.

signal measurement system

sensor body and two Wheatstone bridges

4.1.1. Representation The string of real numbers in a chromosome denotes one particular combination of the dimensions of a part. For example, the part shown in Fig. 4 is a rectangular block with six drilled holes and a milled slot. This part can be completely described by the following 33 dimensions: 1. length, 2. width, 3. height, 4. length of slot, 5. width of slot, 6. depth of slot, 7. x-coordinate of center of slot, 8. y-coordinate of center of slot, 9. z-coordinate of center of slot, 10. diameter of hole 1, 11. depth of hole 1, 12. x-coordinate of center of hole 1, 13. y-coordinate of center of hole 2, 14. diameter of hole 2, 15. depth of hole 2, 16. x-coordinate of center of hole 2, 17. y-coordinate of center of hole 2, 18. diameter of hole 3, 19. depth of hole 3, 20. x-coordinate of center of hole 3, 21. y-coordinate of center of hole 3, 22. diameter of hole 4, 23. depth of hole 4, 24. x-coordinate of center of hole 4, 25. y-coordinate of center of hole 4, 26. diameter of hole 5, 27. depth of hole 5, 28. x-coordinate of center of hole 5, 29. y-coordinate of center of hole 5, 30. diameter of hole 6, 31. depth of hole 6, 32. x-coordinate of center of hole 6, 33. y-coordinate of center of hole 6. Each chromosome contains 33 elements to represent the dimensions of the part. An example of the chromosome is shown below:

Length

Width

Height

Length of slot

Width of slot

Depth of slot

60

40

25

60

10

5

signal conditioning system

amplifiers

19

low pass filter

Interface system

driver

Power supply

Fig. 3. Block diagram of measurement hardware.

PC

20

S.M. Tam, K.C. Cheung / Expert Systems with Applications 18 (2000) 17–25

x-Coordinate of center point of slot

y-Coordinate of center point of slot

z-Coordinate of center point of slot

Diameter of hole A

Depth of hole A

x-Coordinate of center of hole A

5.0

2.0

22.5

8.0

25

20

y-Coordinate of center of hole A

Diameter of hole B

22

8.0

It should be noted that the number of dimensions required to describe a part depends on the actual design. Therefore the length of a chromosome varies from one design to another. 4.1.2. Creation of initial population At the start of the search, the GA requires a group of initial solutions. Since no a priori knowledge exists for the actual defect, 800 randomly produced solutions created by a random number generator are used as the initial population. The value of each element is equal to the standard dimension plus a number randomly selected from 23 to 13. For example, the standard diameter of the drilled holes is 8 mm, therefore elements 10, 14, 18, 22, 26 and 30 can have any value between 5 and 11 mm. Note that the range of 23 to 13 can be varied for parts of different design. 4.1.3. Genetic operators Three genetic operators, selection, crossover, and mutation are used in this search algorithm. 4.1.3.1. Selection According to Darwin’s evolution theory the best ones should survive and create new offspring. There are many methods on how to select the best chromosomes, for example roulette wheel selection, Boltzman selection, tournament selection, rank selection, steady state selection



y-Coordinate of center of hole F 22.0

and some others. Roulette Wheel selection method had been used to select the best chromosomes in this research. The existing individuals (parents) are selected according to their fitness. The better the chromosomes are, the more chances they have to be selected. The aim of the selection procedure is to reproduce more of individuals whose fitness values are higher than those whose fitness values are low. This process drives the search towards a promising area.

4.1.3.2. Crossover Crossover is used to create two new individuals (children) from two existing individuals (parents) picked from the current population. Both onepoint and two-point crossover techniques are used in the search process. In one-point crossover, two individuals are randomly selected as parents from the pool of individuals and cut at a randomly selected point. The tails, which are the parts after the cutting point, are swapped and two new individuals are formed. Fig. 5(a) shows an example of this operation. In two-point crossover, two individuals are randomly selected as parents from the pool of individuals and a point is randomly selected. The elements at the selected point of each selected individual are swapped to form two new individuals. An example of two-point crossover is shown in Fig. 5(b). The

Fig. 4. Dimensions of a part machined out of mild steel.

S.M. Tam, K.C. Cheung / Expert Systems with Applications 18 (2000) 17–25

2.4 2.3 1.2 4.5

2.4 5.5 1.2 4.5 6.4 7.1

6.7 3.2

21

==>

2.4 7.1 1.2 4.5 6.4 5.5

Fig. 6. One-point mutation method.

2.1 3.4 9.6 4.5

7.2 6.8

(a)

2.4 3.6

7.2 5.4 3.1

2.4 3.6 2.8 7.2 5.4 3.1

example, if element 3 is greater than the standard value by 2, that means the defective part is 2 mm taller than standard. The nature and the magnitude of the defect, together with the associated coordinates of the center of mass and the mass, will be stored in the knowledge base. An example of the information stored is shown below:

4.3 = 2.8 2.1 2.7

5.9 6.3 1.2

2.1 2.7 4.3 5.9 6.3 1.2

Xg

Yg

Zg

m

Defect details

4.737

1.929

12.688

419.81

The part is 2 mm taller than standard

(b) Fig. 5. (a) One-point crossover method. (b) Two-point crossover method.

one-point crossover rate is 2% and the two-point crossover rate is 3%. 4.1.3.3. Mutation Mutation operates on one individual at a time. An individual is selected randomly from the pool of individuals. Two elements of the chromosome are chosen at random and their values are swapped. This process forces the algorithm to search new areas. An example of the mutation operation is shown in Fig. 6. The mutation rate is 1%. 4.1.4. Fitness evaluation For each set of dimensions represented by a chromosome, the values of Xg ; Yg ; Zg and m are calculated. The objective of the search is to minimize the difference between the calculated and the measured values of Xg ; Yg ; Zg and m. A fitness evaluation function is defined as:

If more than one difference exist within the dimensions contained in a chromosome, the defect will be recorded in the knowledge base as: Xg

Yg

Zg

m

Defect details

Conjunction

4.000

1.10

11.928

342.297

and

4.000

1.10

11.298

342.297

The part is 2 mm narrower than standard The part is 2 mm shorter than standard

If more than one chromosome produce the same calculated values of X g ; Y g ; Z g and m; that means the measured mass and location of center of mass can be caused by more than one defect. Therefore, the information will be stored as: Xg

Yg

Zg

m

Defect details

Conjunction

fp ˆ 10 2 {9…Xg 2 X g †2 1 9…Yg 2 Y g †2

4.79

2.03

12.67

406.2

or

1 9…Zg 2 Z g † 1 1…m 2 m†2 }

4.79

2.03

12.67

406.2

The part is 2 mm taller than standard The slot is 2 mm shallower than standard

where (Xg ; Yg ; Zg ) and m are the measured coordinates of the center of mass and the mass of the part, and (X g ; Y g ; Z g ) and m are the coordinates of the center of mass and the mass of the part calculated from the dimensions contained in chromosome p. The coefficients 9 and 1 are chosen after considering the relative magnitudes of Xg ; Yg ; Zg and m. 4.1.5. Defect extraction After the fitness values for all the chromosomes have been calculated, those chromosomes with fitness values better than 9.99999 are considered as containing dimensions that closely match those of the defective part. The dimensions contained within those chromosomes will be compared against those of a standard part. The differences represent the nature and magnitude of the defect. For

4.2. Knowledge base The defects found by genetic algorithm search are cumulatively stored in the knowledge base. The information stored is in the form described in Section 4.1. With continued use of the genetic algorithm search, the knowledge contained within the knowledge base will grow. 4.3. Defect identification process After a part has been identified as defective, its mass and coordinates of center of mass will be used as “keys” to search for matching values in the knowledge base. For each record, the percentage differences between the values

22

S.M. Tam, K.C. Cheung / Expert Systems with Applications 18 (2000) 17–25

Start

Search knowledge base for matching records

No

Yes

matching records found ?

print print ofof details details ofofdefects defects

Create initial population

Create initial population

No

No

Evaluation

Evaluation

Selection

Selection

Crossover

Crossover

Mutation

Mutation

Any chromosomes whose fitness values ≥ 9.99999

No. of generations

Yes

No

Any chromosomes whose fitness values ≥ 9.99999

Yes

Extract defect

Extract defect

Store defects in knowledge base

Store defects in knowledge base

No. of generations

≥ 30 ? Yes

Yes

End

Fig. 7. Flowchart of the defect identification process.

≥ 10 ?

No

S.M. Tam, K.C. Cheung / Expert Systems with Applications 18 (2000) 17–25

of the mass and the coordinates of center of mass stored in that record and those of the defective part are calculated. If each of the differences is less than 5%, then the defects contained within that record will be taken as the defects that the defective part has. After finding matching records in the knowledge base, the genetic algorithm search will be used to find other defects that produce the measured mass and coordinates of center of mass. To save the time used in the search, the number of generations is limited to 10. Defects found by this search will be stored in the knowledge base. If no matching records can be found in the knowledge base, the genetic algorithm search will be used for 30 generations. Fig. 7 shows a flowchart of this defect identification process.

5. Identification results In order to test the accuracy of the system, four specimens have been manufactured. The shapes and dimensions are

23

shown in Fig. 8(a)–(d). Compared with specimen 1-00, specimen 1-01 is wider by 2 mm, specimen 1-02 is taller by 2 mm, and specimen 1-03 is both narrower and shorter by 2 mm. Specimens 1-00, 1-01, 1-02 and 1-03 were placed on the sensor platform at a fixed position, respectively. The measurement process for each specimen was repeated ten times. For each specimen, ten measurements have been taken and the measured values are presented to the genetic algorithm based defect identification system. Tables 1–4 list the measured values of Xg ; Yg ; Zg and m, and the results of identification. For specimen 1-00, all of the ten measurements, the system could not find any defects. This is expected as specimen 1-00 is considered as a good part. For specimen 1-01, the system correctly identified the defect as 2 mm wider than standard for the measurements numbered 1–9. Specimen 1-02, it is 2 mm taller than standard, for nine out of the ten measurements, the system correctly identified this defect. For measurement number 8, the system

(a)

(b)

(c)

(d) Fig. 8. The four specimens: (a) 1-00; (b) 1-01; (c) 1-02; and (d) 1-03.

24

S.M. Tam, K.C. Cheung / Expert Systems with Applications 18 (2000) 17–25

Table 1 The identification results of specimen 1-00 (C0 : no defect identified by the system) Measurement no.

Measured Xg (mm)

Measured Yg (mm)

Measured Zg (mm)

Measured m

Actual defects

Genetic algorithm based defect identification system

1 2 3 4 5 6 7 8 9 10

4.9 5.196 5.306 5.1882 4.7098 5.1465 5.14 5.23897 5.1182 5.173425

1.86 2.29 2.0956 1.9359 1.82564 1.8138 2.08 2.25 2.1546 2.178

12.26067 12.172 12.28 11.819 12.07 12.37 12.631 12.355 11.972 12.136

370.292 380.3 377.57 403.8158 382.74 375.633 369.739 375.9 384.7 381.02

C0 C0 C0 C0 C0 C0 C0 C0 C0 C0

C0 C0 C0 C0 C0 C0 C0 C0 C0 C0

Table 2 The identification results of specimen 1-01 (C1 : the width of a part is wider than specification by 2 mm; U : the defect cannot be identified or incorrect identification) Measurement no.

Measured Xg (mm)

Measured Yg (mm)

Measured Zg (mm)

Measured m

Actual defects

Genetic algorithm based defect identification system

1 2 3 4 5 6 7 8 9 10

4.6379 4.8523 4.7766 5.1213 5.2638 5.2045 5.1180 4.8082 5.2239 4.7411

3.2526 2.8067 2.8426 3.1397 3.0979 3.1725 3.2396 2.8036 3.1534 2.6569

12.317 11.799 11.6314 12.346 12.2164 12.1824 11.8269 11.5496 11.7821 12.2376

391.2312 419.2651 414.4431 391.1648 394.4758 401.2399 397.0322 416.1567 413.2573 414.2801

C1 C1 C1 C1 C1 C1 C1 C1 C1 C1

C1 C1 C1 C1 C1 C1 C1 C1 C1 U

Table 3 The identification results of specimen 1-02 (C2 : the height of a part is taller than standard by 2 mm; C3 : the height of a part is taller than standard by 1.5 mm) Measurement no.

Measured Xg (mm)

Measured Yg (mm)

Measured Zg (mm)

Measured m

Actual defects

Genetic algorithm based defect identification system

1 2 3 4 5 6 7 8 9 10

4.7371 5.1421 5.1310 4.7156 5.0954 5.1854 5.1623 5.1985 4.9312 4.7992

1.9289 1.9904 1.9263 1.9068 1.9280 2.0217 2.1424 9.9115 1.9671 2.0332

12.6877 13.1566 12.6431 13.0572 12.9091 12.6525 12.6838 12.4852 12.9047 12.6729

419.8112 406.4669 421.4826 401.2634 412.2877 418.7319 406.8798 402.0712 424.8465 406.175

C2 C2 C2 C2 C2 C2 C2 C2 C2 C2

C2 C2 C2 C2 C2 C2 C2 C3 C2 C2

identified the defect as 1.5 mm taller than standard. In fact, the nature of the defect has been correctly identified, only that the magnitude of it is slightly inaccurate. Specimen 1-03 contains two defects: it is both narrower and shorter than standard by 2 mm. The system was able to identify these two defects in all of the ten measurements.

6. Conclusion A new knowledge system technique has been proposed. The knowledge acquisition can be based on the use of genetic algorithm. Based on this technique, a genetic algorithm based defect identification system is developed. It can

S.M. Tam, K.C. Cheung / Expert Systems with Applications 18 (2000) 17–25

25

Table 4 The identification results of specimen 1-03 (C4 : the width of a part is narrower than standard by 2 mm and the length of a part is shorter than standard by 2 mm) Measurement no.

Measured Xg (mm)

Measured Yg (mm)

Measured Zg (mm)

Measured m

Actual defects

Genetic algorithm based defect identification system

1 2 3 4 5 6 7 8 9 10

4.0000 4.1200 3.9900 4.1330 4.0360 4.0763 3.7462 4.0627 4.0675 3.9308

1.0096 1.1957 1.0616 1.0646 1.1947 1.1248 1.0195 0.8644 1.0593 1.3018

11.9276 12.1939 12.1143 11.8541 11.9066 11.9309 11.7817 11.6966 11.7712 11.7234

342.2970 337.7108 355.5307 342.0059 340.7042 340.3401 343.3360 345.1187 343.6409 344.1298

C4 C4 C4 C4 C4 C4 C4 C4 C4 C4

C4 C4 C4 C4 C4 C4 C4 C4 C4 C4

identify defects from the mass and coordinates of center of mass of a defective part. This method uses genetic algorithm search to find combinations of dimensions that produce the same mass and coordinates of center of mass as the defective part. There is also a knowledge base to store defects that have been identified previously. When tried with measurement results obtained from a good part, the system did not suggest any defects. For measurement results from defective parts, apart from two cases out of a total of 30, the system correctly identified the defects. Test results also indicate that the system can identify multiple defects. The time taken to identify a defect varies between 4 and 10 s. The parts inspection system (the combination of inertial sensor and genetic algorithm based defect identification system) reported in this paper that has the following advantages over other parts inspection methods such as coordinate measuring machines (CMMs) and visually based systems. Firstly, the decision on whether the part under inspection is defective or not depends only on the mass and the location of the center of mass of the part. Internal defects such as voids can therefore be detected. Secondly, only inertial properties are used to determine the mass and the location of the center of mass of the part under inspection. The measurement process is not affected by environmental factors such as presence of fumes and dusts. Unlike visually based inspection systems, structured lighting is not required.

Acknowledgements The authors would like to express appreciation for the financial support given by the Department of Mechanical Engineering, University of Hong Kong.

References Aggarwal, N., & Doiron, T. D. (1993). Vision system for dial gage torque wrench calibration. In S. S. Breidenthal & A. A. Desrochers (Eds.), Vision, sensors, and control for automated manufacturing systems, (pp. 77–85). Proc. SPIE, 2063. Babcock, D. L. (1991). Managing engineering and technology, (pp. 20). Englewood Cliffs, NJ: Prentice Hall. Besl, P. J. (1989). Active optical range sensors, (pp. 120–125). Advance in Machine Vision Berlin: Springer. Deriche, R., & Faugeras, O. (1990). Tracking line segments. Proceedings of Computer Vision ECCV 90, First European Conference on Computer Vision, (pp. 212–218). Berlin: Springer. Holland, J. H. (1975). Adaptation in natural and artificial system, Ann Arbor, MI: University of Michigan Press. Ley, D., Klicker, J., & Scheffe, B. (1993). Intelligent multisensor system for high-speed and high-precision 3D metrology. In S. S. Breidenthal & A. A. Desrochers (Eds.), Vision, sensors, and control for automated manufacturing systems, (pp. 2–13). Proc. SPIE, 2063. Rowa, P. (1992). Automatic visual inspection of lumber. Proceedings of Workshop on Scanning Technology and Image Processing on Wood, Sweden, (pp. 25–36). Tam, S. M., & Cheung, K. C. (1995). An internal sensor for parts inspetion. (pp. 812–816). Proceedings of 1995 IEEE International Conference on Robotics and Automation, 21–27 May, 1.