top of page

MATLAB Implementation of Single Phase Shunt Active Filter

Modern power systems often face challenges from nonlinear loads, which introduce harmonics and increase reactive power demand, ultimately degrading power quality. In this blog post, we’ll explore how a Single-Phase Shunt Active Power Filter (SAPF) can be modeled and simulated in MATLAB to address these issues effectively.

🔌 The Problem with Nonlinear Loads

In typical single-phase power systems, the source current is ideally sinusoidal. However, when nonlinear loads—like a combination of a rectifier and an inductive load—are connected, they cause the source current to become non-sinusoidal.

This distortion leads to two primary problems:

  • An increase in harmonic components in the source current

  • Higher reactive power demand from the source

This not only impacts system performance but can also affect other connected equipment. The solution lies in using active filtering techniques.




⚙️ Introduction to Single-Phase Shunt Active Filter

To counteract the distortion caused by nonlinear loads, a Single-Phase Shunt Active Power Filter (SAPF) is implemented. The system consists of:

  • A single-phase voltage source

  • Source inductor

  • A nonlinear load

  • A shunt-connected H-Bridge inverter

  • A DC-link capacitor

The H-bridge inverter is controlled to inject a compensating current that cancels out the harmonic and reactive components drawn by the nonlinear load.

🧠 Control Strategy: PQ Theory

The PQ control theory is used to generate the reference compensating current. Here’s how it works:

  1. Measure capacitor voltage and compare it with the reference (set at 700V).

  2. Use a PI controller to maintain the voltage level.

  3. Create a virtual three-phase voltage and current using transport delays, enabling PQ control in a single-phase system.

  4. Convert voltage and current values into alpha-beta components.

  5. Calculate real (P) and reactive (Q) power.

  6. Apply a low-pass filter to isolate the average real power.

  7. Calculate the reference current (Iref) from Vα, Vβ, P, and Q.



🔁 Generating Compensating Current

The Iref (reference current) is compared with the actual current through the active filter. A controller processes this error and generates switching pulses for the inverter’s MOSFETs.

The inverter then injects a compensating current into the system that:

  • Cancels out harmonic components

  • Supplies the reactive power needed by the nonlinear load

The result: the source current becomes sinusoidal again.

📊 Simulation Results in MATLAB

When simulating this system in MATLAB, the following outcomes were observed:

  • The capacitor voltage stabilized at 700V (reference value).

  • The source current remained sinusoidal, even though the load current was highly distorted.

  • The Total Harmonic Distortion (THD) for:

    • Load current was approximately 44.79%

    • Source current dropped to just 0.58% after compensation

    • Compensating current THD was around 119.3%, showing it successfully canceled load harmonics

  • Harmonic orders (e.g., H3, H5, H7) were all reduced to below 0.5%, ensuring high power quality.

🔄 Filter Comparison: With vs. Without Active Filtering

To demonstrate the impact of the SAPF:

  • Without the filter, the source and load currents had the same non-sinusoidal shape, with both showing a THD of about 46%.

  • With the filter enabled, the source current transformed into a near-perfect sinusoidal waveform, and THD dropped drastically.

This confirms the effectiveness of the active filter in compensating both harmonics and reactive power.

✅ Conclusion

A Single-Phase Shunt Active Power Filter, implemented using MATLAB and controlled by PQ theory, offers a powerful solution to improve power quality in systems with nonlinear loads. By injecting a compensating current, it maintains a sinusoidal source current, reduces THD, and supplies necessary reactive power, ensuring reliable and efficient operation of the electrical network.

Comments


bottom of page