Fuzzy Logic-Based Energy Management in a Grid-Connected PV-Battery System using MATLAB
- lms editor
- Jul 29, 2025
- 4 min read
🟢 PV Array Configuration and Power Estimation
The PV system consists of 8 panels connected in series per string, and two such strings are used in parallel. Each panel is rated at 250 W, so:
Single string output = 8 × 250 = 2000 W
Total array output = 2 × 2000 = 4000 W
With each panel delivering around 30.7 V, the series configuration results in approximately 245–246 V DC per string. The system is designed to deliver 400 V at the DC bus.
⚡ Boost Converter Design
The boost converter steps up the panel voltage (~245 V) to 400 V. Key design steps include:
Using standard boost converter equations to calculate inductance (L) and capacitance (C)
Parameters are selected based on:
Input power = 4000 W
Output voltage = 400 V
Switching frequency = user-defined (e.g., 10 kHz)
The computed L and C values are implemented in the boost converter to maintain voltage regulation and ensure MPPT tracking.
🔋 Bidirectional DC-DC Converter for Battery Integration
A bidirectional DC-DC converter connects the battery (rated at 240 V) to the 400 V DC bus. Its purpose is to:
Charge the battery from excess PV power
Discharge the battery to support the load or grid when PV is insufficient
Design of the converter again follows classical formulas, considering:
Power rating (based on PV and battery capability)
Input voltage = 240 V, output voltage = 400 V
Operation in both directions (boost and buck modes)
🧰 LCL Filter Design for Grid Interface
To interface with the AC grid, an LCL filter is used to reduce harmonic distortion. Key design inputs include:
Power handling = up to 5000 W (PV + battery)
AC voltage = 230 V RMS
Switching frequency = 7.5 kHz
Grid frequency = 50 Hz
From the design equations, inductors (L1 and L2) and filter capacitor (C) values are derived to meet grid standards and reduce THD.
🌞 MPPT Control of the PV Panel
To extract maximum power from the PV panels:
Voltage and current from the PV array are continuously measured
These inputs are fed into an MPPT algorithm, which generates the duty cycle for the boost converter’s IGBT
The MPPT ensures the PV array operates at its maximum power point while maintaining a 400 V DC output
🔋 Voltage Control for Battery Converter
A PI controller is implemented to regulate the battery converter:
The actual DC bus voltage is compared with a 400 V reference
The resulting error is processed by the PI controller to adjust the duty cycle
This maintains stable DC bus voltage regardless of load or source variations
🧠 Fuzzy Logic-Based Energy Management System (EMS)
At the core of the system lies a fuzzy logic controller that manages energy flow between PV, battery, and grid. The controller takes two inputs:
PV Power (scaled 0–1): Actual power divided by 4000 W
Battery SoC (scaled 0–1): State of charge scaled from 0–100%
The fuzzy logic controller defines multiple membership functions:
PV: Zero, Small, Medium, Big, Very Big
SoC: Zero, Low, Medium, High, Very High
Output (Reference Current): Negative High, Negative Medium, Zero, Positive Medium, Positive High
Logic behavior:
If PV is low and SoC is low → draw power from the grid
If PV and SoC are high → inject power to the grid
If balanced → maintain zero power flow
The fuzzy surface maps PV and SoC conditions to appropriate current reference values between −1.3 to +1.3.
🔄 Inverter Control and Current Regulation
The reference current from the EMS is used to generate a sinusoidal signal:
Multiplied with a sine wave to produce an AC reference signal
Transformed from abc to dq frame
Compared with actual grid current (also in dq frame)
The error is fed into a current controller, generating control signals for PWM
These PWM pulses control the inverter's switches, allowing bidirectional power flow:
From DC bus to AC grid
Or from AC grid to the DC bus (during low irradiance or low SoC)
🔁 Dynamic Response to Changing Irradiance Conditions
The system is tested under different irradiance levels:
1000 W/m² → 500 W/m² → 10 W/m² → back to 1000 W/m²
The response observed:
During high irradiance, PV meets load demand and charges the battery
During low irradiance, battery discharges or power is drawn from the grid
State of charge transitions from charging to discharging as needed
Grid current and voltage remain sinusoidal and in phase during normal conditions; phase shift appears during grid import
📊 Monitoring and Visualization
Multiple scopes are used in Simulink to monitor:
PV voltage, current, and power
DC link voltage
Battery voltage, current, and SoC
Load power and grid power
Grid voltage/current at Point of Common Coupling (PCC)
Frequency stability (maintained at 50 Hz)
The system effectively maintains all performance parameters under variable conditions.
✅ Conclusion
This MATLAB/Simulink model provides a robust approach to integrating PV and battery systems with the grid. By combining traditional converter control with fuzzy logic-based EMS, the system can:
Extract maximum power from PV
Manage battery charging/discharging dynamically
Maintain grid standards (voltage, frequency, THD)
Enable smart and reliable bidirectional power flow
This demonstration offers a practical and scalable foundation for real-world energy management systems using renewable energy sources.







Comments