Back to Projects

Microgrid Power Quality Controllers

MATLABSIMULINK

Overview

Microgrid Power Quality Controllers is a final-year electrical engineering research project that models a renewable-energy-source grid interface in MATLAB and Simulink and compares multiple control strategies for improving power quality at the point of common coupling. The study evaluates PID, Sliding Mode Control (SMC), Adaptive Sliding Mode Control (ASMC), Super-Twisting Sliding Mode Control (ST-SMC), and Brain Emotional Learning-Based Intelligent Control (BELBIC) under nonlinear-load conditions. Each controller is assessed using current-reference tracking, grid-current total harmonic distortion, power-factor correction, startup behavior, robustness, and steady-state error.

Objectives

  • ▸ Model a renewable-energy microgrid connected to the utility grid through a controlled power-electronic inverter
  • ▸ Reduce grid-current harmonics introduced by nonlinear loads and intermittent renewable generation
  • ▸ Improve the grid power factor by supplying compensating current through the renewable-energy inverter
  • ▸ Generate a reference compensation current using Fryze Current Minimization and apply the same reference method across all controller designs
  • ▸ Implement and tune PID, SMC, ASMC, ST-SMC, and BELBIC controllers in a common MATLAB and Simulink environment
  • ▸ Compare linear, nonlinear, adaptive, higher-order sliding-mode, and intelligent-control techniques under consistent simulation conditions
  • ▸ Evaluate controller performance using current-tracking error, total harmonic distortion, power-factor deviation, transient response, overshoot, and steady-state behavior
  • ▸ Identify the control approach that provides the strongest overall balance of power-quality improvement and dynamic performance

Architecture

Simulation-based control-system study implemented in MATLAB and Simulink. The modeled system combines a renewable-energy DC source, a voltage-source inverter, an inverter output filter, a three-phase utility grid, and nonlinear loads at the point of common coupling. Fryze Current Minimization calculates grid power and instantaneous conductance, derives the desired grid current, filters the result to preserve its fundamental-frequency component, and determines the inverter compensation-current reference from the difference between load and desired grid currents. The reference is supplied to interchangeable PID, SMC, ASMC, ST-SMC, and BELBIC control subsystems. Their control signals drive the inverter so its injected current compensates harmonic and reactive load components. A shared simulation model records grid current, reference-current tracking, total harmonic distortion, power factor, startup transients, and steady-state behavior, allowing all controller outputs to be compared under the same electrical parameters and load changes.

Key Features

  • ▸ Renewable-energy-source and utility-grid interface modeled with a controlled inverter, output filter, grid impedance, and nonlinear loads
  • ▸ Fryze Current Minimization reference generator based on three-phase grid power, instantaneous conductance, RMS voltage, fundamental-frequency filtering, and compensation-current calculation
  • ▸ PID controller implementation with proportional, integral, and derivative gains tuned to balance rise time, steady-state error, overshoot, and stability
  • ▸ Sliding Mode Controller designed around a sliding surface and reaching law to provide robustness against parameter variation and external disturbances
  • ▸ Adaptive Sliding Mode Controller using an integral sliding surface and adaptive gains to improve dynamic response under changing operating conditions
  • ▸ Super-Twisting Sliding Mode Controller using a higher-order sliding-mode algorithm to reduce chattering while preserving robustness and tracking performance
  • ▸ BELBIC implementation inspired by amygdala and orbitofrontal learning processes, using stimulus and reward signals to adapt controller behavior
  • ▸ Common plant, reference signal, electrical parameters, and test conditions used to make the controller comparison consistent
  • ▸ Grid-current waveforms captured before and after compensation to visualize harmonic reduction and waveform improvement
  • ▸ Current-reference tracking comparisons used to quantify each controller's ability to follow the required inverter compensation current
  • ▸ Total harmonic distortion measurements used to assess grid-current quality
  • ▸ Power-factor measurements used to evaluate reactive-current compensation and alignment of grid voltage and current
  • ▸ Transient analysis covering startup disturbance, overshoot, controller settling, and response to load switching
  • ▸ Steady-state analysis covering residual tracking error and settled harmonic performance
  • ▸ Controller-specific parameter tables for the electrical model, PID gains, sliding-mode coefficients, adaptive gains, and BELBIC learning values
  • ▸ Combined plots and tabular results summarizing all controller performances in a single comparison

Challenges

  • ▸ Designing a common simulation benchmark that allowed fundamentally different linear, nonlinear, adaptive, higher-order, and intelligent controllers to be compared fairly
  • ▸ Deriving a stable reference current from rapidly varying nonlinear-load current while retaining only the grid's fundamental-frequency component
  • ▸ Tuning PID gains to reduce steady-state error without introducing excessive overshoot, oscillation, or startup instability
  • ▸ Selecting an SMC sliding surface and control law that remained robust to plant variations and disturbances
  • ▸ Managing the chattering inherent in conventional sliding-mode control without sacrificing robustness or current-tracking accuracy
  • ▸ Introducing adaptive behavior into ASMC while controlling startup disruption and gain sensitivity
  • ▸ Implementing the higher-order Super-Twisting algorithm to reduce discontinuity with manageable parameter and information requirements
  • ▸ Configuring BELBIC stimulus, reward, amygdala, and orbitofrontal learning parameters so the controller learned effectively without creating damaging startup-current spikes
  • ▸ Separating transient behavior from steady-state performance because some controllers settled quickly but showed substantial initial disruption
  • ▸ Comparing controllers across multiple objectives where lower tracking error, lower THD, near-unity power factor, smooth startup, and robustness could favor different designs
  • ▸ Ensuring that aggregate house-style power-quality conclusions were based on identical electrical model parameters and switching events
  • ▸ Interpreting small power-factor deviation values correctly as error from the desired near-unity power factor rather than as the raw power factor

Outcomes

  • ▸ Built a reusable MATLAB and Simulink microgrid testbench for evaluating power-quality controllers under renewable generation and nonlinear-load conditions
  • ▸ Implemented and compared five principal control approaches: PID, SMC, ASMC, ST-SMC, and BELBIC
  • ▸ Demonstrated that every evaluated controller improved current tracking, reduced grid-current harmonics, and moved the grid power factor toward unity compared with the uncompensated system
  • ▸ Measured BELBIC with the lowest reported current-tracking error of 0.029 and the lowest reported grid-current THD of approximately 1.098 among the compared controllers
  • ▸ Observed a reported BELBIC power-factor deviation of 0.001, placing its settled correction among the strongest evaluated results
  • ▸ Measured PID with a current-tracking error of 0.160, THD of 1.332, and power-factor deviation of 0.004, while also observing greater startup disruption than the stronger nonlinear controllers
  • ▸ Showed that ST-SMC reduced reported THD to 1.396 compared with 1.414 for conventional SMC, supporting the higher-order controller's chattering-reduction objective
  • ▸ Identified that ASMC could settle rapidly but experienced a pronounced switching transient in the tested configuration
  • ▸ Established that BELBIC provided the strongest overall simulated performance after its learned parameters were initialized appropriately
  • ▸ Documented an important implementation trade-off: unoptimized BELBIC learning initialization could create a short startup-current spike, whereas reusing learned terminal weights substantially reduced overshoot
  • ▸ Produced controller-specific waveforms, combined comparison plots, parameter tables, and a quantitative results matrix suitable for engineering analysis and future controller refinement