Article

Citation:  Mahmood, Z. H., Amendment PI Control Approach Created on a Neural Network for an Active Harmonic Compensator. 2025. 3: p. 39-45

Academic Editor: Assoc. Prof. Dr. Shahad Nidhal Al-yousif

Received: 30/8/2025

Revised: 10/10/2025

Accepted: 19/10/2025

Published: 23/10/2025

Copyright: © 2025 by the authors. Submitted for possible open access publication under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

Amendment PI Control Approach Created on a Neural Network for an Active Harmonic Compensator

 Zain Alabideen H. Mahmood 1, *

1  Department of Electrical Power and Machines, College of Engineering, University of Diyala, Diyala, Iraq; zain.alabideen@uodiyala.edu.iq

*   Correspondence: zain.alabideen@uodiyala.edu.iq

Abstract: Direct power control (DPC) is attracting wide attention throughout the world outstanding to its merits of simple construction, rapid dynamic reaction, and strong robustness against parameter variations. The establishment of a switching table is the key aspect of DPC, and so far, there are various switching tables in the literature. However, they differ in the sector division and vector selection. The simulation results verify that the improved DPC using the neural network ANN method has a more satisfactory compensation effect when the grid voltage is under distorted and unbalanced circumstances, and it proves that the ANN method is correct and superior. Improved DPC achieves control of active power and its dynamic performance. The good compensation of reactive power using the adaptive ANN method results in low ripple.

Keywords: 3-phase line voltage; grid--connection; THD; DPC

1. Introduction

In recent years, the application of various power electronic devices has been increasing. Various nonlinear loads have caused current waveform distortion, generating a large amount of harmonic current in the power grid. Therefore, harmonic control devices have been widely studied and applied. Compared with traditional passive filters, APF has the advantages of fast response speed, dynamic continuous real-time compensation, and no interference with the power grid [1]. Due to its advantages of good resonance and filtering effect, APF has been increasingly adopted for harmonic suppression and reactive power compensation in power grids [2]. The control of APF needs to have good tracking and real-time performance. Hysteresis control can achieve good dynamic performance, but its switching frequency, loss, and control accuracy are affected by the tolerance bandwidth [3]. Many scholars have improved hysteresis control by combining hysteresis control with PI control. At the same time, methods based on SVPWM to achieve hysteresis current control [4] have also been rapidly developed. These methods not only maintain the excellent performance of hysteresis control but also improve its shortcomings. Voltage-type PWM (pulse width modulation) rectifiers have been generally employed in several fields of power conversion and transmission due to their low current harmonic distortion, controllable power factor, and bidirectional energy flow [5]. As the application of PWM rectifiers continues to deepen, their performance requirements are becoming increasingly higher, which puts higher demands on the control technology of PWM rectifiers. Accordingly, more and more control methods have been proposed to control PWM rectifiers. In recent years, new control methods have been continuously proposed, including sliding mode control [6], fuzzy control [7], and model predictive control. Among them, sliding mode control can enhance the robustness of the system, fuzzy control is suitable for some systems with unknown parameters, and model predictive control has the advantages of simple principles and excellent dynamic performance. Although these methods improve system performance, they generally have a large amount of computation, which limits their application in practice. The earliest and most widely used method in PWM rectifiers is the voltage-oriented control (VOC) [8], which decouples the grid-side three-phase current into active current and reactive current components through rotational transformation, thereby forming closed-loop control of active current and reactive current, respectively. VOC can achieve good dynamic performance and steady-state performance, but it has a strong dependence on the parameters of the current inner loop PI (proportional-integral regulator). Unlike VOC, DPC does not require current rotational conversion. It straight controls active and reactive power by directly choosing the appropriate voltage vector through the switch table, thus having the advantages of a simple algorithm and fast dynamic response speed [9]. The switch vector table is the core content of DPC, and its influence on the control effect is also the most significant. The switching vector table in the early literature [10] has a large power pulsation in the steady state. For this reason, many scholars have conducted in-depth research on the switching vector table and proposed other new vector tables [11]. However, these vector tables are not unified in terms of sector division and vector selection. Currently, few literatures conduct a detailed analysis of the establishment mechanism of the vector table. Most of them only conduct qualitative approximation. In addition, there is a lack of in-depth and detailed research on the relationship and differences between existing vector tables and the performance comparison of different vector tables.

This paper, built on a detailed analysis of the impact of different voltage vectors on a uses mathematical derivation combined with geometric diagrams to conduct a detailed study of sector division and vector selection. This analysis yielded six vector tables. Three of these tables have been reported, while the remaining three have not yet been documented.  The results show that it achieves good dynamic performance. While effective decoupling of power and work is achieved, steady-state performance differs.

 

2. Materials and Methods

2.1 Modular Direct Power Control Strategy

A direct power control strategy for flux linkage (DPC) is used. In the grid-connected inverter, the grid voltage is integrated to obtain the flux linkage  . Analysis of each module yields the flux linkage of the equivalent system, enabling coordinate orientation and power control. Each module is cascaded and connected to the grid. For the equivalent model of the cascaded system, the inverter output line voltage is twice the equivalent photovoltaic output voltage [12]. The DPC control block diagram of the system is illustrated in Figure 1. The system detects the three-phase current of the power supply and calculates the actual active power P and reactive power Q based on the virtual flux linkage. The difference between the power reference value obtained on the DC side and the actual value obtained on the grid side is approved through a PI regulator to obtain the voltage vector reference values ​​V and Vq. A coordinate transformation is then performed to obtain the voltage vector orientation values ​​v and vq on the coordinate system. Finally, the SVM module generates the required PWM pulse signals, achieving grid-connected control of the cascaded three-phase photovoltaic system.

 

2.2 PWM Rectifier Mathematical Model

 

 Figure 2 shows the main circuit of a 3-phase voltage-type PWM rectifier. ea, eb, and ec are the 3-phase AC voltages on the grid side, and L and R are the inductance and equivalent resistance of the 3-phase AC reactor, respectively [13, 14].

Figure 1. DPC System structure control diagram

Figure 2. Three-phase voltage-type PWM rectifier circuit

 

Figure 1 shows a single-stage 3-phase grid-linked inverter. The inverter is connected to the grid via a filter inductor L and a line resistor R. Conferring to Kirchhoff's law, the system's state equation in the 3-phase stationary coordinate system is [15]:

                                 (1)

 

                                            (2)

In the formula, , , and  These are the three-phase voltages of the grid. , , and  These are the output currents of the grid-connected inverter. , , and  are the output voltages of the three-phase grid-connected inverter; and unN is the voltage between the DC bus and the neutral point of the 3-phase grid. Performing the Park transformation on equation (1) yields the state equation in d-q rotating coordinates:

 

                              (3)

 

In the formula, id and  are the d and q mechanisms of the grid current in the d-q coordinate system; ed and eq are the d and q mechanisms of the grid voltage in the d-q coordinate system; and  and  are the d and q components of the inverter output voltage in the d-q coordinate system. The switching states Si (i = a, b, c) of the three-phase photovoltaic grid-connected inverter are defined as

 

 

The 3-phase grid-linked inverter demonstrated in Figure 2 has seven dissimilar voltage vectors, and the voltage space vectors it generates are illustrated in Figure 3 [16, 17].

 

 

The output voltage  of the grid-connected inverter is

                     (4)

Where Udc is the DC bus voltage, θ is the spatial angle of the grid.

 

 2.3 Amendment PI Technique

 A neural network is composed of 3 layers: the input, hidden, and output layers. Inputs to a network can be the terminal voltage and orientation, or any other dimensions required by the DPC procedure. The output is usually one or several orientation indications. Like a duty cycle indication operated to drive the power converter to activate at or close to the DPC. The association between nodes i and j is labeled as weighting Wij. The effectiveness of this DPC technique is mainly strengthened by the hidden layer and the amount of training the network has undergone. The weights between the neurons are tuned to produce the obligatory output, which could be a command to change a DC converter duty cycle. Many advances have been made in the field of ANN controllers, shown in Figure 4.

Figure 3. Inverter space voltage vector diagram

Figure 4. Amendment PI Technique

 

 

                                                  (5)

                                                   (6)

Where,  and  are weights.  and  These are the bias values.  and  These are the signal values for input and output lines

3. Discussion and results

 A simulation model of a virtual flux direct power control system based on three cascaded photovoltaic inverter modules was constructed in MATLAB/Simulink. The grid voltage E = 100 V, and the grid frequency is 50 Hz. The parameters of the three modules are assumed to be identical, and the power loop control is a PI controller. The specific system factors are shown in Table 1.

 

 

 

 

Table 1. Simulation factors of the system

Factors

Value

Units

Voltage source (E)

100

V

Switching frequency

10

kHz

Power loop PI parameters

 

Grid filter inductance

2000

mH

 filter inductance

0.25

μH

Line equivalent resistance

0.003

Ω

Capacitor

2500

μF

Vdc

380

V

 

Results according to the vector table and control diagram in the sixth vector table. Figure 5 displays the simulation results according to the control diagram in the first vector table. The two curves shown are: the DC bus voltage drop in the bus voltage of the conventional digital controller, while the improved method does not change, so the response and performance of the improved method are better. The settling time of the conventional method is 0.35s, while that of the improved method is 0.02s.

Figure 6 shows the waveforms of the current source a harmonic current detection can be seen as high. There are significant differences. Spectrum analysis and total harmonic distortion (THD) of the steady-state current are displayed in Figure 6. The THD is high with conventional DPC technology. The THD value is 8.13% shown in Figure 7.

 

Figure 5 shows Vdc using a PI and ANN controller.

Figure 6. shows a current source with PI.

Figure 8 shows the waveforms of the current source the harmonic current detection can be seen as low.  Spectrum analysis and total harmonic distortion (THD) of the steady-state current are displayed in Figure 6. The THD is low with improved DPC technology. The THD value is 3.07% shown in Figure 9. The harmonic detection method is an effective and practical method for detecting harmonics. Simulation results show that after optimization, the current source closely resembles a sine waveform, demonstrating the significant effectiveness of the optimization.

 

 

Figure 7. shows a THD with PI

Figure 8. shows a current source with an ANN

Improved DPC achieves control of active power, and its dynamic performance is shown in Figure 10.  Response time is less in the improved method using ANN. The reactive power remains at almost zero, as shown in Figure 10. However, at high ripple. Figure 10 verifies that the good compensation of reactive power using the adaptive ANN method results in low ripple.

 

Figure 9. shows a THD with an ANN.

Figure 10. shows a P&Q with an ANN and PI.

5. Conclusions

Direct power control is a simple, fast-dynamic control method suitable for controlling 3-phase voltage-source PWM rectifiers. The switching vector table is the core component of direct power control and directly impacts the overall system performance. Built on the instantaneous power model of a 3-phase voltage-source PWM rectifier, this paper uses mathematical derivation and geometric diagramming to conduct a detailed analysis of vector table construction. This paper presents simulation comparisons of the traditional and improved DPC. The results show that improved DPC control of the DC link voltage and current is achieved, and THD exhibits a low value, but the traditional DPC exhibits high current harmonics and ripple.

References

 

1.             Dos Santos, E., C. Jacobina, and A. Maciel. Parallel connection of two shunt active power filters with losses optimization. in 2010 Twenty-Fifth Annual IEEE Applied Power Electronics Conference and Exposition (APEC). 2010. IEEE.

2.             Bahar, S.T. and Y.G. Rashid, A Study on An MPPT Control Approach Using Artificial Intelligence and the Perturb and Observe Method. Diyala Journal of Engineering Sciences, 2024: p. 131-143.

3.             Singh, B., K. Al-Haddad, and A. Chandra, A review of active filters for power quality improvement. IEEE transactions on industrial electronics, 1999. 46(5): p. 960-971.

4.             Zhong, Q.-C., et al. Reduction of DC-bus voltage ripples and capacitors for single-phase PWM-controlled rectifiers. in IECON 2012-38th Annual Conference on IEEE Industrial Electronics Society. 2012. IEEE.

5.             Bouzelata, Y., et al., Design and simulation of a solar supplied multifunctional active power filter and a comparative study on the current-detection algorithms. Renewable and Sustainable Energy Reviews, 2015. 43: p. 1114-1126.

6.             Bahar, S.T. and R.G. Omar, Permanent Magnet Synchronous Motor Torque Ripple Reduction Using Predictive Torque Control. Journal of Engineering and Sustainable Development, 2023. 27(3): p. 394-406.

7.             Bahar, S.T. and R.G. Omar, Torque ripple alleviation of a five-phase permanent magnet synchronous motor using predictive torque control method. International Journal of Power Electronics and Drive Systems, 2022. 13(4): p. 2207.

8.             Popescu, M., et al., Shunt active power filters in three-phase, three-wire systems: A topical review. Energies, 2024. 17(12): p. 2867.

9.             Das, S.R., et al., A review on different control strategies applied to power filter for power quality improvement. Electrical Engineering, 2025: p. 1-29.

10.           Al-Dayyeni, W.S. and H.S. Mahmood, PID Control Perspective: Techniques and Uses. Edison Journal for electrical and electronics engineering, 2025: p. 1-8.

11.           Rathi, K. and N.R. Prabha, Grid interconnected photo voltaic system using shunt active filter for power quality improvement. International Journal of Power Electronics and Drive Systems, 2018. 9(1): p. 365.

12.           Li, Z., et al., Harmonic detection method based on adaptive noise cancellation and its application in photovoltaic-active power filter system. Electric Power Systems Research, 2020. 184: p. 106308.

13.           Arab, N., et al., A multifunctional single-phase grid-integrated residential solar PV systems based on LQR control. IEEE Transactions on Industry Applications, 2018. 55(2): p. 2099-2109.

14.           Hussien, A.H. and K.M.A. Alazawi, Installation of an Electric Car Charger Using the Bald Eagle Optimizer Cascaded PI and LQR Controller. Edison Journal for electrical and electronics engineering, 2025: p. 9-15.

15.           Hassan, A., et al., Power electronics for green hydrogen generation with focus on methods, topologies, and comparative analysis. Scientific Reports, 2024. 14(1): p. 24767.

16.           Jalan, S.K., et al., A novel active current co‐efficient extraction‐based control for grid‐tied solar photovoltaic system. IET Power Electronics, 2021. 14(12): p. 2099-2114.

17.          Alhafadhi, M.H., M.J. Ahmed, and H.H. Ibrahim, Load Frequency Control for Hybrid Power System by Modified PSO-PID Controller. Edison Journal for electrical and electronics engineering, 2024. 2: p. 35-41.