scieee AI-readable full text Open interactive document viewer

Least mean squares and recursive least squares algorithms for total harmonic distortion reduction using shunt active power filter control

Martinek, Radek

Abstract

This paper deals with the use of least mean squares (LMS, NLMS) and recursive least squares (RLS) algorithms for total harmonic distortion (THD) reduction using shunt active power filter (SAPF) control. The article presents a pilot study necessary for the construction of our own controlled adaptive modular inverter. The objective of the study is to find an optimal algorithm for the implementation. The introduction contains a survey of the literature and summarizes contemporary methods. According to this research, only adaptive filtration fulfills our requirements (adaptability, real-time processing, etc.). The primary benefit of the paper is the study of the efficiency of two basic approaches to adaptation ((N)LMS and RLS) in the application area of SAPF control. The study examines the impact of parameter settings (filter length, convergence constant, forgetting factor) on THD, signal-to-noise ratio (SNR), root mean square error (RMSE), percentage root mean square difference (PRD), speed, and stability. The experiments are realized with real current and voltage recordings (consumer electronics such as PC source without power factor correction (PFC), HI-FI amplifier, etc.), which contain fast dynamic transient phenomena. The realized model takes into account a delay caused by digital signal processing (DSP) (the implementation of algorithms on field programmable gate array (FPGA), approximately 1-5 s) and a delay caused by the reaction time of the proper inverter (approximately 100 s). The pilot study clearly showed that the RLS algorithm is the most suitable for the implementation of an adaptive modular inverter because it achieved the best results for all analyzed parameters.

Full text

Article Least Mean Squares and Recursive Least Squares Algorithms for Total Harmonic Distortion Reduction Using Shunt Active Power Filter Control Radek Martinek *,† ,Jaroslav Rzidky †, Rene Jaros *,† ,Petr Bilik †and Martina Ladrova † Department of Cybernetics and Biomedical Engineering, Faculty of Electrical Engineering and Computer Science, VSB–Technical University of Ostrava, 17. listopadu 15, 708 33 Ostrava, Czech Republic; jaroslav[email protected] (J.R.); petr[email protected] (P.B.); [email protected] (M.L.) *Correspondence: [email protected] (R.M.); r[email protected] (R.J.); Tel.: +420-721-009-971 (R.M.) † These authors contributed equally to this work. Received: 22 March 2019; Accepted: 17 April 2019; Published: 24 April 2019   Abstract: This paper deals with the use of least mean squares (LMS, NLMS) and recursive least squares (RLS) algorithms for total harmonic distortion (THD) reduction using shunt active power filter (SAPF) control. The article presents a pilot study necessary for the construction of our own controlled adaptive modular inverter. The objective of the study is to find an optimal algorithm for the implementation. The introduction contains a survey of the literature and summarizes contemporary methods. According to this research, only adaptive filtration fulfills our requirements (adaptability, real-time processing, etc.). The primary benefit of the paper is the study of the efficiency of two basic approaches to adaptation ((N)LMS and RLS) in the application area of SAPF control. The study examines the impact of parameter settings (filter length, convergence constant, forgetting factor) on THD, signal-to-noise ratio (SNR), root mean square error (RMSE), percentage root mean square difference (PRD), speed, and stability. The experiments are realized with real current and voltage recordings (consumer electronics such as PC source without power factor correction (PFC), HI-FI amplifier, etc.), which contain fast dynamic transient phenomena. The realized model takes into account a delay caused by digital signal processing (DSP) (the implementation of algorithms on field programmable gate array (FPGA), approximately 1–5 µ s) and a delay caused by the reaction time of the proper inverter (approximately 100 µ s). The pilot study clearly showed that the RLS algorithm is the most suitable for the implementation of an adaptive modular inverter because it achieved the best results for all analyzed parameters. Keywords: shunt active power filter (SAPF) control; least mean squares (LMS) algorithm; normalized least mean squares (NLMS) algorithm; recursive least square (RLS); total harmonic distortion (THD); control methods for SAPF; non-linear load; higher harmonic components 1. Introduction This paper deals with the topic of shunt active power filter (SAPF) control [ 1 – 4 ]. The aim of the study is to present a review of the methods of SAPF control used in practice. SAPFs are specially controlled voltage or current inverters, and they have to contain a very powerful computing unit that is able to react to the presence of higher harmonics immediately and reliably compensate these higher harmonics and reactive powers in the network. Contemporary industrial enterprises usually have several types of electric equipment and loads, which can be separated into linear (heating, lamps, active loads, AC machine) and nonlinear (inverters, uninterruptible power supply (UPS) or LED lighting systems). Semiconductor inverters are the main Energies 2019,12, 1545; doi:10.3390/en12081545 www.mdpi.com/journal/energies Energies 2019,12, 1545 2 of 26 source of negative effects on voltage quality in electricity distribution systems. These effects include the strain on the electric network from higher harmonics and reactive power. Nowadays, two types of power filters are commonly used: passive [ 5 ] and active [ 6 ]. A passive power filter (PPF) consists of inductors and capacitors, and its circuit design is simple, but it has the following disadvantages [7]: • An individual PPF is suitable only for a specific harmonic component since the harmonics are high or low enough to be eliminated. Designing a group of PPFs for various harmonics is uneconomical. • Improving the power factor is less effective using a PPF, and in the case of change in the system architecture, the original design is not applicable. • PPF implementation can lead to equipment damage due to the production of series of resonance parallel with the circuit impedance. •The source impedance substantially affects PPF filtering properties. •If a low-resistance circuit generates additional current harmonics, PPF becomes ineffective. •The PPF takes more space. Active filters can be classified as series active filters, shunt active filters, or a combination of these types. A series active filter solves problems related to voltage harmonics, such as voltage flicker, balancing, or sag. Conversely, a shunt active filter is used for solving current-related issues and reactive power compensation. For active power filter (APF) implementation, power switches, inductors, capacitors, and a control circuit are used. The control circuit calculates the compensation current necessary to prevent resonance by the elimination of current harmonics. The disadvantage of the APF is its greater switching loss than in the case of the passive filter. In addition, the complicated design of the APF controller results in low reliability. However, it is easy to develop microprocessors of power electronic components used in APF implementation, thanks to the modern level of technological advancement, so that these disadvantages can be overcome. The effectiveness of APFs is mainly influenced by determining the current harmonic, which can be obtained from either the frequency or time domain. The frequency domain calculation is based on Fourier analysis, and the time domain approach requires the use of instantaneous reactive power theory [ 7 , 8 ]. Using APFs, which are able not only to compensate harmonics but also improve the power factor and voltage regulation under different loads and unbalanced supply conditions, is the most effective solution. This fact has led researchers to develop and implement cost-effective control methods. Today, techniques such as instantaneous reactive power theory (d-q [ 9 , 10 ], p-q [ 11 ], modified d-q [ 12 ], p-q-r [ 13 ], vector [ 12 ]) are implemented to compensate current in the electrical grid [14]. The primary objective of the authors is to develop a controlled adaptive modular inverter, which will reflect the advantages of the adaptive systems. In the SAPF control area, these are new, still unused approaches. The adaptive systems are characterized by the ability to change their parameters according to information about the controlled system or processed signal. The real-time identification (adaptive) algorithm is the core of the adaptive system. Modern adaptive systems have already succeeded in many areas and industries (e.g., biological signal processing [ 15 – 19 ]; speech signal processing [ 20 – 24 ]; control and regulation area [ 25 – 28 ]; etc.), and current practice suggests that the same trend will continue in the future. For the practical use of these methods in real applications, theoretical and practical research of both new and current methods is needed. The application areas of these new approaches to digital signal processing are not very developed yet and are missing in some areas. This can also be said of the area of SAPF control. For this reason, there is a wide scope for further research and development. This paper presents a pilot study in this area. The idea of adaptation is based on the properties of a living mass, so that we can talk about the so-called bio-inspired approach. It refers to inspiration from the ability of living organisms to adapt their behavior to changes in the environment, even though these changes are unfavorable. This phenomenon is called learning. Among systems that are capable of adaptation (learning), in addition to natural systems, we can now also include technical systems. Learning ability is Energies 2019,12, 1545 3 of 26 sometimes considered as a definition of intelligence. It is natural that great effort is dedicated to equipping technical systems with this feature. Technical adaptive systems are characterized by the ability to adjust their parameters to current information about the controlled system or processed signal. Currently, it is possible to observe a fast development of the methods of adaptive signal processing, e.g., various modifications of the basic adaptive algorithms with stochastic gradient [29–31] and recursive optimal adaptation [ 32 – 34 ], artificial neural networks [ 35 , 36 ], fuzzy systems [ 37 , 38 ], and their combination, known as fuzzy-neuro systems [38,39] . The area of adaptive signal processing is one of the fastest developing scientific/technical subjects. With the development of this area, there is often, and especially in technical practice, a question of how these new methods can be used to solve established goals in real applications. This paper focuses on the application of these methods in SAPF control. In this study, currently used control methods for SAPF are analyzed in detail. The experimental part of the paper is focused primarily on adaptive methods for SAPF control. This progressive method of control has been increasingly applied over the last few years. Several basic approaches have evolved: • Artificial intelligence techniques and soft computing techniques (adaptive neuro-fuzzy inference systems (ANFIS), adaptive linear neuron (ADALINE) ) [40–45] • Adaptive algorithms (least mean squares (LMS) algorithm, normalized least mean squares (NLMS), recursive least mean squares (RLS) algorithm, etc.) [46–48]. This study deals with the implementation of LMS, NLMS, and RLS algorithms. The goal is to improve their behaviour for dynamically changing currents, where the nonlinear loads are quickly connected and disconnected. The experimental results are evaluated by total harmonic distortion (THD), signal-to-noise ratio (SNR), root mean square error (RMSE), and percentage root mean square difference (PRD). 2. Shunt Active Power Filter The parallel active filter forms the controlled current generator connected in parallel to a load. It can remove the unwanted higher harmonic components by generating the same components with the inverse phase and introducing them into the network. Thus, the current carried from the network is filtered and the deformations of the voltage, caused by non-sinusoidal voltage drops on power network impedance, are corrected. In this way, the compensation of the harmonic components can be carried out without the danger of unwanted resonance. Due to the generation of phase-shifted fundamental current harmonics, the filter is able to compensate the reactive power very quickly, eventually altering the asymmetric load to a symmetric one. The parallel filter is connected to the network via a coupling passive filter since the inverter of the active filter itself is the source of higher harmonics. The passive filter is a low-pass LC filter [6]. The current or voltage generator can consist of a bridge connection of semiconductor switches (insulated gate bipolar transistor (IGBT)). This generator in the three-phase system contains six switches and the current or voltage source. In practice, a solution with a voltage-source variant was proved. The desired shape of the current flowing to the filter can be obtained by the appropriate switching of transistors on the bridge. Figure 1shows a simplified block diagram of a SAPF [6]. Energies 2019,12, 1545 4 of 26 Controller Inverter V DC I L I C SAPF L f L l V SI SPCC I L Non-linear load producing current harmonics Filter inductance AC voltage source Source current Load current Line inductance Compensation current Figure 1. Block diagram of a shunt active power filter (SAPF). 3. Control Methods for SAPF Nowadays, SAPF control algorithms can be divided into two basic types of control: control in the time domain [ 1 , 49 , 50 ] and control in the frequency domain [ 49 , 51 ]. The control can be used both for one-phase [52] and three-phase connections [49,50,53] of SAPFs. The control methods in the time domain can be separated according to a calculation of the compensation quantities (voltages or currents) using techniques working with the instantaneous powers in the power grid: p-q, unity power factor (UPF), perfect harmonic cancellation (PHC), and the synchronous detection method (SDM), or with the components of the instantaneous current values: synchronous reference frame (SRF), Id-Iq [49]. The control algorithm in the frequency domain uses a Fourier analysis, such as discrete Fourier transform (DFT), fast Fourier transform (FFT), or recursive discrete Fourier transform (RDFT), to obtain the reference values. This has the disadvantage of a long computing time and the generation of a time delay. One period of the signal is needed for the computation of FFT. Some publications compute FFT only from a half or a quarter of a period. This is suitable when the signal shape is symmetric over these stages [49]. 3.1. Control in the Time Domain Methods using an instant value of the current or powers of the load are often used for this purpose. Some techniques employ suitable algebraic transformations (Clarke transform [ 9 ], transformation 3/2). The axis coordinates for these methods are shown in Figure 2. c - axis a - axis α - axis d - axis b - axis β - axis q - axis Θ uq uα Us ud uβ Figure 2. Axis coordinates used in transformations. Energies 2019,12, 1545 5 of 26 3.2. Instantaneous Inactive Filter Control (p-q Theory) The p-q method works with instant values in the three-wire or four-wire three-phase power system. It is suitable for the steady-state signals but also for a transition state. This theory is based on the Clarke transformation [ 9 ] of the three-phase voltages and currents in coordinates a-b-c into the coordinates α - β -0, with a successive calculation of the instantaneous power components of p-q theory. After transformation, the following voltages and currents in coordinates α-β-0 [11] are obtained:    u0 uα uβ   =r2 3·   1 √2 1 √2 1 √2 1−1 2−1 2 0√3 2−√3 2   ·   ua ub uc   , (1)    i0 iα iβ   =r2 3·   1 √2 1 √2 1 √2 1−1 2−1 2 0√3 2−√3 2   ·   ia ib ic   . (2) p=uα·iα+uβ·iβinstantaneous real power. (3) q=uα·iβ+uβ·iαinstantaneous imaginary power. (4) The power components p and q are related to the same α - β voltages and currents, and they can be written down together: "p q#="uαuβ −uβ−uα#·"iα iβ#. (5) For detailed information, see [54,55]. 3.3. Synchronous Reference Frame Method Within the SRF method, the source currents ( ia , ib , ic ) are first detected and transformed into two-axis stationary coordinates α - β -0 from the three-axis stationary coordinate a-b-c according to Equation (6) [10].    iα iβ i0   =r2 3·   1−1 2−1 2 0√3 2−√3 2 1 √2 1 √2 1 √2   ·   ia ib ic   . (6) Two direct Park transformations [ 9 ] are used there. They enable the evaluation of the specific harmonic component of the input signals and low-pass filter. Next, the two-axis current quantities iα and iβ of the stationary axis α - β are transformed into a two-axis synchronous (rotating) coordinate d-q according to Equation (7), where cos Φ and sin Φ represent a synchronous unit of the vectors, which can be generated using a phase locked loop (PLL) [10]. "id iq#="cosΦsinΦ sinΦcosΦ#·"iα iβ#. (7) The currents id and iq contain both AC and DC components. The primary component of the current is the fixed DC part, and the AC component represents a harmonic part. This harmonic component can be easily extracted using the high-pass filter. The current id is the combination of the fundamental active current ( id_DC ) and the harmonic current of the load ( idh ). The primary component of the current rotates synchronously with the rotating axis, and it can be considered as the direct current. By the filtering of id , the current representing the fundamental component of the current of the load in the synchronous axis is gained. Thus, the AC component idh can be obtained by subtracting id_DC from the total current id , which leaves behind the harmonic component present in the current of the load. In the rotating axis, the current of axis q ( iq ) represents a sum of the fundamental reactive Energies 2019,12, 1545 6 of 26 current and of the harmonic currents of the load. The current in axis q can be used for the calculation of the reference compensation current. The inverse transformation is made for the transformation of the currents from the two-axis synchronous axis d-q into a two-axis stationary axis α - β according to Equation (8) [10]. "iα iβ#="cosΦ−sinΦ sinΦcosΦ#·"idh iq#. (8) In the end, the current transformed from the two-axis stationary axis α - β -0 back into the three-axis stationary axis a-b-c according to Equation (9) and the compensation reference currents i∗ ca , i∗ cb , and i∗ cc are obtained [10].    i∗ ca i∗ cb i∗ cc   =r2 3·    1 0 1 √2 −1 2 √3 21 √2 −1 2−√3 21 √2    ·   iα iβ i0   . (9) 3.4. Control of Instant Values of Current Components (ID-IQ Method) This method uses the same system of coordinates as SRF, but unlike SRF, there is no need for a phase-locked loop (PLL) and synchronization. The currents id and iq can be obtained from Equation (10) [50]. "id iq#=r2 3·"cosΦcos(Φ−2π 3)cos(Φ−4π 3) −sinΦ−sin(Φ−2π 3)−sin(Φ−4π 3)#·   ia ib ic   , (10) where cosΦ=uα qu2 α+u2 β ,sinΦ=uβ qu2 α+u2 β , (11) where uαand uβare from p-q theory. This method is also suitable for three-phase systems [50]. The conversion from coordinates d-q to coordinates a-b-c is the same as in the case of SRF. For detailed information see [56]. 3.5. Control of Instantaneous Inactive Power in Coordinates p-q-r This theory is characterized by a double transformation process: a first conversion of the voltages and currents from the coordinates a-b-c into coordinates α - β -0 and a second conversion from the coordinates α-β-0 to coordinates p-q-r according to the following equations [13]:    iα iβ i0   =r2 3·   1−1 2−1 2 0√3 2−√3 2 1 √2 1 √2 1 √2   ·   ia ib ic   , (12)    uα uβ uβ   =r2 3·   1−1 2−1 2 0√3 2−√3 2 1 √2 1 √2 1 √2   ·   ua ub uc   . (13) The physical importance of the coordinate transformation of the equations mentioned above is shown in Figure 3. The vertical angles from the plane α - β into coordinates a-b-c are the same, namely Φ=tg−1(1/√2), and axis a is located above axis α[13]. As shown in Figure 4a, the new coordinate α0 - β0 -0 is made by rotating axis 0 of the coordinate α - β -0 using angle Φ1 , which results in the alignment of axis α with a vector of the instantaneous spatial Energies 2019,12, 1545 7 of 26 voltage ( eαβ ) into the plane α - β . The current of the spatial vector in coordinate α0 - β0 -0 can be expressed as [13]   iα0 iβ0 i0   =   cosΦ1sinΦ10 −sinΦ1cosΦ10 0 0 1   ·   iα iβ i0   =    eα eαβ eβ eαβ 0 −eβ eαβ eα eαβ 0 0 0 1    ·   iα iβ i0   , (14) where eαβ =qe2 α+e2 β. (15) α - axis b - axis β - axis 0 - axis c - axis a - axis Θ Figure 3. The physical importance of the coordinate transformation between a-b-c and α-β-0. Similarly, the coordinates p-q-r can occur by the rotation of axis β0 of the coordinate α0 - β0 -0 using angle Φ2 , as shown in Figure 4b. This results in the alignment of axis α0 with a vector of the instantaneous spatial voltage ( eαβ0 ). The current of the spatial vector in the coordinate p-q-r is expressed as [13]    ip iq ir   =   cosΦ20sinΦ2 0 1 0 −sinΦ20cosΦ2   ·   iα0 iβ0 i0   =    eαβ eαβ00e0 eαβ0 0 1 0 −e0 eαβ00eαβ eαβ0    ·   iα0 iβ0 i0   , (16) where eαβ0=qe2 α+e2 β+e2 0. (17) α - axis β - axis e Θ a) b) β' - axis α' - axis 1 α eβ 0 - axis (q - axis) eαβ Θ1 α' - axis 0 - axis e Θ r - axis p - axis 2 αβ e0 q - axis eαβ0 Θ2 Figure 4. The physical importance of the coordinates p-q-r; ( a ) the relation between coordinates α0 - β0 -0 and α - β -0 (a view from the top of axis 0); and ( b ) the relation between coordinates α0 - β0 -0 and p-q-r (a bottom view of axis 0). Energies 2019,12, 1545 8 of 26 The axes β0 and q are identical. By the combination of Equations (16) and (18), the transformation from coordinate α-β-0 into coordinate p-q-r occurs [13]:    ip iq ir   =    eα eαβ0 eβ eαβ0 e0 eαβ0 −eβ eαβ eα eαβ 0 −e0·eα eαβ0·eαβ −e0·eβ eαβ0·eαβ eαβ eαβ0    ·   iα iβ i0   . (18) 3.6. Unity Power Factor The UPF method requires that the load and active power filter are considered as a linear load. If this is fulfilled, the source current after compensation is expressed as isref =K·us, (19) where Kaccording to Equation (20) is the conductivity of the nonlinear load and the power active filter. After compensation, the source current is sinusoidal with the same shape as the source voltage, and they are in phase. No higher harmonics are present in the current source, and the power factor is equal to one [1,52]. K=−→ pLαβ +−→ pL0 (u2 0+u2 α+u2 β)DC . (20) The power delivered by the source is ps =us·isref =us·K·us=K(u2 0+u2 α+u2 β). (21) The reference current of the source is defined as    is0ref isαref isβref   =K·   u0 uα uβ   =−→ pLαβ +−→ pL0 (u2 0+u2 α+u2 β)DC ·   u0 uα uβ   . (22) 3.7. Perfect Harmonic Cancellation The result of these methods is the compensation of all of the harmonic currents and the fundamental reactive power taken by the load. The current of the source is in phase with a fundamental component of the voltage of the source at the point of common coupling (PCC) [ 1 ]. The reference source current is defined as isref =K·u+ 1, (23) where u+ 1is the spatial vector of voltage with a fundamental harmonic of the source at the PCC. The power delivered by the source is expressed as ps =us·isref =us·K·u+ 1=K(uα·u+ α1+uβ·u+ β1), (24) where K=−→ pLαβ +−→ pL0 u+2 α1+u+2 β1 . (25) In the end, the reference current of the source is defined:    is0ref isαref isβref   =K·   0 uα1 uβ1   =−→ pLαβ +−→ pL0 u+2 α1+u+2 β1·   0 u+ α1 u+ β1   . (26) Energies 2019,12, 1545 9 of 26 3.8. Synchronous Detection Method This theory can work effectively in symmetric or asymmetric systems because the compensation currents are calculated by taking into account the voltages of individual phases. This theory is used to calculate the compensation currents, while the three-phase source powers a highly nonlinear load. The method of the uniform distribution of the SDM current is used in this study to compute three-phase compensation currents that are supplied by the active filter [53]. When calculating three-phase compensation currents using the method of equal distribution of SDM current, the following assumptions are taken into account: the voltage is not distorted and the loss in the neutral wire is negligible [53]. Assume that the maximal values of source currents are symmetric after compensation: Iam =Ibm =Icm =Im. (27) The maximal values of the active curents in each phase after compensation are Iam =2Pa Uam ,Ibm =2Pb Ubm ,Icm =2Pc Ucm , (28) where Pa , Pb , and Pc are the real powers of each phase, and Uam , Ubm , and Ucm are the maximal values of the voltages of each phase. Overall average power is defined as PTav =Pa+Pb+Pc. (29) By adjusting, we get Ut=Uam +Ubm +Ucm, (30) Pa=Uam Ut Pav,Pb=Ubm Ut Pav,Pc=Ucm Ut Pav. (31) The currents of the reference active source are calculated as iac c(t) = 2Pav Uam ·Ut uan(t), (32) ibc c(t) = 2Pav Ubm ·Ut ubn(t), (33) icc c(t) = 2Pav Ucm ·Ut ucn(t), (34) where the compensation currents are defined as ic an(t) = ian(t)−iac c(t), (35) ic bn(t) = ibn(t)−ibc c(t), (36) ic cn(t) = icn(t)−icc c(t). (37) 3.9. Selection of the Optimal Method Revuelta et al. [ 12 ] analyzed the strategies gained from five formulations of the instantaneous power theory (d-q [ 9 , 10 ], p-q [ 11 ], modified d-q [ 12 ], p-q-r [ 13 ], and vector [ 12 ]) applied on symmetrical, asymmetrical, and non-sinusoidal symmetrical nonlinear systems. They compare the performance of the compensation using two quantities measured in the source currents after compensation: the value of THD and the effective value of the current in the neutral wire in a three-phase four-wire system. Energies 2019,12, 1545 16 of 26 Voltage input module NI 9225 has three direct voltage inputs. The incoming analog signal on each channel was conditioned, buffered, and then sampled by a 24-bit Delta-Sigma AD converter. The operating input range of NI 9225 is 850 Vpp (peak–peak). Loads were connected to a low-level distribution system with a nominal voltage of 230 V, 50 Hz, and this voltage was measured. Current input module NI 9227 has four direct current inputs using a 12 m Ω shunt resistor as a current sensor. The incoming analog signal on each channel was conditioned, buffered, and then sampled by a 24-bit Delta-Sigma AD converter. The operating input range of NI 9227 is 28 App(peak–peak). Thanks to the enormous dynamic range of the 24-bit AD converter, the typical scaling coefficient (SC) was 1.785 µA/LSB. SC =Ipp 2N=28 224 =1.785 µA. (52) From the set of loads presented in Figure 9, the smallest currents were measured for the following two loads: (d) HI-FI amplifier in standby mode had a peak–peak current of 30 mA and (f) the audio-tape recorderhad the peak–peak current of 80 mA. From the information above can be calculated the number of AD converter levels used to represent the smallest measured current, 30 mApp: 30 mApp 1.785 µA=16806 levels. (53) To calculate the AD converter output word width from the known number of AD converter levels, the following formula can be used: I=log216806 =14.037 bit. (54) From this formula, it is evident that even the measured current peak-to-peak value (30 m App ) is very small in comparison with the input range of the current module (28 A). Thanks to the huge dynamic range of the 24-bit AD converter used, the small signal is theoretically divided into 16806 levels and this corresponds to 14-bit AD converter. For the measurement equipment, the effective number of bits (ENOB) has to be considered to respect the whole signal-chain and the real AD converter parameters. In the documentation for NI 9227, the ENOB cannot be found, but even subtracting 4 bits because of noise, the smallest measured signal was converted into digital form using a 14 − 4 = 10 bit AD converter. Regular oscilloscopes use 8 bit AD converters, the high-end oscilloscopes use 10 bit AD converters, and only the best oscilloscopes use 12 bit AD converters [79]. 6. Results For the purpose of simulation, a delay of 100 µ s was added, which corresponds to the delay of the inverter, on which we will apply the algorithms. This delay resulted in the current after compensation not having the clearly sinusoidal waveform that was obtained in the case of adaptive algorithms without delay. However, from the view of the THD, this is a substantial improvement, namely from 63.27 % to 12.51 % when using LMS; to 14.3 % when applying NLMS, and to 6.43 % when utilizing the RLS algorithm. Figures 11–13 show the waveform of the reference (green) and input (red) signals after filtration. The overshoots in the first 100 ms are caused by the delay of the inverter and by the type of compensated load. The overshoots are not so evident in the case of other types of load. In Figure 14, the frequency spectras of the signal before and after filtration are shown. Before filtration, there exists a significant level of the third and fifth harmonics in the spectra. Those harmonics are suppressed by filtration using all three adaptive algorithms. Energies 2019,12, 1545 17 of 26 0 0.1 0.2 0.3 0.4 0.5 0.6 Time (s) -1 0 1 Current(A) Time (s) -0.02 0 0.02 Current(A) 0.3 0.4 0.5 0.6 Time (s) -0.05 0 0.05 Current(A) Figure 11. Input signal after filtration using the LMS algorithm; filter length 10, step size 0.005, delay 100 µs. 0 0.1 0.2 0.3 0.4 0.5 0.6 Time (s) -1 0 1 Current(A) 0.5 0.6 Time (s) 0.3 0.4 Time (s) -0.05 0 0.05 Current(A) -0.02 0 0.02 Current(A) Figure 12. Input signal after filtration using the NLMS algorithm; filter length 100, step size 0.005, delay 100 µs. 0 0.1 0.2 0.3 0.4 0.5 0.6 Time (s) -2 0 2 Current(A) 0.3 0.4 Time (s) 0.5 0.6 Time (s) -0.02 0 0.02 Current(A) -0.05 0 0.05 Current(A) Figure 13. Input signal after filtation using the RLS algorithm; filter length 2, forgeting factor 0.999, delay 100 µs. Energies 2019,12, 1545 18 of 26 a) b) c) d) 1 10 100 Current (%) THD = 63.27 % 0 200 400 600 800 1000 Frequency (Hz) 1 10 100 Current (%) THD = 12.51 % 0 200 400 600 800 1000 Frequency (Hz) 1 10 100 Current (%) THD = 14.30 % 0 200 400 600 800 1000 Frequency (Hz) 1 10 100 Current (%) THD = 6.42 % 0 200 400 600 800 1000 Frequency (Hz) Figure 14. FFT of input signal from 0 to 600 ms; ( a ) before filtration, ( b ) after applying the LMS algorithm with a filter length of 10 and a step size of 0.005, ( c ) after applying the NLMS algorithm with a filter length of 100 and a step size of 0.005, ( d ) after applying the RLS algorithm with a filter length of 2 and a forgetting factor of 0.999. In Figure 15, you can see that the effect of the inverter delay on the THD was tested as part of adaptive filtration testing when the RLS algorithm was used. It was found that with a filter length of 2 and forgetting factor of 0.999, the delay set from 50 µ s to 200 µ s had an effect on the THD in the range of ± 8 %. This range varies depending on the filter settings, so the correct adaptive algorithm settings will be crucial for our application. a) b) c) d) e) f) 0 0.1 0.2 0.3 0.4 0.5 0.6 Time (s) -2 0 2 Current (A) 0 0.1 0.2 0.3 0.4 0.5 0.6 Time (s) -2 0 2 Current (A) 0 0.1 0.2 0.3 0.4 0.5 0.6 Time (s) -2 0 2 Current (A) 1 10 100 Current (%) THD = 4.89 % 0 500 1000 Frequency (Hz) 1 10 100 Current (%) THD = 9.14 % 0 500 1000 Frequency (Hz) 1 10 100 Current (%) THD = 13.66 % 0 500 1000 Frequency (Hz) Figure 15. Influence of inverter delay on shape and THD after applying the RLS algorithm with a filter length of 2 and a forgetting factor of 0.999. ( a ) after applying a 50 µ s delay, ( b ) after applying a 150 µ s delay, ( c ) after applying a 200 µ s delay, ( d ) FFT after applying a 50 µ s delay, ( e ) FFT after applying a 150 µs delay, and (f) FFT after applying a 200 µs delay. Energies 2019,12, 1545 19 of 26 6.1. Total Harmonic Distortion The THD defines the distortion of the sinus signal, indicated as a percentage. It is defined as a ratio of the sum of all powers of harmonic components and the power of the fundamental harmonic [ 80 , 81 ]. THD =qP2 2+P2 3+P2 4+···+P2 n P1·100, (55) where P1 is the power of the fundamental harmonic, and P2 , . . . , Pn are the powers of higher harmonics. 6.2. Signal-to-Noise Ratio The SNR is defined as the useful signal standoff from the noise, and it is indicated in decibels (dB). If the SNR is higher than 0 dB, the useful signal is greater than the noise. For the calculation, there is a need to know the ideal (reference) signal [82]. SNROUT =10 ·log10 ∑N−1 i=1[sigideal(i)]2 ∑N−1 i=1[sigout(i)−sigideal(i)]2!. (56) 6.3. Root Mean Square Error The RMSE is defined as the mean quadratic error. It settles the difference between real and ideal values. The unit is established according the measured quantity [83]. RMSEOUT =1 nsn ∑ i=1sigout(i)−sigideal(i)2. (57) 6.4. Percentage Root Mean Square Difference The PRD is defined as the percent difference of the mean quadratic error [84,85]. PRDOUT =v u u t∑N i=1[sigideal(i)−sigout(i)]2 ∑N i=1sig2 ideal(i)·100. (58) The filtration quality can be evaluated using the parameters THD, RMSE, and PRD when the values should be as low as possible and the parameter SNR when the values should be as high as possible. The LMS and NLMS algorithms have a time of convergence under 100 ms with suitable settings and the RLS algorithm takes approximately 10 ms to stabilize the initial overcoming oscillation. Thus, we examined this time and the steady time separately. From Tables 2and 3, it can be seen that during the application of the LMS and NLMS algorithms, the THD is lower with a smaller step size. However, there is a longer time of convergence. For this reason, it is suitable to also compare the signal based on other parameters, such as SNR, RMSE, or PRD. Therefore, the most suitable settings of the LMS algorithm are a filter length of 10 and a step size of 0.001, and for the NLMS algorithm, a filter length of 100 and a step size of 0.001. Tables 2and 3lead to the conclusion that in the case of the RLS algorithm, it is not appropriate to set the value of the forgetting factor under 0.999 because these settings are non-stable or the parameters of the electrical network get worse. The best results were obtained using a forgetting factor of 0.999. The size of the filter length has an impact primarily in transitions where the amplitude changes, and in the case of a large filter length, the overcoming oscillations, which can reach up to multiple of the desired amplitude, occur. Energies 2019,12, 1545 20 of 26 Table 2. Results of the experiment using adaptive algorithms for the initial stage (from 0 to 100 ms). LMS Filter Length (-) = 10 Filter Length (-) = 30 µTHD SNROUT RMSEOUT PRDOUT THD SNROUT RMSEOUT PRDOUT (-) (%) (dB) (A) (%) (%) (dB) (A) (%) 0.01 31.41 7.25 0.0012 43.42 70.68 2.09 0.0022 78.57 0.001 49.31 4.19 0.0018 62.02 31.92 6.55 0.0013 47.06 0.005 28.69 7.57 0.0012 41.83 41.48 5.41 0.0015 53.65 NLMS Filter Length (-) = 50 Filter Length (-) = 100 µTHD SNROUT RMSEOUT PRDOUT THD SNROUT RMSEOUT PRDOUT (-) (%) (dB) (A) (%) (%) (dB) (A) (%) 0.01 56.43 4.38 0.0017 60.38 55.95 4.33 0.0017 60.78 0.001 52.16 4.07 0.0018 62.57 44.98 4.31 0.0017 60.85 0.005 42.34 5.61 0.0015 52.44 38.59 5.90 0.0014 50.70 RLS Filter Length (-) = 2 Filter Length (-) = 30 λTHD SNROUT RMSEOUT PRDOUT THD SNROUT RMSEOUT PRDOUT (-) (%) (dB) (A) (%) (%) (dB) (A) (%) 0.99 84.37 1.41 0.0024 84.97 Unstable Unstable Unstable Unstable 0.999 29.63 8.41 0.0011 37.98 29.55 7.95 0.0011 40.06 0.9999 31.71 8.10 0.0011 39.36 31.29 7.71 0.0011 41.15 1 31.95 8.06 0.0011 39.52 31.52 7.68 0.0012 41.31 µis the step size; λis the forgetting factor. Table 3. Results of the experiment using adaptive algorithms for a settled filter (from 100 to 600 ms). LMS Filter Length (-) = 10 Filter Length (-) = 30 µTHD SNROUT RMSEOUT PRDOUT THD SNROUT RMSEOUT PRDOUT (-) (%) (dB) (A) (%) (%) (dB) (A) (%) 0.01 19.33 8.65 0.00060 36.95 37.03 5.21 0.00089 54.89 0.001 5.96 18.08 0.00020 12.47 7.59 14.17 0.00032 19.57 0.005 10.86 12.69 0.00037 23.19 26.68 6.92 0.00073 45.09 NLMS Filter Length (-) = 50 Filter Length (-) = 100 µTHD SNROUT RMSEOUT PRDOUT THD SNROUT RMSEOUT PRDOUT (-) (%) (dB) (A) (%) (%) (dB) (A) (%) 0.01 24.92 9.37 0.00055 33.99 24.03 9.93 0.00051 31.89 0.001 8.79 11.70 0.00042 26.00 8.50 11.92 0.00041 25.35 0.005 13.44 11.23 0.00044 27.44 12.58 12.76 0.00037 23.02 RLS Filter Length (-) = 2 Filter Length (-) = 30 λTHD SNROUT RMSEOUT PRDOUT THD SNROUT RMSEOUT PRDOUT (-) (%) (dB) (A) (%) (%) (dB) (A) (%) 0.99 40.65 3.57 0.00107 66.32 Unstable Unstable Unstable Unstable 0.999 5.40 16.92 0.00023 14.26 7.55 16.44 0.00024 15.07 0.9999 7.11 18.23 0.00020 12.27 6.89 18.25 0.00020 12.24 1 7.50 18.08 0.00020 12.47 7.38 18.13 0.00020 12.41 µis the step size; λis the forgetting factor. 6.5. Discussion The designed conception, “least mean squares and recursive least squares algorithms for total harmonic distortion reduction using shunt active power filters control”, can also be used in a three-phase system. It is obvious that the proposal of three independent adaptive systems is needed for the three-phase design. The authors have solved the problematics in [40–42,46,48]. Energies 2019,12, 1545 21 of 26 The next objective of the research, which will continue on from this study, will be the construction of a proper adaptive modular inverter. Different methods of SAPF control will be tested based on this system. The authors will focus on the development of a current generator designed to inject harmonics into the power grid and a set of nonlinear loads. The system will contain three independent one-phase generators and a module with a separate chokefor the possibility of inserting a defined impedance in the power grid. The generators can be used individually in a one-phase power grid or as a common assembly in a three-phase power grid. It will then be possible to test on this system. In the authors’ opinion, a comparative study of all methods mentioned above (traditional and modern) should be the object of subsequent research (see Figure 16), where ANN is artificial neural network, SRF is synchronous reference frame, SDFT is sliding discrete Fourier transform, and RDFT is recursive discrete Fourier transform. Currently, only a limited amount of comparative studies have been conducted, e.g., [86,87]. It is evident that the advanced techniques of signal processing are beginning to be applied in the SAPF control area, where they are still new. Nowadays, no comparative studies, which would compare the individual methods from the view of dynamic properties, THD improvement, implementation complexity, etc., exist. Reference current estimation methods Modern Traditional Time domain Frequency domain Soft computing methods P-Q theory SRF theory FFT SDFT RDFT Wavelet transform ANN Adaptive filtering Figure 16. Schematic diagram of current estimation methods. Current trends in the domain of advanced methods of signal processing show that it would be possible to use some of the soft-computing methods for SAPF control [86,88], namely •Adaptive systems [89–93], •Methods based on techniques of artificial intelligence [94–98]. 7. Conclusions Within the experiments conducted, the simulation of an adaptive system, which was used to test the representatives of both basic families of adaptive algorithms, LMS and RLS, was undertaken. This system was used for the suppression of higher harmonic components. The practical use may rest in the suppression of higher harmonics and reactive power in an electrical network, primarily in an industry where nonlinear loads are abundantly represented. The system was tested using real data, which were measured on consumer electronics. In the case of the LMS algorithm, the impact of the filter length and size of the convergence constant on the properties of the examined system was evaluated, specifically the signal distortion and the convergence time. It was shown that the requirements for these two properties are contradictory. By setting the filter length and the convergence constant, we can get either a system with fast adaptation but with a high distortion value, or the converse. In the case of the RLS algorithm, the impact of the filter length and the forgetting factor, which determines how many samples the system remembers, were examined. With an increasing filter length, higher overcoming oscillations occurred with changes in amplitude. Energies 2019,12, 1545 22 of 26 With a decreasing value of the forgetting factor, the algorithm was more sensitive to recent samples, and it did not reach the desired accuracy, or it did not become stable. Thus, in general, the RLS algorithm was found to be faster, and it showed better filtration results but at the expense of computational difficulty. The LMS algorithm did not have as good results as the RLS algorithm, but due to its low computational cost, it is suitable for practical use. In the future, we can expect an increase in computing power, which will lead to a more powerful DSP. Thus, the requirement of low computational costs for individual algorithms will disappear, and it will be possible to realize more powerful algorithms. Author Contributions: Conceptualization, R.M. and J.R.; Methodology, R.M. and J.R.; Software, J.R.; Resources, R.M., P.B. and J.R.; Validation, R.M., P.B. and J.R.; Formal Analysis, R.M., J.R., R.J., P.B. and M.L.; Investigation, R.M., J.R., R.J., M.L. and P.B.; Writing—Original Draft Preparation, J.R.; Writing—Review & Editing, R.M., P.B., M.L. and R.J.; Data Curation, J.R., P.B. and R.M.; Visualization, R.J.; Supervision, R.M.; Project Administration, R.M.; Funding Acquisition, R.M. Funding: This article was supported by the Ministry of Education of the Czech Republic (Projects No. SP2019/118, SP2019/85). This work was also supported by the European Regional Development Fund in the Research Centre for Advanced Mechatronic Systems, project number CZ.02.1.01/0.0/0.0/16_019/0000867 within the Operational Programme entitled Research, Development, and Education. Conflicts of Interest: The authors declare no conflict of interest. References 1. Montero, M.I.M.; Cadaval, E.R.; Gonzalez, F.B. Comparison of control strategies for shunt active power filters in three-phase four-wire systems. IEEE Trans. Power Electron. 2007,22, 229. [CrossRef] 2. Kanjiya, P.; Khadkikar, V.; Zeineldin, H.H. Optimal control of shunt active power filter to meet IEEE Std. 519 current harmonic constraints under nonideal supply condition. IEEE Trans. Ind. Electron. 2015,62, 724–734. [CrossRef] 3. Mehrasa, M.; Pouresmaeil, E.; Zabihi, S.; Rodrigues, E.M.; Catalao, J.P. A control strategy for the stable operation of shunt active power filters in power grids. Energy 2016,96, 325–334. [CrossRef] 4. Panigrahi, R.; Subudhi, B.; Panda, P.C. A robust LQG servo control strategy of shunt-active power filter for power quality enhancement. IEEE Trans. Power Electron. 2016,31, 2860–2869. [CrossRef] 5. Rahman, N.F.A.; Hamzah, M.K.; Noor, S.Z.M.; Hasim, A.S.A. Single-phase hybrid active power filter using single switch parallel active filter and simple passive filter. In Proceedings of the 2009 International Conference on Power Electronics and Drive Systems (PEDS), Taipei, Taiwan, 2–5 November 2009; pp. 40–45. [CrossRef] 6. Korenc, V.; Holoubek, J. Reactive Power Compensation in Practice; Electronics Libraries: Prague, Czech Republic, 1999. 7. Chen, M.H. Development of shunt-type three-phase active power filter with novel adaptive control for wind generators. Sci. World J. 2015,2015, 963456. [CrossRef] [PubMed] 8. Chavan, U.M.; Thorat, A.R.; Bhosale, S.S. Shunt Active Filter for Harmonic Compensation Using Fuzzy Logic Technique. In Proceedings of the 2018 International Conference on Current Trends towards Converging Technologies (ICCTCT), Coimbatore, Tamilnadu, India, 1–3 March 2018; pp. 1–6. [CrossRef] 9. Bula, D.; Pasko, M. Model of hybrid active power filter in the frequency domain. Anal. Simul. Electr. Comput. Syst. 2015, 15–26. [CrossRef] 10. Sawant, D.P.; Chavan, P.P. SRF Method for Compensation of Source Current Harmonics using Shunt Active Filter. Int. J. Innov. Technol. 2016,4, 3652–3655. 11. Afonso, J.L.; Couto, C.; Martins, J.S. Active filters with control based on the pq theory. IEEE Ind. Electron. Soc. Newslett. 2000,47, 5–10. 12. Revuelta, P.S.; Herrera, R.S. Application of the instantaneous power theories in load compensation with active power filters. In Proceedings of the 10th European Conference on Power Electronics and Applications, Toulouse, France, 2–4 Semptember 2003. 13. Kim, H.; Akagi, H. The instantaneous power theory on the rotating pqr reference frames. In Proceedings of the IEEE 1999 International Conference on Power Electronics and Drive Systems. PEDS’99, Hong-Kong, China, 27–29 July 1999; Volume 1, pp. 422–427. [CrossRef] Energies 2019,12, 1545 23 of 26 14. Diab, M.; El-Habrouk, M.; Abdelhamid, T.H.; Deghedie, S. Survey of Active Power Filters Configurations. In Proceedings of the 2018 IEEE International Conference on System, Computation, Automation and Networking (ICSCA), Pondicherry, India, 6–7 July 2018; pp. 1–14. [CrossRef] 15. Thakor, N.V.; Zhu, Y.S. Applications of adaptive filtering to ECG analysis: noise cancellation and arrhythmia detection. IEEE Trans. Biomed. Eng. 1991,38, 785–794. [CrossRef] 16. Stein, J.Y. Digital Signal Processing: A Computer Science Perspective; John Wiley & Sons, Inc.: Hoboken, NJ, USA, 2000. 17. Uncini, A. Fundamentals of Adaptive Signal Processing; Springer International Publishing: Cham, Switzerland, 2015. 18. Taebi, A.; Mansy, H.A. Noise cancellation from vibrocardiographic signals based on the ensemble empirical mode decomposition. J. Biotechnol. Bioeng. 2017,2, 00024. [CrossRef] 19. Aslam, M.S.; Raja, M.A.Z. A new adaptive strategy to improve online secondary path modeling in active noise control systems using fractional signal processing approach. Signal Process. 2015 ,107, 433–443. [CrossRef] 20. Clarkson, P.M. Optimal and Adaptive Signal Processing; Routledge: Abingdon-on-Thames, UK, 2017. 21. Mowlaee, P.; Saeidi, R.; Stylianou, Y. Advances in phase-aware signal processing in speech communication. Speech Commun. 2016,81, 1–29. [CrossRef] 22. Mars, P. Learning Algorithms: Theory and Applications in Signal Processing, Control and Communications; CRC Press: Hoboken, NJ, USA, 2018. 23. Chan, W.; Jaitly, N.; Le, Q.; Vinyals, O. Listen, attend and spell: A neural network for large vocabulary conversational speech recognition. In Proceedings of the 2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Shanghai, China, 20–25 March 2016; pp. 4960–4964. [CrossRef] 24. Saegrov, A.; Kamben, R.U.S. Method and System for Long-Range Adaptive Mobile Beam-Forming Ad-Hoc Communication System With Integrated Positioning. U.S. Patent No. 9,516,513, 6 December 2016. 25. Wang, J.; Su, W.; Sabatti, C.; Owen, A.B. Detecting Replicating Signals using Adaptive Filtering Procedures with the Application in High-throughput Experiments. arXiv 2016, arXiv:1610.03330. 26. Imani, M.; Braga-Neto, U.M. Maximum-likelihood adaptive filter for partially observed boolean dynamical systems. IEEE Trans. Signal Process. 2017,65, 359–371. [CrossRef] 27. Shi, Y.; Shen, C.; Fang, H.; Li, H. Advanced control in marine mechatronic systems: A survey. IEEE/ASME Trans. Mechatron. 2017,22, 1121–1131. [CrossRef] 28. Srinivas, M.; Hussain, I.; Singh, B. Combined LMS–LMF-based control algorithm of DSTATCOM for power quality enhancement in distribution system. IEEE Trans. Ind. Electron. 2016,63, 4160–4168. [CrossRef] 29. Schmidt, M.; Le Roux, N.; Bach, F. Minimizing finite sums with the stochastic average gradient. Math. Program. 2017,162, 83–112. [CrossRef] 30. Ruder, S. An overview of gradient descent optimization algorithms. arXiv 2016, arXiv:1609.04747. 31. Mandt, S.; Hoffman, M.D.; Blei, D.M. Stochastic gradient descent as approximate bayesian inference. J. Mach. Learn. Res. 2017,18, 4873–4907. 32. Wu, Z.; Shi, J.; Zhang, X.; Ma, W.; Chen, B.; Senior Member, I.E. Kernel recursive maximum correntropy. Signal Process. 2015,117, 11–16. [CrossRef] 33. Shanechi, M.M.; Orsborn, A.L.; Carmena, J.M. Robust brain-machine interface design using optimal feedback control modeling and adaptive point process filtering. PLoS Comput. Biol. 2016,12, e1004730. [CrossRef] 34. Wang, J.; Yu, C.; Li, S.E.; Wang, L. A forward collision warning algorithm with adaptation to driver behaviors. IEEE Trans. Intell. Transp. Syst. 2016,17, 1157–1167. [CrossRef] 35. Elobaid, L.M.; Abdelsalam, A.K.; Zakzouk, E.E. Artificial neural network-based photovoltaic maximum power point tracking techniques: A survey. IET Renew. Power Gener. 2015,9, 1043–1063. [CrossRef] 36. Ali, J.B.; Fnaiech, N.; Saidi, L.; Chebel-Morello, B.; Fnaiech, F. Application of empirical mode decomposition and artificial neural network for automatic bearing fault diagnosis based on vibration signals. Appl. Acoust. 2015,89, 16–27. [CrossRef] 37. Qiu, J.; Ding, S.X.; Gao, H.; Yin, S. Fuzzy-Model-Based Reliable Static Output Feedback H∞ Control of Nonlinear Hyperbolic PDE Systems. IEEE Trans. Fuzzy Syst. 2016,24, 388–400. [CrossRef] 38. Jain, L.C.; Kandel, A.; Teodorescu, H.N.L. Fuzzy and Neuro-Fuzzy Systems in Medicine; CRC Press: Boca Raton, FL, USA, 2017. Energies 2019,12, 1545 24 of 26 39. Pothal, J.K.; Parhi, D.R. Navigation of multiple mobile robots in a highly clutter terrains using adaptive neuro-fuzzy inference system. Robot. Auton. Syst. 2015,72, 48–58. [CrossRef] 40. Martinek, R.; Manas, J.; Zidek, J.; Bilik, P. Power quality improvement by shunt active performance filters emulated by artificial intelligence techniques. In Proceedings of the 2nd International Conference on Advances in Computer Science and Engineering (CSE 2013), Los Angeles, CA, USA, 1–2 July 2013; Atlantis Press: Paris, France, 2013. [CrossRef] 41. Martinek, R.; Vanus, J.; Kelnar, M.; Bilik, P. Control methods of active power filters using soft computing techniques. In Proceedings of the 8th International scientific symposium on electrical power engineering (Elektroenergetika), Stara Lesna, Slovakia, 16–18 September 2015; pp. 363–366. 42. Martinek, R.; Vanus, J.; Bilik, P.; Stratil, T.; Zidek, J. An efficient control method of shunt active power filter using adaline. IFAC-PapersOnLine 2016,49, 352–357. [CrossRef] 43. Bhattacharya, A.; Chakraborty, C. A shunt active power filter with enhanced performance using ANN-based predictive and adaptive controllers. IEEE Trans. Ind. Electron. 2011,58, 421–428. [CrossRef] 44. Elmitwally, A.; Abdelkader, S.; El-Kateb, M. Neural network controlled three-phase four-wire shunt active power filter. IEE Proc. Gener. Transm. Distrib. 2000,147, 87–92. [CrossRef] 45. Hamadi, A.; Al-Haddad, K.; Rahmani, S.; Kanaan, H. Comparison of fuzzy logic and proportional integral controller of voltage source active filter compensating current harmonics and power factor. In Proceedings of the 2004 IEEE International Conference on Industrial Technology, 2004. IEEE ICIT’04, Hammamet, Tunisia, 8–10 December 2004; Volume 2, pp. 645–650. [CrossRef] 46. Martinek, R.; Bilik, J. New Strategies for Application of Recursive Least Square Algorithm in Active Power Filters. In Proceedings of the 8th International Scientific Symposium on Electrical Power Engineering (Elektroenergetika), Stara Lesna, Slovakia, 16–18 September 2015; pp. 344–347. 47. Tamboli, D.A.; Chile, R.H. Reference signal generation for shunt active power filter using adaptive filtering approach. In Proceedings of the 2015 International Conference on Industrial Instrumentation and Control (ICIC), Pune, India, 28–30 May 2015; pp. 766–770. [CrossRef] 48. Martinek, R.; Zidek, J.; Bilik, P.; Manas, J.; Koziorek, J.; Teng, Z.; Wen, H. The use of lms and rls adaptive algorithms for an adaptive control method of active power filter. Energy Power Eng. 2013 ,5, 1126. [CrossRef] 49. Paclt, Z. Active Power Filter Control; CVUT in Prague: Praha, Czech Republic, 2011. 50. Emadi, A.; Nasiri, A.; Bekiarov, S.B. Uninterruptible Power Supplies and Active Filters; CRC Press: Boca Raton, FL, USA, 2015. 51. Koupeny, J. Control Algorithms of Active Filters; CVUT in Prague: Praha, Czech Republic, 2008. 52. Zhao, H.J.; Pang, Y.F.; Qiu, Z.M.; Chen, M. Study on UPF harmonic current detection method based on DSP. J. Phys. Conf. Ser. 2006,48, 1327. [CrossRef] 53. CH, S.; Kusam, S.; Shekar, K.C. Shunt active filter algorithms for a three phase system fed to adjustable speed drive. Int. J. Eng. Sci. Technol. 2011,3, 7577–7586, 54. Akagi, H.; Kanazawa, Y.; Nabae, A. Instantaneous reactive power compensators comprising switching devices without energy storage components. IEEE Trans. Ind. Appl. 1984,3, 625–630. [CrossRef] 55. Akagi, H.; Watanabe, E.H.; Aredes, M. Instantaneous Power Theory and Applications to Power Conditioning; John Wiley & Sons: Hoboken, NJ, USA, 2017; Volume 62. 56. Bhattacharya, S.; Divan, D.M.; Banerjee, B. Synchronous frame harmonic isolator using active series filter. In Proceedings of the European Conference on Power Electronics and Applications, Firenze, Italy, 1–30 September 1991; Volume 3, p. 30. 57. Pinto, J.G.; Neves, P.; Pregitzer, R.G.; Monteiro, L.F.; Afonso, J.L. Single-phase shunt active filter with digital control. Renew. Energies Power Qual. J. 2007,1, 619–624. [CrossRef] 58. Haque, M.T. Single-phase pq theory for active filters. In Proceedings of the 2002 IEEE Region 10 Conference on Computers, Communications, Control and Power Engineering, TENCOM’02, Beijing, China, 28–31 October 2002; Volume 3, pp. 1941–1944. [CrossRef] 59. Paulo, S.D. Adaptive Filtering: Algorithms and Practical Implementation; The International Series in Engineering and Computer Scienc; Springer: New York, NY, USA, 2008; pp. 23–50. 60. Poularikas, A.D.; Ramadan, Z.M. Adaptive Filtering Primer with MATLAB; CRC Press: Boca Raton, FL, USA, 2017. 61. Arenas-Garcia, J.; Azpicueta-Ruiz, L.A.; Silva, M.T.; Nascimento, V.H.; Sayed, A.H. Combinations of adaptive filters: performance and convergence properties. IEEE Signal Process. Mag. 2016,33, 120–140. [CrossRef] Energies 2019,12, 1545 25 of 26 62. Sayed, A.H. Adaptive Filters; John Wiley & Sons: Hoboken, NJ, USA, 2011. 63. Farhang-Boroujeny, B. Adaptive Filters: Theory and Applications; John Wiley & Sons: Hoboken, NJ, USA, 2013. 64. Bellanger, M.; Bellanger, M. Adaptive Digital Filters; CRS Press: Boca Raton, FL, USA, 2001. [CrossRef] 65. Saxena, G.; Ganesan, S.; Das, M. Real time implementation of adaptive noise cancellation. In Proceedings of the 2008 IEEE International Conference on Electro/Information Technology, Ames, IA, USA, 18–20 May 2008; pp. 431–436. [CrossRef] 66. Mitra, S.K.; Kuo, Y. Digital Signal Processing: A Computer-Based Approach; McGraw-Hill: New York, NY, USA, 2006; Volume 2. 67. Ifeachor, E.C.; Jervis, B.W. Digital Signal Processing: A Practical Approach; Pearson Education: London, UK, 2002. 68. Haykin, S.S.; Widrow, B. Least-Mean-Square Adaptive Filters; Wiley-Interscience: New York, NY, USA, 2003; Volume 31. 69. Bershad, N.J.; Bermudez, J.C.M.; Tourneret, J.Y. An affine combination of two LMS adaptive filters—Transient mean-square analysis. IEEE Trans. Signal Process. 2008,56, 1853–1864. [CrossRef] 70. Sayed, A.H.; Kailath, T. A state-space approach to adaptive RLS filtering. IEEE Signal Process. Mag. 1994 ,11, 18–60. [CrossRef] 71. Dhiman, J.; Ahmad, S.; Gulia, K. Comparison between Adaptive filter Algorithms (LMS, NLMS and RLS). Int. J. Sci. Eng. Technol. Res. (IJSETR) 2013,2, 1100–1103. 72. Szopos, E.; Hedesiu, H. LabVIEW FPGA based noise cancelling using the LMS adaptive algorithm. Acta Tech. Napoc. Electron. Telecommun. 2009,50, 5–8. 73. Kehtarnavaz, N.; Gope, C. DSP system design using LabVIEW and Simulink: a comparative evaluation. In Proceedings of the 2006 IEEE International Conference on Acoustics Speech and Signal Processing Proceedings, Toulouse, France, 14–19 May 2006; Volume 2, p. II-II. [CrossRef] 74. Tian, H.; Duan, L.J. Design of multifunctional digital filter based on LabVIEW. Electron. Meas. Technol. 2011 , 3. Available online: http://en.cnki.com.cn/Article_en/CJFDTotal-DZCL201103016.htm (accessed on 14 April 2019). 75. Duttweiler, D.L. Proportionate normalized least-mean-squares adaptation in echo cancelers. IEEE Trans. Speech Audio Process. 2000,8, 508–518. [CrossRef] 76. Song, I.; Park, P.; Newcomb, R.W. A normalized least mean squares algorithm with a step-size scaler against impulsive measurement noise. IEEE Trans. Circuits Syst. II Express Briefs 2013,60, 442–445. [CrossRef] 77. Douglas, S.C. A family of normalized LMS algorithms. IEEE Signal Process. Lett. 1994,1, 49–51. [CrossRef] 78. Krejca, L. Implementation of the Channel Equalization Algorithms Used in FMT Modulation. Master’s Thesis, VUT in Brno, Brno, Czech Republic, 2010. 79. IEC 61000-4-30 Ed.2.0 Electromagnetic Compatibility (EMC): Part 4-30: Testing and Measurement Techniques—Power Quality Measurement Methods; International Electrotechnical Commission: Geneva, Switzerland, 2008; 134p, ISBN 2-8318-1002-0. 80. Qian, S.; Madsen, K.N.; Lucia, W.A.N.U.S. Total Harmonic Distortion (THD) Controlled Clip Detector and Automatic Gain Limiter (AGL). U.S. Patent Application No. 10/079,578, 12 August 2018. 81. Srndovic, M.; Familiant, Y.; Grandi, G.; Ruderman, A. Time-domain minimization of voltage and current total harmonic distortion for a single-phase multilevel inverter with a staircase modulation. Energies 2016 , 9, 815. [CrossRef] 82. Proakis, J.G. Digital Signal Processing: Principles Algorithms and Applications; Pearson Educ. India: Gandhi, India, 2001. 83. Willmott, C.J.; Matsuura, K. Advantages of the mean absolute error (MAE) over the root mean square error (RMSE) in assessing average model performance. Clim. Res. 2005,30, 79–82. [CrossRef] 84. Javaid, R.; Besar, R.; Abas, F.S. Performance evaluation of percent root mean square difference for ecg signals compression. Signal Process. Int. J. (SPIJ) 2008,48, 1–9. 85. Blanco-Velasco, M.; Cruz-Roldan, F.; Godino-Llorente, J.I.; Blanco-Velasco, J.; Armiens-Aparicio, C.; Lopez-Ferreras, F. On the use of PRD and CR parameters for ECG compression. Med. Eng. Phys. 2005 ,27, 798–802. [CrossRef] 86. Singh, H.; Kour, M.; Thanki, D.V.; Kumar, P. A Review on Shunt Active Power Filter Control Strategies. Int. J. Eng. Technol. 2018,7, 121–125. [CrossRef]