A photovoltaic maximum power point tracking and lithium battery intelligent charging management system based on an optimized whale algorithm
Patent Information
- Application Number
- CN202611116592.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-10-09
AI Technical Summary
[0007]本发明的目的在于克服现有光伏最大功率点追踪技术及光伏锂电池充电系统在实际应用中存在的诸多不足
[0042]1.追踪速度快且无较大稳态振荡:传统扰动观察法在最大功率点附近存在持续功率振荡,且光照突变时需逐步爬升寻优,响应迟缓。本发明在包围捕食策略中引入方向系数实现双向搜索,避免单侧收敛偏向;同时设置提前收敛判断机制,当功率增量连续小于预设阈值时强制终止迭代,减少无效计算,在稳态锁定后不再引入额外扰动。传统算法在光照突变时需重新启动寻优过程,期间存在较长的功率跌落期。本发明设置突变重启机制,在稳态运行中实时监测输出功率,当功率相对偏差超过预设阈值时自动触发重启,清空历史数据并重新执行寻优。根据表1、表2所示,从无光到强光本发明相比传统扰动观察法算法寻优时间缩短约49.5%,寻优功率提升约1.77%,强光到弱光情况下寻优功率提升约0.6%,两种情况下稳态功率波动减小35%-41%。
Smart Images

Figure CN122890622A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of photovoltaic power generation and maximum power point tracking control technology, specifically relating to a photovoltaic maximum power point tracking and lithium battery intelligent charging management system based on an optimized whale algorithm. Background Technology
[0002] Under non-uniform illumination conditions such as partial shading, aging, or temperature variations, photovoltaic cells exhibit multi-peak power-voltage characteristic curves. Traditional maximum power point tracking methods, such as the perturbation-observation method and the incremental conductance method, are prone to getting trapped in local optima, leading to a decrease in system efficiency. Therefore, in photovoltaic power generation systems, quickly and accurately tracking the global maximum power point is particularly important.
[0003] Traditional maximum power point tracking (MPPT) methods rely on fixed-step perturbations or conductance comparisons, which not only have slow convergence speeds but are also prone to failure under multi-peak conditions. With advancements in swarm intelligence optimization technology, utilizing intelligent methods for rapid MPPT of photovoltaic arrays has become a key approach to improving the power generation efficiency of photovoltaic systems.
[0004] Currently, swarm intelligence methods such as the whale optimization algorithm have achieved good results in some maximum power point tracking tasks. However, due to the complex working environment of photovoltaic systems, factors such as light intensity and temperature change in real time, and photovoltaic modules are subject to aging and local shading, the maximum power point tracking algorithm is required to have stronger robustness and generalization ability under different operating conditions, while also possessing fast response and steady-state oscillation-free characteristics.
[0005] Existing photovoltaic charging control systems have significant shortcomings at the hardware level. When sunlight intensity is low, the output current of photovoltaic cells falls below the minimum charging current threshold of lithium batteries, and traditional systems directly cut off the charging circuit, resulting in complete waste of low-light energy. When multiple lithium batteries are used in series, there is a lack of effective equalization charging management, and overcharging or undercharging of individual cells is common, affecting the overall lifespan of the battery pack. At the same time, the system lacks a hardware-level rapid switching mechanism during sudden changes in sunlight, leading to power drops and charging interruptions. Therefore, designing a photovoltaic charging control system that integrates maximum power point tracking, multi-channel equalization charging, and low-light energy harvesting has significant engineering application value.
[0006] In addition, most existing photovoltaic charging controllers are based on a single MPPT algorithm (such as the perturbation-observation method), which users cannot replace with a better algorithm according to actual lighting conditions and load characteristics; they lack data output interfaces, making it impossible to monitor and record the system's operating status in real time; the main control chip has low I / O resource utilization and does not support users to connect additional functional modules, resulting in closed system functions and poor scalability. Summary of the Invention
[0007] The purpose of this invention is to overcome the numerous shortcomings of existing photovoltaic maximum power point tracking (MPPT) technologies and photovoltaic lithium battery charging systems in practical applications. Addressing the deficiencies of traditional methods under non-uniform illumination conditions, such as susceptibility to local optima, slow convergence speed under multi-peak power characteristic curves, power oscillations during steady-state operation, slow system response during sudden changes in illumination, low energy utilization under weak light conditions, and uneven charging of multiple lithium batteries, this invention provides a photovoltaic MPPT and intelligent lithium battery charging management system based on an optimized whale algorithm. This solves the technical problems of traditional solar cell MPPTs, such as slow convergence speed, poor stability, and charging failure due to output current falling below the minimum charging current threshold of lithium batteries under weak light conditions.
[0008] To achieve the above objectives, the present invention provides the following technical solution:
[0009] A photovoltaic maximum power point tracking method based on an optimized whale algorithm includes the following steps:
[0010] 1) Set the lower limit of the duty cycle for the pulse width modulation wave. and duty cycle limit whale population Maximum number of iterations Maximum convergence factor and minimum value Fixed spiral step size Early convergence power difference threshold Threshold for the number of consecutive convergences and the relative deviation threshold of mutation restart Power lower limit ; in the duty cycle interval [ , Initialize uniformly at equal intervals. The duty cycle for each individual whale is calculated using the following formula:
[0011]
[0012] Set global optimal power =0, current iteration count t=0, early stop counter count=0, previous optimal power =0, globally optimal duty cycle Initialize to the midpoint of the interval;
[0013] 2) Adaptive convergence factor update
[0014] The convergence factor is dynamically updated based on the current iteration count, so that it decreases linearly from its maximum value to its minimum value as the iteration count increases. The specific formula is as follows:
[0015]
[0016] 3) Individual power acquisition and assessment
[0017] Output the duty cycle D for each individual whale sequentially; after the circuit stabilizes, collect the voltage V and current I of the photovoltaic array, and calculate the instantaneous power using the following formula:
[0018]
[0019] Compare the current power with the individual's historical best power Compare the values; if the value is larger, update the individual's optimal duty cycle. Simultaneously with globally optimal power If the value is larger, then update the globally optimal duty cycle. ;
[0020] 4) Hybrid location update strategy
[0021] For each individual whale, generate two independent random numbers p∈[0,1] and r∈[0,1], and update the duty cycle according to the following rules:
[0022] Encirclement predation strategy and Using the current globally optimal duty cycle as a reference, a direction coefficient (2r-1) is introduced to achieve bidirectional search. The update formula is as follows:
[0023]
[0024] Random search strategy and : Duty cycle of randomly selected whale individuals For reference, a random search is performed; the specific formula is as follows:
[0025]
[0026] Spiral bubble web predation strategy ( ): Using a fixed step size To update the position, addition or subtraction is randomly selected with equal probability. The specific formula is as follows:
[0027]
[0028] The updated duty cycle will be limited to [ ]. , Within the range;
[0029] 5) Early convergence judgment and termination
[0030] After each iteration, calculate the power increment. ,like If the counter reaches a certain value, the counter increments by 1; otherwise, the counter is reset to zero. When this happens, the iteration is forcibly terminated;
[0031] 6) Steady-state locking and sudden restart
[0032] After the iteration terminates, the system locks and continuously outputs the optimal duty cycle. Real-time power is collected at a fixed sampling period. When both conditions are met When this occurs, a mutation restart is triggered, historical data is cleared, and steps 1) through 5 are re-executed.
[0033] The lithium battery intelligent charging management system includes:
[0034] Photovoltaic array connection and sampling module: Used to connect the photovoltaic array and collect the output voltage and current of the photovoltaic array in real time after the system is powered on; This module contains three independent voltage and current detection units, corresponding to the photovoltaic input terminal, lithium battery charging terminal and energy storage capacitor terminal respectively; Each detection unit adopts the INA226 high-precision power monitoring chip and communicates with the main control module through the I2C communication protocol to achieve milliampere-level current measurement and accurate voltage acquisition;
[0035] Maximum Power Point Tracking (MPPT) Execution Module: This module starts first after system power-on and executes the improved whale optimization algorithm. It iteratively optimizes within a preset duty cycle range and outputs the pulse width modulation (PWM) wave corresponding to the globally optimal duty cycle. The core of this module is an STM32F103C8T6 microcontroller, which has an internally embedded MPPT control program for the improved whale optimization algorithm. The main control chip is powered independently by a TPS54202 step-down chip, which converts the photovoltaic cell power to a stable 5V voltage, ensuring the independence of the MCU power supply. It also supports user-defined replacement of other MPPT algorithms to meet tracking requirements under different operating conditions. All unused general-purpose input / output interfaces of the microcontroller are brought out via header pins, allowing users to connect external functional modules as needed, such as Bluetooth wireless transmission modules, TF card data recording modules, audible and visual alarm modules, or temperature and humidity sensors, to achieve flexible expansion of system functions.
[0036] Buck converter and drive module: Connected between the output of the photovoltaic array and the charging management circuit, it is used to step down the power energy corresponding to the maximum power point to a voltage level suitable for lithium battery charging; the PWM drive of the Buck converter uses the EG3014S chip. This module integrates a bootstrap capacitor and a floating ground drive circuit, which can enhance the PWM wave output capability to drive the power switching transistors of the Buck converter and meet the high-voltage side drive requirements of the Buck circuit.
[0037] Multi-channel charging management module: used to charge each lithium battery cell in turn according to voltage priority strategy; this module uses TP4056H charging chip for charging management and AP22804AW switching chip to control the on and off of the charging circuit to realize the switching and protection of multiple batteries;
[0038] Low-light energy harvesting module: Includes an energy storage capacitor and its voltage detection circuit. During charging, it monitors the photovoltaic output current in real time. When the detected current is lower than the minimum charging current threshold of the lithium battery, it automatically disconnects the discharge switch connected to the lithium battery (implemented using an AP22804AW chip), stores the micro-current energy in the capacitor, and turns on the discharge switch after the voltage across the capacitor rises to a preset release threshold, discharging the lithium battery with a pulse current higher than the minimum charging current threshold. The capacitor voltage of this module is detected in real time by a second INA226 chip.
[0039] Communication and Display Module: This module transmits system operating data to the host computer via the USART serial port protocol and displays voltage, current, power, and duty cycle information in real time on an OLED screen. The OLED screen is a 0.96-inch display connected to the main control module via an I2C bus. Serial communication uses the USART protocol and connects to the PC via a USB-to-TTL interface for data printing, storage, and analysis. Users can customize the layout and data types displayed on the screen (e.g., in addition to the default voltage, current, and power, charging time can be added). The USART serial communication unit supports user-defined frame formats, transmission frequencies, and data items to be uploaded, facilitating personalized data processing and visualization by the host computer.
[0040] Light intensity detection module: It adopts BH1750 chip and is connected to the main control module through I2C bus. It is used to collect ambient light intensity data in real time to assist in the judgment of light change. The main control module determines whether a light change has occurred based on the difference between two consecutive light intensities. If the difference exceeds the preset threshold, the change restart mechanism is triggered.
[0041] Compared with the prior art, the beneficial effects of the present invention are:
[0042] 1. Fast tracking speed and no large steady-state oscillations: Traditional perturbation-observation methods suffer from continuous power oscillations near the maximum power point, and require gradual climbing for optimization during sudden changes in illumination, resulting in slow response. This invention introduces a directional coefficient into the encirclement-prey strategy to achieve bidirectional search, avoiding unilateral convergence bias; it also sets an early convergence judgment mechanism, forcibly terminating the iteration when the power increment is continuously less than a preset threshold, reducing invalid calculations, and no further perturbations are introduced after steady-state locking. Traditional algorithms need to restart the optimization process during sudden changes in illumination, resulting in a long power drop period. This invention sets a sudden restart mechanism, monitoring the output power in real time during steady-state operation, and automatically triggering a restart when the relative power deviation exceeds a preset threshold, clearing historical data and re-executing the optimization. According to Tables 1 and 2, from no light to strong light, the optimization time of this invention is shortened by about 49.5% and the optimization power is increased by about 1.77% compared to the traditional perturbation-observation method; in the case of strong light to weak light, the optimization power is increased by about 0.6%, and the steady-state power fluctuation is reduced by 35%-41% in both cases.
[0043] 2. High utilization rate of low-light energy: Existing photovoltaic charging systems often directly cut off the charging circuit under low-light conditions (output current below the minimum charging current threshold of the lithium battery), resulting in complete energy waste. This invention sets up a low-light energy harvesting module, which stores micro-current energy through an energy storage capacitor. After the capacitor voltage rises to a preset release threshold, it discharges to the lithium battery with a pulse current, so that the low-light energy that would otherwise be unusable can be effectively harvested.
[0044] 3. Balanced charging of multiple batteries to extend battery pack life: Traditional series-connected lithium battery charging lacks balanced management, which can easily lead to overcharging or undercharging of individual cells, shortening the overall lifespan of the battery pack. This invention uses a multi-channel charging management module to charge each lithium battery in turn according to the priority order of voltage from low to high. After each cell is fully charged, the charging process automatically switches, effectively achieving battery pack balance.
[0045] 4. Reliable and Independent Hardware Design: This invention uses a TPS54202 step-down chip to independently power the microcontroller, avoiding the impact of power loop fluctuations on the control circuit; it uses an EG3014S integrated bootstrap driver chip to simplify the high-voltage side drive design of the Buck converter; and it uses three INA226 channels to monitor the photovoltaic input, lithium battery charging, and energy storage capacitor voltage respectively, achieving milliampere-level current measurement accuracy. The overall system exhibits high stability and measurement accuracy in portable photovoltaic charging devices.
[0046] 5. Supports custom MPPT algorithms and the addition of other peripherals, offering strong scalability: Traditional lithium battery charging systems typically use a single fixed MPPT algorithm (such as the perturbation-observation method), which cannot adapt to different operating conditions or user needs. The maximum power point tracking (MPPT) execution module of this invention not only incorporates an improved whale optimization algorithm but also supports user-defined MPPT algorithms (such as particle swarm optimization, incremental conductance method, etc.). Unused I / O ports also support user-defined connections to other peripherals, facilitating the expansion of Bluetooth modules, SD card storage modules, buzzer alarm modules, etc., enabling wireless data transmission, historical data storage, or anomaly reporting. Simultaneously, users can customize and modify the display data of the communication and display modules, significantly improving the system's applicability and scalability.
[0047] 6. Host Computer Communication and Data Visualization: Most existing portable charging devices lack data output interfaces, preventing users from monitoring system operation status in real time. This invention integrates a USART serial communication module, enabling real-time transmission of operating data such as voltage, current, power, and duty cycle to a host computer, supporting data printing, storage, and analysis. Simultaneously, a OLED screen displays key parameters on-site, allowing users to directly access the status without connecting to a computer. This design provides strong support for intelligent debugging, performance evaluation, and remote monitoring of photovoltaic charging equipment. Attached Figure Description
[0048] Figure 1 This is the flowchart of the main program of this algorithm.
[0049] Figure 2 This is the execution flowchart for this system.
[0050] Figure 3 This is one of the schematic diagrams of this system.
[0051] Figure 4 This is the second schematic diagram of the system.
[0052] Figure 5 This is the third schematic diagram of this system.
[0053] Figure 6 This is the fourth schematic diagram of the system.
[0054] Figure 7 This includes the physical components and working diagrams of the system.
[0055] Figure 8 This is the front PCB layout diagram of this system.
[0056] Figure 9 This is the PCB layout diagram on the reverse side of this system.
[0057] Figure 10 The image shows the measured charging results of the lithium battery during outdoor operation of this system.
[0058] Figure 11 This diagram shows the charging current of a lithium battery under low-light conditions.
[0059] Figure 12 This diagram shows the charging current of the energy storage capacitor under low light conditions.
[0060] Figure 13 This diagram shows the discharge current after the energy storage capacitor reaches its discharge threshold.
[0061] Figure 14 The image shows the results of the perturbation observation algorithm, which simulates a sudden change from no light to bright light and then to weak light.
[0062] Figure 15 The image shows the results of the optimized whale algorithm, which transforms light from no light to strong light and then to weak light.
[0063] Figure 16 This is a diagram showing the usage of I / O ports.
[0064] Figure 17 The diagram shows a comparison of different photovoltaic maximum power point tracking systems, where (a) is the system of this invention, (b) is another system 1, and (c) is another system 2. Detailed Implementation
[0065] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby providing a clearer and more explicit definition of the scope of protection of the present invention.
[0066] This embodiment provides a photovoltaic maximum power point tracking control system based on an improved whale optimization algorithm. Its hardware system includes a main control module, a voltage and current detection module, a Buck converter and drive module, a multi-channel charging management module, a low-light energy harvesting module, a light intensity detection module, a communication and display module, and an independent power supply module for the main control module. The overall operating logic of this embodiment relies on... Figure 2 The execution flowchart of this system is implemented, and the algorithm iteration logic follows... Figure 1 This is the main program flowchart for this algorithm; the hardware circuit topology is referenced below. Figure 3-6 This is the schematic diagram of the system.
[0067] 1. System initialization:
[0068] 1) The main control module uses an STM32F103C8T6 microcontroller (72MHz), which has an internally embedded MPPT control program with an improved whale optimization algorithm. The main control chip is powered independently by a TPS54202 step-down chip: the TPS54202 supports a wide input voltage range of 4.5V to 28V and can stably output 5V voltage, which is then converted to 5V by a low dropout linear regulator to supply the STM32 and other peripherals, ensuring the independence of the MCU's power supply and avoiding the impact of power loop fluctuations on the control circuit.
[0069] 2) The voltage and current detection module includes three independent voltage and current detection units, used to collect the voltage and current at the photovoltaic array input, the lithium battery charging terminal, and the voltage of the energy storage capacitor module, respectively. Each detection unit uses the INA226 high-precision power monitoring chip, which supports millivolt-level voltage and milliampere-level current detection and connects to the main control module via the I2C bus. Specifically, the SDA / SCL of the first INA226 (photovoltaic input) is connected to the PA2 / PA1 pins of the STM32; the SDA / SCL of the second INA226 (lithium battery charging terminal) is connected to the PA7 / PA6 pins; and the SDA / SCL of the third INA226 (energy storage capacitor terminal) is connected to PA8 / PA11. All INA226s are configured in continuous conversion mode with a sampling period of 1.1ms, enabling rapid real-time detection of current and voltage changes in each module. Using a 10mΩ shunt resistor, milliampere-level current measurement and accurate millivolt-level voltage acquisition are achieved.
[0070] 3) The Buck converter is connected between the photovoltaic array output and the charging management circuit to step down the voltage corresponding to the maximum power point to a voltage level suitable for lithium battery charging (the full charge threshold for a single lithium battery is set to 4.2V). The PWM driver uses the EG3014S enhanced driver chip, which has a high-side operating voltage of up to 80V, a Vcc power supply voltage range of 4.5V to 30V, and an output current capability of up to 1A. The Buck circuit integrates a bootstrap capacitor and a floating ground drive circuit, which can enhance the PWM wave output capability to drive the power switching transistor (NMOSFET) of the Buck converter. The PWM output pin (PA0) of the STM32 is connected to the input pin of the EG3014S, and the output of the EG3014S directly drives the power switching transistor, ensuring stable operation of the drive.
[0071] 4) The multi-channel charging management module is used to charge each lithium battery cell in turn according to a voltage priority strategy. This module uses a TP4056H charging chip for constant current and constant voltage charging management, with a maximum charging current of 1A. The on / off control of the charging circuit uses an AP22804AW load switch chip, with an input voltage range of 2.7~5.5V, a maximum current of 2.5A, and a turn-on voltage as low as 1.5V. It can be directly controlled by the STM32 I / O, with an on-resistance of only 50mΩ and negligible power loss. The STM32's PB15 pin controls the lithium battery charging switch, the PB12 pin controls the load resistor switch, the PB13 pin controls the reverse current protection switch, the PB14 pin controls the capacitor discharge switch, and the PB5, PB6, and PB7 I / O ports control battery charging channels 1-3 respectively.
[0072] 5) The low-light energy harvesting module includes energy storage capacitors (multiple 5F / 5.5V supercapacitors) and their voltage detection circuit (operated by the third INA226). When the charging current is lower than the minimum charging current threshold of the lithium battery (set to 15mA), the weak electrical energy output from the photovoltaic system is stored in the energy storage capacitors. The capacitor voltage is monitored in real time by the INA226. When the voltage rises to the preset release threshold (set to 4.5V), the main control module controls the energy storage module to turn on the discharge switch, and the energy storage capacitor discharges to the lithium battery with a larger current. See the waveform of the current change during the capacitor discharge phase for details. Figure 13 This diagram shows the discharge current of the energy storage capacitor after it reaches the discharge threshold. During the discharge process, the capacitor voltage decreases, and after it drops to near the battery voltage, it enters the next energy storage cycle.
[0073] 6) The light intensity detection module uses a BH1750 digital light intensity sensor with a range of 1–65535 lux and a maximum resolution of 0.5 lux. The BH1750 is connected to the STM32 microcontroller via an I2C bus (SCL connects to PA3, SDA connects to PA4), and uses continuous high-resolution sampling mode. The main control module reads the real-time light intensity to help determine sudden changes in light intensity.
[0074] 7) The communication and display module includes an OLED screen and a USART serial port. The OLED uses a 0.96-inch 128×64 resolution display, connected via an I2C bus (SCL connects to PB8, SDA connects to PB9), displaying information such as the current battery charging voltage, charging current, light intensity, and charging channel. Serial communication uses USART1 and a USB-to-TTL module to connect to the host computer (RX of the USB-to-TTL module connects to PA9, TX connects to PA10), with the baud rate set to 115200, periodically sending information such as the solar cell input voltage and current, and the lithium battery charging voltage and current.
[0075] 8) Customization features allow users to modify the MPPT algorithm, the detection frequency and accuracy of the current and voltage detection module, the accuracy and operating mode of the light detection module, and the data content of the communication and display modules. Additionally, unused I / O ports of the STM32F103C8T6 support user-defined connections to other peripherals to meet specific user needs. The system is equipped with a download port, allowing the use of downloaders such as ST-LINK to download user-defined programs to achieve special user requirements. For details on chip I / O port allocation and unused pin layout, please refer to [link to relevant documentation]. Figure 16 .
[0076] The physical appearance of the machine and its actual working condition are shown in the figure. Figure 7 , Figure 7The left image shows the bare PCB of the system, which integrates an STM32 main controller, a multi-channel sampling chip, a Buck driver circuit, a TP4056 charging circuit, a supercapacitor energy storage unit, and an OLED display module. The board has reserved external terminals for photovoltaic, lithium battery, and capacitor connections, demonstrating high hardware integration. The middle image shows the outdoor wiring diagram for a single photovoltaic cell external system, enabling charging tests under single photovoltaic power supply. The right image shows the outdoor wiring diagram for multiple photovoltaic cells connected in series to form a photovoltaic array connected to the system, which can simulate multi-peak illumination conditions. Figure 7 This demonstrates the physical structure of the system's hardware and verifies its compatibility with both single photovoltaic and multi-photovoltaic array input methods. It also shows that the system can stably perform photovoltaic MPPT tracking and lithium battery charging in natural outdoor environments.
[0077] For details on the circuit board wiring structure, please refer to Figure 8 and 9 The PCB layout of this system, in which, Figure 8 The front PCB, i.e. the top layer for component mounting, is shown with red lines to display the top layer traces and pad structure. The board surface is clearly marked with the positive and negative terminals of the solar cells, the positive and negative terminals of the energy storage capacitors, the three lithium battery terminals, and the OLED external interface, etc. The hardware is arranged according to functional areas. The photovoltaic input and Buck power conversion circuits are located on the upper part of the board. The BH1750 light sensor is placed nearby in the photovoltaic input area. The middle of the board contains the pads of the STM32F103C8T6 main control chip, I2C communication pins, and reserved pins for program download. The lower right area is concentrated with the switching devices, charging chips, and matching resistors and capacitors corresponding to the multi-channel lithium battery charging. The lower left area is arranged with the energy storage capacitor voltage sampling circuit. The edge of the board has reserved multiple rows of general-purpose IO expansion pins, and the pins are arranged in a neat manner according to the STM32 pin number. Figure 9 The reverse side of the PCB shows all the traces on the bottom layer in blue. The bottom layer has a large area of GND grounding copper plating, which can reduce ground impedance and shield electromagnetic interference. The top layer power traces are isolated from the bottom layer ground traces, which effectively reduces the interference of high-frequency noise from the Buck switching power supply on weak signal lines such as INA226 voltage and current sampling and I2C communication. The bottom layer routes each sampling signal line and control signal line independently to avoid signal crosstalk caused by high current power lines. The entire PCB follows the strong and weak current zone routing concept, taking into account the stability of power circuit operation and the accuracy of analog and digital signal acquisition. The external labels are intuitive and clear, which facilitates the wiring and assembly of peripherals such as photovoltaic modules, lithium battery packs, energy storage supercapacitors, and OLED displays.
[0078] 2. Maximum Power Point Tracking:
[0079] 1) In this embodiment, the automatic reload value of the timer for the pulse width modulation wave is set to 719, the lower limit value of the comparison register is set to 70, and the upper limit value is set to 180, accordingly generate the corresponding , , the number of whale populations is 4, the maximum number of iterations is 4, the maximum convergence factor is 1.6, and the minimum value is 0.2, the fixed spiral step size is 1.8, the提前收敛功率差阈值 is 1 mW, the提前收敛连续次数阈值 is 2, and the mutation restart relative deviation threshold is 10%, the lower power limit is 150 mW. Within the duty cycle interval , , the duty cycles of whale individuals are uniformly initialized at equal intervals, and the specific formula is as follows:
[0080]
[0081] Set the global optimal power = 0, the current number of iterations t = 0, the early stop counter count = 0, the previous round of optimal power = 0, and the global optimal duty cycle is initialized to the median of the interval.
[0082] 2) Iterative optimization is performed. In the first iteration (t=0), the convergence factor is 1.6. Four duty cycles D1, D2, D3, D4 are output in sequence, after each duty cycle is output, a delay (60 ms in this embodiment) is applied to wait for the circuit to stabilize. The voltage and current are read through INA226, and the power P is calculated. Assume that the measured powers are P1, P2, P3, P4, among which P2 is the maximum. Then the individual optimal power is updated to the respective power, and the global optimal power = P2, and the optimal duty cycle = D2. Then position updating is performed, and random numbers p and r are generated for each whale individual. Assume that for individual 1 (current duty cycle D1): p=0.32 and r=0.67 are generated. Satisfy p<0.5 and r<a, adopt the encirclement predation strategy: The new duty cycle is calculated and updated after amplitude limiting. Assume that for individual 2 (current duty cycle D2): p=0.67 is generated, and random addition is adopted for the spiral strategy The new duty cycle is calculated and updated after amplitude limiting, and individual 3 and individual 4 are updated similarly.
[0083] Second iteration (t=1): convergence factor The power is sampled again according to the new population, assuming the globally optimal power increment is P1. If P1 < If the counter increments by 1, it will stop early; otherwise, it will be reset to zero.
[0084] Third iteration (t=2): Continue iterating until the counter reaches... If this happens, the iteration will be forcibly terminated.
[0085] 3) Steady-state operation and sudden restart
[0086] After the iteration is complete, the system locks the optimal duty cycle. It continuously outputs power and samples real-time power at fixed intervals. When it detects... When this happens, a mutation restart is triggered, historical data is cleared, and initialization and optimization are re-executed.
[0087] 3. Charging solution selection:
[0088] High-intensity direct charging: When the charging current is higher than the preset minimum threshold for lithium battery charging and the battery is not fully charged, this system directly charges the lithium battery, and the multi-channel management module charges in turn according to voltage priority.
[0089] Low-light energy storage charging: When the charging current is lower than the preset minimum threshold for lithium battery charging but there is still a micro-current output, the direct charging circuit is disconnected, and the micro-current is stored in the energy storage capacitor. After the capacitor voltage rises to the release threshold, the battery is discharged with a pulse current to recycle the low-light energy.
[0090] Full charge standby: After all battery voltages reach full charge, disconnect all charging switches and the system enters standby monitoring mode. Charging will resume after the battery voltage drops back to the restart threshold.
[0091] The present invention will be verified as follows:
[0092] To verify the accuracy and feasibility of the MPPT algorithm, a solar cell with mW-level power output was used in this experiment. The traditional perturbation observation method and the optimized whale method were compared and verified under two conditions: no light to strong light and strong light to weak light. The corresponding curves were plotted to determine the power value at the maximum power point.
[0093] First, the actual performance of the traditional perturbation-observation method was tested and data was collected:
[0094] Figure 14 This is the output power tracking curve of the traditional perturbation observation method under conditions of sudden change from no light to bright light and then back to weak light. (Example) Figure 14As shown, in the first stage, the system rapidly undergoes duty cycle perturbation after startup, and the power curve shows a clear upward trend, approaching the maximum power point (1056.886mW) in approximately 2.325s. However, limited by the forced and continuous fixed-step trial characteristics of the traditional perturbation-observation method, the system cannot achieve state lock-in after reaching the vicinity of the maximum power point, oscillating between 1034.990mW and 1074.743mW. In the second stage, after an optimization time of 3.035s, the output power reaches the maximum power point (602.630mW), oscillating and maintaining between 589.318mW and 605.961mW.
[0095] The measured curves based on the traditional perturbation-observation method objectively verify the feasibility of this basic algorithm in photovoltaic maximum power point tracking. However, they also realistically expose its shortcomings in practical engineering applications, such as power oscillations and slow response to drastic environmental changes. This provides a direct experimental benchmark for subsequent verification of the optimized whale algorithm proposed in this invention.
[0096] Figure 15 To optimize the output power tracking curve of the whale algorithm under conditions of sudden changes from no light to bright light and then back to weak light. For example... Figure 15 As shown, in the first stage, the system output power rapidly rises to the maximum power point (1075.573mW) within 1.174s, oscillating between 1064.328mW and 1090.342mW. The oscillation amplitude is significantly smaller than that of the perturbation-observation method, achieving a relatively stable output. In the second stage, after an optimization time of 3.043s, the system finds the maximum power point (606.274mW), achieving a steady-state output oscillating between 602.162mW and 611.986mW. The oscillation amplitude is significantly smaller than that of the perturbation-observation method.
[0097] The system achieved a rapid power response after a sudden change, finding a higher maximum power point than the perturbation and observation method, and operating more smoothly near the new maximum power point.
[0098] The results of the actual operation of different maximum power point tracking algorithms under different lighting conditions are shown in Tables 1 and 2:
[0099] Table 1
[0100]
[0101] Table 2
[0102]
[0103] As shown in Tables 1 and 2, compared with the traditional perturbation and observation algorithm, the optimization time of this invention is shortened by about 49.5% and the optimization power is increased by about 1.77% when the light intensity changes from no light to strong light. When the light intensity changes from strong light to weak light, the optimization power is increased by about 0.6%, and the steady-state power fluctuation is reduced by 35% to 41% in both cases.
[0104] Figure 11 and Figure 12 The graph shows the charging current of the lithium battery under low light conditions and the charging current of the energy storage capacitor. Figure 11 The current curves for directly charging the lithium battery when the output current is low are shown in Table 3. With a charging current of approximately 10–20 mA, the system was directly connected to the lithium battery for charging. The results are shown in Table 3. After approximately 10 minutes, the battery voltage remained unchanged, indicating no charging effect.
[0105] Figure 12 This is the capacitor charging current curve for the low-light energy harvesting scheme of this invention (storing a micro-current in an energy storage capacitor and then discharging it). Under the condition of a charging current of approximately 10–20 mA, the system charges the capacitor. After the capacitor reaches a preset charging threshold, it discharges to charge the lithium battery. The results are shown in Table 3. After approximately 1.2 minutes, the battery voltage changed from 3.503V to 3.509V, indicating a charging effect.
[0106] Table 3
[0107]
[0108] Figure 10 This graph shows the relationship between the lithium battery charging voltage and time during outdoor operation of this system. The voltage of the lithium battery to be charged gradually increases over time, thus achieving the lithium battery charging function.
[0109] Figure 16 This invention illustrates the use and unused I / O ports. All I / O ports are brought out using pin headers, and users can use unused I / O ports to expand and add other peripherals.
[0110] Table 4 shows a functional comparison of this system with other photovoltaic maximum power point tracking systems:
[0111] Table 4
[0112]
[0113] Figure 17 A comparison chart of different photovoltaic maximum power point tracking systems. Figure 17 In the diagram, (a) represents the system of this invention, (b) represents other system 1, and (c) represents other system 2. Figure 17The differences in hardware and functionality among the three systems are evident. Compared to the other two comparative systems, this invention boasts higher hardware integration, highly integrating photovoltaic power sampling, MPPT driving, multi-channel lithium battery charging, low-light energy storage unit, display, and communication expansion interfaces into a single unit. It also features abundant onboard peripherals and a well-organized functional layout. In contrast, the comparative systems generally suffer from limited functionality, lack of low-light energy storage structure, absence of multi-channel equalization charging modules, and missing expansion interfaces. This directly demonstrates that, compared to traditional photovoltaic MPPT systems, this system possesses complete charging management, low-light energy utilization, and secondary development and expansion capabilities. Its hardware functionality and scenario adaptability are significantly superior to existing similar systems.
[0114] Based on the measured data and comparative analysis of the above embodiments of the present invention, the following conclusions can be drawn:
[0115] Based on comprehensive physical comparison and testing data, the photovoltaic maximum power point tracking method proposed in this invention, based on an improved whale optimization algorithm, employs a collaborative control mechanism of bidirectional search, early convergence, and abrupt restart. This significantly improves the dynamic response speed when dealing with sudden changes in illumination, while achieving minimal power oscillations during steady-state operation. The low-light energy harvesting module improves the energy utilization rate of microcurrents through pulsed discharge of the energy storage capacitor. Experimental results demonstrate that this method effectively balances tracking efficiency, steady-state accuracy, low-light energy utilization, and battery equalization management under complex dynamic conditions.
[0116] The system proposed in this invention significantly outperforms other systems in terms of functional flexibility and scalability. This system supports customization of the MPPT algorithm, peripheral expansion, host computer communication and data customization, OLED data display, and customization of display content. Overall, this system not only achieves a balance between tracking efficiency and steady-state accuracy under actual dynamic operating conditions, but also possesses significant advantages in system flexibility, user interaction, and scalability, further validating the practical value and comprehensive performance of this invention in complex photovoltaic application scenarios.
[0117] This system acquires real-time voltage and current data of the photovoltaic array and uses the real-time output power of the photovoltaic array as a fitness evaluation function to construct a target model for maximum power point optimization. An improved whale optimization algorithm iteratively optimizes the PWM duty cycle of the Buck converter. The prey encirclement strategy introduces a direction coefficient for bidirectional search, the spiral update uses a fixed large step size, and an early convergence judgment mechanism is set up to enable the photovoltaic array to quickly and unbiasedly lock onto the true maximum power point. The electrical energy corresponding to the maximum power point is stepped down by the Buck converter to a voltage level suitable for lithium battery charging. A multi-channel management unit then charges each lithium battery in turn according to a voltage priority strategy. For situations where the output current is lower than the minimum charging current threshold of the lithium battery under low light conditions, an energy storage capacitor and its voltage detection circuit are set up. When the system is detected to be operating in a micro-current state, the discharge switch connected to the lithium battery is automatically disconnected, storing the weak electrical energy output by the photovoltaic array in the capacitor. After the voltage across the capacitor rises to a preset release threshold, the discharge switch is turned on, allowing the energy storage capacitor to discharge to the lithium battery with a current higher than the minimum charging current threshold, thereby achieving effective acquisition and utilization of micro-currents below the charging threshold. This invention has the advantages of rapid maximum power point tracking response, no large power oscillation during steady-state operation, high energy utilization in low light conditions, and balanced charging of multiple batteries. It is suitable for portable photovoltaic charging equipment, outdoor searchlight energy storage systems, and integrated distributed photovoltaic power generation applications.
[0118] Furthermore, the system utilizes the STM32F103C8T6 main control chip, whose abundant I / O port resources support secondary development by users. Users can customize and replace the maximum power point tracking algorithm (such as particle swarm optimization, incremental conductance method, etc.) according to actual needs, modify the data displayed on the OLED screen (such as customizing parameters like the current duty cycle), and upload real-time operating data to the host computer for storage and analysis via the USART serial port. Simultaneously, unused I / O ports of the main control chip are brought out via pin headers, supporting the connection of additional peripheral modules (such as Bluetooth modules, SD card storage modules, buzzer alarm modules, etc.), significantly improving the system's functional scalability and scenario adaptability.
[0119] The above embodiments are merely preferred embodiments of the present invention and should not be considered as limiting the scope of the present invention. All equivalent variations and improvements made within the scope of the present invention should still fall within the patent coverage of the present invention.
Claims
1. A photovoltaic maximum power point tracking method based on an optimized whale algorithm, characterized in that, Includes the following steps: 1) System initialization and parameter configuration: Set the upper and lower limits of the duty cycle of the pulse width modulation wave, the number of whales, the maximum number of iterations, the upper and lower limits of the convergence factor, the spiral step size, the threshold for the power difference between early convergence and early convergence, the threshold for consecutive early convergences, and the threshold for sudden restart. Initialize the duty cycle value of each individual in the population uniformly within the duty cycle interval, and set the initial values of the global optimal power, the current iteration number, the early stop counter, the previous round's optimal power, and the global optimal duty cycle. 2) Adaptive convergence factor update: The convergence factor is dynamically updated based on the current iteration number, so that it decreases linearly from the maximum value to the minimum value as the iteration number increases; 3) Power Acquisition and Evaluation: Output the duty cycle of each individual whale in sequence, and after the system stabilizes, acquire the voltage and current of the current photovoltaic array and calculate the corresponding power; Update the individual optimal power, the global optimal power, and the corresponding optimal duty cycle; 4) Hybrid Position Update Strategy: For each individual whale, generate two independent random numbers, denoted as the first random number and the second random number. Update the duty cycle according to the following rules: If the first random number is less than 0.5 and the second random number is less than the current convergence factor, then adopt an encirclement and predation strategy: Using the current globally optimal duty cycle as a reference, introduce a direction coefficient with a value between -1 and +1, so that the new duty cycle searches bidirectionally on both sides of the globally optimal duty cycle. The new duty cycle is equal to the globally optimal duty cycle minus the product of the current convergence factor, the direction coefficient, and a distance parameter; wherein the distance parameter is calculated by randomly scaling the difference between the globally optimal duty cycle and the current duty cycle. If the first random number is less than 0.5 and the second random number is greater than or equal to the current convergence factor, a random search strategy is adopted: taking the duty cycle of another randomly selected whale individual as a reference, the new duty cycle is equal to the random duty cycle minus the product of the current convergence factor and a distance parameter; wherein the distance parameter is calculated by randomly scaling the difference between the random duty cycle and the current duty cycle. If the first random number is greater than or equal to 0.5, a spiral bubble net predation strategy is adopted: the position is updated with a fixed step size, and addition or subtraction is randomly selected with equal probability. The new duty cycle is equal to the current duty cycle plus or minus the fixed step size. The updated new duty cycle is restricted to the preset lower and upper limits of the duty cycle. 5) Early convergence judgment and termination: After each iteration, calculate the difference between the current global optimal power and the previous optimal power; if the number of times the difference is less than the preset power difference threshold reaches the preset consecutive number threshold, the iteration is forcibly terminated. 6) Steady-state locking and sudden restart: After the iteration terminates, the system locks and continuously outputs the globally optimal duty cycle, and collects real-time power at a fixed sampling period; if the current optimal power is higher than the preset lower limit, and the relative deviation between the real-time power and the locked power exceeds the preset restart threshold, then a sudden restart is triggered, and steps 1) to 5) are executed again.
2. The photovoltaic maximum power point tracking method based on the optimized whale algorithm according to claim 1, characterized in that, The encirclement predation strategy described in step 4) uses the current global optimal duty cycle as a reference and introduces a direction coefficient to enable bidirectional searching on both sides of the optimal duty cycle. The random search strategy uses the duty cycle of a randomly selected whale individual as a reference for random searching. The spiral bubble net predation strategy uses a fixed step size, which is a preset value.
3. The photovoltaic maximum power point tracking method based on the optimized whale algorithm according to claim 1, characterized in that, The preset power difference threshold mentioned in step 5) is a small power change amount, and the preset consecutive number threshold is a preset value.
4. The photovoltaic maximum power point tracking method based on the optimized whale algorithm according to claim 1, characterized in that, The preset restart threshold mentioned in step 6) is a preset relative deviation percentage.
5. A lithium battery intelligent charging management system, employing the photovoltaic maximum power point tracking method based on the optimized whale algorithm as described in any one of claims 1 to 4, characterized in that the system... include: 1) Photovoltaic array connection and sampling module, used to collect the voltage and current of the photovoltaic array; 2) Maximum Power Point Tracking (MPPT) execution module, used to execute the method described in claim 1, outputting a PWM wave with modulated duty cycle, and supporting user-defined MPPT algorithm; 3) Buck converter, used to step down the maximum power point electrical energy to the lithium battery charging voltage; 4) Multi-channel charging management module, used to charge each lithium battery cell in turn according to voltage priority; 5) Low light energy harvesting module, including energy storage capacitor and voltage detection circuit, is used to store micro-current energy when the current is lower than the charging threshold, and release the current to discharge to the lithium battery after the capacitor voltage rises to the release threshold. 6) Communication and display module, used to transmit system operation data to the host computer via serial port, and display charging voltage, current, power and other information in real time on OLED screen; 7) Light intensity detection module, used to measure ambient light intensity in real time and assist the system in judging sudden changes in light intensity.
6. The system according to claim 5, characterized in that, In the weak light energy acquisition module, the release threshold is a preset value. The multi-channel charging management module charges sequentially from low to high voltage. In the maximum power point tracking execution module, the population size, number of iterations, convergence factor, spiral step size, power difference threshold, and restart threshold are all preset values.
7. The system according to claim 5, characterized in that, The photovoltaic array connection and sampling module includes three independent voltage and current detection units, which are used to collect the voltage and current at the input of the photovoltaic array, the voltage and current at the charging end of the lithium battery, and the voltage of the energy storage capacitor module, respectively. All three detection units use the INA226 chip and are connected to the main control module via the I2C bus. The main control chip of the maximum power point tracking execution module uses an STM32F103C8T6 microcontroller, which has an internally embedded MPPT control program with an improved whale optimization algorithm and supports user-defined algorithms. The power supply of the main control chip is independently provided by a TPS54202 step-down chip, which converts the photovoltaic cell power supply into a stable 5V voltage.
8. The system according to claim 5, characterized in that, The PWM drive circuit of the Buck converter uses the EG3014S chip to enhance the PWM wave output capability to drive the power switching transistor of the Buck converter. In the multi-channel charging management module and the low light energy acquisition module, the switching device used to switch between the charging circuit and the discharging circuit uses the AP22804AW chip; the lithium battery charging management uses the TP4056H charging chip, which is responsible for charging control.
9. The system according to claim 5, characterized in that, The OLED screen display unit is connected to the main control module via an I2C bus and is used to display voltage, current, power, and duty cycle data in real time. The USART serial communication unit transmits data with the host computer via the USART protocol. The system also includes a light intensity detection module, which uses a BH1750 chip and is connected to the main control module via an I2C bus to collect ambient light intensity data in real time and assist in judging sudden changes in light intensity.
10. The system according to claim 5, characterized in that, The main control chip of the maximum power point tracking (MPPT) execution module is an STM32F103C8T6 microcontroller. Unused general-purpose input / output interfaces are brought out via pin headers, allowing users to connect custom peripherals according to their needs. The MPPT execution module supports user-defined MPPT algorithms, including but not limited to particle swarm optimization, incremental conductance method, or perturbation-observation method. The communication and display module allows users to customize the data displayed on the OLED screen, as well as the data format and content sent via the USART serial port. The communication protocols for each module are software I2C and hardware serial communication protocols. The control of each module is achieved by the main control chip through I / O ports.
Citation Information
Patent Citations
Improvement in cloth-steaming apparatus
US115200A