Grid-connected solar PV system with Battery Energy Storage System
Grid-connected solar PV system with Battery Energy Storage System
𝐈𝐧𝐭𝐫𝐨𝐝𝐮𝐜𝐭𝐢𝐨𝐧
A Grid-connected Solar PV System with Battery Energy Storage System (BESS) combines renewable generation, energy storage, DC loads, and utility-grid interaction in a single coordinated power system.

In this MATLAB/Simulink model:
Solar PV generates electrical power from available irradiance.
An Incremental Conductance MPPT controller extracts maximum PV power.
A boost converter interfaces the PV array with the DC bus.
A battery provides energy storage through a bidirectional DC-DC converter.
A regulated 400 V DC bus supplies the DC load.
A single-phase inverter connects the DC system to a 230 V, 50 Hz utility grid.
Power can flow from the PV-battery system to the grid or from the grid back to the DC system.
A simple energy-management logic determines the direction of grid power flow using PV power and battery SOC.
The model is useful for understanding renewable-energy integration, battery charging/discharging, MPPT, DC-bus regulation, bidirectional power flow, and grid-connected inverter control.
𝐒𝐲𝐬𝐭𝐞𝐦 𝐎𝐯𝐞𝐫𝐯𝐢𝐞𝐰
The complete system contains five major sections:
Solar PV array
Boost converter with MPPT
Battery Energy Storage System
DC bus and DC load
Single-phase grid-connected inverter
The basic power-flow structure is:
Solar PV → Boost Converter → DC Bus → DC Load / Battery / Grid
The battery is connected to the DC bus through a bidirectional converter, while the grid is connected through a controlled single-phase inverter.
Main system parameters
Parameter | Value / Description |
PV module rating | 250 W |
Number of PV modules | 8 in series |
Maximum PV array power | Approximately 2 kW |
Approximate PV array MPP voltage | 240 V |
Battery configuration | 20 × 12 V batteries in series |
Battery nominal voltage | 240 V |
Battery capacity | 48 Ah |
Initial SOC – Scenario 1 | 50% |
Initial SOC – Scenario 2 | Approximately 9.99% |
DC bus reference voltage | 400 V |
Grid voltage | 230 V |
Grid frequency | 50 Hz |
Grid type | Single phase |
PV MPPT method | Incremental Conductance |
PV low-power threshold | 100 W |
Battery low-SOC threshold | 10% |
Grid import reference | Approximately −10 A peak |
Grid export reference | Approximately +2 A peak |
𝐒𝐨𝐥𝐚𝐫 𝐏𝐕 𝐒𝐲𝐬𝐭𝐞𝐦
The PV array uses eight series-connected modules, with each module rated at approximately 250 W.
Therefore, under standard operating conditions, the complete PV string can generate nearly 2 kW.
The output of the PV array depends mainly on:
Solar irradiance
PV cell temperature
The model allows both:
Static irradiance operation
Dynamic irradiance variation
This makes it possible to analyze the effect of rapidly changing environmental conditions on the PV array, battery, DC bus, and grid power exchange.
PV power variation with irradiance
The PV characteristics observed in the model are approximately:
Irradiance | Maximum PV Power |
1000 W/m² | ≈ 2000 W |
800 W/m² | ≈ 1599 W |
600 W/m² | ≈ 1197 W |
400 W/m² | ≈ 799 W |
100 W/m² | ≈ 188 W |
The results clearly demonstrate that PV output power decreases as solar irradiance decreases.
𝐈𝐧𝐜𝐫𝐞𝐦𝐞𝐧𝐭𝐚𝐥 𝐂𝐨𝐧𝐝𝐮𝐜𝐭𝐚𝐧𝐜𝐞 𝐌𝐏𝐏𝐓
An Incremental Conductance MPPT algorithm is used to extract the maximum available power from the PV array.
The controller receives:
PV voltage
PV current
Based on these measurements, the MPPT algorithm determines the required converter operating point.
MPPT control process
PV voltage and current are continuously measured.
The Incremental Conductance algorithm identifies the maximum power operating region.
A duty-cycle command is generated.
The duty cycle is sent to the PWM generator.
PWM pulses control the boost-converter IGBT.
The PV array is continuously driven toward its maximum power point.
This control enables the PV system to respond effectively when irradiance changes.
𝐁𝐨𝐨𝐬𝐭 𝐂𝐨𝐧𝐯𝐞𝐫𝐭𝐞𝐫
The PV array voltage is lower than the required DC-link voltage.
Therefore, a boost converter is placed between the PV array and DC bus.
Its main responsibilities are:
Interface the PV array with the DC bus.
Support MPPT operation.
Increase the PV voltage to the required DC-link level.
Transfer the extracted solar power to the common DC bus.
The converter switching pulse is generated from the output of the MPPT controller.
𝐁𝐚𝐭𝐭𝐞𝐫𝐲 𝐄𝐧𝐞𝐫𝐠𝐲 𝐒𝐭𝐨𝐫𝐚𝐠𝐞 𝐒𝐲𝐬𝐭𝐞𝐦
The battery system consists of approximately 20 series-connected 12 V battery units, producing a nominal voltage of about 240 V.
The stated battery capacity is approximately 48 Ah.
The battery can operate in two major modes:
Battery charging
Charging occurs when:
Available PV power is greater than the immediate load requirement.
Power is imported from the utility grid under low-SOC conditions.
Excess renewable/grid power is available on the DC bus.
A negative battery current in the presented simulation corresponds to battery charging.
Battery discharging
Discharging occurs when:
PV generation decreases.
Solar power is insufficient for the DC load and grid power demand.
The battery SOC remains above the lower operating threshold.
A positive battery current represents battery discharge in the shown results.
𝐁𝐢𝐝𝐢𝐫𝐞𝐜𝐭𝐢𝐨𝐧𝐚𝐥 𝐃𝐂-𝐃𝐂 𝐂𝐨𝐧𝐯𝐞𝐫𝐭𝐞𝐫
The battery is connected to the common DC bus through a bidirectional DC-DC converter.
Unlike a conventional one-directional converter, this converter supports power flow in both directions:
DC bus → Battery: Charging
Battery → DC bus: Discharging
Its most important task in this model is maintaining the DC-link voltage at approximately 400 V.
𝐃𝐂 𝐁𝐮𝐬 𝐕𝐨𝐥𝐭𝐚𝐠𝐞 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
The DC bus acts as the central power-sharing point for:
Solar PV
Battery
DC load
Grid-connected inverter
The target DC voltage is:
400 V
The controller performs the following steps:
Measure actual DC-bus voltage.
Compare it with the 400 V reference.
Process the voltage error through a PI controller.
Generate the required converter control command.
Pass the command through a PWM generator.
Control the switches of the bidirectional DC-DC converter.
As a result, the DC bus remains close to its reference despite changing PV power and battery operating conditions.
𝐆𝐫𝐢𝐝-𝐂𝐨𝐧𝐧𝐞𝐜𝐭𝐞𝐝 𝐈𝐧𝐯𝐞𝐫𝐭𝐞𝐫
The DC system is connected to a 230 V, 50 Hz single-phase grid through a controlled full-bridge inverter and output filter.
The inverter provides bidirectional grid power flow.
Therefore, the system can operate in two important conditions:
Power export: DC microgrid → Utility grid
Power import: Utility grid → DC microgrid
This feature enables the battery and PV system to interact dynamically with the utility network.
𝐄𝐧𝐞𝐫𝐠𝐲 𝐌𝐚𝐧𝐚𝐠𝐞𝐦𝐞𝐧𝐭 𝐋𝐨𝐠𝐢𝐜
The grid current reference is selected mainly according to:
PV output power
Battery state of charge
A low-PV and low-SOC condition forces the grid to provide power to the DC system.
Basic operating logic
PV Condition | Battery SOC | Grid Operation | Current Reference |
PV power < 100 W | SOC < 10% | Grid supplies DC system | ≈ −10 A peak |
Sufficient PV power | SOC above minimum limit | DC system supplies grid | ≈ +2 A peak |
PV power decreases | SOC sufficiently high | Battery supports loads/grid | Positive battery discharge current |
Excess PV power | Battery available for charging | Battery charges and surplus can reach grid | Based on controller |
This simple logic prevents excessive battery discharge when its SOC becomes very low.
𝐖𝐨𝐫𝐤𝐢𝐧𝐠 𝐏𝐫𝐨𝐜𝐞𝐬𝐬
Case 1: High solar irradiance
At approximately 1000 W/m²:
PV power reaches nearly 2 kW.
DC bus remains close to 400 V.
DC load receives approximately 1 kW in the demonstrated case.
Remaining PV power is available for battery charging and grid support.
Battery current can become negative, indicating charging.
Battery SOC increases.
Case 2: Irradiance falls to 500 W/m²
When irradiance decreases:
1000 W/m² → 500 W/m²
PV power falls from nearly:
2 kW → 1 kW
Consequently:
PV contribution becomes insufficient for the previous operating condition.
Battery changes from charging to discharging.
Battery current changes direction.
Battery supplies the power deficit.
DC-link voltage remains regulated.
DC and grid-side requirements continue to be supported.
Case 3: Very low irradiance
When irradiance falls to approximately 10 W/m²:
PV generation becomes almost zero.
The battery becomes the primary DC-side source if sufficient SOC is available.
Battery discharge current increases.
Battery supplies the DC load and grid-side power requirement.
SOC gradually decreases.
Case 4: Solar irradiance recovers
When irradiance increases again:
10 → 500 → 1000 W/m²
the system responds automatically.
At approximately 500 W/m²:
PV power recovers to roughly 1 kW.
Battery discharge demand decreases.
At approximately 1000 W/m²:
PV generation reaches about 2 kW.
Battery can return to charging mode.
SOC begins increasing.
Excess PV energy can be exported to the grid.
𝐈𝐧𝐯𝐞𝐫𝐭𝐞𝐫 𝐂𝐨𝐧𝐭𝐫𝐨𝐥 𝐒𝐭𝐫𝐚𝐭𝐞𝐠𝐲
The single-phase inverter uses a current-control structure.
The measured inverter/grid current is processed through a reference-generation and current-control section.
The controller performs:
Grid/inverter current measurement
Current-reference generation
Transformation into the control reference frame
Reference and actual current comparison
PI current regulation
Conversion of the controller output back to the inverter command
PWM generation
Switching of the four inverter IGBTs
The direction and magnitude of grid power depend on the selected current reference.
𝐆𝐫𝐢𝐝 𝐏𝐨𝐰𝐞𝐫 𝐄𝐱𝐩𝐨𝐫𝐭
When adequate PV power and battery energy are available, the controller selects the export condition.
In the demonstrated simulation:
Current reference is approximately +2 A peak.
The DC-side system supplies the grid.
PV supplies the DC load.
Battery charging or discharging depends on the instantaneous power balance.
Excess power is transferred to the AC grid.
This represents renewable-energy export to the utility network.
𝐆𝐫𝐢𝐝 𝐏𝐨𝐰𝐞𝐫 𝐈𝐦𝐩𝐨𝐫𝐭
The second major operating case occurs when:
PV power falls below approximately 100 W, and
Battery SOC falls below approximately 10%.
Under this condition:
The grid-current reference changes to approximately −10 A peak.
Power-flow direction reverses.
The utility grid supplies the DC microgrid.
DC load continues operating.
Battery begins charging.
Battery SOC starts increasing.
This operating mode protects the battery from continued deep discharge.
𝐋𝐨𝐰-𝐒𝐎𝐂 𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐒𝐜𝐞𝐧𝐚𝐫𝐢𝐨
A separate test is carried out with initial battery SOC set to approximately:
9.99%
This test demonstrates the operation of the grid-support logic.
Response under different irradiance conditions
Operating Condition | PV Response | Battery Response | Grid Response |
1000 W/m² | ≈ 2 kW | Charges | Export possible |
500 W/m² | ≈ 1 kW | May discharge/support system | Depends on SOC logic |
10 W/m² + SOC <10% | Nearly 0 W | Charges | Grid imports power to DC side |
500 W/m² + SOC still <10% | ≈1 kW | Higher charging contribution | Grid continues supporting |
1000 W/m² + SOC still <10% | ≈2 kW | Stronger charging | Grid support continues until SOC criterion changes |
SOC rises above 10% | PV available | Normal energy sharing resumes | Export condition can return |
An important feature is that the controller considers the required operating conditions together rather than using PV power alone.
𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐮𝐥𝐭𝐬
The MATLAB/Simulink model monitors several important parameters.
PV measurements
The PV scope displays:
PV voltage
PV current
PV power
The PV power closely follows the applied irradiance profile.
Battery measurements
The battery scope includes:
Battery voltage
Battery current
Battery SOC
The battery current clearly shows transitions between:
Charging mode
Discharging mode
SOC increases during charging and decreases during discharge.
DC load measurements
The DC load section monitors:
DC-bus voltage
Load current
DC-load power
Despite solar irradiance changes, the controller keeps the DC bus close to:
400 V
Inverter and grid measurements
The grid-connected section shows:
Inverter voltage
Inverter current
Grid current
The current direction changes according to whether the system is:
Exporting energy to the grid, or
Importing energy from the grid.
𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐈𝐫𝐫𝐚𝐝𝐢𝐚𝐧𝐜𝐞 𝐓𝐞𝐬𝐭
The demonstrated dynamic irradiance pattern is approximately:
Simulation Stage | Irradiance | Approximate PV Power |
Initial condition | 1000 W/m² | ≈2000 W |
Reduced irradiance | 500 W/m² | ≈1000 W |
Very low irradiance | 10 W/m² | ≈0 W |
Recovery | 500 W/m² | ≈1000 W |
Full recovery | 1000 W/m² | ≈2000 W |
This test demonstrates that the battery acts as an energy buffer between rapidly changing PV generation and the load/grid demand.
𝐃𝐂 𝐁𝐮𝐬 𝐏𝐨𝐰𝐞𝐫 𝐁𝐚𝐥𝐚𝐧𝐜𝐞
One of the important results of the model is the DC-bus current-balance plot.
It includes currents associated with:
PV converter
Battery converter
DC load
Inverter
The combined DC-bus current remains approximately balanced.
This demonstrates that the energy generated or imported into the DC bus is distributed among:
Loads
Battery
Grid
according to the operating condition.
𝐊𝐞𝐲 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐬
2 kW solar PV array
Battery Energy Storage System
400 V regulated DC bus
230 V, 50 Hz single-phase grid
Incremental Conductance MPPT
PV boost converter control
Bidirectional battery DC-DC converter
Battery charging and discharging
Single-phase full-bridge inverter
Bidirectional grid power flow
PV power and SOC-based energy-management logic
Low-SOC battery protection
Dynamic irradiance testing
Grid-to-DC power transfer
DC-to-grid renewable power export
DC-bus current-balance analysis
MATLAB/Simulink-based control implementation
𝐀𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧𝐬
This type of grid-connected PV-battery architecture can be studied for:
Residential solar energy systems
Smart homes
Commercial renewable-energy systems
Solar-plus-storage installations
Grid-support systems
Battery charging systems
Distributed energy resources
DC microgrids
Smart-grid research
Renewable-energy laboratories
Bidirectional power converters
Energy-management algorithm development
Grid-interactive battery systems
Renewable-energy integration studies
𝐀𝐝𝐯𝐚𝐧𝐭𝐚𝐠𝐞𝐬 𝐨𝐟 𝐏𝐕 𝐰𝐢𝐭𝐡 𝐁𝐚𝐭𝐭𝐞𝐫𝐲 𝐒𝐭𝐨𝐫𝐚𝐠𝐞
Integrating battery storage with a grid-connected solar system provides several benefits:
Stores excess solar energy.
Supports loads during reduced irradiation.
Reduces dependence on immediate grid power.
Prevents interruption during sudden PV variations.
Enables controlled power exchange with the grid.
Helps regulate the common DC bus.
Improves renewable-energy utilization.
Allows grid charging when battery SOC becomes critically low.
Supports smooth transitions between different power-flow conditions.
𝐂𝐨𝐧𝐜𝐥𝐮𝐬𝐢𝐨𝐧
The Grid-connected Solar PV System with Battery Energy Storage System in MATLAB/Simulink demonstrates coordinated operation of solar generation, battery storage, DC loads, and a single-phase utility grid.
The PV array uses Incremental Conductance MPPT to extract maximum available solar power, while the boost converter transfers this energy to a regulated 400 V DC bus. A bidirectional DC-DC converter manages battery charging and discharging and contributes to DC-link voltage regulation.
Under high irradiance, PV energy supplies the load, charges the battery, and can export excess energy to the utility grid. When irradiance decreases, the battery supplies the required power deficit. If PV power becomes very low and battery SOC falls below approximately 10%, the controller reverses the grid power direction so that the utility supplies the DC load and charges the battery.
The simulation therefore provides a clear example of MPPT operation, battery energy management, bidirectional power conversion, DC-bus regulation, dynamic irradiance response, and grid import/export control in a single MATLAB/Simulink environment.



Comments