Analysis of Fault Harmonic in Electrical Power System Based on Improved Particle Swarm Optimization Algorithm

To estimate the parameters of fault harmonics in electrical power system more accurately and control the harmonic pollution, an improved Particle Swarm Optimization (PSO) algorithm is proposed. The traditional PSO algorithm has been improved, the problem of harmonic estimation is transformed into a minimum optimization problem, and the harmonic parameter optimization algorithm based on improved PSO and least square method is proposed, and corresponding simulation examples and measured data are created in matrix laboratory (MATLAB). The results show that the algorithm is not only accurate, but also has the advantages of anti-gaussian white noise and processing interharmonic. The proposed algorithm has potential application in harmonic fault analysis of electrical power system.


Introduction
With the massive use of power electronics, non-linear loads, etc., harmonic pollution in modern power systems is becoming more and more serious. It not only causes harm to primary equipment and secondary equipment of the electrical power system itself, but also brings adverse effects to all aspects of people's life and production, causing a lot of economic losses and affecting people's quality of life [1]. Therefore, it is necessary to control the harmonics in the electrical power system, so as to reduce or even eliminate the harm to the power system and people's production and life. However, before the harmonics are controlled, the key task is to accurately estimate the parameters of the harmonics contained in the current or voltage signals in the electrical power system, so as to manage the harmonic more targeted [2].

Literature review
At present, many domestic and foreign scholars, research institutions and universities have made deep research and exploration on the problem of harmonic estimation, and they have achieved certain achievements. In 1989, Heydt first proposed the problem of harmonic state estimation and presented a harmonic source identification algorithm with the minimum variance estimator [3]. Then, scholars at home and abroad has put forward the electrical power system harmonic estimation algorithm based on Fourier transform, harmonic estimation based on mathematical morphology, the harmonic estimation algorithm based on Kalman filtering, harmonic estimation algorithm based on the least square method and the harmonic estimation algorithm based on evolutionary algorithm for harmonic estimation [4]. However, traditional algorithms have their inherent disadvantages, such as frequency aliasing effect, picket fence effect and spectrum leakage of Discrete Fourier Transform (DFT), which will greatly reduce the accuracy of harmonic estimation, and they can't effectively detect frequency deviation and interharmonic [5]. For the above-mentioned defects of traditional algorithms, an improved PSO algorithm is adopted to estimate harmonic parameters. This algorithm overcomes the deficiency of the traditional algorithm to some extent. It can not only estimate the harmonic parameters accurately under normal conditions, but also deal with frequency deviation, interharmonic and the situation when both exist.

Improved PSO algorithm
In the traditional PSO, each individual is progressive in each generation, and even the worst individual will not be abandoned [6]. Thus, those poor individuals, due to the slow pace of evolution, are in fact largely meaningless to the guidance of optimization. Here, a natural selection mechanism is introduced to improve those poor individuals, thus maintaining the optimal property of the whole population. In the implementation of the algorithm, the PSO embedded in the natural selection mechanism is mainly to sort the particles in ascending order according to the adaptive value after the position update and overlimit processing are performed by the traditional PSO, then replace half of the particles with poor fitness values with half of the particles with better fitness values, thus greatly improving the optimal property of the population [7].
The process of improving PSO algorithm based on natural selection and improved mutation mechanism is given below. For the convenience of description, the improved PSO is denoted as Particle Optimization with Natural Selection and Selective Passive Congregation (PSONSSPC).
Firstly, the positions of each particle are assigned randomly within the search space, and the velocities of each particle are assigned randomly within the allowable range of velocities. This step is the same as the traditional PSO. For the update speed, check the situation of overspeed and adjust it; update the positions of each particle, check the situation of overspeed and make adjustments. Suppose the position and velocity of each particle in the kth iteration are In the k+1th iteration, for particle 1 k i X  , first randomly select a particle k R in the particles of the last iteration, and compare the fitness values of k R and 1 k i X  . If the fitness value of particle k R is better than the fitness value of 1 k i X  , then update the speed according to the following formula: Otherwise, the speed will be updated according to the traditional PSO. After the speed is updated, the speed limit processing is performed, followed by the position update and the position limit processing. After updating the position of each particle, the historical optimal position of the individual and the historical optimal position of the whole should be updated according to the current adaptive value of each particle. And the natural selection mechanism is carried out, the particle swarm is arranged in ascending order according to the fitness value, and then the half of the particles with poor adaptation value, that is, the latter half, are replaced by the particles with the better fitness value, that is, the particles of the first half, and its velocity and Pbest of each particle do the same. Finally, the convergence condition is checked, and the general convergence condition is that the maximum number of iterations is reached or the convergence precision is reached. Once the convergence condition is reached, the iteration stops; otherwise, return to the initial step for the next iteration.

Power system harmonic estimation algorithm based on PSONSSPC
Suppose the harmonic current or voltage signal S(t) in an electrical power system is expressed as follows: Among them, n represents the number of harmonics, An, ωn, and φn represent the amplitude, angular frequency and phase of the nth harmonic, respectively, ωn=2πnf1, f1 represents angular frequency of fundamental harmonic; N represents the highest harmonic number; g(t) represents the noise in the signal.
The main task of harmonic estimation is to solve the amplitude An, angular frequency ωn, and phase φn of each harmonic according to the sampling signal S(t). Since the angular frequency of the nth harmonic is n times the fundamental harmonic angular frequency, the solution of the nth harmonic angular frequency is actually the solution of the fundamental harmonic angular frequency, that is, the fundamental harmonic frequency f1. Assuming that the fundamental harmonic frequency, the magnitude of the nth harmonic, and the estimated phase are 1 f , ˆn A , and ˆn  , then S(t) can be reconstructed from the estimated parameters, denoted as   S t : Among them, The main task of the above harmonic estimation is to find the optimal 1 f , ˆn A and ˆn  , so that the error between the reconstructed signal   S t and the original signal S(t) is minimized. To describe the error quantitatively, the error function J is introduced: Among them, K is the number of sampling points within the period of a fundamental wave. By using the least square method, the task of harmonic estimation can be transformed into the following optimization problem: The core of the problem is to solve the phase and frequency. For this nonlinear problem, PSONSSPC can be used to solve it. Obviously, for the case without interharmonics, the dimension of the problem is (N+1) dimensions, for each particle 1 2 1ˆ, ,..., , Firstly, randomly assign the initial position 0 i X of each particle within the allowable range of phase and fundamental harmonic frequency, and randomly assign initial flight speeds ,..., , to the mutation mechanism and carry out the out-of-limit processing; then update location and carry out the out-of-limit processing; calculate the amplitude vector Gbest k  of the population. Next, update the particle swarm with the natural selection mechanism, replace the worst half with the best half. Finally, check whether the iteration stop condition is reached. If not, return the speed update step to start the iteration again. Otherwise, the iteration stops, that is, the optimal phase and frequency are found.

Case verification based on MATLAB simulation signal
To facilitate comparison with other methods, test signals generated by the simulation model in reference [8] are used to verify the proposed harmonic estimation algorithm. The test signal is a three-phase power system with double bus, and there is a 6-pulse rectifier bridge at the load bus end. The test signal is a distorted voltage signal on the load bus, denoted as Z0(t) [8]. The harmonic components are shown in table 1, and the waveform is shown in figure 1:  Figure. 1 The waveform of test signal The sampling frequency of the test signal is set to 3.2khz, that is, 64 points are sampled in a cycle. To quantitatively evaluate the performance of the algorithm, in addition to focusing on the amplitude, phase, and frequency estimated by the algorithm, a parameter ε for describing the overall estimation error is defined: Among them,   Z k is the estimated value of   0 Z k , K is the number of sampling points within a period. The following is the example verification for normal case, the case of frequency deviation, the case of interharmonic, the case of both frequency deviation and interharmonic. Table 2 to Table 5 show the amplitude, phase and corresponding relative error of each harmonic estimated by this algorithm under various noise conditions.    It can be concluded from Table 2 that in the absence of noise, the relative errors of the amplitude and phase of each harmonic estimated by the algorithm are almost zero; as the Signal to Noise Ratio of the signal is gradually reduced, the performance of the method is reduced. Under the interference of gaussian white noise of 40dB, the accuracy of this algorithm is still very considerable, the error of amplitude estimation is less than 4%, and the error of phase angle estimation is less than 7%; even when the Signal to Noise Ratio is reduced to 25dB, the estimation accuracy of this algorithm on amplitude is still within 10%, the estimation error on phase is generally within 6%, and the phase estimation value of the seventh harmonic is more than 30%. This is because the actual phase of the seventh harmonic is small, and even small absolute errors can cause large relative errors. In general, this method has high accuracy in harmonic estimation and excellent performance against gaussian white noise. To compare with other methods, the calculation results in literature [8] are referred. Table 6 shows the comparison results of the total error ε of this method and other methods [8] under various noise conditions.  Table 7 shows the global error for the harmonic estimation of the operating currents of various electrical appliances and the value of interharmonic frequency. It can be concluded from Table 7 that the estimated overall error is basically within 5%, the accuracy is high, and the frequency of the interharmonic components in the waveforms of various electrical appliances is estimated. The overall estimation error of the notebook is more than 10%, because its waveform contains a lot of high-frequency noise components. Before the harmonic estimation, the filtering pretreatment can be first considered, which is also the work that should be done in the future.

Conclusion
The harmonic parameter optimization algorithm based on improved PSO and least square method is designed. The simulation results in MATLAB show that the accuracy of the algorithm in harmonic parameter estimation is generally higher than that of DFT, Genetic Algorithm (GA), Particle Swarm Optimization with Passive Congregation (PSOPC), etc., and it has the advantages of anti-Gaussian white noise and ability to handle interharmonics. The built data acquisition platform is used to collect the working current waveforms of five kinds of electrical appliances. The verification of the algorithm with these five measured waveforms shows that this algorithm can accurately estimate the harmonic parameters in the measured waveform.
The PSONSSPC-based harmonic estimation algorithm only considers a common situation in which an interharmonic exists, but some specific load currents in the power system contain multiple interharmonics. Therefore, the algorithm needs to be further improved in the future so that it can estimate the existence of any interharmonic.