In modern power systems, power quality has become one of the core indicators for measuring the performance of power systems. With the rapid development of industrial automation, new energy grid integration, and smart grids, the proportion of nonlinear loads in the power grid continues to rise. This has led to increasingly prominent issues such as harmonic pollution and three-phase imbalance, which not only affect the safe and stable operation of power equipment but also restrict improvements in energy utilization efficiency. As a key device for harmonic pollution control, the core performance of Active Power Filters (APF) depends on the accuracy and reliability of harmonic detection methods. In-depth research on the application of the Perfect Harmonic Cancellation (PHC) method in APF, through theoretical derivation and simulation verification, confirms the superiority of this method under complex grid conditions. Based on such research results, this article will conduct a detailed analysis covering the background of harmonic problems, limitations of traditional methods, theoretical innovations of the PHC method, simulation verification, and application value, comprehensively interpreting the technical breakthroughs and practical significance of the PHC method in APF.
1. Power System Harmonic Problems and the Core Role of APF
1.1 Causes and Hazards of Harmonic Pollution
Harmonics in power systems stem from the widespread use of nonlinear loads. When current flows through nonlinear components (such as rectifiers, inverters, arc furnaces, and frequency converters), its waveform deviates from a sine curve, generating a series of harmonic components whose frequencies are integer multiples of the fundamental frequency. Once these harmonic components are injected into the power grid, they can cause numerous problems: at the equipment level, harmonics can lead to additional heating of motors, transformers, and other equipment, reducing their service life; at the metering level, harmonics can result in errors in electric energy meter measurements, affecting the accuracy of electricity bill settlements; at the system level, harmonics may trigger false operations of relay protection and even cause grid resonance, endangering the safe operation of the system.
With the popularization of sensitive loads such as computers, precision instruments, and communication equipment in industrial and civil fields, users have increasingly higher requirements for the power quality of the grid. Statistics show that the annual economic losses caused by equipment failures and efficiency losses due to harmonic pollution in the industrial sector alone account for 3%-5% of total power consumption. Therefore, effectively controlling harmonic pollution has become a key issue for the stable operation of power systems.
1.2 Working Principle and Control Strategy of APF
Active Power Filter (APF) is one of the most effective devices for controlling harmonic pollution. Its core principle is to generate a compensation current that is equal in magnitude but opposite in direction to the harmonic by real-time detection of harmonic components in the load current, thereby canceling out the harmonics generated by the load and restoring the power supply current to a sinusoidal waveform.
The control strategy of APF mainly includes two links: harmonic detection and current control. Among them, harmonic detection is the core link, which directly determines the compensation accuracy and response speed. An ideal harmonic detection method should be able to accurately extract harmonic components under various grid conditions (including symmetric sinusoidal voltage, distorted voltage, and unbalanced voltage) and provide a reliable compensation reference for the current control module.
Currently, many harmonic detection methods have been proposed in academia and industry. The most widely used in the time domain include the p-q method based on the Instantaneous Reactive Power Theory, the synchronous rotating coordinate method (d-q method), and the Perfect Harmonic Cancellation (PHC) method. Among them, the p-q method and d-q method were widely used in early APF due to their simple principles and ease of implementation, but their limitations under complex grid conditions have gradually become apparent; the PHC method, through targeted improvements, has effectively overcome the shortcomings of traditional methods and become the core detection algorithm of the new generation of APF.

2. Limitations of Traditional Harmonic Detection Methods in APF
2.1 Principle and Defects of the p-q Method
The p-q method is based on the three-phase Instantaneous Reactive Power Theory. It transforms three-phase voltage and current into the α-β stationary coordinate system, calculates the instantaneous active power p and instantaneous reactive power q, then extracts the DC component of the active power through a low-pass filter, and finally reversely deduces the fundamental active current to obtain the harmonic current component.
However, the core defect of the p-q method lies in its "dependence" on the grid voltage: when the grid voltage is distorted (containing high-order harmonics) or three-phase unbalanced, the voltage waveform deviates from the ideal sinusoidal symmetric characteristic, causing harmonic components to be mixed into the instantaneous power p and q. The low-pass filter cannot completely separate the fundamental wave and harmonics, ultimately leading to large errors in the harmonic detection results. For example, when the grid voltage contains 250Hz harmonics (5th harmonics), the instantaneous power calculated by the p-q method will contain 100Hz (2nd) and 300Hz (6th) fluctuation components, resulting in distortion of the extracted fundamental current. The compensation current of APF cannot accurately cancel the harmonics, and the Total Harmonic Distortion (THD) of the power supply current remains as high as over 20%.
In addition, under unbalanced load conditions, the p-q method cannot effectively distinguish between negative sequence components and harmonic components, resulting in obvious three-phase unbalance in the compensated power supply current, which further affects power quality.
2.2 Improvements and Shortcomings of the d-q Method
The d-q method originates from the synchronous rotating coordinate transformation in motor control. Its core idea is to convert three-phase voltage and current into the synchronously rotating d-q coordinate system through Park transformation, so that the fundamental component is converted into a DC component and the harmonic component is converted into an AC component. Then, the DC component is extracted through a low-pass filter to reversely deduce the fundamental current.
Compared with the p-q method, the d-q method performs better when the grid voltage is distorted: the synchronous rotating coordinate transformation can keep the fundamental component as a DC on the d-q axis, reducing some harmonic interference. For example, when the grid voltage contains 250Hz harmonics, the THD of the power supply current compensated by the d-q method is approximately 12.61%, which is better than the 20.12% of the p-q method.
However, the d-q method still has obvious limitations: its synchronous rotating reference phase relies on the zero-crossing detection of the grid voltage. When the grid voltage is unbalanced, the zero-crossing detection will have deviations, causing the rotating coordinate system to be out of sync with the fundamental component. The fundamental current fluctuates on the d-q axis, which cannot be completely filtered out by the low-pass filter, ultimately resulting in an unsatisfactory compensation effect. When the grid voltage contains harmonics and is unbalanced, the THD after compensation by the d-q method still reaches 11.41%, which cannot meet the requirements of precision equipment for power quality.
3. Theoretical Innovation and Compensation Current Derivation of the PHC Method in APF
3.1 Core Idea of the PHC Method
The PHC method is an improvement on the p-q method and d-q method, specially designed for APF harmonic detection. Its goal is to eliminate all harmonic currents and fundamental reactive power, and at the same time compensate for unbalance, so that the compensated power supply current is symmetric and sinusoidal. Its core innovation is: taking the positive sequence fundamental component in the grid voltage as the reference, eliminating the adverse effects caused by grid voltage distortion or unbalance, so it can still maintain a good compensation effect under complex grid conditions.
The positive sequence fundamental component refers to the component in the grid voltage with a frequency of the fundamental wave (50Hz) and symmetric three-phase phases (mutually differing by 120°). This component is not affected by grid harmonics and unbalance—even if the actual grid voltage is distorted (such as containing 3rd, 5th, and 7th harmonics) or the three-phase amplitude/phase is unbalanced, its positive sequence fundamental component still maintains a stable sinusoidal symmetric characteristic. By extracting this component as the detection reference, the PHC method ensures that the harmonic detection process is not affected by grid abnormalities, providing an accurate compensation current reference for APF.
3.2 Derivation of Compensation Current Based on the Instantaneous Reactive Power Theory
The derivation of the compensation current of the PHC method is based on the Instantaneous Reactive Power Theory, with the shunt APF as the research object. The specific process is as follows:
3.2.1 Relationship Between Load Current and Power Supply Current
The core of the shunt APF is to cancel the harmonic components in the load current through the compensation current. Let the load current i_L be composed of the fundamental component i_Lf and the harmonic component i_LH, that is, i_L = i_Lf + i_LH; the compensation current output by APF is i_C, then the power supply current i_S = i_L + i_C. To make the power supply current contain only the fundamental component, it is necessary to satisfy i_S = i_Lf, so the compensation current must satisfy i_C = -i_LH.
3.2.2 Extraction of Positive Sequence Fundamental Components in the α-β Coordinate System
The PHC method first transforms the positive sequence fundamental components of the three-phase grid voltage (set as u_af⁺, u_bf⁺, u_cf⁺) into the α-β stationary coordinate system to obtain the α-axis component u_αf⁺ and β-axis component u_βf⁺. The transformation process is realized by a specific matrix. The first row of the matrix is 1, -1/2, -1/2, the second row is 0, √3/2, -√3/2, and the whole is multiplied by a coefficient of √(2/3), then multiplied by the instantaneous values of the three-phase positive sequence fundamental voltage, and finally the positive sequence fundamental components in the α-β coordinate system are obtained.
This transformation can convert the three-phase positive sequence fundamental voltage into orthogonal components in the α-β coordinate system, laying the foundation for subsequent power calculation.
3.2.3 Decomposition of Instantaneous Power and Calculation of Compensation Current
Based on the Instantaneous Reactive Power Theory, the instantaneous active power p and instantaneous reactive power q of the load can be calculated through the voltage and current components in the α-β coordinate system: the instantaneous active power p is equal to the product of the α-axis voltage and α-axis current plus the product of the β-axis voltage and β-axis current; the instantaneous reactive power q is equal to the product of -β-axis voltage and α-axis current plus the product of α-axis voltage and β-axis current, where the voltage components are the positive sequence fundamental components u_αf⁺, u_βf⁺, and the current components are the load currents i_α, i_β in the α-β coordinate system.
The instantaneous active power p is decomposed into a DC component (fundamental active power, denoted as p̄) and an AC component (harmonic active power, denoted as p̃). Then, the fundamental active component in the load current can be calculated through p̄, while the harmonic component and reactive component are determined by p̃ and q.
The compensation goal of the PHC method is to eliminate all harmonics and fundamental reactive power, and compensate for unbalance at the same time, so the compensation current must cancel the current components corresponding to p̃ and q. Finally, the compensation current of APF in the α-β coordinate system is derived as: obtained by multiplying an inverse matrix with the matrix containing p̃ and q, where the inverse matrix is obtained by inverting the matrix composed of u_αf⁺, u_βf⁺, -u_βf⁺, u_αf⁺.
The key of this calculation process is: all steps are based on the positive sequence fundamental components u_αf⁺, u_βf⁺ of the grid voltage, so even if the grid voltage is distorted or unbalanced, the reference value of the compensation current remains stable, ensuring that APF outputs an accurate compensation current.

4. Simulation Verification and Result Analysis of the PHC Method in APF
To verify the superiority of the PHC method in APF, the research uses Matlab/Simulink to build a three-phase three-wire APF simulation model, and compares the compensation effects of the PHC method, p-q method, and d-q method under different grid voltage conditions. The simulation parameters and results are as follows:
4.1 Construction of Simulation Model
The simulation system mainly includes the following modules:
- Main circuit: three-phase power grid (voltage adjustable), nonlinear load (three-phase rectifier bridge + 2mH inductor + 5Ω resistor), shunt APF (voltage source inverter + LC filter);
- Detection module: respectively realize the harmonic detection algorithms of p-q method, d-q method, and PHC method, with the core of extracting harmonic components in the load current;
- Control module: adopt hysteresis current control to make APF output a compensation current equal in magnitude but opposite in direction to the harmonic component;
- Analysis module: calculate the Total Harmonic Distortion (THD) of the current through the FFT analysis tool of the powergui toolbox to evaluate the compensation effect.
The simulation models of the three methods have similar structures, and the core difference lies in the detection module: the p-q method directly uses the grid voltage to calculate the instantaneous power, the d-q method extracts the fundamental wave through synchronous rotating coordinate transformation, and the PHC method first extracts the positive sequence fundamental component of the grid voltage, then performs power calculation and harmonic separation.
4.2 Simulation Results Under Sinusoidal Symmetrical Grid Voltage Conditions
When the three-phase grid voltage is sinusoidal and symmetric (220V/50Hz), the load current shows obvious pulse characteristics due to the rectifier bridge, and the THD before compensation is 30.57%. The compensation effects of the three methods are as follows:
- p-q method: the THD of the power supply current after compensation is 8.42%, and the waveform is close to sine, but there are still a small amount of high-frequency harmonics;
- d-q method: the THD after compensation is 9.91%, slightly worse than the p-q method, mainly due to the small phase deviation introduced by the synchronous rotating coordinate transformation;
- PHC method: the THD after compensation is 7.16%, and the power supply current waveform is closest to the ideal sine, with the best harmonic suppression effect.
This result shows that under ideal grid conditions, all three methods can achieve a certain degree of harmonic compensation, but the PHC method has higher compensation accuracy due to a more stable reference.
4.3 Simulation Results Under Symmetric Grid Voltage Containing Harmonics
When the grid voltage contains 35.4V/250Hz harmonics (5th harmonics) and is three-phase symmetric, the load current distortion intensifies, and the THD before compensation is 31.51%. The compensation effects are as follows:
- p-q method: the THD after compensation is as high as 20.12%, and the power supply current waveform still has obvious distortion. The reason is that the 5th harmonic in the grid voltage causes the instantaneous power calculated by the p-q method to contain 100Hz (2nd) and 300Hz (6th) harmonics, which cannot be completely filtered out by the low-pass filter, resulting in distortion of the detected harmonic components;
- d-q method: the THD after compensation is 12.61%, which is better than the p-q method, but the 5th harmonic is still not completely eliminated because the synchronous rotating coordinate cannot completely isolate the influence of the 5th harmonic;
- PHC method: the THD after compensation is 7.89%, and the power supply current waveform is close to sine. Because the PHC method is calculated based on the positive sequence fundamental component, it is not affected by 250Hz harmonics, the detected harmonic components are accurate, and the compensation current effectively cancels the load harmonics.
4.4 Simulation Results Under Asymmetric Grid Voltage Containing Harmonics
When the grid voltage is asymmetric and contains harmonics (phase A and C are 220V/50Hz, phase B is 141V/50Hz, with 35.4V/250Hz harmonics), the load current is not only distorted but also three-phase unbalanced, and the THD before compensation is 29.00%. The compensation effects are as follows:
- p-q method: the THD after compensation is 26.22%, almost no compensation effect, and the three-phase power supply current is seriously unbalanced. Because the voltage asymmetry causes the p-q method to be unable to distinguish between negative sequence components and harmonics, the detection results are completely distorted;
- d-q method: the THD after compensation is 11.41%, the three-phase unbalance is improved, but there are still obvious harmonic components, because the reference phase of synchronous rotation has deviations due to the influence of voltage asymmetry;
- PHC method: the THD after compensation is 7.99%, and the three-phase power supply current is basically symmetric, with a waveform close to sine. Because the PHC method is based on the positive sequence fundamental component, it completely eliminates the interference of voltage asymmetry and harmonics, the detected harmonics and unbalanced components are accurate, and the compensation current effectively cancels the harmonics and negative sequence components of the load.
4.5 Summary of Simulation Results
The comparison table of compensation effects of the three methods is as follows:

The results show that:
- The more complex the grid voltage (distortion + unbalance), the more significant the advantage of the PHC method;
- The THD of the PHC method is lower than 8% under all working conditions, meeting the requirement of "public grid THD ≤ 5% (≤ 8% in special cases)" in relevant standards, while traditional methods cannot meet the standard under complex working conditions;
- The PHC method can not only suppress harmonics but also effectively compensate for three-phase unbalance, keeping the power supply current symmetric, which is difficult for traditional methods to achieve.
5. Technical Value and Application Prospects of the PHC Method in APF
5.1 Technical Value
The application of the PHC method in APF has broken through the dependence of traditional harmonic detection methods on grid voltage quality, and its core technical value is reflected in:
- Anti-interference: by extracting the positive sequence fundamental component, it fundamentally eliminates the interference of grid distortion and unbalance, enabling APF to work stably under complex grid conditions;
- Comprehensive compensation: it can not only eliminate harmonic currents but also compensate for fundamental reactive power and three-phase unbalance, realizing "one-stop" power quality optimization;
- Algorithm robustness: the derivation process is strictly based on the Instantaneous Reactive Power Theory, with simple formulas and clear physical meanings, which is easy for engineering implementation and parameter optimization.
5.2 Application Prospects
APF based on the PHC method can be widely used in the following scenarios:
Industrial field: industries such as iron and steel, chemical industry, and automobile manufacturing have a large number of rectification equipment, arc furnaces, and other strong nonlinear loads. The PHC method can ensure that APF can accurately compensate for harmonics when the grid voltage fluctuates, protecting precision machine tools, PLC, and other equipment;
- New energy grid integration: the volatility of output power of photovoltaic and wind power systems is prone to cause grid voltage distortion and unbalance. The PHC method can improve the dynamic compensation capability of APF and promote efficient grid integration of new energy;
- Commercial buildings: there are many of equipment such as elevators, air conditioners, and charging piles in large buildings, with prominent harmonic and three-phase unbalance problems. The PHC method can improve power quality and reduce equipment failure rates and energy consumption;
- Smart grid: as a core device for power quality regulation in distribution networks, APF based on the PHC method can be linked with the dispatching system to realize real-time monitoring and dynamic compensation of harmonics in the entire network.

6. Conclusion
In-depth studies through theoretical derivation and simulation verification have fully confirmed the superiority of the PHC method in APF. Compared with the traditional p-q method and d-q method, the PHC method takes the positive sequence fundamental component of the grid voltage as the reference, effectively eliminating the interference of grid distortion and unbalance. Its compensation current derivation is strictly based on the Instantaneous Reactive Power Theory, ensuring detection accuracy and compensation effect.
Simulation results show that: under sinusoidal symmetric grid voltage, the compensation effect of the PHC method is slightly better than traditional methods; under grid voltage containing harmonics or unbalanced conditions, the advantage of the PHC method is significant, with the power supply current THD always lower than 8% and three-phase symmetry maintained. This characteristic makes the PHC method an ideal choice for APF under complex grid conditions, providing a reliable technical solution for solving harmonic pollution problems in power systems.
With the development of power systems towards intelligence and diversification, the engineering application of the PHC method will further improve the performance of APF, playing an important role in improving grid power quality and ensuring the safe and stable operation of the system. In the future, combined with the high-speed computing capabilities of digital signal processors (DSP) and FPGAs, the real-time performance and compensation accuracy of the PHC method will be further improved, promoting the development of active filtering technology to a new height.
Hengrong Electric Co., Ltd. is a professional manufacturer of power factor correction & power quality solutions, supplying CE-certified APF,Capacitors ,Reactors and SVG in many countries.