Chen, Joseph C. "Neural Networks and Neural-Fuzzy Approaches in an In-Process Surface Roughness Recognition System for End Milling Operations" Computational Intelligence in Manufacturing Handbook Edited by Jun Wang et al Boca Raton: CRC Press LLC,2001 ©2001 CRC Press LLC 16 Neural Networks and Neural-Fuzzy Approaches in an In-Process Surface Roughness Recognition System for End Milling Operations 16.1 Introduction 16.2 Methodologies 16.3 Experimental Setup and Design 16.4 The In-Process Surface Roughness Recognition Systems 16.5 Testing Results and Conclusions 16.1 Introduction Different machining processes produce different products with varying qualities. When evaluating the quality of a finished piece, surface roughness is the most important result of the machining process to consider, because many product attributes can be determined by how well the surface finish is produced. The quality of the surface finish, or surface roughness, affects several functional attributes of parts, such as surface friction, wear, reflectivity, heat transmission, porosity, coating adherence, and fatigue resistance. The desired surface roughness value is usually specified for individual parts, and a particular process is selected in order to achieve the specified roughness. Typically, surface roughness measurement has been carried out by manually inspecting machined surfaces at fixed intervals. A surface profilometer containing a contact stylus is used in the manual inspection procedure. This procedure is both time-consuming and labor-intensive. In addition, a num- ber of defective parts could be produced during the time needed to complete an off-line surface inspection, thereby creating additional production costs. Another disadvantage of using surface profilo- meters is that they register the serious interference of extraneous vibration generated in the surrounding environment. This extraneous vibration might significantly influence the accuracy of surface measure- ments. For these reasons, researchers are seeking solutions to model the surface roughness in an on- line or in-process fashion. Joseph C. Chen Iowa State University ©2001 CRC Press LLC The studies of Martellotti [1941, 1945] are among the earliest that represent a major contribution to the understanding of kinematics and the mechanism of surface generation in milling processes. Martel- lotti developed parametric equations to describe the trochoidal path that the tool follows. These studies also provide approximate analytical expressions for the ideal peak-to-valley roughness generated in up- and down-slab milling, and face milling. Numerous other studies have explored the topography of milled surfaces. Many of these focused on predicting the two- or three-dimensional shape of a milled surface under ideal and non-ideal conditions. Kline et. al. [1982] demonstrated the effects of cutter runout on surface errors, and surface errors or dimensional inaccuracies were predicted using the cantilever beam theory for cutter runout. Another study by Babin et al. [1985] applied the cantilever beam theory to predict the topography of wall surfaces produced by end milling. Armarego and Deshpande [1989] presented one more milling process geometry model that incorporates cutter runout to predict cutting forces. Sutherland and Babin [1985] demonstrated a two-dimensional worst-case analysis of the slot floor surface. However, the model for the slot floor surface significantly underpredicted surface roughness values. Research by Kolarits and DeVries [1989] extended the previous model to account for varying cut geometries and feed rates. This extended floor surface generation model improved prediction capabilities considerably. However, the roughness parameter predictions for some of the tests were found to deviate greatly from measured values. You and Ehmann [1989] developed a comprehensive model to predict the three-dimensional surface texture generated by ball end mills. They also presented an algorithm for three-dimensional representa- tions of the machined surface; however, the effect of flexibility of the cutter-workpiece system was not considered in this model. Montgomery and Altintas [1991] presented the effects of the cutter-workpiece system flexibility in their force and surface prediction model in order to analyze the surface generation mechanism in peripheral milling under dynamic cutting conditions. All models previously discussed represent only deterministic cutting models, but most machined surfaces exhibit interrelated characteristics of both random and deterministic components. Zhang and Kapoor [1991] demonstrated the effect of random vibrations on surface roughness in the turning process. These vibrations were shown to occur due to random variations in the microhardness of the workpiece material. Ismail and others presented a surface generation model in milling that included both cutter vibrations and the effects of tool wear [Ismail et al., 1993]. Melkote and Thangaraj [1994] presented another enhanced end milling surface texture model including the effects of radial rake and primary relief angles. These three models, limited to laboratory usage or based on theoretical analysis, could not be implemented as an in-process monitoring system. The findings of this literature review, in addition to communication with leading private industrial research and development laboratories in the state of Iowa (including Winnebago Co. in Forest City; Delavan Inc. in Des Moines; Sauer-Sundstrand Inc. in Ames), point to the feasibility of in-process surface roughness recognition (ISRR) systems for implementation in the newer generation of milling machines. The successful implementation of this surface roughness recognition system will enable metal cutting industries to reduce manufacturing costs by eliminating the relatively inefficient off-line quality control aspect of surface roughness inspection. Therefore, reductions in manufacturing costs will increase com- petitiveness in worldwide markets. This implication supports the development of an effective and inex- pensive ISRR system. The development of this system will enable implementation of adaptive control in modern manufacturing environments. 16.2 Methodologies In order to provide an adaptive control mechanism, ISRR systems require two major components: (i) sensors, which receive the dynamics signal from the machining cutting processes; and (ii) an intelligent technique able to learn the dynamics of the machining system while allowing for control features to be built in. The research described in this chapter employed an accelerometer to detect the dynamics mechanism of the tool and material interface. This study also used two major intelligent learning ©2001 CRC Press LLC methodologies to incorporate data about the machining process through actual cuts. These methodol- ogies were also employed to construct a control system that predicts surface roughness during the execution of the machining process. These two learning methodologies are artificial neural networks (ANN) and fuzzy neural (FN) systems. An overview of these two approaches follows in the next section. 16.2.1 Neural Networks Model Several learning methods have been developed for ANNs. Many of these learning methods are closely connected with a certain network topology, with the main categorization method distinguished by supervised vs. unsupervised learning. Backpropagation was chosen from among various learning methods already existing in this field. This approach was adopted into this research for two reasons: primarily, it is the most representative and commonly used algorithm, in addition to being relatively easy to apply; additionally, it has been consistently successful when used in practical applications [Das et al., 1996; Huang and Chiou, 1996]. The backpropagation algorithm can be divided into two main processes, the process of learning and the process of recalling . 16.2.1.1 The Learning Process Step 1. Given network parameters: Set all the necessary parameters, such as the number of input neurons ( i ), the number of hidden layers and the number of neurons included in each hidden layer ( h ), the number of output neurons ( j ), etc. Step 2: Initialize the beginning weights and biases: Set all the initial weights and biases values randomly. Step 3: Load the input vector X and the target output vector T of a training example. Step 4: Calculate and infer the actual output vector Y . (a) Calculate the output vector H of hidden layers. Equation (16.1) Equation (16.2) (b) Infer the actual output vector Y . Equation (16.3) Equation (16.4) Step 5: Calculate the error term. (a) The error term of the output layer: Equation (16.5) (b) The error term of the hidden layer: Equation (16.6) net W xh X h hih i ih =• ∑ _–_ θ H f net hh net h = () = + 1 1 exp – net W hy H y jh hj h j =〈−__ θ Y f net jj net j = () = + − 1 1 exp δ jj jjj YYTY= ()( ) 1 –– δ δ hh h hi j j HH Why = () • ∑ 1– _ ©2001 CRC Press LLC Step 6: Calculate the revised weight of the weight matrix and the revised bias of the bias vector. (a) For the output layer: Equation (16.7) (b) For the hidden layer: Equation (16.8) Step 7: Adjust and renew the weight matrix and the bias vector. (a) For the output layer: W_hy hj = W_hy hj + ∆ W_hy hj , θ _y j = θ _y j + ∆θ _ y j Equation (16.9) (b) For the hidden layer: W_xh ih = W_xh ih + ∆ W_xh ih , θ _h h = θ _h h + ∆θ _ h h Equation (16.10) Step 8: Repeat steps 3 through 7, until the energy function has converged or the specified learning cycles are completely executed. 16.2.1.2 The Recalling Process Step 1: Set all the network parameters. Step 2: Read the weight matrix W_xh and W_hy , and the bias vector θ_ h and θ_ y . Step 3: Load the input vector X of a testing example. Step 4: Calculate and infer the actual output Y. (a) Calculate the output vector H of hidden layers. Equation (16.11) Equation (16.12) (b) Infer the actual output vector Y . Equation (16.13) Equation (16.14) 16.2.2 Fuzzy-Nets Modeling The proposed fuzzy-nets system was developed by fuzzy rules generated from sampled input–output pairs. This model is built in five steps. 16.2.2.1 Step 1: Divide the Input and Output Spaces into Fuzzy Regions Assume that the domain intervals of input variable x i are , and that the domain intervals of output variable y are [ y – , y + ]. Each domain interval can be divided into 2 N + 1 regions. The value of N is dynamic for different variables, and the lengths of each region can be equal or unequal. Each region is denoted by ∆∆ Why H y hj j h j j _,_–== ηδ θ ηδ ∆∆ Wxh X h ih h i h h _,_–== ηδ θ ηδ net W xh X h hih i ih =• ∑ _–_ θ H f net hh net h = () = + 1 1 exp – net W hy H y jhj h hj =• ∑ _–_ θ Y f net jj net j = () = + 1 1 exp – xx ii – , + [] ©2001 CRC Press LLC SN (Small N), S(N-1) (Small N-1), …, MD (Medium), … , LN (Large N), Equation (16.15) and then assigned a fuzzy membership function. The divisions of the input and output spaces are shown in Figure 16.1, where N is 2 for x 1 , and 3 for x 2 and y . The width for each variable is the same. In this study, the input variables are spindle speed ( S ), feed rate ( F ), depth of cut ( D ), and vibration average per revolution ( V ). The output variable is the surface roughness average value, R a . A triangular membership function specified by three parameters { a , b , c } is employed as follows: Equation (16.16) FIGURE 16.1 The domain intervals of the input–output variables and triangular membership function. MDS1S2S3 L1 L2 L3 0 1 x 2 − d µ( x 2 ) x 2 + MDS1S2S3 L1 L2 L3 0 1 µ(y) y − d y + MDS1S2 L1 L2 d µ( x 1 ) x 1 − x 1 + 0 triangle x a b c xa xa ba axb cx cb bxc cx ;,, – – – – () = ≤ ≤≤ ≤≤ ≤ 0 0 ©2001 CRC Press LLC The spread of the input feature shown in Figure 16.1 is defined as (i = 1,2, ., k), Equation (16.17) where and are the domain intervals of variable x i , x i X i . There are 2 N + 1 fuzzy regions quantifying the universe of discourse X i . The center points of each linguistic variable are Equation (16.18) Equations 16.17 and 16.18 are also used for the output variable y. 16.2.2.2 Step 2. Generate Fuzzy Rules from Given Data Pairs through Experimentation Three steps are used for generating fuzzy rules: 1. Determine the degree of input–output data obtained from the successful experiment. 2. Assign the input–output pairs to the region with the maximum degree. 3. Obtain one rule from one pair of designated input–output data. In this study, the experimental input–output pairs were Equation (16.19) where i denotes the number of input–output pairs. 1. A human expert examined these rules to ensure their usefulness and correctness. 2. The degrees of each data pair were determined by the function Equation (16.20) where x c is the center of the linguistic level x , and x s is the width of the linguistic level x , equal to d . 3. After all of the input and output elements were determined, each element was assigned to the region with the maximum degree. 4. One rule from one pair of the desired input–output pair [ S 1 , F 1 , D 1 , V 1 , R a 1 ], was assigned. For example, the degree of one input–output pair: was determined by Equation 16.20 as d xx N ii = + – – 2 x i – x i + ∈ xx d x N dx ii i i –– – ,,, –,.+… + () () + 21 SFDVR ii i i a i ,, ,, , [] µ x xx x xxxx xx x xxxx i ic s iccs ci s icsc () = ∈+ [] ∈ [] 1 1 – – ,, – – ,–,. 0, otherwise ©2001 CRC Press LLC Equation (16.21) The region of each datum with a maximum degree was assigned as follows: Equation (16.22) Rule one was obtained by IF S 1 is MD and F 1 is L 3 and D 1 is L 2 and V 1 is S 1 THEN R a 1 is S 1, Equation (16.23) where AND indicates that the conditions of the IF statement must all be met simultaneously in order for the result of the THEN statement to be true. 16.2.2.3 Step 3: Assign a Degree to Each Rule and Resolve the Conflicting Rules If two or more rules generated in step 2 have the same IF command but a different THEN command, then the rules conflict. To resolve conflicts between the two data sets, a degree must be assigned to each rule, generated from the data pairs as Equation (16.24) where µ (S i ) = the degree of the spindle speed variable, µ (F i ) = the degree of the feed rate variable, µ (D i ) = the degree of the depth of cut variable, µ (V i ) = the degree of the vibration variable, µ (R a i ) = the degree of the surface roughness variable, µ (E i ) = the degree assigned by the human expert to determine the importance of this rule. The following function resolved the conflict between rules: Equation (16.25) where R k and R l are two conflicting rules, d(R k ) and d(R l ) are the degree of rules, R k and R l , and ε is the user-defined parameter 0 < ε < 0.05. Next, the rule with the maximum degree is selected. If the above function cannot resolve the conflict, ε may be decreased, or two more regions to one feature of the input vector may be increased and the input–output data pairs retrained. If these rules still conflict, the region number of the next input feature is extended to two more regions and then retrained. These procedures are repeated until all of the conflicting problems are resolved. µ µ µ µ µ S F D V R a 1 1 1 1 1 07 03 1 09 3 01 2 08 2 02 1 02 08 1 03 07 1 () =∈ ∈ {} () =∈ ∈ {} () =∈ ∈ {} () =∈ ∈ {} () =∈ ∈ {} .,. . MD, S L, L LL MD, S S2, S SMDFLDLVSRS a 1 1111 3211∈ ∈∈∈∈,, ,,. dR S F D V R E i ii i i a ii () = ()()()()()() µµµ µ µ µ dR dR kl ()() >– ε ©2001 CRC Press LLC 16.2.2.4 Step 4. Create a Combined Rule Base A combined rule base consists of two kinds of rules: rules generated from numerical data by means of steps 1 through 3, and linguistic rules determined by a human expert. As shown in Figure 16.2, the combined rule base includes two fuzzy rules: IF S is L1 and F is L1 THEN R a is L1; IF S is MD and F is S1 THEN R a is S1. Equation (16.26) 16.2.2.5 Step 5. Determine a Mapping Based on the Combined Fuzzy Rule Base A defuzzification strategy is used to determine the output control y for any given input datum. There are many methods for defuzzification. In this study, the following centroid of area method was applied: Equation (16.27) where , y i = the center value of the region, and y = the output for a given input datum. This is the most widely adopted defuzzification strategy today, and it is reminiscent of the calculation of expected values of probability distributions. 16.3 Experimental Setup and Design Figure 16.3 shows the complete experimental setup in this research. A computer numerical control (CNC) program was written to perform the end milling cutting processes. The electromagnetic proximity sensor was fixed at a close distance to the spindle, as shown in Figure 16.4, and the accelerometer sensor was mounted on the vise beneath the workpiece (Figure 16.5). Rotation and vibration data were collected simultaneously by the proximity sensor and the acceler- ometer sensor, respectively, when the cutter had cut the workpiece at a distance of 0.35 in. The main concern was to avoid the impact of initially unstable or significant vibration. Figure 16.6 illustrates the two types of signals (i.e., rotation data and vibration data). These two types of data were connected to an analog-to-digital (A/D) board (the vibration data from the accelerometer sensor had to be amplified by the PCB battery power unit beforehand) and then transmitted to a 486 personal computer for further data recording, processing, and analysis. FIGURE 16.2 Illustration of a combined fuzzy rule base. F L2 L1 MD S1 S2 S2 S1 MD L1 L2 S L1 S1 y y ii i = ∑ ∑ µ µ 0 0 µµµµµ o iiiii SFDV = ()()( )( ) {} min ,,, ©2001 CRC Press LLC A computer program was written in C language that allowed the collection of the two kinds of data transformed from analog to digital signals by an A/D converter. The collection time for each run was about 0.54 s, and the runs contained 6000 rotation or vibration data from the proximity sensors or accelerometer, respectively. The cutting parameters (spindle speed, feed rate, and depth of cut) were changed manually according to different cutting conditions for each run. Also, after each specimen was cut, the cutting tool was cleaned to avoid chip formation or a built-up edge (BUE), which would affect the surface roughness of the following cut. The tool condition was also checked to ensure that it was free from defects. All specimens in this experiment were conducted under dry cutting conditions without coolants. Coolants are not generally used in order to reduce costs and prevent tool breakage due to thermal shock. Moreover, the decision to use dry cutting conditions was based on the need to isolate the correlation between cutting vibrations and surface roughness in end milling. With the experimental setup complete, the next step was to develop the ISRR-ANN and -FN models. In this study, identifying the parameters of the training and testing data sets was a very important factor in establishing the experimental runs. These runs could not exceed the suggested cutting parameters, which were based on machine capabilities and the nature of the material composition of both the workpiece and end mill. FIGURE 16.3 Experimental setup. VM DESIGNER: Wei-Liang DESIGNER: Wei-Liang Proximity Sensor CNC Machine Center Accelerometer Sensor A/D Board 486 Personal Computer Workpiece Vise PCB Battery Power Unit . Armarego and Deshpande [1989] presented one more milling process geometry model that incorporates cutter runout to predict cutting forces. Sutherland and Babin. interrelated characteristics of both random and deterministic components. Zhang and Kapoor [1991] demonstrated the effect of random vibrations on surface roughness