Test Frequency Selection Using Particle Swarm Optimization

The paper deals with the problem of test frequency selection for multi-frequency parametric fault diagnosis of analog linear circuits. An appropriate set of test frequencies is determined by minimizing the conditionality of the sensitivity matrix based on the system of fault equations using a global stochastic optimization. A novel method based on the Particle Swarm Optimization, which provides more accurate results and improves the convergence rate, is described. The paper provides several practical examples of its application to test frequency selection for active RC filters. A comparison of the results obtained by the proposed method and by the Genetic Algorithm is also presented.


Introduction
Nowadays, continuing miniaturization of modern electronic devices leads to more complex circuits and systems.The testing process has become more difficult and the cost of testing is still increasing.In the case of analog circuits the testing represents a much more complex problem in comparison with digital ones due to the behaviour of analog signals.To reduce test costs a development of new robust methods for Automatic Test Plan Generation (ATPG) for analog circuits is one of the main objective in this area [1].
Analog faults can be classified into several classes, e.g.manufacturing tolerances, soft, hard and catastrophic faults, depending on the deviation of network parameters from their nominal values [2].The multifrequency parametric fault diagnosis is a technique for estimating the actual values of some network parameters from measurements of network characteristics in the frequency domain [3].The circuit components, whose parameters exceed the allowed tolerance intervals, are classified as faulty.
An arbitrary network function of lumped linear timeinvariant analog circuit can be expressed as: where s is the complex frequency, and the polynomial coefficients a i and b i are nonlinear functions of network parameters p = [p 1 , . . ., p R ] T .
The actual values of unknown network parameters can be estimated based on the measurements of one or more different network functions at several frequencies [2].In the case of one excitation source, each network function corresponds to one test point.From a mathematical point of view, the parameter estimation represents solving the set of nonlinear fault equations based on the network function Eq. ( 1): where H k represents the k-th network function with respect to the k-th test point selected, and M k,i are the measurements of the k-th network function on the i-th test frequency.The system can be solved for example using the Newton-Raphson iteration method.
The set of tested parameters p t ∈ p, i.e. the unknowns in Eq. ( 2), must be selected beforehand.The remaining components are considered to have a priori known (nominal) values.A proper selection of test point(s) and test frequencies is of cardinal importance for a robust solution of Eq. (2).
As an analog circuit consists of different types of components (resistors, capacitors, inductors, etc.), the individual network parameters have different physical units and their nominal values are spread over a wide range of magnitudes.Then, the Jacobian (sensitivity) matrix associated with the system of fault equations Eq. ( 2) contains mutually incomparable elements.It causes that the matrix is ill-conditioned and the fault diagnosis may return non-relevant results.To overcome the problem, the set of equations Eq. ( 2) should be formulated using the normalized network parameters p where p is the original value and p nom is the nominal value [4].
The process of parametric fault diagnosis can be divided into two independent phases.The first phase, called testability analysis, determines which network parameters can be identified based on the selected test point(s).The maximum number of testable network parameters is referred to as the testability degree T [3].The testability is associated with the solvability degree of the system of fault equations Eq. ( 2).In the case of one test point, the solvability is given as the rank of the Jacobian matrix associated with the system Eq.( 2): Theoretically, the testability degree of a circuit is independent of the fault localization method, the nominal values of network parameters and the selected set of test frequencies [5].
The set of linearly dependent columns of the Jacobian matrix determines ambiguity groups [6].In these groups the effects of individual network parameters on the network function are indistinguishable from one another.For example, two resistors in series create such a group.Only some parameters of the ambiguity group can be estimated independently.The remaining parameters must be considered to be fixed.
When the total number of potentially faulty parameters is greater than the testability degree T or when the parameters being tested belong to the same ambiguity groups, the system of fault equations has no unique solution and the set of test points should be extended.
The second phase consists in solving the system of fault equations Eq. ( 2) to obtain the actual values of unknown network parameters.However, in the real fault diagnosis, the system is always perturbed by errors and for this reason the diagnosis may return nonrelevant results.For example, the ill-conditioned system of equations is prone to large numerical errors of the solution, in the case of the uncertainty of fixed (untested) network parameters, the final solution is mathematically correct but the estimated values of tested network parameters may not correspond to their actual ones, the measurement of weak signals, e.g. in stop bands of analog filters, as well as the measurement at high frequencies is usually more problematic.Fortunately, all these errors can be minimized by an appropriately chosen set of test frequencies [3].
However, an optimal method for test frequency selection has not been determined yet.The methods based on maximizing the sensitivities of tested network parameters in the frequency domain [7] may lead to closely-spaced frequencies for example for bandpass filters, i.e. the system of fault equations is illconditioned.The method using interval analysis [8] takes into account the uncertainty of fixed network parameters, but the method is applicable only for diagnosis of catastrophic faults, i.e. soft faults can not be diagnosed.The simple heuristic solution [9] based on fixed relations between individual test frequencies is computationally very inexpensive, but the method may not be optimal in general and it can be applicable only to specific simple circuits.On the other hand, the genetic optimization method proposed in [9] discretizes the solution, the computational demands are very high and the algorithm converges slowly.
The procedure for test frequency selection proposed in this paper is based on the modified Particle Swarm Optimization (PSO).Section 2 of this paper deals with the mathematical background of the method and Section 3 provides several application examples for analog frequency filters.

Test Frequency Selection
The selected set of test frequencies should minimize the sensitivity of the solution of Eq. ( 2) to the numerical errors, uncertainty of fixed network parameters and measurements errors.The proposed method is based on the measure introduced in [9].The error of the perturbed system of fault equations Eq. ( 2) as well as the convergence rate of the Newton-Raphson iteration method are taken into account in the measure formulated in the form: where cond(J) is the condition number of the Jacobian matrix J associated with fault equations Eq. ( 2), σ max and σ min are the maximum and minimum singular values of J.The minimizing of E leads to minimizing the conditionality of the Jacobian matrix and maximizing the sensitivities to unknown network parameters, which is represented by J −1 2 in Eq. ( 5).
The system of fault equation Eq. ( 2) with a small E is well-conditioned while a large E leads to an illconditioned problem.The computational complexity of Eq. ( 5) is given by the complexity of singular value decomposition.The Jacobian matrix itself can be obtained by repeatedly solving the adjoint sensitivity network [14] for each test frequency.
The minimization of E represents a complex problem with many local optimums.The use of the Genetic Algorithm (GA) was reported in [10].The main disadvantage of the method is the discretization of the solution dependent on the bit representation of chromosomes and very slow convergence rate in the order of hundreds of steps, i.e. high computational cost.The proposed solution is based on the Particle Swarm Optimization (PSO) [11], [12].The main advantages of the method are the high convergence rate, no discretization of the solution and a very easy implementation.
The particle swarm consists of individual agents, which move randomly in a u-dimensional space, where u is the number of test frequencies and is the same as the number of unknown parameters in Eq. ( 2) for only magnitude measurements.The position of each agent is associated with one set of test frequencies.The fitness function E is evaluated for each agent in each iteration step.During the optimization the agents are moving towards to the global optimum.
The agent speed v n+1 ∈ R u in the next iteration step is given as: (6) where w n is the inertia weight in the current step, v n is the actual speed, c 1 and c 2 are the weight coefficients of optimization, x pers and x glob are the coordinates of personal and global optimums found so far, x n is the actual position of agent, and r 1 and r 2 are random numbers with the uniform distribution from the interval < 0, 1 > generated in each iteration.
When the inertia weight w is too high, the position of each agent can oscillate around the global optimum in the final phase of optimization.Reducing w during the optimization can overcome the problem [12].
The new position of each agent x n+1 is: where ∆t is the time step.Choosing ∆t < 1 helps to damp the oscillations of agents around the global optimum.
At the beginning of optimization it is necessary to use a large number of agents to preserve the robustness of the process.During the optimization, agents move closer to the global optimum and it is unnecessary to evaluate the fitness function for all the agents used at the beginning.Therefore agents with high values of E are removed.This approach can significantly speed-up the final phase of optimization.
Since network functions are better represented in the logarithmic frequency scale and the core of PSO works well on the linear scale, it is advantageous to introduce the transformation of coordinates: where x i is the agent position in the space of optimization coordinates, f i corresponds to the actual test frequency, and f L and f H define the frequency interval of interest.Some areas of the search space may represent an unfeasible solution.To keep the swarm in the feasible area, use can be made of absorbing, reflecting or invisible walls [12].The authors in [11] state that the invisible walls may produce a little better results.
The fitness function E does not depend on a particular ordering of individual test frequencies.An example for u = 2 is shown in Fig. 1.For this reason, the red points correspond to the same set of test frequencies.Then, the agents can be restricted to the area where x 1 < x 2 < .... < x u .Restricting the search space leads to a smaller required number of agents, i.e. less computational demands.

Application Examples
The method was applied to three benchmark active RC filters [10] and the results were compared with the results obtained using GA.
The following parameters of PSO according to the recommendations in [11] and [12] were used: • Initial number of agents: 12, 26, 50.
The first example is the Tow-Thomas second-order band-pass filter shown in Fig. 2. The filter is tuned to the resonant frequency f 0 = 1,6 kHz with the quality factor Q = 10.The frequency response of the filter is shown in Fig. 3.The nominal values of components are 100 nF, with the ideal operational amplifiers being used in the analysis.Only one test point, which corresponds to magnitude measurements of V 2 , was chosen.The testability degree T is equal to 3 and the same testable group (R 1 , R 4 , C 1 ) was considered as in [10].To determine these three unknown network parameters it is necessary to determine three test frequencies minimizing the E measure Eq. ( 5).As it can be seen in Fig. 4 the PSO method found, after approximately 30 iteration steps, the following solution: f 1 = 1149 Hz, f 2 = 1592 Hz and f 3 = 4826 Hz (E = −1, 50).The progress of the optimization for different initial numbers of agents is also presented.In the case of 50 agents, the optimization converged quickly, but it took the longest time due to the number of agents.The results are similar to the case of 26 agents.When only 12 agents are used, the speed of convergence is reduced.The optimization took the least time, but the algorithm may not find the appropriate global optimum.
The same optimization problem was solved using the basic GA with elitism and mutations [13].In this case, the following optimization parameters were used: • Chromosome representation: 16 bits.
• Frequency interval {f | 1 Hz ≤ f i ≤ 10 kHz}.The results of GA are shown in Fig. 5.The speed of convergence is lower (approximately 3 times) than the results obtained by PSO.When a small number of bits in chromosome representation of frequency are used, the results may be inaccurate.A large number of bits reduce the speed of convergence.One test point corresponding to magnitude measurements of V 2 was considered.The testability degree T is equal to 3. When proceeding as in [10] the same suitable testable group (R 6 , C 1 , C 2 ) was chosen.The last example is the fourth-order elliptic low-pass filter shown in Fig. 10.For nominal values of components   By proceeding as in [10] the suitable testable group (R 4 , R 8 , R 17 , C 1 , C 3 ) with respect to magnitude measurements of V 2 was chosen.
After approximately 20 iteration steps, PSO found the global optimum.The set of test frequencies is f 1 = 12,1 Hz, f 2 = 1011 Hz, f 3 = 2380 Hz, f 4 = 3135 Hz and f 5 = 4166 Hz (E = 0, 50).The results are shown in Fig. 12.The speed of convergence is good and the global optimum was also found with a small number of agents.The results of GA are shown in Fig. 13.The speed of optimization convergence is much lower than PSO.In [10], the authors state that it may take up to thousands of iteration steps.

Conclusion
The paper shows a novel approach to optimum test frequency selection using the modified particle swarm optimization, which minimizes the Test Index measure E. In comparison with Genetic Algorithms the method converges faster and provides results of greater accuracy.