MATLAB Simulation of Microgrid Dynamics with PO, ANFIS, PSO MPPT
MATLAB Simulation of Microgrid Dynamics with PO, ANFIS, PSO MPPT
𝐈𝐧𝐭𝐫𝐨𝐝𝐮𝐜𝐭𝐢𝐨𝐧
Microgrids combine renewable energy sources, energy storage, local loads, and the utility grid into a coordinated power system. In this MATLAB/Simulink model, a PV plant, battery energy storage system, local load, and grid are integrated at the Point of Common Coupling (PCC).

A major focus of this simulation is Maximum Power Point Tracking (MPPT) for the photovoltaic system. Different MPPT approaches are tested and compared, including P&O MPPT, PSO-ANFIS MPPT, and a PSO-based sliding-mode MPPT approach. Pasted text
This model is useful for:
Students learning renewable-energy systems
Researchers working on intelligent MPPT techniques
Engineers studying grid-connected PV and battery systems
Users interested in MATLAB/Simulink-based microgrid control
Comparative study of conventional and intelligent MPPT methods
𝐒𝐲𝐬𝐭𝐞𝐦 𝐎𝐯𝐞𝐫𝐯𝐢𝐞𝐰
The complete microgrid contains:
1 MW solar PV plant
1 MW / 1 MWh battery energy storage system
Boost converter for the PV system
Three-level neutral-point-clamped inverter
Two-level battery inverter
Local AC load
PCC measurement section
Step-up transformer
Utility grid
MPPT and inverter control systems
The PV array is connected to a boost converter, and the converter output is interfaced with the AC network through a three-level inverter. The battery is directly connected to its bidirectional inverter for charging and discharging operation. Pasted text
𝐌𝐚𝐢𝐧 𝐒𝐲𝐬𝐭𝐞𝐦 𝐏𝐚𝐫𝐚𝐦𝐞𝐭𝐞𝐫𝐬
Parameter | Value / Description |
PV plant rating | Approximately 1 MW |
PV module rating | 355 W |
PV modules in series | 15 |
Parallel strings | 190 |
PV peak voltage | Approximately 651 V |
Reference irradiance | 1000 W/m² |
Reference temperature | 23°C |
Battery power rating | 1 MW |
Battery energy rating | 1 MWh |
Battery nominal voltage | 922 V |
Initial battery SOC | 50% |
PCC voltage | 600 V |
Intermediate grid voltage | 25 kV |
Utility grid voltage | 120 kV |
Grid frequency | 60 Hz |
Simulation duration shown | 5 s |
The transcript describes the PV plant as producing approximately 1 MW under the stated reference operating condition. Pasted text
The battery system is rated at approximately 1 MW / 1 MWh, with a nominal voltage of 922 V and an initial SOC of 50%. Pasted text
𝐏𝐕 𝐒𝐲𝐬𝐭𝐞𝐦
The PV section converts solar energy into electrical power and injects it into the microgrid.
Main stages are:
PV array
MPPT controller
Boost converter
DC link
Three-level inverter
AC-side filter and transformer
PCC connection
The boost converter is controlled using the selected MPPT technique so that the PV array operates close to its maximum available power point.
The inverter then converts the DC power into three-phase AC power for delivery to the PCC. Pasted text
𝐖𝐨𝐫𝐤𝐢𝐧𝐠 𝐏𝐫𝐨𝐜𝐞𝐬𝐬
The overall energy-flow process can be understood in the following sequence:
Solar irradiance and temperature determine the operating condition of the PV array.
The MPPT algorithm determines the appropriate control command.
The boost converter regulates the PV operating point.
DC power is supplied to the inverter.
The inverter converts DC power into AC power.
The generated PV power is supplied to the PCC.
The battery charges or discharges depending on the microgrid power requirement.
The grid supports the system when the local generation and storage cannot completely balance the load.
PCC voltage, frequency, active power, reactive power, and different currents are monitored.
𝐂𝐨𝐧𝐭𝐫𝐨𝐥 𝐒𝐭𝐫𝐚𝐭𝐞𝐠𝐲
𝐏&𝐎 𝐌𝐏𝐏𝐓
The Perturb and Observe MPPT method uses PV voltage and current measurements.
Its control process includes:
Measure PV voltage
Measure PV current
Determine the variation in PV power
Determine the variation in PV voltage
Update the duty cycle
Apply the duty cycle to the boost converter
The output of the P&O MPPT block is therefore used directly for boost-converter control. Pasted text
P&O is attractive because it is:
Simple to implement
Easy to understand
Suitable for basic MPPT studies
Computationally less complicated than many intelligent techniques
𝐏𝐒𝐎-𝐀𝐍𝐅𝐈𝐒 𝐌𝐏𝐏𝐓
The intelligent MPPT section uses a PSO-tuned ANFIS structure.
Its main inputs are:
Solar irradiance
Temperature
Its main output is:
PV reference voltage
The reference voltage is compared with the measured PV voltage. The resulting control signal is processed using a PI controller to produce the duty cycle for the boost converter. Pasted text
PSO-ANFIS development process
The implementation described in the simulation includes:
Reading PV module specifications
Generating irradiance and temperature data
Collecting corresponding PV-voltage data
Training the ANFIS model
Using PSO during the tuning/training process
Generating the trained fuzzy inference system
Loading the trained ANFIS structure inside the MPPT subsystem
The trained fuzzy inference system is then used inside the Simulink MPPT block. Pasted text
𝐏𝐒𝐎 𝐁𝐚𝐬𝐞𝐝 𝐒𝐥𝐢𝐝𝐢𝐧𝐠 𝐌𝐨𝐝𝐞 𝐌𝐏𝐏𝐓
Another control configuration uses PSO together with a sliding-mode controller.
In this structure:
PSO generates the reference voltage.
The reference signal is given to the sliding-mode controller.
The sliding-mode controller generates the duty cycle.
The duty cycle controls the PV boost converter. Pasted text
This approach is useful for studying robust converter control under changing operating conditions.
𝐏𝐕 𝐈𝐧𝐯𝐞𝐫𝐭𝐞𝐫 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
The PV inverter control system uses PCC measurements and DC-link regulation.
Important control stages include:
PCC voltage measurement
PCC current measurement
DC-link voltage measurement
Phase-Locked Loop
Park transformation
DC-link voltage regulator
PI controller
d-axis current reference generation
Current regulator
Feed-forward decoupling
Inverse Park transformation
PWM generation
The measured three-phase variables are converted into the dq reference frame using the Park transformation. Pasted text
The DC-link voltage controller generates the d-axis current reference, while the q-axis reference is set to zero in the described operating condition. This allows the PV inverter to focus mainly on real-power injection. Pasted text
𝐁𝐚𝐭𝐭𝐞𝐫𝐲 𝐄𝐧𝐞𝐫𝐠𝐲 𝐒𝐭𝐨𝐫𝐚𝐠𝐞 𝐒𝐲𝐬𝐭𝐞𝐦
The microgrid includes a 1 MW / 1 MWh lithium-ion battery storage system.
The battery is connected directly to a two-level inverter without an additional DC–DC converter in the described configuration.
Depending on the power requirement, the inverter operates so that the battery can:
Supply power to the microgrid
Absorb excess power
Support active-power balancing
Support reactive-power control
The inverter can therefore support both charging and discharging operation. Pasted text
𝐆𝐫𝐢𝐝 𝐚𝐧𝐝 𝐏𝐂𝐂 𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧
The PCC acts as the common electrical interface between:
PV plant
Battery storage
Local load
Utility grid
The PCC voltage is given as 600 V in the model description.
Voltage is stepped up to 25 kV and then connected to the 120 kV grid.
The complete network operates at 60 Hz. Pasted text
The model also monitors:
PCC voltage
PCC frequency
PCC active power
Load power
Battery active power
PV active power
Battery reactive power
PCC current
Load current
Battery-side current
PV-side current
𝐌𝐏𝐏𝐓 𝐌𝐞𝐭𝐡𝐨𝐝 𝐂𝐨𝐦𝐩𝐚𝐫𝐢𝐬𝐨𝐧
MPPT Method | Main Inputs | Main Control Output | Main Concept |
P&O MPPT | PV voltage, PV current | Duty cycle | Conventional perturbation-based tracking |
PSO-ANFIS MPPT | Irradiance, temperature | Reference voltage / duty-cycle control | Intelligent data-driven MPPT |
PSO + Sliding Mode | Optimized reference | Duty cycle | Optimization combined with robust control |
This comparison allows the user to study how different control techniques affect PV power tracking and microgrid response.
𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐮𝐥𝐭𝐬
The simulation displays several important signals, including:
PV generated power
Load power
PCC power
Battery power
Battery-side reactive power
PCC voltage
PCC frequency
Each MPPT method is simulated separately so that the PV response can be compared under similar system conditions. Pasted text
The transcript reports that the responses from the different MPPT methods were plotted together for comparison. Pasted text
According to the reported simulation observation, the PSO-ANFIS MPPT showed improved tracking behavior in that particular simulation comparison relative to the other displayed methods. This should be understood as a result reported for the demonstrated model and operating conditions rather than a universal conclusion for every PV system. Pasted text
𝐊𝐞𝐲 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐬
MATLAB/Simulink-based microgrid simulation
Approximately 1 MW PV plant
1 MW / 1 MWh BESS
Grid-connected microgrid architecture
P&O MPPT implementation
PSO-ANFIS intelligent MPPT
PSO-based sliding-mode MPPT
Boost-converter control
Three-level PV inverter
Two-level battery inverter
dq-axis inverter control
PI-based DC-link regulation
PLL synchronization
Active and reactive power monitoring
PCC voltage and frequency monitoring
MPPT performance comparison
Battery charging and discharging capability
PV, battery, load, and grid power-flow analysis
𝐀𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧𝐬
This simulation can support learning and research in areas such as:
Solar PV grid integration
Battery energy-storage systems
Intelligent MPPT
ANFIS-based renewable-energy control
Particle Swarm Optimization
Sliding-mode converter control
Microgrid energy management
Grid-connected inverter control
Renewable-energy power electronics
Active and reactive power control
PCC performance analysis
Smart-grid studies
AI-assisted renewable-energy control
𝐖𝐡𝐲 𝐂𝐨𝐦𝐩𝐚𝐫𝐞 𝐌𝐮𝐥𝐭𝐢𝐩𝐥𝐞 𝐌𝐏𝐏𝐓 𝐌𝐞𝐭𝐡𝐨𝐝𝐬?
Using a single MPPT technique does not show how alternative control approaches behave under the same microgrid configuration.
A comparative model allows users to examine:
Tracking response
PV-power extraction
Dynamic behavior
Controller response
Interaction with the DC link
Grid-side power variation
Battery power response
It also provides a useful platform for extending the model with other intelligent or optimization-based MPPT techniques.
𝐖𝐡𝐨 𝐂𝐚𝐧 𝐔𝐬𝐞 𝐓𝐡𝐢𝐬 𝐌𝐨𝐝𝐞𝐥?
The simulation is suitable for:
𝐂𝐨𝐧𝐜𝐥𝐮𝐬𝐢𝐨𝐧
The MATLAB Simulation of Microgrid Dynamics with P&O, ANFIS, and PSO MPPT provides a practical platform for studying renewable-energy integration, energy storage, inverter control, and maximum-power-point tracking.
The model combines a large PV plant, battery storage, local loads, and the utility grid within a single Simulink environment. Multiple MPPT methods can be simulated and compared using PV-power, PCC-power, battery-power, voltage, frequency, and reactive-power responses.
For students, researchers, and engineers, this type of simulation provides a clear way to understand how conventional, intelligent, and optimization-based MPPT controllers influence the dynamic operation of a grid-connected PV–battery microgrid.



Comments