Classification of Spot Welds Using Power Factor Time Profiles Julie ES.3nmons Stephen M. Pollock Department of Industrial & Operations Engineering University of Michigan Ann Arbor, MI 48109 Technical Report 97-02 March 1997

Classification of Spot Welds Using Power Factor Time Profiles Julie E. Simmons Department of Industrial and Operations Engineering University of Michigan Ann Arbor, MI 48109-2117 and Stephen M. Pollock Department of Industrial and Operations Engineering University of Michigan Ann Arbor, MI 48109-2117 March 1997 Technical Report No. 97-2 1. Introduction Determining the quality of a weld, in real time, is of paramount importance in many manufacturing settings. Resistance spot welding is the predominant means for joining sheet metals in manufacturing automobiles, furniture, and appliances. In the automobile industry alone, literally billions of welds are made each year (from 2000 to 5000 in every automobile). Due to the lack of confidence and consistency in the quality of welds, up to 30% more welds have to be made than are actually needed. Controlling their quality is essential for achieving low warranty and liability costs and attaining high product quality. Currently, methods for determining weld quality depend upon physical procedures (e.g. tearing or prying "stress-to-failure" actions, followed by examination of the resulting bead size and structure, etc.) or indirect measurements (of ultra sound, eddy currents, magnetic flux, etc.). Since these methods are cumbersome and time consuming, their use is normally incorporated into the traditional sampling inspection paradigm, resulting in associated delays in taking corrective action or scheduling necessary maintenance. Moreover, they do not lend themselves to real-time continuous process monitoring and control. Most non-destructive test methods are still in their development stages. They tend to require a considerable amount of operator training and skill development; are generally "off-line" and thus not suitable for 100% testing; and they are not designed for providing process control. It has long been suspected that information about the quality of a weld might be contained in the behavior, over time, of the secondary circuit current draw (or a monotonic function of the current draw) as represented by a "power factor" curve (PFC). We study the effectiveness of a statistically-based algorithmic method (which we call "template matching") for classification of 100% of resistance spot welds into categories of: "no weld"; "partial weld"; "good"; and "expulsion", by using power factor curves. This 1

method promises to make it possible to inspect every weld and, as a result, to lower the fraction of low-quality welds in products that make it to market. Such a method would eliminate the waste (in time and material) generated by destructive testing, resulting in less re-work and higher throughput. It should also allow the redesign of parts by reducing the number of spot welds currently included to compensate for occasional bad welds, thus reducing the overall process time. This method would be invaluable for use in real-time process adjustment or maintenance decision making. In addition, our efforts should enable us to develop a catalogue of parameters that relate PFCs to weld quality as a function of current, pressure, welding tip geometry and wear, part material and thickness etc. This characterization of a weld by its PFC should also provide information to improve realtime process monitoring and control. For example, such monitoring could adaptively set primary circuit "voltage on" control points to ensure sufficient time to obtain a good weld, but not so much as to produce expulsion events (thus avoiding material wastage, injuries from sparks, maintenance due to abrasive slag, etc.). Or, the current could be adjusted to ensure a good weld while keeping the weld cycle time constant, a desirable feature for more efficient production scheduling. Finally, the information obtained by characterizing PFCs could also be valuable for use in predictive maintenenace planning and scheduling, since changes in the PFCs may be indicators of weld tip and equipment wear. Preliminary calculations, using data provided to us by a major automotive manufacturer are extremely promising, showing classification rates greater than 90% per weld. This is a result which - if shown to hold over a variety of welding processes - represents a great improvement over present weld-quality determination methods. 2. Basic Problem Formulation We start with a power factor curve g(t), measured at N (N is typically on the order of twenty) points over the period of time during which a weld is produced: g(t) = power factor curve, t = 0, 1,... N where t = time from start of weld (measured in "cycles" of length 1/60 sec) N = maximum number of cycles used in the weld. The basic problem is to develop a procedure which takes as input g(t) and produces, a determination as to whether the weld is in one of the following quality categories: a) "open" (no weld); b) "stick" (partially bonded); 2

c) "good" (i.e. meets a set of nugget diamter specifications); or d) "expulsion" (a good weld, but with material "expulsed" from the weld). Our basic premise is that there is a PFC template f(t) such that any particular weld's PFC g(t) can be "fit" to f(t) by: a) scaling and/or shifting f(t); b) scaling t; c) using only a portion of f(t), from t = 0 to some cutoff time; d) accounting for random deviations ("errors") between f(t) and g(t). Figure 1. shows an example of such a template: shifting f(t) moves the whole curve up or down; scaling f(t) stretches the curve vertically; and scaling t stretches or compresses the time axis. This representation has its foundation in the physics of the welding process: the scaling and shifting are due to factors such as pressure, current and tip geometry; the cut off time is directly related to the total energy expended; and the random terms are the result of uncontrollable factors. The parameters of this "fit" are then used to statistically classify the weld into one of the quality categories. For example, the right-hand boundaries of the regions shown on Figure 1, labeled N, S, G, and E show typical cutoff times for welds that are likely to be "no weld", "stick", "good", and "expulsion", respectively. 3. Template Representation We have available experimental (or operating) data taken from M welds, as represented by: fk(t) = kth power factor curve, k = 1, 2,... M, t = 0, 1,... Nk where t = time from start of weld, measured in "cycles" of length 1/60 sec) Nk = maximum number of cycles on the kth curve. M Our approach is to use the ZNk data points, contained in the M PFCs, to k=l a) estimate a "template" that will represent a generic weld PFC 3

b) estimate, for each fk(t), a set of parameters that provides the best fit to the template; c) use these parameters, along with Nk, to determine to which category the kth weld can be assigned; d) determine the statistical performance of such a weld classification procedure. Because of the complex physical processes involved in welding, we do not assume, apriori, any particular functional form for the template - it is to be estimated from the data. Instead, we specify template by a set of n + 1 parameters y {yo, Y1,, 2... YN}, where yi represents the template at integer times i = 0, 1,..., N. For times other than integers, f(t) can be represented by the piecewise linear representation: f(t) = f(ty) - yi +(i+( -yi)(t- i) < i t< i + <N (1) f(t)=yn N<t. In the expression above, and in what follows, y is explicitly used as an argument of f(t) in order to stress the dependence of the template on these parameters. Suppose we know (or assume) y, such as one leading to the template shown in Figure 1. In order to "fit" this template to any observed PFC, we define an error term (giving the quality of the fit) in the usual way - the sum (over all times) of square differences between the PFC and the scaled and shifted template. Thus we can compute dk,the error in fitting the kth observed PFC by: Nk dk = dk(ck, pk, 'k, ) = Z[%k + akf(kt) - k(t)]2 (2) t=O where: A- = PF-shifting parameter for the kth PFC Ck = PF-scaling parameter for the kth PFC 3k = time-scaling parameter for the kth PFC Note that the upper limit of the sum in (2) is the maximum time of the kth observed PFC; this will correspond to a template time of t = OkNk. If tk = 3pkNk < N, this means that only a portion (from t = 0 to t = fkNk) of the template is used to fit the kth PFC. Also note that the error dk is a function of the entire set y as well as the three parameters aCk, Ok and 'y. 4

By defining the parameter vectors: ( - 1 (,a2,,... M) =-(Y1, 2,... 7M), and assuming that the values of y are not yet determined, we can represent the template matching problem to be that of determining a set of "optimal" parameter vectors Y* *, a*, *,* that solve the non-linear program: M min ZYdk(ak, kk, y, ) (3) y',,'' k=1 such that > o0; p> 0; > 0. (4) A convenient way to approach this problem is to decompose the optimization into two stages: M min m irindk(ak,3k,y,) (5) min =1 min, (5) That is, if we define Al d*(3, ) = dk(a;, /k, Y, ), (6) k=l then finding a solution to (5) is the equivalent of finding d* - mind* (/, ) = Zdk(cOk,i k, y), (7) d'Y^ k=1 subject to the constraints of (4). The reason for rewriting (5) as (7) is because for any fixed value of /, and y the minimization inside the brackets of (5) can be achieved analytically, as shown in the next section. 4. First Stage Minimization The minimization of the term in brackets in (5) with respect to a and 7y can be done term-by-term within the sum, since each term depends only upon the kth components ak 5

and 7k. Moreover, from (2) we see that dk is continuous in ak and yk. Thus it can be shown that a set of necessary conditions for minimization with respect to y is: d Nk — (d) = 0 = 2Z[%k + akf(/kt[y) - f(t)], k = 1, 2,... M. (8) dYk t=o Similarly, a set of necessary conditions for minimization with respect to a is d Nk d- (dk) = 0 = 2Z[7k + cakf(/kt yj) - fk(t)]f(Iktly) k = 1,2,... M. (9) dak t=0 These conditions produce the following explicit expressions for the optimal values a* and yk as functions of 3 and y: a = - (D-AC)/(B-A2) k*= (BC-DA)/(B-A2) where Nk A - Ef(lkt|y) t=O Nk B f E 2 (kt[I) t=O Nk c Efk (t) t=0 Nk D - f(0ktlY)fk(t) t=O 5. Second Stage Minimization The minimization in (7) can be carried out in one of two ways. One is direct: writing a* and y* as explicit functions of 3 and y, and then using a standard non-linear optimization code (such as MINOS). As an alternative, an iterative process can be implemented. First, an initial guess for y is used, and then the minimization with respect to p can be obtained (given this value of y) by a line search on each ok, due to the separation of terms in the sum. Using the resulting value of S3k a next iteration of minimization with respect to y can be carried out, etc. The minimization in (5) with respect to y is accomplished by noting, from (1), that f(tly) is continuous in the parameters yi for any fixed value of t. In particular t-i+l i-l<t<i d f(tly= 1 I-(t-i) i< t <i+l dyi f 0 t< i-1,or t+ 1 < t 0 t < i - I,or t +1 < t 6

so that d /POkt-+i + < < 0 t < or < t. -~-~k k - Using this result gives the following necessary condition for minimization of the term in (5) in brackets with respect to y: d M M dy (E = dk) = 0 = 2 [S/k + akf (!ktkl) - f(t)]ak(l -3kt + i) (10) dyi k=l k =l_ <t< M +2E E5 [Yk + akf (kt) - fk(t)]ak(0kt - + 1), i = 0,1,... N. k=l i-A<t< i This is a set of N + 1 linear equations in the N + 1 unknowns Yo, Y1,... YN which, given values of ak = 7;, Ck = yk and fk = p/ can be solved to obtain y*, the optimizing value of y. Note, we do not require the equations to be independent. 6. Classification of Welds Once the values of c4,y5k and pk have been obtained for the kth PFC, they can be used, in conjunction with t = -P3Nk, as part of a rule that decides into which category the kth weld fits. To do this, it is necessary to investigate the joint distribution of these fit parameters, conditional on having known weld categories. Once these distributions are obtained, they can be subsequently used to develop Neyman-Pearson type hypothesis tests for the classification. 7. Example Calculations In order to test our procedure, we used 41 power factor curves for which the weld quality was known. We then made an "example" template by averaging 10 other power factor curves for which the weld quality was known to be "expulsed", thus having large cutoff times. (Note that this template is not necessarily the best one that could have been attained from existing data. We use it here simply to demonstrate the general power of the method. A more general template estimation procedure is discussed in Section 5). The template was then fitted to each curve by scaling and/or shifting the template. This was done by computing values of "fitting parameters" a, 0 and ', that minimized the squared error between the scaled template and the sample power factor curve. That is, for a given weld's curve g(t), parameters a, 3 and y were found by solving N dk = min [? + af(Qt) - g(t)]2 (11) a3,y t=O 7

The resulting a, 3 and y are referred to as a*, * and 7y*. Figures 2 through 9 show the resulting template fits to typical PFCs of open, stick, good, and expulsion welds. Figure 2 shows, for a known "open" weld, the observed PFC (squares) and the best fit template (open circles). Figure 3 represents the same information for another (quite different) known "open" weld PFC. Figures 4 and 5 show results for two different "stick" welds; Figures 6 and 7 for two different "good" welds; and Figures 8 and 9 for two different "expulsion" welds. Since,3* scales time, it indicates where the sample's largest time value falls on the template. It is therefore possible to compute an adjusted cutoff time t* = *N. Table 1 shows the values of a*,,*, y* and t* for 41 welds of known quality. The seventh column labeled "Class.", shows the results of a classification rule based solely upon using t*: if (t* < 11.3), (11.3 < t* < 12.7), (12.7 < t* < 14.4), (14.4 < t*) the weld is classified as "no weld (N)","stick (S)","good (G)" and "expulsion (E)", respectively. Combining N abd S into a single "no weld (NW)" category and G and E into a single "weld (W)" category, and using the same decision rule for t*, gives the gross classification results shown in the last three columns. As can be seen, although the algorithm as currently implemented has some problems (e.g. it produces negative values of a* for weld 7001, 7009, and 7011), it still performs very well in distinguishing between W and NW. Indeed, it correctly identifies 38 of the 41 welds (93% of the cases). (Typical automotive standards only require 70% correct identification). The PFCs for the three welds that were not correctly identified are shown in Figures 10, 11, and 12. Figure 10 shows that allowing the value of a to be negative produces an undesirable result in which the template is inverted and then fitted to the weld PFC. (A modification to the fitting algorithm that constrains a* > 0 is clearly desirable, and will be explored.) Figures 11 an 12 show that, while the method appears to have reasonably fit the template to these samples, the PFCs are not typical. Indeed, we suspect that even a welding expert/operator may not have been able to correctly identify these welds without a destructive test. It should also be noted that for these welds the method was conservative: they were identified as no welds when they were actually welds. Table 2 shows a more detailed classification of the 41 welds. As can be seen from the table, using a value of t* alone does not seem to provide for an effective fine-level discrimination between "good" and "expulsion" welds. However, the results show the promise of the general method, and there is a great potential for improvement by incorporating information about the other parameters, a and y, into the classification scheme. 8. Future Research The quality and accuracy of the template matching classification method should improve when we develop a better method for template identification - recall that we used, for our example calculations, the average of selected expulsion-weld power factor curves rather than the more general estimation scheme described in Section 5. In addition, we 8

have yet to investigate using the information provided by values of a* and y* in the classification algorithm. The benefits of adding a time shift parameter will also be examined. Additional data will also help us to accurately determine the distributions of t* which will further improve the accuracy of classification. Extensions of this research seek to: 1. gather more PFCs for a variety of weld conditions, in order to build up a credible and representative data base; 2. develop efficient methods of performing the optimization computations, i.e., a software tool to create the template and evaluate welds with PFCs; 3. produce conditional distributions of the optimal fit parameters, and use their statistical properties to classify the welds into specific categories; 4. examine the information provided by weld classifications to see if it is suitable for process control and improvement; 5. test the general method for a variety of spot welding conditions; 6. estimate the recommended number of cycles required for good welds; 7. assess the degree to which PFC monitoring and template-fitting can be used to: a) determine the current required to achieve a good weld given a fixed weld cycle time; b) determine, given a current, the weld time most likely to result in a good weld; c) develop a schedule for stepping the current. 9

0 Cs 03, E em._ O 0 CLO CO x OJD..e Z Fe T 0 u U E rA( w C;.M w E0 JolpUA.laJod

Table 1. Summary of Weld Classifications for 41 Samples. Weld # Act. Qual. t* * 3 y* 7001 N 20.97 -0.30 2.33 92.85 7002 N 2.70 2.03 0.30 -70.35 7003 N 4.84 1.16 0.44 -11.17 7004 N 5.46 1.26 0.42 -16.50 7005 N 9.75 0.80 0.65 13.23 7006 N 7.70 0.93 0.48 3.56 7007 N 10.20 0.74_ 0.60 16.53 7008 N 8.74 0.98 0.46 1.34 7009 N 10.50 -20.75 0.50 1503.39 7010 S 11.04 1.12 0.48 -10.03 7011 S 0.75 -31.04 0.03 2216.98 7012 S 11.07 1.05 0.41 -3.10 7013 G 12.47 1.03 0.43 -1.97 7014 G 12.18 1.00 0.42 0.58 8001 N _ 2.94 2.45 0.42 -98.29 8002 N 8.19 1.06 0.91 -4.38 8003 S 9.79 1.14 0.89 -9.29 8004 S 12.20 1.07 0.94 -3.83 8005 G 13.05 1.06 0.87 -3.29 8006 G 12.96 1.05 0.811 -2.94 8007 G 13.77 1.01 0.81! 0.92 8008 E 144.50 1.07 8.50 -3.64' 8009* G 16.20 0.81 0.77 15.90 8010* G 17.70 0.74 0.77 22.13 8011* G 19.50 0.73 0.781 22.33 8012* G 19.50 0.72 0.77 22.88 8013* G 21.50 0.76 0.74' 19.87 9001 N 2.80 3.16 0.56! -148.19 90021 N 9.60 1.18 1.37i 13.45 90031 S 12.40 1.12 1.38' -8.40 9004[ G 1 12.80 1.001 1.16i 0.20 9005 E 17.00 1.06 1.31 -4.24 90061 E 21.20 0.74 1.41' 20.47 9007 E 21.10 1.05 1.32 -3.33 9008J E 19.70 1.12 1.16 -8.14 9009; E 25.10 1.021 1.32' -0.86 9010J E 27.90 1.11 1.33J -7.77 9011 E 30.60 0.99 1.331 1.82 90121 E 33.50 0.86 1.34i 11.87' 90131 E 35.90 0.94 1.331 5.28 9014* G 32.20 0.79 1.1 1i 16.53 * Indicates that welds may require a non-expulsion template Corr.? (0=No, 1=Yes) Act. Weld? Class. Weld? Corr.? 0 NW W 0 1 NW NW 1 1 NW NW 1 1 NW NW 1 1 NW NW - 1 - - - - - - - - - 1 NW NW N 1 NW NW 1 N 1 NW NW _ N 1 NW NW 1 _ __ I -— t- - --- -- 0 NW NW 1 N 0 NW NW -- 1 N 0 NW NW 1 S 0 W NW_ 0 S 0 W NW 0 N 1 NW W 1 N 1 NW NW 1__ 0 NW NW 1 1 NW NW 1 i 1 W W 1 1 W W W W 1 0 0 0 0 1 1._... 1 1 1 W W W W NW NW NW W W W W W W W W W W W. w W I NW. I NW NW W W W W W W W W W W % Correct W 1 1 1 1 1 1 1 1 1 1 1 1 1 1. I, 1 92.68% 1 0 68.29%

Table 2. Summary of Weld Classification Results. Classification Actual Open Stick Good Expulsion Total Open 12 0 0 1 13 Stick 4 2 0 0 6 Good 0 2 4 6 12 Expulsion 0 0 0 10 10 Total 16 4 4 17 41 -j

Figure 2. Best Fit of a Template to Weld # 7003 ("Open Weld"). a* = 1.16, P* = 0.439, y* = -11.17 80 78 - 76 - o 74 - U1 L. t... 0 72 - 70 68 - Template -- Power Factor -o- Best Fit 66 0 2 4 6 8 Time in Cycles (1/60 sec) 10 12 14 16

Figure 3. Best Fit of a Template to Weld # 7006 ("Open Weld"). a* = 0.927, P3* = 0.48, y* = 3.564 80 78 76 - 74 - 72 - oa~ 'C- i Template 70 - -- Power Factor -o — Best Fit 68 66' 64 0 2 4 6 8 10 12 14 16 Time in Cycles (1/60 sec)

Figure 4. Best Fit of a Template to Weld # 8004 ("Stick Weld"). o* = 1.07, [3* = 0.94, y* = -3.83 82 - 80 - 78 - 76 - 74 - 72 - 72- Template — l — Power Factor — O- Best Fit 70 68 66 0 2 4 6 8 10 12 14 16 I Time in Cycles (1/60 sec)

Figure 5. Best Fit of the Sample Template to Weld # 9003 ("Stick Weld"). o* = 1.12, P* = 1.38, y* = -8.40 82 - 80 - 78 - 76 - qW 0 fw -:74 - IO 72 - 70 - i -- Template -U- Power Factor — O- Best Fit I~~~~~~~~~~~~~~~~~~~~~~~ 68 66 0 2 4 6 8 Time in Cycles (1/60 sec) 10 12 14 16

Figure 6. Best Fit of a Template to Weld # 8005 ("Good Weld"). o* = 1.06, P* = 0.87, y* = -3.29 82 - 80 - 72 - <-Template 78 - ~~/S327/~~~ |^r ~~~ --- Power Factor -v — Best Fit 70 68 - 66 0 2 4 6 8 10 12 14 16 Time in Cycles (1/60 sec)

Figure 7. Best Fit of a Template to Weld # 8007 ("Good Weld"). a* = 1.01, * = 0.81,y* = 0.92 82 - 80 - Template 72 /- ---- Power Factor — O — Best Fit 70 68 - 66 I 0 2 4 6 8 10 12 14 16 Time in Cycles (1/60 sec)

Figure 8. Best Fit of a Template to Weld # 9005 ("Expulsion Weld"). o* = 1.06, P**= 1.31, y*=-4.24 82 80 -78 - 76 - 0 0 74 - 72 - 70 - 68 - Template -*- Power Factor -O- Best Fit 66 0 2 4 6 8 10 Time in Cycles (1/60 sec) 12 14 16 18

Figure 9. Best Fit of a Template to Weld # 9008 ("Expulsion Weld"). o* = 1.05, P* = 1.32, y* =-3.33 82 - 80 - 78 -76 - 0 74 -0 72 - i Template -- Power Factor -- Best Fit I 70 68 - 66 - 0 2 4 6 8 10 12 Time in Cycles (1/60 sec) 14 16 18 20

Figure 10. Best Fit of a Template to Weld # 7001 (Incorrectly Classified). 80 78 76 - 0 74 -c) sO 72 - 70 - 68 t -- Power Factor --- Best Fit I Template I 66 0 20 25 5 10 15 Time in Cycles (1/60 sec)

Figure 11. Best Fit of a Template to Weld # 7013 (Incorrect Classification). 82 80 - 78 - 76 - 74 -72 - --- Power Factor -o- Best Fit Template 70 1 -68 ~ 66 0 2 4 6 8 10 12 14 16 Time in Cycles (1/60 sec)

Figure 12. Best Fit of a Template to Weld # 7014 (Incorrectly Classified). 82 80 - 78 - 76 -- 74 - 0 c) 0 I4 72 - 70 -68 - 68 - --- Power Factor -0- Best Fit - Template 66 0 2 4 6 8 Time in Cycles (1/60 sec) 10 12 14 16