Adaptive Fuzzy Logic Controller for Harmonics Mitigation Using Particle Swarm Optimization

: An excessive use of non-linear devices in industry results in current harmonics that degrades the power quality with an unfavorable effect on power system performance. In this research, a novel control technique-based Hybrid-Active Power-Filter (HAPF) is implemented for reactive power compensation and harmonic current component for balanced load by improving the Power-Factor (PF) and Total–Hormonic Distortion (THD) and the performance of a system. This work proposed a soft-computing technique based on Particle Swarm-Optimization (PSO) and Adaptive Fuzzy technique to avoid the phase delays caused by conventional control methods. Moreover, the control algorithms are implemented for an instantaneous reactive and active current (I d -I q ) and power theory (Pq0) in SIMULINK. To prevent the degradation effect of disturbances on the system’s

While current and voltage are decreasing in the power system, installing a hybrid type filter combines both active and passive filters implemented in [6]. Moreover, with excessive use of the loads that are non-linear, the power system is badly affected by harmonics [7]. To solve unconstrained optimization algorithms, a q-gradient descent optimization algorithm has been proposed. The algorithm occasionally declares a fixed value that is not the solution but is very near to it due to the use of the q-derivative in [8]. The multi-objective technique-based PSO has been implemented in [9] for HAPF, and the components have been studied. The qualitative aspects of possible solutions to the non-linear implicit fractionals boundary condition in variable order settings [10]. The existence conditions given below in (1) for the solutions in our establishments have been obtained using Krasnoselskii's theorem, and Ulam-Hyerz-Rassias stability (UHR) can be verified. The fractional calculus domain deals with the extension of conventional control to a fractional control that derives integration order and taking derivative from integer expression to real numbers. The fractional-order differential-integral is given as; The most common definition in engineering applications is Caputo definition [11] and can be observed in (2) where Γ n (n) = +α ∫ 0 x n−1 e −x dx required is the gammas function that depends on x the namely as fractional order Riemann Liouville.
The key motivation behind the proposed implementation is that the PI controller is incapable of reacting to an abrupt change in error signal because it can only determine instantaneous values without considering the rise and fall of error. Hence, the proposed implementation is more realistic and capable of practical application. The main contributions of this research work are as follow: • Simulation of HSAPF for three-phase power system using Pq0 and I d -I q control theory in SIMULINK. • To optimize the PI controller parameters using PSO that minimizes a objective function by providing robust parameters to PI and can also regulate DC link voltage that helps maintain the charging and discharging of capacitors. • Implementation of PSO-based Adaptive Fuzzy PI system to eliminate harmonics in a power system, based on gains acquired by PSO, and its performance compared with other techniques.
This part of the paper is summarized in sections, with Section-2 summarizing a literature review. Section 3 examines the control techniques used for harmonics mitigation. In Section 4, results will be discussed, and a comparison of a given technique with previous systems such as Pq0, Id-Iq PSO-PI, based on THD, DC-Link Voltage regulation will be summarized. In the Section 5, the conclusion based future-works will be discussed.

Literature Review
By referring [12], the Enhanced Grasshopper Optimization-based Artificial Neural Network (EGOANN) technique has been implemented to make the source current sinusoidal under the unbalanced condition, and the simulation was carried out on MATLAB. The result presents that the THD value has been reduced per the IEEE standard provided. The Fuzzy Logic-based APF has been designed for harmonics compensation in power systems and results present that the DC-link voltage is optimized by using FLC rather than PI [13][14][15]. In [16,17], a new FLCbased control scheme has been proposed for the Unifid-Power Quality Conditioners (UPQC) to reduce voltage dip, THD in a power distribution system to improve the PF. Under unbalanced load conditions, the FLC outperformed the conventional PI controllers in [16] and [17]. The THD obtained from FLC has been less than 5%, and additionally, the system's robustness has also been improved by authors in [18]. Moreover, a HAPF is designed and augmented by employing Particle-Swarm with intelligent Grey-Wolf's Optimization (PSO-GWO) with Fractional orders PID controller (FOPID) in [19][20][21][22]. The controller (FOPID) parameters are optimized by the intelligent PSO-GWO technique that has been implemented to enhance the power system quality [21,22]. The FLC implementation for HAPF has been used in [23] to produce appropriate switching signals as it helps to control both output currents of the converter. In [24], a PSO-based FOPI controller has been implemented for the HSAPF, and the experiments are being tested under unbalanced load situations, with THD reduced to less than 5%. Moreover, in [25], an FLC-based active filter has been implemented to mitigate harmonics on the system by using MATLAB fuzzy toolbox. The current exists in the neutral wire flow due to an unbalanced load connected to the system [26]. The Fuzzy based control algorithms are implemented to design APF and compensate reactive power with source current in micro-grid [27]. A controller must be capable of handling the non-linearity and robustness of the system under an unbalanced load [28][29][30].

Implementation of HSAPF
HSAPF combines single tuned pasive filters in the series arrangement with the active filter used for harmonic current compensation, as shown in Fig. 1. A robust, adaptive, and techno-economical controller is required for HSAPF to reduce the switching loses of the invertors and the voltage rating of APF.

Implementation of I d -I q Based HSAPF
The I d -I q-based control technique for reference current calculation contains three functional blocks and is carried out in MATLAB using the three-phase power system. The dc-link capacitor voltage has been compared to a dc reference value value, and than error is given to the PI for zero steady-state error that is further used to track a reference value of current signal. The I d -I q currents are obtained from Park's transformation that passed through the eighth order butter-worth filter to eliminate dc components from the non-linear load.

Implementation of PSO-PI for I d -I q Based HSAPF and Objective Function
The conventional PI controller has been implemented with I d -I q control technique and the gains set using the hit and trial method. In the Swarm, many Pbest and particles with the best fitness value are usually referred to as Global best (G best ) in problem space. PSO algorithm accelerates every particle at each time towards P best and G best with random-weighted acceleration [18]. Update the velocity, position of each particles for further iteration in (1) and (2) as (3) and (4) whereas i and k represent the total iterations with particle number, x k (i) and V k (i) represent current velocity and the position of ith, particle at k iteration, x k+1 .(i) and V k+1 (i) are the positions current and the velocity of i particle's at the (k+1) th ilteration. In further, C1, C2 are the acceleration constants, inertia, r1, r2 are the random numbers that lie between 0,1. The PSO proposed PI technique depends on objective function (OF) that monitors optimizing search. The PSO technique assigns random K p and K i and evaluates function. Whenever we have designed a controller for any system, one or more than one parameter is selected. Four performance index criteria are usually used to minimize the error function. These are given below ISE integrates square of error signal over time, as given in (5), it will eliminate large errors from the system; however, it allows small errors in the system. In (6), the Integrates Absolute Error over time IAE has been modeled and slowed down the response. ITAE expression given in (7) means integrates absolute error signal multiply with time over time help settle system quickly compared to other performance indices [20]. The goal is to minimize ITAE for K p , K i values as (8). P1 and P2 are upper, the lower range of the proportional constant, and I1 and I2 are upper, lower limits of the Ki as depicted in (9).
Subject to P 1 ≤ K p ≤ P 2 , I 1 ≤ K i ≤ I 2 (9) J is performance index, tsim is represented as simulation time that would be a large value so that system output response reaches steady-state value and T = 10sec is selected. W is the weight factor.  (7) 3. Calculate the objective function of (10) (ITAE) 4. Set Iter max = 1 %Iteration counter 5. while (stopping criteria does not achieve) 6. Determine (g best ) % The global best position ever observed with swarm optimization 7.

11.
Re-evaluate the objective function for new position of each particle 12. Accordingly, Update the particle position. 13. if (estimation of new particle position < P best ) 18. the while statement end by Computing the Global best (G best ) of each particle

Inertia Weight Control Strategy for PSO
Its inertial weight determines the PSO convergence behavior. A large inertial weight causes the optimization to converge slowly, while the low inertial weight causes local trapping. As a result, the inertia weight should be selected to achieve a better search-utilization trade-off. In the implemented model, an inertial weight expression decreases linearly from a large to a small value over some iterations, improving the technique's performance. W = w max − g en W max − W min max g en (11) As inertial weight is represented by 'w' that sets w max = 0.9, w min = 0.2 and g en represents the generation number. Initially, w is set to 0.9, w decreases from its value as the evolutionary generation increases. For objective function, a SIMULINK library is used. Fig. 3 shows that the inertial weight w decreases linearly with the number of iterations that show a precise solution over the number of iterations. The ITAE tuning method is much better than the others, as discussed in detail in Section 1. It can be observed in Fig. 3. Fig. 2 shows that the inertial weight w decreases linearly with the number of iterations that show a precise solution over the number of iterations. The K p and K i values are obtained from PSO are 1.093, 15.091 corresponding to Swarm at GBEST.itae = 5.9165. The presence of these PSO gains in any system makes it stable and free of oscillations. The chosen parameters for PSO can be observed below in Tab. 1.

Adaptive Fuzzy PI Systems
In this section, by using gains obtained from PSO, adaptively tuning of PI controller has been carried out using FLC. The following quantization factor can transform the error 'e' and rate of change 'ec' from the fundamental to the fuzzy universe ke = 3/e max and kec = 3/e max and can be observed in Fig. 4. . Fuzzy rules for inputs and output is given in [28] and their detailed description in Tab. 2. The working of FLC depends on the rules set. The Fuzzy rules can be expressed by IF-Then conditions [28]. R i : if e is the A i and the ec, is B i then u is the C i . The centroid method is used for the defuzzification process. It can be easily defined 49 rules for Kp and Ki. As the system has two inputs so there are 7 × 7 = 49 control rules for the membership function R = R 1 U R 2 U, . . . ,R 49 .The Fuzzy rules may be explained as 1) R1: if e is NB and ec is NB then Δkp1 is PB and Δki1 is NB

Design of PSO Based Adaptive Fuzzy-PI System
The PI parameters sum output by FLC and the PSO-PI parameters is the adaptive adjustment of the PI controller for the dc voltage regulator. Fig. 6 elaborates the proposed Hybrid technique. By using optimize gains obtained from PSO-PI, adaptive adjustment of PI controller will be carried out using FLC so that reference current is optimized as elaborated in (12)-(13).
As Figs. 5 and 6 depicts the proposed Adaptive Fuzzy PI-based I d -I q technique for HSAPF. To maintain the power balance between load and source side, there is a need to purpose a suitable controller that tracks Vdc to set value. The stable DC link voltages represents the percentage of low ripple factor produced on the inverter AC output. As in the case of non-linear systems having uncertainties so, by getting optimize gains that are K p , K i obtained from PSO-PI, adaptive adjustment of PI controller will be carried out by using FLC for improvement in the performance of HSAPF. It may result in a system that is stable and free of oscillations.

Simulation Results
This part has demonstrated the effectiveness of the given HSAPF due to non-linear loads. by using the simulation results generated in MATLAB. The load is three phase bridge rectifier attached to its DC side with a resistive load.
The characteristics of the load current are used to design the RL tuned passive filter. A singletuned passive filter is used to remove low-order harmonics as they have a maximum impact. The design simulation parameters are in Tab. 3 with dominant odd harmonics, the source current has a THD of 35.85%, and FFT analysis with load (non-linear) is shown in Figs. 7a and 7b, which represents the response of source current (A) with time (sec). It can be seen that the resultant waveform is non-sinusoidal that causes the source current to be distorted. So, there is a need to make them sinusoidal that improve power quality by implementing different techniques. The Source voltage remains sinusoidal due to the balanced load. As in Fig. 7b, the average THD of source current for all fundamental frequencies is 35.85 percent without any control technique. Lower-order harmonics are of more concern than higher-order harmonics. Three scenarios are investigated for this non-linear load Case 1: when I d -I q is implemented alone with HSAPF for calculating the reference currents. Case 2: when HAPF is attached with I d -I q based PSO-PI controller. Case 3: HAPF is attached with I d -I q based adaptive Fuzzy PI controller for estimating maximum reference current.

I d -I q Based HSAPF with PI Controller for THD Reduction
After implementing the HSAPF based on the I d -I q technique on MATLAB/Simulink, the waveform of the Source current (I s ) becomes sinusoidal under non-linear load with THD 2.03% at a fundamental frequency of 50 Hz as given in Fig. 8f. The main goal of the control technique is to minimize transient response due to non-linear load and obtain sinusoidal source current. The harmonics in source voltage are minimized by impedance at the source side. Thus, the sinusoidal waveform can be observed in Fig. 8a. Fig. 8b illustrates the sinusoidal waveform of source voltage after implementing the I d -I q control technique based on HSAPF. The harmonics in source voltage are minimized by impedance at the source side, so it can be concluded that no distortion on source voltage is observed. Fig. 8c depicts the current in load of the three phase power system with bridge rectifier attached across the three-phases. The transient response of the filter current is initially unbalanced, but after 0.04sec, the system achieves its stability.
The conventional controller is mainly for DC link voltage regulation to minimize switching loss of VSI and to charge the DC capacitor upon discharging. From Fig. 8e, it can be concluded from the results that response time of the voltage regulator is minimized up-to 0.06 sec by the I d -I q technique, which is far better than Pq0 technique. Figs. 8a-8d shows that the distorted source is current, and the filter current is not restored instantly as it takes time to get stable. Moreover, there is also an overshoot that needs to improve further. As from Fig. 8e, the dc-link waveform at time 0.06 sec is not in a steady state, and initially, there is an overshoot that needs to be improved.

I d -I q Based HSAPF with PSO-PI Controller for THD Reduction
The HSAPF based on the PSO-PI control technique is used for dc voltage regulator to improve transient response due to non-linear load. The PI controller's performance depends on its gains; the best gains produce better results and improve system response. Fig. 9a shows the sinusoidal waveform of the source current obtained after successfully implementing the PSO-PI-based I d -I q technique. The results show that the PSO algorithm is an efficient technique that helped provide better performance than the conventional PI controller by improving steady-state response by providing the best gains to the PI controller. Fig. 9b shows the load current in a three phase power system. The non-sinusoidal waveform shows that may affect the source current due to the switching operation of elements and the commutation of the high current power circuits. After harmonics compensation, both source voltage and current are in phase, and reactive power is compensated successfully to make the PF close to unity. From Fig. 9d, it can be observed that applying the PSO technique on the PI controller minimizes the THD of the source current varied from 2.03% to 1.96% at the fundamental frequency, i.e., 50 Hz. Fig. 9c shows that the PSO-PI-based I d -I q control technique performed better by injecting compensating current thus, source voltages and currents are in phase has helped improve THD of the system to 1.98% as given in Fig. 9d. When the DC voltage is not reached at stability and the dc voltage's is reached at stability, the harmonic current is eliminated, and a balanced sinusoidal source current is obtained. The results in Fig. 9e depict that overshoot is reduced from 1700 V to 1300 V and settling time reduced from 0.06 to 0.05sec.
The results concluded that PSO has successfully tuned the PI controller by giving the best gains, so that performance of I d -I q -based HSAPF is further improved. As in Fig. 9e, there is still an overshoot and oscillation in dc voltage because the PI technique failed to handle robustness and non-linearity of the system; hence, there is a need to design and implement a suitable controller that will help to minimize robustness that overshoot and transient response get also be improved. It can be observed in Figs. 9a-9c the waveform of the source current and filter current still has oscillations and overshoot that need to improve. So, PSO has been implemented to obtain the optimized gain for the adaptive tuning of PI controller has been carried out by using FLC that can help improve the performance of HSAPF.

I d -I q Based HSAPF with PSO Based Adaptive Fuzzy-PI Controller for THD Reduction
This research aims to mitigate current harmonics on the source side up to the minimum value caused by non-linear load so that power quality in the system can also be improved. Fig. 10a depicts that the sinusoidal waveform of source current has been obtained after adaptive adjustment of PI controller through hybrid techniques. The distorted waveforms, transient response, and overshoot have been improved to a minimum value by using the PSO-based Adaptive Fuzzy-PI system control technique compared to PSO-PI and conventional PI controller-based HSAPF. Fig. 10b shows that the waveform of filter current becomes sinusoidal with less stability time and overshoot than PSO-PI and conventional PI controller. The THD has also reduced to 1.72% that can be observed in Fig. 10d. Vdc tracked its reference value within less time to maintain the balance of difference of powers from load to source side. From the Fig. 10c, it can seen that the overshoot has been reduced from 1300 to 850 V and settling time from 0.05 to 0.04 sec. The simulation results demonstrate that this novel technique performed well for tuning the PI controller and thus, improved the system response. The proposed model aids in the visualization of data in situations where wireless applications cannot operate independently of traditional database transactions. Data is accessed from both traditional centralized and distributed sources, as well as wireless applications, at the same time. It includes mobile transactions/queries as well as dissemination applications. As stated in our previous work [31], our model easily visualizing all kinds of the access. To aid comprehension and the appreciation of our proposed model, we classify the various types into the units listed below.
• Contents Providers (CP)s offer the data to be read out and revised by each user.
• Dissemination Operators (DO)s are in control to push the data. Moreover, CPs feed DOs along with the required disseminated data.
• Mobile Support Stations (MSS)s are the conventional platforms to help bi-directional wireless communication among wireless users. • Dissemination Controller (DC) directs data to be disseminated from the MSSs, CPs to DOs.
Functional units of dissemination design are separated into the 4 stages of the cellular network as follows.
• The Database level: In this level, the CPs supplies the data to be disseminated, which they maintain and manage. These may be legacy systems that support conventional relational databases and SQL access. • The Signaling level: In this level, one or more DC is required to specify what and when data items are put in the wireless dissemination channels. • The Network level: At this level, MSSs provide the services and infrastructure needed to support the normal two-way wireless phone/data usage and the User level where Wireless Clients (WC)'s exists. In this paper, a techno-economical HSAPF has been implemented to overcome the power quality issue by using an appropriate soft computing technique. Initially, Pq0 and I d -I q control techniques are implemented in SIMULINK for current reference compensation, and then an innovative PSO-based adaptive Fuzzy PI system is proposed to overcome the non-linearity of conventional controllers. In this research, a novel control technique has been implemented to enhance the power system efficiency and ease of implementation in hardware when needed. The benefits of the technique over traditional controllers are summarized as follow: • The error measured DC voltage of VSI and the set value is minimized in the case of a PSO-based adaptive Fuzzy PI. • The proposed technique gives better tracking performance and robustness for reactive power compensation and harmonics mitigation. • It's economical, easy to carry out the technique.
Three different control techniques are analyzed in this paper for a three-phase HSAPF. The proposed design reduces THD to the lowest possible levels in all test cases. It can observed that the THD of source current in the case of PSO-based adaptive Fuzzy PI has reduced to 1.72%, while in the case of PSO-PI, it is reduced to 1.98% that lies the IEEE, 519-1992 harmonic standard. Therefore, it could be inferred from the comparative analysis that the adaptive Fuzzy PI system tuned by PSO has accurate results with a less THD, with minimum T st , and a power factor nearer to unity. This work can be further extended in the future as instead of using PI controller, FOPI based PSO-GA technique can be implemented for further improvement in the performance of HSAPF. Moreover, a practical implementation based on a real hardware platform of this proposed technique can be considered in future work to test the results in MATLAB of the proposed technique.