⚡ MATLAB Simulation of UPQC for Power Quality Mitigation Using Ant Colony Optimized Fuzzy Control
- lms editor
- 17 minutes ago
- 3 min read
Modern power distribution systems face several power quality issues such as voltage sag, swell, harmonics, and unbalanced loading. Sensitive loads like servers and industrial electronics require a regulated, distortion-free voltage profile to operate reliably. One of the most effective solutions for mitigating these disturbances is the Unified Power Quality Conditioner (UPQC).
In this article, we explore the MATLAB simulation of a UPQC controlled by a Fuzzy Logic Controller (FLC) tuned using Ant Colony Optimization (ACO). This hybrid optimization-based control enhances the UPQC’s ability to regulate voltage and current under nonlinear and disturbed operating conditions.
🔌 What Is UPQC?
A Unified Power Quality Conditioner (UPQC) combines:
Series Active Filter – Injects compensating voltage to correct voltage sag, swell & harmonics
Shunt Active Filter – Injects compensating current to correct current harmonics & power factor
Common DC-Link Capacitor – Provides necessary energy exchange between the two filters
UPQC thus ensures:
✔ Constant load voltage (1 p.u.)✔ Sinusoidal input current✔ Low Total Harmonic Distortion (THD)✔ Mitigation of sag, swell & harmonic disturbances
🧩 System Configuration Used in MATLAB
The simulation model consists of:
1️⃣ Grid Source
A programmable three-phase source used to generate:
Voltage sag
Voltage swell
Harmonic disturbances
2️⃣ Nonlinear Load
A 3-phase rectifier with RL load producing grid current THD ≈ 22.24%.
3️⃣ UPQC Architecture
Shunt Active Filter connected in parallel
Series Active Filter connected in series through a transformer
Common DC-link capacitor to exchange energy between filters
4️⃣ Control Strategy
Both filters are controlled using a Fuzzy Logic Controller, where:
Error (e) and change of error (ce) are inputs
Controller outputs regulate DC-link voltage and injected current
Output scaling factors (Kᵤ), input scaling factors (Kₑ, Kcₑ) and membership functions are optimized using Ant Colony Optimization
🧠 Fuzzy Controller Tuned by Ant Colony Optimization
✔ Why Fuzzy Logic Control?
Nonlinear and adaptive behavior
Excellent disturbance handling
Ideal for power quality applications
✔ Why ACO Optimization?
Tunes fuzzy membership functions
Adjusts rule-base parameters
Enhances controller performance
Minimizes THD and error functions
🔍 Optimization Objectives
The ACO minimizes a combined cost function built from:
Integral of Absolute Error (IAE)
Integral of Squared Error (ISE)
Integral of Time-Multiplied Absolute Error (ITAE)
Root Mean Square Error (RMSE)
Grid current THD
Six key fuzzy parameters (Ke, Kce, Ku, NB, NS, PS, etc.) are optimized iteratively.
During each iteration, the algorithm updates:
Best cost value
Optimized parameter set
Membership function tuning
🧪 Ant Colony Optimization Process in MATLAB
The simulation runs the ACO for 10 iterations (for demonstration), where each iteration:
Evaluates performance of current parameter set
Computes cost function
Updates the pheromone trails
Selects new optimal fuzzy parameters
In a real application, 50–100 trials are recommended to obtain the global best solution for the fuzzy controller.
At the end of optimization:
Best parameter set is displayed
These parameters are integrated back into the FLC block
The UPQC model is re-simulated using the tuned controller
📊 Simulation Results
1️⃣ Voltage Sag/Swell Compensation
A fault is created between 0.1s – 0.3s, resulting in grid voltage sag
The series active filter injects compensating voltage
Load voltage stays regulated at 1 p.u. throughout the disturbance
2️⃣ Harmonic Mitigation
At 0.2s onwards, harmonic disturbances are injected into the grid voltage:
Grid voltage becomes distorted
Load voltage remains sinusoidal
Series filter injects harmonic compensation voltage
3️⃣ Input Current Shaping
The shunt active filter ensures the grid current remains sinusoidal and balanced.
4️⃣ THD Analysis
Initial grid current THD: ≈22%
After UPQC with ACO-tuned fuzzy control: ≈2.44%
Meets IEEE 519 standard requirement (< 5%)
🏁 Conclusion
This MATLAB simulation demonstrates the effectiveness of a UPQC controlled by an Ant Colony Optimized Fuzzy Logic Controller. The hybrid optimization approach significantly enhances voltage regulation, harmonic reduction, and dynamic response under sag, swell, and nonlinear load conditions.
✔ Highlights:
Load voltage maintained at 1 p.u. during disturbances
Grid current THD reduced to 2.44%
Adaptive fuzzy logic tuned using ACO ensures superior performance
Robust mitigation of sag, swell & harmonics
This model is ideal for researchers, students, and engineers working on power quality enhancement, nonlinear load compensation, and intelligent control systems.







Comments