Archimedes Optimization for Solar MPPT
STM32 firmware implementing physics-inspired global optimization for maximum power point tracking under partial shading. Hardware validated and published in IJECE 2025.
github.com/sigitdanip/aoampptThe Problem
Solar panels in real-world conditions rarely receive uniform sunlight. Buildings, trees, clouds, and dust create partial shading that splits the power-voltage curve into multiple peaks — local maxima that trap conventional algorithms.
Perturb and Observe (P&O) and Incremental Conductance (INC), the industry-standard MPPT methods, were designed for single-peak curves. When shading creates multiple maxima, they converge on whichever peak they encounter first — often a local one, leaving significant power on the table.
Metaheuristic algorithms like Particle Swarm Optimization can find the global maximum, but their computational cost typically keeps them in simulation papers. There was no practical, hardware-validated implementation of the Archimedes Optimization Algorithm for real-time MPPT on a resource-constrained microcontroller until this work.
The System
The STM32F4 microcontroller runs a bare-metal control loop: ADC reads voltage and current through a resistive divider (Z1 = 100 ohm, Z2 = 1445 ohm), DMA transfers 150 samples per measurement cycle for noise averaging, then the AOA algorithm computes the optimal duty cycle for the buck converter PWM output.
The Archimedes Optimization Algorithm models candidate solutions as objects immersed in fluid. Each object has density, volume, and acceleration — higher-density objects sink toward better solutions while buoyant ones explore the search space. This physics-inspired balance of exploration and exploitation helps the algorithm escape local maxima on multi-peak P-V curves.
The system communicates real-time measurements over UART at 9600 baud, streaming voltage, current, and computed power to a serial monitor. No RTOS, no external dependencies — pure HAL-based bare-metal C on STM32CubeMX-generated hardware abstraction.
Results
Under uniform irradiance, the AOA-based MPPT achieved 99.2% tracking efficiency — competitive with P&O's 99.5% but without the steady-state oscillation that P&O introduces. Where AOA truly separates itself is under partial shading: 96.8% tracking efficiency compared to 94.5% for P&O, which frequently converged to local maxima.
The 150-sample ADC averaging proved effective at noise rejection without introducing meaningful latency. Convergence to the global maximum under dynamic shading was 30-40% faster than Particle Swarm Optimization on the same hardware, thanks to AOA's lower per-iteration computational cost.
Implementation
The firmware runs on STM32CubeMX-generated HAL with ADC, DMA, UART, and GPIO peripherals. The 150-sample averaging loop runs inside the ADC DMA completion callback, trading a small latency increase for significant noise reduction on the current sensor input.
Future work includes porting the optimization to a timer-based interrupt for deterministic update cycles, adding I2C display output for standalone operation, and testing on larger arrays with distributed MPPT architecture.