Fuzzy MPPT and P&O MPPT Battery Charging Control in MATLAB
Fuzzy MPPT and P&O MPPT Battery Charging Control in MATLAB
𝐈𝐧𝐭𝐫𝐨𝐝𝐮𝐜𝐭𝐢𝐨𝐧
Solar-powered battery charging systems require an effective 𝐌𝐚𝐱𝐢𝐦𝐮𝐦 𝐏𝐨𝐰𝐞𝐫 𝐏𝐨𝐢𝐧𝐭 𝐓𝐫𝐚𝐜𝐤𝐢𝐧𝐠 (𝐌𝐏𝐏𝐓) controller to extract the maximum available power from the photovoltaic array under changing environmental conditions.

This MATLAB/Simulink model compares two commonly used MPPT methods:
𝐅𝐮𝐳𝐳𝐲 𝐋𝐨𝐠𝐢𝐜 𝐌𝐏𝐏𝐓
𝐏𝐞𝐫𝐭𝐮𝐫𝐛 𝐚𝐧𝐝 𝐎𝐛𝐬𝐞𝐫𝐯𝐞 (𝐏&𝐎) 𝐌𝐏𝐏𝐓
Both controllers are tested with the same 𝐏𝐕 array, buck converter and 48 V battery system so that their dynamic response, tracking performance and charging behaviour can be compared directly.
𝐒𝐲𝐬𝐭𝐞𝐦 𝐎𝐯𝐞𝐫𝐯𝐢𝐞𝐰
The complete solar battery charging system consists of:
Solar PV array
PV voltage and current measurement
MPPT controller
PWM pulse generator
DC-DC buck converter
Filter inductor and capacitors
48 V battery
Battery voltage, current and SOC measurement
Battery charging protection logic
The basic power flow is:
Solar PV → MPPT Controller → Buck Converter → Battery
The controller continuously monitors the PV operating condition and adjusts the converter duty cycle to obtain maximum available solar power.
𝐏𝐕 𝐀𝐫𝐫𝐚𝐲 𝐒𝐩𝐞𝐜𝐢𝐟𝐢𝐜𝐚𝐭𝐢𝐨𝐧
Parameter | Value |
Single PV panel power | 250 W |
Number of series-connected panels | 4 |
Number of parallel strings | 2 |
Total PV array rating | 2000 W |
Open-circuit voltage of one panel | 36.6 V |
Voltage at maximum power point | 30.9 V |
Short-circuit current | 8.75 A |
Current at maximum power point | 8.1 A |
Approximate PV array operating voltage | 123.6 V |
Standard cell temperature | 25°C |
Four 250 W panels connected in series provide approximately 1000 W per string.
With two parallel strings, the total installed PV capacity becomes approximately 2000 W.
𝐏𝐕 𝐏𝐨𝐰𝐞𝐫 𝐚𝐭 𝐃𝐢𝐟𝐟𝐞𝐫𝐞𝐧𝐭 𝐈𝐫𝐫𝐚𝐝𝐢𝐚𝐧𝐜𝐞 𝐋𝐞𝐯𝐞𝐥𝐬
The available maximum PV power changes according to solar irradiance.
Solar Irradiance | Approximate Maximum PV Power |
1000 W/m² | Around 2000 W |
800 W/m² | Around 1595 W |
600 W/m² | Around 1187 W |
500 W/m² | Around 983.9 W |
400 W/m² | Around 781.1 W |
200 W/m² | Around 379.7 W |
This variation demonstrates why an MPPT controller is essential. A fixed-duty-cycle converter cannot continuously operate the PV array near its maximum power point when irradiance changes.
𝐁𝐚𝐭𝐭𝐞𝐫𝐲 𝐂𝐡𝐚𝐫𝐠𝐢𝐧𝐠 𝐒𝐲𝐬𝐭𝐞𝐦
The PV array is connected to the battery through a 𝐃𝐂-𝐃𝐂 𝐛𝐮𝐜𝐤 𝐜𝐨𝐧𝐯𝐞𝐫𝐭𝐞𝐫.
The buck converter reduces the higher PV-side voltage to a suitable charging voltage for the battery.
Battery Parameter | Value |
Nominal battery voltage | 48 V |
Battery capacity | 200 Ah |
Initial SOC | 50% |
Fully charged voltage | Approximately 52.26 V |
The charger controller monitors:
Battery SOC
Battery terminal voltage
MPPT duty cycle
Charging current
Charging is permitted only when the battery satisfies the specified charging conditions.
𝐁𝐮𝐜𝐤 𝐂𝐨𝐧𝐯𝐞𝐫𝐭𝐞𝐫
The buck converter contains:
Controlled semiconductor switch
Freewheeling diode
Inductor
Input capacitor
Output capacitor
PWM control input
The input capacitor is approximately 1000 µF in the demonstrated model and helps maintain the PV-side voltage with reduced ripple.
The inductor and output capacitor are selected according to:
PV power rating
Input voltage
Battery voltage
Switching frequency
Allowed current ripple
Allowed voltage ripple
The converter duty cycle is generated by either the Fuzzy MPPT controller or the P&O MPPT controller.
𝐖𝐨𝐫𝐤𝐢𝐧𝐠 𝐏𝐫𝐨𝐜𝐞𝐬𝐬
The overall charging process can be explained in a few simple steps:
The PV array generates DC power according to irradiance and temperature.
PV voltage and PV current are measured.
The MPPT controller analyses the PV operating point.
A suitable duty-cycle command is generated.
The PWM generator converts the duty-cycle command into switching pulses.
The buck converter regulates the power transferred from the PV array.
Battery SOC and voltage are continuously monitored.
Charging continues only while the battery remains below its specified charging limits.
The battery SOC gradually increases as charging continues.
𝐅𝐮𝐳𝐳𝐲 𝐌𝐏𝐏𝐓 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
The Fuzzy MPPT controller uses measured:
PV voltage
PV current
From these quantities, PV power is calculated.
The controller monitors changes in:
PV power
PV voltage
The relationship between the change in PV power and the change in PV voltage is used as an indication of the PV operating point.
This allows the fuzzy controller to determine whether the operating point should be moved toward a higher or lower PV voltage region.
𝐅𝐮𝐳𝐳𝐲 𝐂𝐨𝐧𝐭𝐫𝐨𝐥 𝐑𝐚𝐧𝐠𝐞
Controller Quantity | Range / Setting |
Fuzzy slope input | Approximately −10 to +10 |
Duty-cycle output | Approximately 0 to 0.8 |
Representative duty cycle near the operating region | Around 0.6 |
The fuzzy rule base maps the PV operating condition to the required duty-cycle adjustment.
This approach allows the controller to respond smoothly without continuously applying a fixed perturbation.
𝐖𝐡𝐲 𝐚 𝐒𝐰𝐢𝐭𝐜𝐡 𝐁𝐥𝐨𝐜𝐤 𝐢𝐬 𝐔𝐬𝐞𝐝 𝐢𝐧 𝐭𝐡𝐞 𝐅𝐮𝐳𝐳𝐲 𝐂𝐨𝐧𝐭𝐫𝐨𝐥𝐥𝐞𝐫
Near the maximum power point, the variation in PV voltage can become extremely small.
Direct processing of a near-zero voltage change may create an undefined or numerically unstable input for the fuzzy logic controller.
To avoid this problem:
The change in voltage is checked first.
A very small minimum value is used whenever the voltage variation approaches zero.
This prevents invalid numerical values.
The fuzzy controller can therefore continue operating smoothly near the maximum power point.
The transcript uses a small substitute value of approximately 1 × 10⁻² for this purpose.
𝐅𝐮𝐳𝐳𝐲 𝐌𝐏𝐏𝐓 𝐑𝐮𝐥𝐞 𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧
The fuzzy rule base determines the duty cycle according to the slope of the PV power-voltage characteristic.
Typical behaviour includes:
Near the maximum power point → maintain approximately the present duty cycle.
Operating point away from the MPP → modify the duty cycle.
Large error → larger corrective response.
Small error near MPP → smaller correction.
The main benefit is smoother tracking with reduced steady-state oscillation.
𝐏&𝐎 𝐌𝐏𝐏𝐓 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
The Perturb and Observe controller also uses:
PV voltage
PV current
Calculated PV power
The present PV power and voltage are compared with their previous sampled values.
Based on the direction of change, the controller decides whether to:
Increase the duty cycle
Decrease the duty cycle
Continue in the same operating direction
The duty-cycle command is accumulated continuously during operation.
The resulting signal is then sent to the PWM generator and buck converter.
𝐏&𝐎 𝐂𝐨𝐧𝐭𝐫𝐨𝐥 𝐋𝐨𝐠𝐢𝐜
A simplified interpretation of the P&O decision process is shown below.
PV Power Change | PV Voltage Change | Controller Action |
Increasing | Increasing | Move operating point in the current favourable direction |
Increasing | Decreasing | Adjust duty cycle in the opposite direction |
Decreasing | Increasing | Reverse the previous perturbation |
Decreasing | Decreasing | Reverse the previous perturbation |
Because P&O deliberately perturbs the operating point, some oscillation around the maximum power point can occur.
𝐁𝐚𝐭𝐭𝐞𝐫𝐲 𝐂𝐡𝐚𝐫𝐠𝐞𝐫 𝐂𝐨𝐧𝐭𝐫𝐨𝐥 𝐋𝐨𝐠𝐢𝐜
The MPPT duty cycle is not directly applied to the converter without checking the battery condition.
The charger verifies two important conditions:
Condition | Charging Requirement |
Battery SOC | Less than 100% |
Battery voltage | Less than approximately 52.26 V |
When both conditions are satisfied:
MPPT operation is enabled.
PWM pulses are supplied to the buck converter.
Solar power is transferred to the battery.
When the charging limit is reached, the controller can block or restrict further charging.
This provides basic battery charging protection in addition to MPPT operation.
𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐂𝐚𝐬𝐞 𝟏 – 𝐂𝐨𝐧𝐬𝐭𝐚𝐧𝐭 𝐈𝐫𝐫𝐚𝐝𝐢𝐚𝐧𝐜𝐞
The first comparison is performed under constant atmospheric conditions.
Simulation Parameter | Value |
Solar irradiance | 1000 W/m² |
Cell temperature | 25°C |
Initial battery SOC | 50% |
The following quantities are observed:
PV voltage
PV current
PV power
Battery voltage
Battery current
Battery SOC
Both controllers successfully charge the battery and track the available PV power.
However, their transient behaviour is different.
𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐮𝐥𝐭𝐬 – 𝐂𝐨𝐧𝐬𝐭𝐚𝐧𝐭 𝐈𝐫𝐫𝐚𝐝𝐢𝐚𝐧𝐜𝐞
The simulation demonstrates noticeable differences between Fuzzy MPPT and P&O MPPT.
Performance Aspect | Fuzzy MPPT | P&O MPPT |
Initial PV voltage oscillation | Lower | Higher |
PV current oscillation | Lower | Noticeable |
PV power oscillation | Lower | Noticeable |
Maximum-power-point tracking | Faster in the shown response | Slower in the shown response |
Battery charging current | Smoother | More oscillatory |
Steady-state response | Smooth | Contains tracking ripple |
In the demonstrated waveform:
Fuzzy MPPT approaches the maximum-power operating region at approximately 0.1 s.
P&O requires a noticeably longer period in the shown simulation.
P&O exhibits repeated oscillation in PV voltage, current and power.
Fuzzy MPPT gives a comparatively smoother charging-current response.
𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐂𝐚𝐬𝐞 𝟐 – 𝐂𝐡𝐚𝐧𝐠𝐢𝐧𝐠 𝐈𝐫𝐫𝐚𝐝𝐢𝐚𝐧𝐜𝐞
A second test is performed to evaluate dynamic tracking.
The irradiance is changed during simulation as follows:
Time | Solar Irradiance |
Before 1 s | 1000 W/m² |
After 1 s | 500 W/m² |
At 500 W/m², the expected PV maximum power is approximately:
983.9 W
This test evaluates how quickly and smoothly each controller adapts to a sudden reduction in solar input.
𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐑𝐞𝐬𝐩𝐨𝐧𝐬𝐞 𝐂𝐨𝐦𝐩𝐚𝐫𝐢𝐬𝐨𝐧
𝐅𝐮𝐳𝐳𝐲 𝐌𝐏𝐏𝐓
During the irradiance change:
PV power smoothly moves toward the new maximum-power region.
PV voltage remains comparatively stable.
PV current follows the new operating level with reduced disturbance.
Battery charging current shows very little transient oscillation.
The controller quickly establishes the new operating point.
𝐏&𝐎 𝐌𝐏𝐏𝐓
When the same irradiance change is applied:
PV voltage exhibits transient oscillations.
PV current shows additional ripple.
PV power contains a noticeable transient.
Battery charging current also experiences oscillation.
More time is required to settle around the new operating point.
𝐅𝐮𝐳𝐳𝐲 𝐌𝐏𝐏𝐓 𝐯𝐬 𝐏&𝐎 𝐌𝐏𝐏𝐓
Criterion | Fuzzy MPPT | P&O MPPT |
Controller type | Intelligent rule-based | Conventional iterative |
MPPT input information | PV voltage and current | PV voltage and current |
Duty-cycle generation | Fuzzy rule base | Perturb-and-observe decision |
Tracking oscillation | Low | Higher |
Steady-state PV ripple | Lower | More noticeable |
Irradiance-change response | Smooth | More transient oscillation |
Battery-current response | Smooth | More ripple |
Control implementation | More elaborate | Simple |
Rule design required | Yes | No |
Computational simplicity | Moderate | High |
Suitable for basic implementation | Yes | Very suitable |
Suitable for reduced-oscillation tracking | Strong advantage | Limited by perturbation process |
𝐊𝐞𝐲 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐬
𝐅𝐮𝐳𝐳𝐲 𝐋𝐨𝐠𝐢𝐜 and 𝐏&𝐎 MPPT comparison in a common MATLAB/Simulink platform
2000 W solar PV array
48 V, 200 Ah battery
DC-DC buck converter
PV voltage, current and power monitoring
Battery voltage, current and SOC monitoring
Battery SOC-based charging control
Full-charge voltage protection
PWM-based converter switching
Constant-irradiance testing
Step irradiance variation
Dynamic MPPT comparison
Battery charging-performance comparison
Suitable for understanding both conventional and intelligent MPPT methods
𝐖𝐡𝐲 𝐅𝐮𝐳𝐳𝐲 𝐌𝐏𝐏𝐓 𝐒𝐡𝐨𝐰𝐬 𝐚 𝐒𝐦𝐨𝐨𝐭𝐡𝐞𝐫 𝐑𝐞𝐬𝐩𝐨𝐧𝐬𝐞
The fuzzy controller does not rely only on a repetitive fixed perturbation.
Instead, its control response depends on the current PV operating condition.
As a result:
Large deviations can receive stronger corrective action.
Small deviations near the maximum power point can receive smaller corrections.
Continuous unnecessary movement around the MPP can be reduced.
Battery current becomes smoother.
PV power ripple can be reduced.
This behaviour is especially useful when solar irradiance changes suddenly.
𝐀𝐝𝐯𝐚𝐧𝐭𝐚𝐠𝐞𝐬 𝐨𝐟 𝐏&𝐎 𝐌𝐏𝐏𝐓
Although the presented comparison shows stronger dynamic performance for the fuzzy controller, P&O remains highly useful because of its simplicity.
Its advantages include:
Simple operating principle
Easy MATLAB/Simulink implementation
Low computational burden
No fuzzy membership-function design
No fuzzy rule-base tuning
Suitable for learning basic MPPT concepts
Widely used as a benchmark for advanced MPPT methods
𝐀𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧𝐬
This type of solar charging control can be studied for:
Solar battery charging systems
Standalone photovoltaic systems
Renewable-energy storage systems
Solar-powered DC loads
Solar electric mobility charging architectures
DC microgrids
Telecom backup systems
Remote renewable-energy installations
Intelligent power electronic converter control
MPPT algorithm performance analysis
Battery energy-storage research
𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠 𝐎𝐮𝐭𝐜𝐨𝐦𝐞𝐬
By studying this MATLAB/Simulink model, students, researchers and engineers can understand:
How a solar PV array is configured for a required power level
How irradiance affects PV output power
Why MPPT is necessary
How Fuzzy MPPT operates
How P&O MPPT operates
How a buck converter interfaces PV with a low-voltage battery
How PWM duty cycle controls charging power
How battery SOC and voltage can be included in charger protection
How controller performance can be evaluated using transient waveforms
Why steady-state oscillation matters in practical MPPT systems
How changing irradiance influences PV and battery variables
𝐂𝐨𝐧𝐜𝐥𝐮𝐬𝐢𝐨𝐧
The Fuzzy MPPT and P&O MPPT Battery Charging Control in MATLAB model provides a clear comparison between intelligent and conventional solar maximum-power-point tracking methods.
Using identical PV, converter and battery ratings makes the comparison meaningful.
The demonstrated results show that:
Both controllers are capable of extracting solar power and charging the battery.
P&O MPPT provides a simple and practical control structure.
P&O exhibits noticeable oscillation around the operating point.
Fuzzy MPPT provides a smoother PV response.
Fuzzy MPPT reduces battery-current oscillation.
Fuzzy MPPT responds more smoothly during irradiance variations in the demonstrated simulation.
Battery SOC and full-charge voltage monitoring improve the overall charger control structure.
Overall, the model provides a useful MATLAB/Simulink platform for understanding solar PV MPPT, DC-DC buck conversion, intelligent control and battery charging behaviour.



Comments