## 4 Results in Practical Cases  
In order to quantify the results obtained with the ANN-APF, two essential indices were used: the total harmonic distortion of the supply current, \(ITHD\), defined in (16), and the power factor, \(PF\), defined in (17), measured before and after compensation.  
\[ITHD=\frac{\sqrt{\sum\limits_{i\,>\,1}I_{i}^{2}}}{I_{1}}\,\cdot\,100\% \tag{16}\]  
\[PF=\frac{P}{\sqrt{V_{d}^{2}+V_{b}^{2}+V_{c}^{2}}\sqrt{I_{d}^{2}+I_{b}^{2}+I_{c }^{2}}} \tag{17}\]  
Those indices, together with the monitoring of the voltages and currents waveforms, will allow us to evaluate the system performance. In addition, international standards were taken into account: IEC 61000-4-30 [41] and EN-50160 [42]. Thus, it is strongly recommended to achieve a source current \(ITHD\) below 5% and a \(PF\) close to one. In that sense, the control system will be required to operate in the environment of 50 Hz \(\pm 1\%\), i.e., from 49.5 to 50.5 Hz, as this is the interval in which the frequency must be during 95% of the time every week. Obviously, it is also desired that no important disturbance would be observed in case of higher frequency deviations. The standard requires the electrical network to work 100% of the time in the interval from \(50-6\%\) to \(50+4\%\), i.e., from 47 to 52 Hz [41].  
In order to use the neural networks with currents and voltages of practical three-phase circuits, a scale factor must be applied to the waveforms before accessing the ANN, because their amplitudes can reach values of several Amperes and hundreds of Volts. The generalization capability tests showed a wide tolerance for input waveform amplitudes. However, the ANN performance is higher if the input waveforms do not significantly exceed the \(\pm 1\) range.  
In the practical cases, the voltage waveforms have amplitudes over 300 V, whereas the fundamental harmonic amplitude in the waveform patterns was not higher than sqrt \((1^{2}+1^{2})\approx 1.414\). Therefore, the voltage inputs were divided by a scale factor \(K_{V}\) before reaching the ANN, and consequently, the outputs must be multiplied by the same factor. Figure 5 shows the required adjustment of the inputs and outputs.  
For the same reason, current inputs need the application of a scale factor. Considering the dependency of the currents on the variable loads, the scale factor was based on the measurement of the load current _rms_ value. The product \(K_{I}\)-\(I_{RMS}\) has provided an autonomous  
Figure 5: Scaling of the ANN input signals, converting them into values that do not significantly exceed the \(\pm 1\) range, allowing ANN performance optimization.  
adjustment of the scale factor. In particular, values of \(K_{I}\) = 0.4 or 0.5 were appropriate. The current data are divided by \(K_{I}\)-\(I_{RMS}\) and the ANN output is multiplied by the same factor. Figure 5 shows this input and output adjustment.  
No special stability analysis was conducted. On one side, the feedforward ANNs have no feedback connections, and do not use online training algorithms to adjust any parameter. The ANNs use the load current signals (independent of the SAPF injected currents) to obtain, after every cycle, the coefficients A and B for generation of the reference signals. This absence of feedback loop can contribute to a stable behavior. On the other side, the hysteresis PWM control and the use of inductors in the connection of the APF with the three-phase system usually do not cause unstable operation. If the ANN control does not obtain correct coefficients in some of the cycles, the APF could produce some short time intervals without a perfect compensation. However, the way in which the ANN refreshes the outputs after each cycle should avoid any rare cumulative effect or stability problem. Therefore, no concerning SAPF unstable operation should be expected. All practical cases tested in this work presented stable operation.