A constant pressure control method for a hydrogen generator

By using an improved single candidate solution optimization algorithm and a dual-channel control strategy, the problem of insufficient control accuracy in the constant pressure control of the hydrogen generator was solved, achieving rapid response and stable pressure regulation, thereby improving the operational reliability and equipment lifespan of the hydrogen generator.

CN120738706BActive Publication Date: 2026-01-02SHANDONG TRANSPORT VOCATIONAL COLLEGE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511247770.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2026-01-02
Estimated Expiration
2045-09-03

AI Technical Summary

Technical Problem

The existing constant pressure control method for hydrogen generators is insufficient in control accuracy and slow in response when faced with multiple operating disturbances and load changes. It is prone to overshoot and steady-state deviation, which leads to a decrease in electrolysis efficiency and equipment aging. The existing PID controller parameter tuning method cannot adapt to complex response characteristics.

Method used

An improved single candidate solution optimization algorithm is used to optimize the parameters of the PID controller online. Combined with a dual-channel control strategy of electrolysis power supply and proportional exhaust valve, the pressure in the electrolysis chamber is accurately regulated and dynamically stabilized through information fluctuation response exponential disturbance and self-excited state transition strategy.

Benefits of technology

It improves the constant pressure control performance of the hydrogen generator under multiple disturbance conditions, enhances the system response speed and adjustment accuracy, extends equipment life, and strengthens the system's robustness and safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120738706B_ABST
    Figure CN120738706B_ABST
Patent Text Reader

Abstract

The application discloses a kind of constant pressure control methods for hydrogen generator, belong to the constant pressure control field of hydrogen generator, specific steps are as follows: S1, the real-time pressure value P (t) inside hydrogen generator is collected by high-precision gas pressure sensor inside electrolytic cavity of hydrogen generator, while the real-time pressure error e (t) is calculated by the target pressure value P_ref set and real-time pressure value;S2, the real-time pressure error e (t) is transmitted into adaptive PID control module;S3, the constant pressure control is carried out using electrolytic power supply control and proportional exhaust valve joint double-channel control strategy, control signal U (t) is used to control electrolytic power supply output current, and the advance compensation control of gas pressure is realized through proportional exhaust valve;S4, S1-S3 are cyclically executed, based on the operating state of hydrogen generator system, the constant pressure control inside hydrogen generator is dynamically carried out;Realize accurate regulation and dynamic stability control to pressure, improve the robustness of system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the field of constant pressure control of a hydrogen production machine, in particular to a constant pressure control method for a hydrogen production machine. BACKGROUND

[0002] As a key equipment for realizing hydrogen production in a new energy system, the running stability and gas production accuracy of a hydrogen production machine are directly affected by pressure fluctuation in an electrolysis cavity. In the process of electrolytic water hydrogen production, due to the coupling interference of factors such as electrolyte concentration, electrolysis temperature, power input fluctuation and load change, dynamic abnormalities such as pressure oscillation, pressure overshoot or response lag are prone to occur in the electrolysis cavity. In severe cases, it may even cause problems such as electrolysis efficiency decline, electrode over-aging or control instability. Therefore, the constant pressure control of the pressure in the electrolysis cavity of the hydrogen production machine is the core key to improving the safety and operating efficiency of the system. The existing constant pressure control method mainly relies on a closed-loop control scheme based on a PID. In the feedback loop, the proportional, integral and differential adjustments of the target pressure and the current pressure difference are performed. However, the performance of the PID controller itself is highly dependent on the parameter setting, and the traditional parameter setting methods such as Ziegler-Nichols or experience method often cannot adapt to the complex response characteristics under multi-working condition disturbance conditions. In addition, the control accuracy is obviously insufficient in the hydrogen production scene with severe load disturbance and large power fluctuation, which is prone to problems such as large overshoot, slow response or large steady-state deviation, thereby limiting the dynamic performance of the overall system. Therefore, an intelligent constant pressure control strategy that can adaptively model the disturbance characteristics and accurately adjust the controller parameters is needed to solve the problems of poor pressure control dynamics and weak regulation stability in the hydrogen production process.

[0003] Single candidate solution optimization algorithm is a new lightweight single optimization method. It has the advantages of simple structure, high iteration efficiency and strong stability, and exhibits good global search ability in complex search space. The SCO algorithm is different from traditional swarm intelligence algorithms. It only uses one candidate solution to intelligently jump in the search space. The exploration-development switching is realized through the segmented disturbance mechanism, which avoids the resource consumption and control redundancy caused by population cooperation. The internal structure adopts a disturbance scheduling logic similar to state self-driving, so that the optimization process has strong ability to jump out of local optimum and global convergence trend. In the parameter optimization scene of the PID controller, the single candidate solution optimization algorithm adjusts the proportional, integral and differential parameters through the intelligent disturbance mechanism, so that the controller can more accurately track the pressure target value, improve the system response speed and regulation accuracy, and is especially suitable for nonlinear systems such as hydrogen production machines with complex working conditions and frequent disturbances. SUMMARY

[0004] The application provides a constant pressure control method for a hydrogen production machine.

[0005] The application provides a constant pressure control method for a hydrogen production machine.

[0006] S1, collecting a real-time pressure value P(t) in the hydrogen production machine by a high-precision gas pressure sensor in an electrolytic cavity of the hydrogen production machine, and calculating a real-time pressure error e(t) by taking a set target pressure value P_ref and the real-time pressure value.

[0007] S2, transmitting the real-time pressure error e(t) into an adaptive PID control module, the adaptive PID control module is an online parameter optimization of a PID controller by an improved single candidate solution optimization algorithm, and a control adjustment signal U(t) is outputted, and the improvement of the algorithm includes two improvement strategies.

[0008] S21, improving a mathematical model of an exploration stage in the single candidate solution optimization algorithm by introducing an information fluctuation response index disturbance strategy, the strategy dynamically constructs a disturbance control factor by a fitness value change characteristic, generates a disturbance amplitude adjustment factor by measuring information fluctuation characteristics in a disturbance path, and drives the update of a candidate solution position in an exponential mapping mode.

[0009] S22, improving an update mathematical model in a development stage of the single candidate solution optimization algorithm for a local optimal solution stagnation by using a self-excited driving state migration strategy, the strategy is enabled in a local optimal stagnation stage, a dynamic response structure based on a time sequence behavior is constructed, and state migration update of the candidate solution in a non-steady state environment is realized.

[0010] S3, performing constant pressure control by using a double-channel control strategy of electrolytic power control and proportional exhaust valve combination, and using the control signal U(t) to control an electrolytic power output current, so as to adjust a hydrogen production rate, and realizing advance compensation control of gas pressure by the proportional exhaust valve.

[0011] S4, cyclically performing S1-S3, and dynamically performing constant pressure control in the hydrogen production machine based on a hydrogen production machine system operation state.

[0012] Preferably, the adaptive PID control module in S2 is internally integrated with an improved single candidate solution optimization algorithm for online real-time optimization of the three core parameters Kp, Ki and Kd of the PID controller, thereby outputting a control adjustment signal U(t), the mathematical model of which is:

[0013] ;

[0014] In the formula, e(t) represents the real-time pressure error, Kp(t) represents the proportional coefficient, Ki(t) represents the integral coefficient, Kd(t) represents the differential coefficient, T represents the total time of system operation, and t represents the current time. Unlike the traditional PID controller whose parameters are fixed, Kp(t), Ki(t) and Kd(t) here are dynamically updated over time, and the updating process is driven by the improved single candidate solution optimization algorithm.

[0015] Preferably, the construction process of the information fluctuation response exponential perturbation strategy in S21 includes the following steps: first, according to the fitness value change and position offset between the current candidate solution and the candidate solution of the previous iteration, the information fluctuation rate on the unit perturbation path is extracted, and the statistical fluctuation of the fitness value in a continuous history is combined to describe the response activity of the current search region; then the information fluctuation rate is input into the exponential adjustment function to generate the corresponding perturbation amplitude factor; finally, according to the position of the current candidate solution, the search increment is formed by superimposing the perturbation amplitude control factor in the random perturbation direction, thereby generating a new search position.

[0016] Preferably, the construction idea of the information fluctuation response exponential perturbation strategy in S21 comes from the dynamic perception demand for the response characteristics of the individual position fitness value in the algorithm optimization process, aiming to solve the problem that the perturbation amplitude in the traditional perturbation method depends on the preset rules and cannot reflect the change of the individual position fitness value in real time. By introducing the information fluctuation rate as the basis for perturbation regulation, the perturbation strength can be adaptively adjusted according to the sensitivity of the fitness value function in the search region, thereby enhancing the structural adaptability to the complex function space and the selectivity of the perturbation direction. In the overall algorithm framework, the strategy improves the controllability and responsiveness of the perturbation behavior in the exploration stage, which helps to avoid early falling into local structure and low perturbation efficiency. In the scene of PID parameter optimization, the strategy makes the parameter search process more responsive to the objective function, effectively perceives the influence of parameter adjustment on system performance, and thereby improves the matching degree of parameter setting. In the constant pressure control system of the hydrogen generator, the optimized PID controller has a more stable response and stronger adjustment precision and disturbance adaptability, thereby helping to maintain the dynamic stability of the gas output pressure within the target range.

[0017] Preferably, the self-excitation driving state transition strategy in S22 is specifically constructed as follows: first, the response inertia of the candidate solution in the current search stage is constructed, and the current change trend is encoded based on the trajectory change ratio of several historical moments; then, the state energy density of the candidate solution is obtained, and the state energy is jointly represented by the change trend and the change acceleration, which is used to measure the non-steady state degree of the current search state; at the same time, a heterophase self-excitation modulation factor is designed, which fuses the inertia term and the energy term, and introduces a phase shift to construct a periodic disturbance to generate a non-resonant driving signal; finally, the above signal is input into the self-excitation jump module to generate a disturbance increment, and then the state update of the current candidate solution is completed.

[0018] Preferably, the design idea of the self-excitation driving state transition strategy in S22 is derived from the modeling theory of state catastrophe and energy modulation coupling in nonlinear dynamic systems, and specifically refers to the self-excitation oscillation and energy valley transition mechanism in the evolution process of complex systems. The core of the strategy adopts a three-element structure of response inertia, state energy density and heterophase modulation factor, and establishes a state update path independent of the historical optimal solution by simulating the asymmetric oscillation process of the variable in the non-steady state space, thereby realizing the driving and regulation of the candidate solution in the stagnation stage, which is significantly different from the traditional disturbance paradigm in terms of construction logic. The technical advantages of the strategy lie in that the disturbance mode is dominated by the time series behavior characteristics, and no longer relies on the direct feedback of fitness, thereby realizing a structured and self-regulating transition control mechanism. Especially in high-dimensional parameter optimization tasks, the non-active state region can be identified by modeling the variable change trend, triggering high-intensity driving modulation, thereby improving the ability to jump out of the local convergence region. The single candidate solution optimization algorithm improved by using the strategy can enhance the adaptability of the controller to nonlinear pressure dynamic changes, improve the identification ability of the parameter search to sensitive regions, avoid the regulation lag caused by low sensitivity regions, effectively shorten the regulation time in the constant pressure response process, and improve the stability precision and system robustness.

[0019] Preferably, the online parameter optimization of the PID controller by the improved single candidate solution optimization algorithm in S2 is specifically as follows:

[0020] Step 1, initialize the basic parameters of the improved single candidate solution optimization algorithm, including the population size N of the algorithm, the problem dimension dim, the maximum number of iterations max iter of the algorithm, the upper limit ub and the lower limit lb of the search space, and initialize the population position through the basic parameter initialization;

[0021] step2, the improved single candidate solution optimization algorithm is mapped with the control parameters of the PID controller, the update of the individual position in the search space in the algorithm is linked with the change of the control parameters of the PID controller, the initialized problem dimension dim=3 corresponds to the three parameters Kp, Ki and Kd, the mapping relationship is [X1, X2, X2]=[Kp, Ki, Kd], X1, X2 and X3 are the values of the individual position vector in three dimensions, the individual position is updated in the iterative optimization process of the algorithm, so as to adjust the control parameters of the PID controller, output the corresponding control amount, and select an optimal parameter combination as the final output by evaluating the individual position;

[0022] step3, the evaluation standard of the individual position is set, the fitness value of the algorithm is taken as the evaluation standard, the fitness value of each position in the initial population is calculated and sorted, the optimal individual position and the optimal fitness value are selected, and the optimal individual position and the optimal fitness value are updated in real time in the subsequent optimization process, and the specific fitness value function is:

[0023] ;

[0024] In the formula, J represents the fitness value, e(t) represents the real-time pressure error, and T represents the running time of the system;

[0025] step4, the individual position in the population is updated through the mathematical model of the improved single candidate solution optimization algorithm, the fitness value of the updated individual is calculated, the sorting of the fitness value in the population and the position of the optimal individual are updated, the mathematical model of the improved single candidate solution optimization algorithm is divided into an exploration stage, a development stage and an escape stage, and the specific formula is:

[0026] D1, the algorithm enters the exploration stage, an information fluctuation response index disturbance strategy improved exploration stage mathematical model is used for position updating;

[0027] D2, the algorithm enters the development stage for position updating, and the specific formula is:

[0028] ;

[0029] In the formula, Xbest represents the optimal individual position, r2 represents a random number between 0 and 1, w represents a weight factor, ub represents the upper limit of the search space, and lb represents the lower limit of the search space;

[0030] D3, when the position of the global optimal individual is not updated for consecutive m times of iteration, m represents the maximum tolerance, it is indicated that the algorithm is trapped in a local optimal solution, and then the escape stage is entered, and a self-activated state migration strategy is used for position adjustment;

[0031] step 5, judge whether the iteration number of the algorithm reaches the maximum iteration number, if not, return to step 4 to continue optimization, if yes, exit the optimization of the algorithm and output the optimal solution.

[0032] Preferably, the constant pressure control in S3 is performed by using a dual-channel control strategy combining electrolytic power control and proportional exhaust valve control, wherein the electrolytic power control serves as a slow channel to change the hydrogen generation rate by adjusting the current, and the proportional exhaust valve control serves as a fast channel to directly adjust the exhaust opening degree to quickly release excess gas, thereby suppressing high-frequency disturbance and dynamic compensation of pressure; the electrolytic power control serves as a main control path to receive a control quantity U(t) output from an adaptive PID control module and output a current I_elec(t) according to a dynamic relationship formula:

[0033] ;

[0034] In the formula, T1 represents a power response time constant, and ku represents a power gain;

[0035] The hydrogen generation rate N_gen can be calculated from the current, and ηF represents a Faraday efficiency value, and F represents a Faraday constant; the change in the hydrogen generation rate ultimately affects the change in the gas pressure dynamics, and the formula is:

[0036] ;

[0037] In the formula, P represents the pressure of the hydrogen production cavity, R represents the ideal gas constant, Tem represents the gas temperature, V represents the gas cavity volume, and N_out(t) represents the gas discharge rate;

[0038] Meanwhile, the pressure error e(t) obtained in S1 is extracted in parallel to obtain a fast change component eH(t), that is, a component of the high-frequency part of the change in the pressure error, which is input to the proportional exhaust valve channel to generate a valve control quantity for valve control. The proportional exhaust valve channel is not a complete control of the pressure, but a prediction of the future pressure change and a damping compensation. The calculation formula of the valve control quantity θ(t) is:

[0039] ;

[0040] In the formula, θ0 represents a static reference opening degree, k1 and k2 represent compensation control gains, represents the first derivative of the error variable change component, Kff represents a feedforward gain, and I_nom(t) represents the average load current of the power supply.

[0041] Preferably, a dual-channel constant pressure control strategy combining electrolytic power control and proportional exhaust valve regulation is adopted, the electrolytic power as the main regulation channel, the hydrogen production rate is changed by controlling the current according to the pressure error, to realize accurate tracking of the steady-state gas pressure; the proportional exhaust valve as the fast compensation channel, responding to the high-frequency component of the error, releasing excess gas in real time to suppress short-term fluctuations, thereby significantly improving the system response speed and anti-interference ability without affecting the energy efficiency, the strategy overcomes the defects of single-channel control such as response lag, easy overpressure and gas waste, has good dynamic performance, control accuracy and system safety, and is suitable for the constant pressure regulation needs of hydrogen production devices in various variable load scenarios.

[0042] Compared with the existing technology, the advantages of the present application are that the improved single candidate solution optimization algorithm is introduced on the basis of the conventional PID controller to realize online adaptive optimization of the PID parameters, and the electrolytic power-proportional exhaust valve dual-channel collaborative control architecture is fused to consider the slow channel steady-state accuracy and the fast channel transient compensation, which not only overcomes the defects of traditional PID relying on offline setting and being easy to fail in multiple working conditions, but also significantly improves the dynamic response speed, steady-state accuracy and anti-disturbance ability of pressure control; at the same time, the proportional exhaust valve only acts instantaneously when high-frequency disturbance occurs, avoiding gas energy waste, cooperating with flexible adjustment of the hydrogen production side current, effectively suppressing pressure overshoot and oscillation, reducing mechanical stress of electrodes and valve parts, and prolonging equipment life; ultimately realizing higher control robustness and system safety in multiple load, strong coupling and nonlinear working conditions, providing a low-cost, low-power and high-reliability intelligent control solution for constant pressure operation of hydrogen production machines. BRIEF DESCRIPTION OF DRAWINGS

[0043] Figure 1 A flowchart of a constant pressure control method for a hydrogen production machine.

[0044] Figure 2 A comparison chart of fitness value changes in the optimization process of the improved single candidate solution optimization algorithm and the standard single candidate solution optimization algorithm.

[0045] Figure 3 A response comparison chart of the control method proposed in the present application and the constant pressure control method of the hydrogen production machine based on the conventional PID controller.

[0046] Figure 4 An execution flowchart of the improved single candidate solution optimization algorithm. DETAILED DESCRIPTION

[0047] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0048] The present application provides a technical solution: a constant pressure control method for a hydrogen production machine, specifically comprising the following steps, such as Figure 1

[0049] S1, collecting the real-time pressure value P(t) inside the hydrogen production machine through a high-precision gas pressure sensor inside the electrolytic cavity of the hydrogen production machine, and calculating the real-time pressure error e(t) by taking the set target pressure value P_ref and the real-time pressure value.

[0050] S2, transmitting the real-time pressure error e(t) into an adaptive PID control module, the adaptive PID control module is an online parameter optimization of the PID controller through an improved single candidate solution optimization algorithm, and outputs a control adjustment signal U(t). For the improvement of the algorithm, two improvement strategies are included:

[0051] S21, improving the mathematical model of the exploration stage in the single candidate solution optimization algorithm by introducing an information fluctuation response exponential disturbance strategy, the strategy dynamically constructs a disturbance control factor through the fitness value change characteristics, simultaneously measures the information fluctuation characteristics in the disturbance path to generate a disturbance amplitude adjustment factor, and drives the update of the candidate solution position in an exponential mapping manner;

[0052] S22, improving the update mathematical model in the development stage of the single candidate solution optimization algorithm for the local optimal solution stagnation condition by using a self-excited driving state migration strategy, the strategy is enabled in the local optimal stagnation stage, a dynamic response structure based on time sequence behavior is constructed to realize the state migration update of the candidate solution in the non-steady state environment.

[0053] Further, the adaptive PID control module in S2 is integrated with an improved single candidate solution optimization algorithm, which is used to optimize the three core parameters Kp, Ki and Kd of the PID controller online in real time, and then output the control adjustment signal U(t). The mathematical model of U(t) is:

[0054] ;

[0055] ​In the formula, e(t) represents a real-time pressure error, Kp(t) represents a proportional coefficient, Ki(t) represents an integral coefficient, Kd(t) represents a differential coefficient, T represents a total time of system operation, t represents a current time, unlike a conventional PID controller parameter fixedly unchanged, Kp(t), Ki(t) and Kd(t) here are dynamically updated with time, and an updating process is driven by an improved single candidate solution optimization algorithm.

[0056] Further, the construction of the mathematical model of the information fluctuation response exponential perturbation strategy in S21 includes the following steps: firstly, based on the fitness value change and position offset of the current candidate solution X(iter) and the candidate solution X(iter) of the previous iteration, the information fluctuation rate on the unit perturbation path is calculated , and specifically:

[0057] ;

[0058] In the formula, is a very small positive number to prevent division by zero, and the value is 1e-5, iter represents a current iteration number, f() represents a fitness value function, represents a local fluctuation factor, which is a random number subject to normal distribution, represents a variance of k times of fitness values, and k is 5;

[0059] Then, the information fluctuation rate is input to an exponential adjustment function to construct a perturbation amplitude control factor , and specifically:

[0060] ;

[0061] In the formula, represents a maximum perturbation amplitude, , dim represents a problem dimension of the algorithm, and a represents an information response attenuation factor, ;

[0062] Finally, based on the current candidate solution position, a search increment is generated by superimposing the perturbation control factor in the random perturbation direction to obtain a new search position X(iter+1), and specifically:

[0063] ;

[0064] In the formula, N() represents a standard normal distribution function, and I represents a unit matrix of dim dimensions.

[0065] The specific construction process of the self-excitation driving state jump strategy in S22 is as follows: first, the response inertia of the candidate solution in the current search stage is constructed, the response inertia is composed of the average change rate of the target variable at multiple continuous time points, and is used to reflect the directional change trend of the candidate solution in the current search stage, and the specific formula is:

[0066] ;

[0067] In the formula, K represents the time window length of the response inertia calculation, and max_iter represents the maximum number of iterations;

[0068] Then, the state energy density of the candidate solution is obtained, the state energy is jointly represented by the change trend and the change acceleration, and is used to measure the non-steady state degree of the current search state, and the specific formula of the state energy E is as follows:

[0069] ;

[0070] In the specific implementation, the mathematical formula is approximated by a numerical value, and the specific formula is as follows:

[0071] ;

[0072] A heterophase self-excitation modulation factor is designed, the factor fuses the inertia term and the energy term, and introduces a phase offset to construct a periodic disturbance, so as to generate a non-resonant driving signal, and the heterophase self-excitation modulation factor is The specific formula is as follows:

[0073] ;

[0074] In the formula, β represents an inertia modulation coefficient, and takes a value of 4, represents an offset coefficient, and takes a uniformly distributed random number in the interval [0, 2π];

[0075] Finally, the above signal is input into the self-excitation jump module to generate a disturbance increment, and then the state update of the current candidate solution is completed, and the overall update formula is as follows:

[0076] ;

[0077] In the formula, represents a standard normal distribution random number, ub represents the upper limit of search control, lb represents the lower limit of search space, and c represents a disturbance amplitude coefficient, and is specifically:

[0078] ;

[0079] In the formula, c_min represents the minimum value of the coefficient is 0.05, c_max represents the maximum value of the coefficient is 0.15, cout represents the current number of times trapped in local optimal solution, m represents the maximum tolerance, and is valued at .

[0080] Further, the PID controller is optimized online by the improved single candidate solution optimization algorithm in S2, and the specific steps are as follows:

[0081] Step 1, initialize the basic parameters of the improved single candidate solution optimization algorithm, including the population size N of the algorithm, the problem dimension dim, the maximum iteration number max_iter of the algorithm, the upper limit ub of the search space, and the lower limit lb, and initialize the population position through the basic parameters;

[0082] Step 2, construct a mapping between the improved single candidate solution optimization algorithm and the control parameters of the PID controller, establish a connection between the update of the individual position in the search space and the change of the control parameters of the PID controller, and initialize the problem dimension dim=3, which corresponds to the three parameters Kp, Ki and Kd. The mapping relationship is [X1, X2, X2]=[Kp, Ki, Kd], X1, X2 and X3 are the values of the individual position vector in three dimensions, respectively. In the iterative optimization process of the algorithm, the individual position is updated to adjust the control parameters of the PID controller, and the corresponding control quantity is output. By evaluating the individual position, a set of optimal parameter combinations is selected as the final output;

[0083] Step 3, set the evaluation standard for the individual position, take the fitness value of the algorithm as the evaluation standard, calculate the fitness value of each position in the initial population, and sort them, select the optimal individual position and the optimal fitness value, and update them in real time in the subsequent optimization process. The specific fitness value function is:

[0084] ;

[0085] In the formula, J represents the fitness value, e(t) represents the real-time pressure error, and T represents the running time of the system;

[0086] Step 4, update the individual position in the population through the mathematical model of the improved single candidate solution optimization algorithm, calculate the fitness value of the updated individual, update the sorting of the fitness value in the population and the position of the optimal individual, and improve the mathematical model of the single candidate solution optimization algorithm, which is divided into exploration stage, development stage and escape stage, as shown in Figure 4 , and the specific steps are as follows:

[0087] D1, the algorithm enters the exploration stage, uses an information fluctuation response index perturbation strategy to improve the mathematical model of the exploration stage, and updates the position;

[0088] D2, the algorithm enters the development stage for position updating, and the specific formula is:

[0089] ;

[0090] In the formula, Xbest represents the optimal individual position, r2 represents a random number between [0, 1], w represents a weight factor, ub represents the upper limit of the search space, and lb represents the lower limit of the search space;

[0091] D3, when the position of the global optimal individual is not updated for consecutive m iterations, m represents the maximum tolerance, indicating that the algorithm is trapped in a local optimal solution, then entering the escape stage, and a self-excitation driven state transition strategy is used to adjust the position;

[0092] Step 5, judge whether the iteration number of the algorithm reaches the maximum iteration number, if not, return to step 4 to continue optimization, if yes, exit the optimization of the algorithm, and output the optimal solution.

[0093] S3, a double-channel control strategy of electrolytic power supply control and proportional exhaust valve combination is used for constant pressure control, the control signal U(t) is used to control the output current of the electrolytic power supply, so as to adjust the hydrogen production rate, and the proportional exhaust valve is used to realize the advance compensation control of gas pressure.

[0094] Further, the double-channel control strategy of electrolytic power supply control and proportional exhaust valve combination for constant pressure control in S3, wherein the electrolytic power supply control as a slow channel changes the hydrogen production rate by adjusting the current, and the proportional exhaust valve control as a fast channel directly adjusts the exhaust opening degree to quickly release the excess gas, thereby suppressing high-frequency disturbance and dynamic compensation of pressure, the electrolytic power supply control as the main control path receives the control amount U(t) output from the adaptive PID control module, and outputs the current I_elec(t) according to the dynamic relationship formula, and the dynamic relationship formula is:

[0095] ;

[0096] In the formula, T1 represents the power supply response time constant, and ku represents the power supply gain;

[0097] The hydrogen production rate N_gen can be calculated by the current, , and ηF represents the Faraday efficiency value, F represents the Faraday constant, and the change of the hydrogen production rate finally affects the change of the gas pressure dynamic, and the formula is:

[0098] ;

[0099] where P represents the hydrogen production chamber pressure, R represents the ideal gas constant, Tem represents the gas temperature, V represents the gas chamber volume, and N_out(t) represents the gas outflow rate;

[0100] At the same time, the pressure error e(t) obtained in S1 is extracted in parallel to obtain its fast-changing component eH(t), that is, the component of the high-frequency part of the pressure error change, which is input to the proportional exhaust valve channel to generate a valve control quantity for valve control. The proportional exhaust valve channel is not a complete control of the pressure, but a prediction of the future pressure change and a damping compensation. The calculation formula of the valve control quantity θ(t) is:

[0101] ;

[0102] where θ0 represents the static reference opening, k1 and k2 represent the compensation control gains, represents the first derivative of the error variable change component, Kff represents the feedforward gain, and I_nom(t) represents the average load current of the power supply.

[0103] Further, a simulation model program is constructed according to the mathematical model of the constant pressure control of the electrolysis power supply control and the proportional exhaust valve combined double-channel control strategy, and the specific parameter values in the physical model are initialized, wherein the power supply response time constant T1=0.5, the power supply gain ku=5, the Faraday efficiency value ηF=0.95, the Faraday constant F=96485.34 C / mol, the ideal gas constant R=8.314 J / (mol·K), the gas chamber volume V=0.02 cubic meters, the gas outflow rate N_out(t)=7.20e-5, the static reference opening θ0=20%, k1=0.05, k2=0.02, the feedforward gain Kff=1.2, the average load current of the power supply I_nom(t)=12 A, and the gas temperature Tem=298 K.

[0104] The input parameters in the constructed model program are the three optimized parameters of the PID controller, and the specific code is as follows:

[0105] function [Plog, tVec] = hydrogen_pressure_model_var(Kp, Ki, Kd)

[0106] % Output:

[0107] % Plog —— Pressure sequence (Pa)

[0108] % tVec —— Time axis (s)

[0109] % Physical and system constants

[0110] R = 8.314; % J / (mol·K)

[0111] Tem = 298; % K

[0112] V = 0.002; % m³

[0113] etaF = 0.95; % Faraday efficiency

[0114] F = 96485; % C / mol

[0115] M = 2.016e-3; % kg / mol

[0116] Cv = 7e-4; % mol / (s·Pa^0.5)

[0117] ku = 5; % A / V

[0118] T1 = 0.5; % s

[0119] theta0 = 0.20; % Valve reference opening (%)

[0120] k1 = 0.005; % Pressure error proportional gain (% / Pa)

[0121] k2 = 0.002; % Differential gain of pressure error (% / (Pa / s))

[0122] Kff = 1.2; % Current feedforward gain (% / A)

[0123] Inom = 12; % A

[0124] % Simulation parameters

[0125] dt = 0.01; % Time step s

[0126] Tend = 4; % Total time in seconds

[0127] tVec = 0:dt:Tend;

[0128] % Target pressure segment (Pa)

[0129] Pref1 = 1e5; %1bar

[0130] Pref2 = 2e5; % 2bar

[0131] Pref = (tVec<= 1.5) * Pref1 + (tVec>1.5) * Pref2;

[0132] % State initialization

[0133] P = Pref1; % Initial pressure (Pa)

[0134] Ielec = Inom; % Initial current (A)

[0135] intE = 0; % Integral term

[0136] ePrev = 0; % Previous error

[0137] Plog = zeros(size(tVec)); % Pressure log

[0138] % Main loop

[0139] for k = 1:length(tVec)

[0140] Pref_k = Pref(k);

[0141] e = Pref_k - P;

[0142] intE = intE + e * dt;

[0143] derE = (e - ePrev) / dt;

[0144] U = Kp * e + Ki * intE + Kd * derE;

[0145] ePrev = e;

[0146] dI = (ku * U - Ielec) / T1;

[0147] Ielec = Ielec + dI * dt;

[0148] Ngen = etaF * Ielec / (2 * F);

[0149] theta = theta0 + k1 * e + k2 * derE + Kff * (Ielec - Inom);

[0150] theta = max(0, min(1, theta)); % Clamp 0–1

[0151] Nout = Cv * theta * sqrt(2 * P / (M * R * Tem));

[0152] dPdt = R * Tem / V * (Ngen - Nout);

[0153] P = P + dPdt * dt;

[0154] Plog(k) = P;

[0155] end end.

[0156] S4. Cycle through S1-S3 to dynamically control the constant pressure inside the hydrogen generator based on the operating status of the hydrogen generator system.

[0157] Furthermore, to verify the advantages of this invention, simulation experiments were conducted using Matlab. First, the code of the standard single-candidate solution optimization algorithm was improved to generate an improved code file. Then, the algorithm parameters were initialized in the main function program, where max_iter=30, N=100, dim=3, [lb,ub]=[0.001,100]. The algorithm programs before and after the improvement were called respectively, and the individual positions obtained in each iteration were correlated with the PID parameters and passed to the constructed system simulation model program function [Plog] = hydrogen_pressure_model_var(Kp, Ki, Kd) to obtain the system's output pressure value. The error between this value and the target pressure was calculated, and the algorithm was re-optimized. The fitness value during each optimization process was saved. After the algorithm iteration was completed, the final control parameters were output, and the output response value of the control quantity was saved for visualization. Figures 2-3 As shown.

[0158] Furthermore, Figure 2 The graph compares the fitness values ​​of the improved single-candidate solution optimization algorithm and the standard single-candidate solution optimization algorithm during the optimization process. It shows that the improved algorithm reaches the vicinity of the optimum in fewer iterations when optimizing the system control parameters, and continues to develop in later local searches, ultimately obtaining a solution with a smaller fitness value at the optimum position. This indicates that the obtained control parameters have better constant-pressure control performance and smaller steady-state error for the hydrogen generator. Figure 3For the response comparison chart of the control method proposed in the application and the constant pressure control method of the hydrogen generator based on the traditional PID controller, the target value of the pressure is set to be dynamically changed, 1 bar in the first 1.5 s of simulation, 2 bar from 1.5 s to 4 s, and a disturbance term is added in the simulation process, a fixed disturbance amount is added at 1 s, and noise with a sinusoidal periodic disturbance is added during 2 s-4 s. It can be seen from the figure that compared with the constant pressure control of the hydrogen generator based on the traditional PID controller, the overshoot after reaching the target value is lower, it can quickly respond and re-adjust to the target value when subjected to sudden disturbance, and it can also achieve a relatively stable control state when facing long-term nonlinear disturbance. Therefore, it can be seen that the control method proposed in the application has better adaptability and robustness.

Claims

1. A constant pressure control method for a hydrogen generator, characterized in that, The specific steps are as follows: S1. The real-time pressure value P(t) inside the hydrogen generator is collected by a high-precision gas pressure sensor inside the electrolysis chamber of the hydrogen generator. At the same time, the real-time pressure error e(t) is calculated by comparing the set target pressure value P_ref with the real-time pressure value. S2. The real-time pressure error e(t) is input into the adaptive PID control module. The adaptive PID control module optimizes the PID controller parameters online using an improved single candidate solution optimization algorithm and outputs a control adjustment signal U(t). The algorithm improvement includes two strategies: S21. The mathematical model of the exploration phase in the single candidate solution optimization algorithm is improved by introducing an information fluctuation response exponential perturbation strategy. The strategy dynamically constructs a perturbation control factor through the fitness value change characteristics, and at the same time measures the information fluctuation characteristics in the perturbation path to generate a perturbation amplitude adjustment factor, and drives the update of the candidate solution position in an exponential mapping manner. S22. An updated mathematical model for local optimal solution stagnation in the development stage of a single candidate solution optimization algorithm is improved using a self-excited state transition strategy. The strategy is activated in the local optimal stagnation stage and realizes the state transition update of the candidate solution in an unsteady environment by constructing a dynamic response structure based on temporal behavior. The specific steps for online parameter optimization of a PID controller using an improved single candidate solution optimization algorithm are as follows: Step 1: Initialize the basic parameters of the improved single candidate solution optimization algorithm, including the population size N, the problem dimension dim, the maximum number of iterations max_iter, the upper bound of the search space ub, the lower bound lb, and initialize the population position through the basic parameters. Step 2: Construct a mapping between the improved single candidate solution optimization algorithm and the control parameters of the PID controller. Establish a connection between the update of the individual position in the search space and the change of the control parameters of the PID controller. The initial problem dimension dim=3, corresponding to the three parameters Kp, Ki, and Kd. The mapping relationship is [X1, X2, X2]=[Kp, Ki, Kd], where X1, X2, and X3 are the values ​​of the individual position vector in the three dimensions, respectively. During the iterative optimization process of the algorithm, the individual position is updated to adjust the control parameters of the PID controller and output the corresponding control quantity. By evaluating the individual position, select an optimal set of parameters as the final output. Step 3: Set the evaluation criteria for individual positions, using the fitness value of the algorithm as the evaluation criteria. At the same time, calculate the fitness value of each position in the initial population, sort them, select the optimal individual position and the optimal fitness value, and update them in real time during the subsequent optimization process. Step 4: Update the individual positions in the population using the mathematical model of the improved single candidate solution optimization algorithm, calculate the fitness value of the updated individuals, and update the ranking of fitness values ​​and the position of the optimal individual in the population. Step 5: Determine if the algorithm has reached the maximum number of iterations. If not, return to step 4 to continue the optimization. If it has, exit the optimization process and output the optimal solution. S3. A dual-channel control strategy combining electrolysis power supply control and proportional exhaust valve is used for constant pressure control. The control signal U(t) is used to control the output current of the electrolysis power supply, thereby adjusting the hydrogen yield. At the same time, the proportional exhaust valve is used to achieve advance compensation control of the gas pressure. S4. Cycle through S1-S3 to dynamically control the constant pressure inside the hydrogen generator based on the operating status of the hydrogen generator system.

2. The constant pressure control method for a hydrogen generator according to claim 1, characterized in that, The adaptive PID control module described in S2 integrates an improved single candidate solution optimization algorithm, which is used to optimize the three core parameters Kp, Ki, and Kd of the PID controller online in real time, and then outputs the control adjustment signal U(t).

3. The constant pressure control method for a hydrogen generator according to claim 2, characterized in that, The construction process of the information fluctuation response exponential perturbation strategy described in S21 includes: First, based on the change in fitness value and position offset between the current candidate solution and the candidate solution of the previous iteration, the information fluctuation rate on the unit perturbation path is extracted. At the same time, the statistical fluctuation of fitness value in a continuous historical period is combined to describe the response activity of the current search area. Then, the information fluctuation rate is input into the exponential adjustment function to generate the corresponding perturbation amplitude factor. Finally, based on the position of the current candidate solution, the above perturbation amplitude control factor is superimposed according to the random perturbation direction to form the search increment, thereby generating a new search position.

4. The constant pressure control method for a hydrogen generator according to claim 3, characterized in that, The specific construction process of the self-excited state transition strategy described in S22 is as follows: First, the response inertia of the candidate solution in the current search stage is constructed, and the current change trend is encoded based on the trajectory change ratio of several historical moments; then, the state energy density of the candidate solution is obtained, and the state energy is jointly represented by the change trend and the change acceleration. Simultaneously, a heterogeneous self-excited modulation factor is designed, which integrates the inertial term and the energy term, and introduces a phase shift to construct a periodic perturbation to generate a non-resonant driving signal. Finally, the above signal is input into the self-excited jumping module to generate a perturbation increment, thereby completing the state update of the current candidate solution.

5. The constant pressure control method for a hydrogen generator according to claim 4, characterized in that, The improved mathematical model for the single candidate solution optimization algorithm is divided into an exploration phase, an development phase, and an escape phase. The specific steps are as follows: D1. The improved single candidate solution optimization algorithm enters the exploration phase. The mathematical model of the exploration phase is improved by an information fluctuation response exponential perturbation strategy, and the position is updated. D2. The improved single candidate solution optimization algorithm enters the development stage for position updating; D3. When the position of the globally optimal individual has not been updated in m consecutive iterations, where m represents the maximum tolerance, it indicates that the improved single candidate solution optimization algorithm has fallen into a local optimum. In this case, it enters the escape phase and uses a self-excited state transition strategy to adjust the position.

6. The constant pressure control method for a hydrogen generator according to claim 5, characterized in that, The constant pressure control described in S3 employs a dual-channel control strategy combining electrolysis power supply control and a proportional exhaust valve. The electrolysis power supply control acts as a slow channel, adjusting the current to change the hydrogen production rate. The proportional exhaust valve control acts as a fast channel, directly adjusting the exhaust opening to quickly release excess gas, thereby suppressing high-frequency disturbances and providing dynamic pressure compensation. The electrolysis power supply control serves as the main control path, receiving the control quantity U(t) from the adaptive PID control module. Based on the dynamic relationship between the control quantity and the current, the current I_elec(t) is obtained. The hydrogen production rate N_gen can then be calculated from the current. ηF represents the Faraday efficiency value, and F represents the Faraday constant. The change in hydrogen production rate ultimately affects the dynamic change in gas pressure. At the same time, the pressure error e(t) obtained in S1 is extracted in parallel to obtain its rapidly changing component eH(t), which is the high-frequency component of the pressure error change. This component is input into the proportional exhaust valve channel to generate valve control quantity for valve control and pressure damping compensation.

Citation Information

Patent Citations

  • Heat supply network control loop based on fuzzy PID algorithm

    CN105588179A

  • PEM water electrolysis system and pressure rising and falling control method

    CN118272842A