Off-Grid Solar PV–Battery System with PSO MPPT & Generator Backup | MATLAB/Simulink Simulation
- lms editor
- 7 minutes ago
- 7 min read
Off-Grid Solar PV–Battery System with PSO MPPT & Generator Backup
𝐈𝐧𝐭𝐫𝐨𝐝𝐮𝐜𝐭𝐢𝐨𝐧
An off-grid solar PV–battery system provides electrical power without depending continuously on the utility grid. Solar energy is used as the primary source, while the battery stores excess PV energy and supports the load when solar generation becomes insufficient.
Off-Grid Solar PV–Battery System with PSO MPPT & Generator Backup

This MATLAB/Simulink model combines solar PV generation, PSO-based MPPT, battery charging control, a bidirectional DC–DC converter, a single-phase inverter, and generator/AC backup.
The operating priority is simple:
Solar PV → AC Load → Battery Charging → Battery Backup → Generator/AC Backup
This arrangement allows the AC load to remain supplied under changing solar conditions.
𝐒𝐲𝐬𝐭𝐞𝐦 𝐎𝐯𝐞𝐫𝐯𝐢𝐞𝐰
The simulated system contains the following major sections:
2000 W solar PV array
PSO MPPT and battery charger controller
Bidirectional DC–DC converter
Battery energy storage
Single-phase DC–AC conversion
Voltage and current control
AC load
Generator or AC input
Rectifier and LC filtering stage
Solar PV acts as the main energy source.
When sufficient PV power is available, the PV system supplies the AC load while available excess energy is used to charge the battery.
When PV generation becomes unavailable, the battery supplies the load.
If both PV generation and battery energy are inadequate, the generator or AC input provides backup power.
𝐒𝐨𝐥𝐚𝐫 𝐏𝐕 𝐀𝐫𝐫𝐚𝐲 𝐃𝐞𝐭𝐚𝐢𝐥𝐬
Parameter | Value |
Total PV array rating | 2000 W |
Single PV module rating | 250 W |
Voltage at maximum power point | 30.9 V |
Current at maximum power point | 8.1 A |
Modules connected in series per string | 4 |
Parallel strings | 2 |
The maximum available PV power varies with solar irradiation.
Higher irradiation produces higher available PV power.
Lower irradiation reduces the peak PV power.
The PSO MPPT controller is used to extract the available maximum power from the PV array.
𝐏𝐒𝐎 𝐌𝐏𝐏𝐓 𝐚𝐧𝐝 𝐁𝐚𝐭𝐭𝐞𝐫𝐲 𝐂𝐡𝐚𝐫𝐠𝐞𝐫 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
The model uses a Particle Swarm Optimization (PSO) based MPPT together with battery charging control.
The PSO controller receives:
PV voltage
PV current
Its control output is the duty cycle required for converter switching.
Battery-related quantities are also monitored so that converter operation can be enabled or blocked according to the charging conditions.
This allows the controller to coordinate:
Maximum PV power extraction
Battery charging
Converter switching
Power delivery to the load
𝐁𝐚𝐭𝐭𝐞𝐫𝐲 𝐄𝐧𝐞𝐫𝐠𝐲 𝐒𝐭𝐨𝐫𝐚𝐠𝐞
The battery is connected through a bidirectional DC–DC converter, allowing power to flow according to the operating condition.
Battery Parameter | Value |
Rated voltage stated for the battery | 40 V |
Rated capacity | 200 Ah |
The bidirectional converter provides two important operating conditions:
Charging operation: excess PV power is transferred to the battery.
Discharging operation: stored battery energy is delivered to the AC load when PV generation is unavailable.
𝐖𝐨𝐫𝐤𝐢𝐧𝐠 𝐏𝐫𝐨𝐜𝐞𝐬𝐬
1. 𝐒𝐨𝐥𝐚𝐫 𝐏𝐕 𝐀𝐯𝐚𝐢𝐥𝐚𝐛𝐥𝐞
When sufficient solar irradiation is available:
The PV array generates electrical power.
PSO MPPT extracts the available peak power.
PV power is supplied to the AC load.
Excess PV energy charges the battery.
The generator/AC backup remains unnecessary.
Therefore, the main energy flow is:
PV → Load
and
Excess PV → Battery
2. 𝐏𝐕 𝐏𝐨𝐰𝐞𝐫 𝐑𝐞𝐝𝐮𝐜𝐞𝐬
When irradiation decreases:
PV output power decreases.
Available PV energy continues supporting the load.
Battery contribution changes according to the power shortage.
Stored energy helps maintain continuous AC-load operation.
The power-sharing condition therefore changes automatically with PV availability.
3. 𝐏𝐕 𝐏𝐨𝐰𝐞𝐫 𝐁𝐞𝐜𝐨𝐦𝐞𝐬 𝐙𝐞𝐫𝐨
When solar irradiation is changed to zero:
PV power falls to zero.
Battery operation changes from charging to supplying power.
The battery supports the AC load through the inverter.
Continuous AC-load voltage is maintained.
The energy path becomes:
Battery → DC Link → Single-Phase Inverter → AC Load
4. 𝐋𝐨𝐰 𝐁𝐚𝐭𝐭𝐞𝐫𝐲 𝐰𝐢𝐭𝐡 𝐍𝐨 𝐏𝐕 𝐏𝐨𝐰𝐞𝐫
A further operating condition occurs when:
PV generation is unavailable, and
Battery state of charge becomes too low for normal load support.
Under this condition, a generator or external AC input can be connected.
The AC source is converted into DC through the rectifier stage and filtered before being supplied to the remaining conversion stages.
The backup source can support:
The AC load
Battery charging when required
This provides additional energy security for off-grid operation.
𝐆𝐞𝐧𝐞𝐫𝐚𝐭𝐨𝐫 / 𝐀𝐂 𝐁𝐚𝐜𝐤𝐮𝐩
The model includes a generator set or AC source as backup.
The AC input passes through:
AC Input → Rectifier → LC Filter → DC Stage → Inverter/Load
When the generator is connected:
Rectifier voltage increases.
Rectifier current increases.
Backup-source power becomes available.
The AC load continues receiving power.
Generator contribution changes according to PV availability.
The same AC-input interface may also represent another available AC supply source.
𝐒𝐢𝐧𝐠𝐥𝐞-𝐏𝐡𝐚𝐬𝐞 𝐈𝐧𝐯𝐞𝐫𝐭𝐞𝐫 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
The inverter converts the available DC power into AC power required by the load.
The controller uses both:
Voltage control
Current control
The control process includes:
Measuring the inverter voltage.
Transforming the measured quantity into the control reference frame.
Generating voltage references.
Comparing actual and reference quantities.
Processing the errors through PI controllers.
Generating a reference current.
Comparing inverter current with the reference current.
Processing the current error using another PI controller.
Producing the modulating signal.
Generating PWM signals for inverter switching.
This closed-loop arrangement maintains the required AC output during changes in PV and battery operation.
𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐮𝐥𝐭𝐬
Different operating conditions are tested to demonstrate energy sharing among the PV array, battery, generator, and AC load.
𝐂𝐚𝐬𝐞 1: High Solar Irradiation
The PV irradiation is initially set to 1000.
Observed values are approximately:
Quantity | Simulation Observation |
PV irradiation setting | 1000 |
PV voltage | 100 V |
PV current | 16 A |
PV power | 1700 W |
Battery current | Negative |
Generator contribution | Zero |
The negative battery current indicates that the battery is operating in charging mode.
In this condition:
PV supplies the AC load.
Excess PV power charges the battery.
Generator backup is not used.
AC-load voltage remains sinusoidal.
𝐂𝐚𝐬𝐞 2: Solar Irradiation Reduced to Zero
The PV irradiation is then changed to zero.
Quantity | Observed Behaviour |
PV irradiation | 0 |
PV power | 0 W |
Battery current | Changes from negative to positive |
Battery operating state | Discharging |
Battery power | Approximately 900 W |
AC load | Continues receiving power |
The battery current changes from negative to positive, showing the transition from charging to battery-supplied operation.
The battery therefore maintains the AC load when solar power is unavailable.
𝐂𝐚𝐬𝐞 3: Generator Backup Connected
When PV power is unavailable and additional backup is required, the generator set is connected.
The simulation shows:
Rectifier voltage increases.
Rectifier current increases.
Generator power becomes available.
The AC load remains supplied.
The backup source supports the system during inadequate PV generation.
This demonstrates the backup functionality of the proposed off-grid configuration.
𝐂𝐚𝐬𝐞 4: PV Irradiation Increased with Generator Connected
When solar irradiation is increased again:
PV generation increases.
PV begins supplying a larger share of the required power.
Excess PV power can again support battery charging.
Generator power contribution decreases.
The generator contribution is observed to reduce to approximately 500 W during this operating condition.
This demonstrates automatic power sharing between PV and the backup source.
𝐂𝐚𝐬𝐞 5: PV Power Reduced Again
When PV generation is reduced once more:
PV contribution decreases.
Battery operation changes according to the available energy.
Generator power becomes the main backup source.
AC-load supply is maintained.
This confirms that the system can move between different source combinations according to renewable-energy availability.
𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐧𝐠 𝐌𝐨𝐝𝐞𝐬 𝐒𝐮𝐦𝐦𝐚𝐫𝐲
Operating Condition | PV | Battery | Generator/AC Input | AC Load |
High solar generation | Supplies power | Charges | Not required | Supplied |
Reduced solar generation | Reduced contribution | Supports balancing | As required | Supplied |
Zero PV generation | No contribution | Discharges | Initially not required | Supplied |
Zero PV + insufficient battery | No contribution | Limited | Supplies backup power | Supplied |
PV increases with generator connected | Contribution increases | Can charge | Contribution decreases | Supplied |
𝐏𝐨𝐰𝐞𝐫 𝐌𝐚𝐧𝐚𝐠𝐞𝐦𝐞𝐧𝐭 𝐏𝐫𝐢𝐨𝐫𝐢𝐭𝐲
The system follows a practical power-management sequence:
1. Solar PV is the primary source
PV power is used first whenever solar energy is available.
2. AC load receives the required power
Available PV generation directly supports the load.
3. Excess PV charges the battery
Surplus renewable energy is stored instead of being wasted.
4. Battery supports the load when PV falls
Stored battery energy maintains supply during insufficient or zero solar generation.
5. Generator/AC input acts as backup
The backup source is introduced when renewable generation and battery energy cannot adequately support the system.
𝐊𝐞𝐲 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐬
2000 W solar PV array
PSO-based MPPT
Integrated battery charging controller
Bidirectional DC–DC converter
Battery charging and discharging operation
200 Ah battery capacity
Single-phase DC–AC power conversion
Closed-loop voltage control
Closed-loop current control
PI-controller-based inverter regulation
PWM-controlled inverter operation
Generator or AC-source backup
Automatic power sharing under changing PV conditions
Continuous AC-load supply during solar-power variations
MATLAB/Simulink-based dynamic simulation
𝐖𝐡𝐲 𝐔𝐬𝐞 𝐏𝐒𝐎 𝐌𝐏𝐏𝐓?
PV characteristics change when solar irradiation changes. Therefore, the available peak operating point of the PV array also changes.
The PSO MPPT controller is used to:
Track the available PV peak power.
Generate the converter duty-cycle command.
Improve utilization of available solar energy.
Coordinate PV operation with battery charging.
Respond to changes in solar irradiation.
This makes PSO MPPT an important part of the renewable-energy control strategy implemented in the model.
𝐀𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧𝐬
This type of solar PV–battery configuration can be studied for applications such as:
Off-grid residential power systems
Remote electrical supply
Solar-powered standalone loads
Battery-supported renewable systems
Rural power supply
Generator-assisted solar systems
Renewable-energy backup systems
Hybrid PV–battery energy systems
Research on MPPT and battery control
Power-electronics and inverter-control studies
𝐁𝐞𝐧𝐞𝐟𝐢𝐭𝐬 𝐨𝐟 𝐭𝐡𝐞 𝐒𝐲𝐬𝐭𝐞𝐦
The simulated arrangement provides several useful characteristics:
Solar energy receives the highest operating priority.
Excess PV power can be stored in the battery.
Battery energy maintains the load when sunlight disappears.
Generator backup improves continuity during low-energy conditions.
Bidirectional conversion enables battery charging and discharging.
Closed-loop inverter control maintains AC-load operation.
Source power sharing changes according to PV availability.
𝐂𝐨𝐧𝐜𝐥𝐮𝐬𝐢𝐨𝐧
The Off-Grid Solar PV–Battery System with PSO MPPT & Generator Backup demonstrates coordinated renewable generation, battery storage, power conversion, and backup supply in MATLAB/Simulink.
Under high solar irradiation, the PV array supplies the AC load while excess power charges the battery. When solar generation falls to zero, the battery changes from charging to discharging and continues supplying the load. If additional backup is required, the generator or AC input supplies power through the rectifier and conversion stages.
The simulation also demonstrates changing power sharing when PV generation returns. As PV output increases, dependence on the generator decreases, with the demonstrated generator contribution reducing to approximately 500 W in one operating condition.
Overall, the model provides a clear platform for understanding PSO MPPT, PV energy extraction, battery charging and discharging, bidirectional DC–DC conversion, single-phase inverter control, and generator-assisted off-grid power management.



Comments