Fuel cell self-learning control method for vehicle-mounted multi-core controller

By implementing parallel self-learning control strategies on vehicle-mounted multi-core controllers, the complex problems of time-variability and multi-time scale control design of fuel cell systems are solved, and precise control of fuel cell systems over a wide operating range and long life cycle is achieved.

CN119200412BActive Publication Date: 2025-03-07HEFEI UNIV OF TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411707046.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-07
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

The time-varying and multi-time scale control design of fuel cell systems is complex. It is difficult for existing single controllers to maintain control accuracy within a wide operating range. The self-learning optimization algorithm requires high computing power for on-board controllers, resulting in difficulty in real-time operation.

Method used

A parallel self-learning control strategy for vehicle-mounted multi-core controllers is proposed. By allocating tasks to each core of the multi-core processor, model optimization, controller optimization and real-time control are performed in parallel, reducing the computing burden and coordinating learning and control at multiple time scales.

Benefits of technology

It realizes precise control of fuel cell system over a wide operating range and long life cycle, reduces controller load and algorithm running time, and ensures real-time and accuracy of control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119200412B_ABST
    Figure CN119200412B_ABST
Patent Text Reader

Abstract

The present invention relates to a fuel cell self-learning control method for a vehicle-mounted multi-core controller, the method comprising: establishing a fuel cell system mechanism model based on fuel cell mechanism research, and then simplifying the model to obtain a control-oriented model of the fuel cell system; designing a controller to control the fuel cell system; using a model parameter self-learning algorithm to calculate the model parameters of the next moment; using a controller self-learning algorithm to update the controller parameters in real time; using a multi-core processor to distribute the fuel cell system self-learning control task to each core of the processor and execute it in parallel. The present invention proposes a fuel cell system parameter self-learning control method that combines real-time updates of the model and controller, improves the operating condition adaptability range of the fuel cell system, and improves the model and control accuracy of the fuel cell system; the present invention uses a multi-core controller to implement a task parallel method, which reduces the program running time and can improve the real-time performance of the control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of fuel cells, and in particular to a fuel cell self-learning control method for a vehicle-mounted multi-core controller. Background Art

[0002] As an emerging power generation technology, fuel cells have the characteristics of high energy efficiency, zero noise, and low emissions. This also determines that in today's increasingly serious energy and environmental crises, they have broad application prospects in the field of new energy vehicles. As the most widely used fuel cell in automobiles, the working principle of proton exchange membrane fuel cell (PEMFC) is to use hydrogen and oxygen as raw materials to undergo electrochemical reactions, directly converting chemical energy into electrical energy, thereby continuously generating current. The efficient and safe operation of fuel cells is inseparable from the operation of auxiliary systems, among which the fuel cell system plays an extremely important role.

[0003] Fuel cell systems are highly nonlinear and strongly coupled, involving the coordinated work of many components. Effective description and research of the structure and performance of fuel cell systems is inseparable from the accurate modeling of their internal dynamic systems. However, due to the large number of components and complex working mechanisms, the difficulty of fuel cell system modeling is greatly increased accordingly. In addition, as the fuel cell operates, the health status of the fuel cell will gradually change, causing the fuel cell system to change over time, further increasing the difficulty of fuel cell system modeling. In order to take into account both modeling difficulty and model accuracy, the variable parameter model uses a parameter iteration algorithm on the control model structure to make the model have good accuracy, which can adapt to different operating conditions and the dynamic characteristics of the fuel cell system over a long life cycle.

[0004] On the other hand, due to the constant changes in operating conditions and the existence of external disturbances, it is difficult for a single controller to maintain control accuracy within a wide range of operating conditions. It may achieve high control accuracy under certain conditions, but experience serious deviations under other conditions.

[0005] In addition, fuel cell systems often vary in days, weeks, or months, while the system's dynamic response time is on the order of hundreds of millimeters and the controller's time step is on the order of ten millimeters. How to develop a control system that adapts to system time variations while dealing with the complexity of control system design introduced by multiple time scales.

[0006] In this regard, the present invention proposes a self-learning control strategy to achieve precise control of the fuel cell system within a wide range of operating conditions and a long life cycle. However, the self-learning control strategy requires the use of self-learning optimization algorithms to optimize the model and controller in real time, but the operation of multiple optimization self-learning algorithms will greatly consume the computing power of the on-board controller, resulting in slow operation or even crash, which is not conducive to real-time operation on the on-board controller. Therefore, on the basis of proposing a self-learning control strategy, the present invention develops a parallel self-learning control strategy based on multi-core chips for on-board multi-core controllers, which reduces the multi-task computing burden while solving the problem of multi-time scale learning and control coordination by designing a multi-core optimization strategy. Summary of the invention

[0007] In view of the above-mentioned problems, the present invention proposes a fuel cell self-learning control method for a vehicle-mounted multi-core controller.

[0008] To achieve the above object, the present invention provides the following technical solutions:

[0009] A fuel cell self-learning control method for a vehicle-mounted multi-core controller, the method comprising:

[0010] S01. Establish a fuel cell system mechanism model based on the research of fuel cell mechanism, and then simplify the model based on several reasonable assumptions to obtain a control-oriented model of the fuel cell system, which is used to calculate the state variables and control targets of the fuel cell system; wherein the control targets are calculated from the state variables and model parameters, and are used to characterize the working state of the fuel cell system;

[0011] S02. Design a controller to control the fuel cell system so that it can always be in the safe and efficient optimal working state;

[0012] S03. Using the model parameter self-learning algorithm, according to the fuel cell system state variables and the true values ​​of the input variables at the same moment, the model parameters at the next moment are calculated, and the control targets and state variables at the next moment are calculated by substituting them into the model, and the control targets and state variables at the next moment are compared with the true values ​​of the state variables measured at the next moment to verify the effect of the model parameter self-learning;

[0013] S04, using the controller self-learning algorithm to update the controller parameters in real time;

[0014] S05. Use a multi-core processor to distribute the fuel cell system self-learning control tasks to each core of the processor and execute them in parallel. This can simultaneously achieve model optimization, controller optimization and real-time control of the fuel cell system, reduce the controller load, reduce the algorithm running time, and ensure the real-time and accuracy of the control.

[0015] As a further technical solution of the present invention, in step S01, when the fuel cell system is a fuel cell air system, its state variables include but are not limited to cathode pressure , Pile pressure etc. The control targets include but are not limited to the oxygen ratio etc.; so, and , The following relationship exists:

[0016] ;

[0017] in, is a constant and can be calculated from the model parameters. is the number of cells in the stack, is the stack current;

[0018] At the same time, the model is used for feedforward control of the fuel cell system to improve the control response speed and control quality. The model is reconstructed into the following form:

[0019] ;

[0020] In the formula, are parameters related to the model;

[0021] make , then there is a feedforward input:

[0022] .

[0023] As a further technical solution of the present invention, in step S02, taking the air system as an example, there is a desired excess oxygen ratio The fuel cell air system is in the best working state, and a controller is designed to track and control the oxygen excess ratio. The controller consists of three parts: feedback control law, disturbance observer and feedforward control. The feedback control law is used to track and control the expected value of the system state variable, so that the fuel cell system is in the best working state. The disturbance observer is used to estimate the disturbance during the operation of the fuel cell system and compensate it to the virtual input to enhance the robustness of the control. The feedforward control makes the controller respond faster and improves the control quality.

[0024] Feedforward control: Taking model-based feedforward as an example,

[0025] Feedback control law: Taking PI feedback control as an example, the feedback input is:

[0026] ;

[0027] Disturbance observer: Taking the extended state observer as an example, it is used to estimate the system disturbance :

[0028] ;

[0029] In the formula, Input variables for the system, is the input gain, is the observer gain, is the observed value of the system state variable;

[0030] Therefore, the overall control law of the controller is:

[0031] .

[0032] As a further technical solution of the present invention, in step S03, the model independent variable is set to , the dependent variable is , the model parameters are The existing parameter self-learning algorithms mainly include error-based self-learning and probability-based self-learning. Or probability density function is the objective function, that is, solving the optimization problem or , and get the optimal solution , which is the optimal value of the model parameters.

[0033] As a further technical solution of the present invention, the parameter self-learning algorithm adopts Bayesian estimation:

[0034] The fuel cell system model is regarded as a Gaussian noise model, and the input variables and state variables of the model are set to , the output variable is set to , the model parameters are set to , its equivalent vector expression is:

[0035] ;

[0036] is the noise of the model, with a mean of 0 and a variance of Gaussian distribution of: ;

[0037] The model parameters is regarded as a random variable that follows a Gaussian distribution, that is, , assuming that the prior probability of the model parameters and noise is known, the posterior probability is calculated according to the Bayesian formula, and then the calculated posterior probability is used as the prior probability of the next iteration, and the cycle is repeated, then the iteration formula is:

[0038] ;

[0039] ;

[0040] in, For the previous moment The covariance matrix of For this moment The covariance matrix of For the previous moment The mathematical expectation of For this moment The mathematical expectation of , that is, the optimal value of the model parameters at this moment.

[0041] As a further technical solution of the present invention, in step S04, the evaluation index is designed. ,in, The weight parameters are manually set and must meet the following requirements: ; is the error, is the overshoot, is time; construct objective function , solve the optimization problem , and the optimal solution is obtained, which is the optimal value of the controller parameters.

[0042] According to the bandwidth method, the feedback control law and disturbance observer parameters can be respectively expressed by the controller bandwidth and observer bandwidth Adjustment, that is: , , , , ; The controller parameters are .

[0043] As a further technical solution of the present invention, the controller self-learning algorithm selects the Pelican optimization algorithm;

[0044] 1) Construct the objective function , It must be a monotonically decreasing function;

[0045] 2) Initialize the position of each population member;

[0046] ;

[0047] For the The position of the first pelican, The candidate solution The value of a variable, and Respectively A lower and upper bound, represents a random vector between 0 and 1;

[0048] 3) Catch-up stage:

[0049] ;

[0050] In the formula Indicates The pelican new position in the catch-up phase; Represents a random number equal to 1 or 2; For the The location of the prey; For the The best objective function value for a pelican; For the The objective function value of a pelican is When, the Pelican will generate more displacement to enhance exploration;

[0051] In order to prevent the pelican from moving to a suboptimal area, the following judgment conditions are designed:

[0052] ;

[0053] 4) Attack phase;

[0054] ;

[0055] In the formula Indicates The new position of the pelicans in the jth dimension according to the attack phase, express The neighborhood radius of and are the current iteration and the maximum iteration respectively;

[0056] 5) Output result: The optimal population member position is the optimal value of the controller parameter.

[0057] As a further technical solution of the present invention, in step S05, the fuel cell system model and controller solution tasks in steps S01 and S02 are assigned to the first core CPU0 of the multi-core controller and executed in parallel. The execution process of the fuel cell system model and controller solution tasks in CPU0 is as follows:

[0058] The fuel cell starts to work. CPU0 performs the first cycle, sets the model and controller parameters, state variables, and initial values ​​of input variables, solves the model and controller, generates the first set of system overshoot and error data, and sends the data to the shared memory for storage, so that CPU1 and CPU2 can call and perform the next cycle.

[0059] In the loop after CPU0, a different calculation process is adopted:

[0060] The optimal values ​​of the controller parameters sent by CPU2 are read from the shared memory and substituted into the controller; the optimal values ​​of the model parameters sent by CPU1 are read from the shared memory and substituted into the model;

[0061] Based on the updated parameters, the controller calculates the control input required by the system and sends it to the actuator to control the fuel cell system. The control input is substituted into the model to calculate the new system overshoot and error, which are sent to the shared memory for CPU1 and CPU2 to read and perform the next cycle.

[0062] As a further technical solution of the present invention, in step S05, the fuel cell system model parameter self-learning task in step S03 is assigned to the second core CPU1 of the multi-core controller and executed in parallel. The execution process is as follows:

[0063] The system error sent by CPU0 is read from the shared memory. If the error is less than the threshold, the model parameters of the previous time are adopted and sent to the shared memory for CPU0 to read and perform the next cycle. If the error is greater than or equal to the threshold, the state variables and input variables of the fuel cell system at this moment measured by the sensor are read, and the model parameters are self-learned based on the read data.

[0064] The updated model parameters are sent to the shared memory for CPU0 to read and proceed to the next cycle.

[0065] As a further technical solution of the present invention, in step S05, the controller parameter self-learning task in step S04 is assigned to the third core CPU2 of the multi-core controller and executed in parallel. The execution process is as follows:

[0066] Read the system error and overshoot sent by CPU0 from the shared memory, use the weighted value of the two as the evaluation index, and set the weighting coefficient manually;

[0067] If the evaluation index is less than the threshold, the previous controller parameters are sent to the shared memory for CPU0 to read and perform the next cycle; if the evaluation index is greater than or equal to the threshold, the controller parameter self-learning is started;

[0068] The optimal values ​​of the controller parameters are sent to the shared memory for CPU0 to read and proceed to the next cycle.

[0069] Compared with the prior art, the present invention has the following beneficial effects:

[0070] The present invention proposes a fuel cell system parameter self-learning control method that combines real-time updating of models and controllers, which can eliminate the model inaccuracy and controller mismatch problems caused by operating condition changes and fuel cell aging, improve the operating condition adaptability range of the fuel cell system, and improve the model and control accuracy of the fuel cell system;

[0071] The present invention proposes a method for realizing task parallelism for a fuel cell system using a multi-core controller, which solves the problem of multi-time scale learning and control coordination, reduces the program running time, and can run in real time on a vehicle-mounted controller. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 A control block diagram of a fuel cell self-learning control method provided by an embodiment of the present invention.

[0073] Figure 2 This is an operation flow chart of the fuel cell self-learning control method provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0074] The technical solution of the present invention is further described in detail below in conjunction with specific implementation methods.

[0075] As an embodiment of the present invention, please refer to Figure 1 , a fuel cell self-learning control method for a vehicle-mounted multi-core controller, the method comprising:

[0076] S01. Establish a fuel cell system mechanism model based on the research of fuel cell mechanism, and then simplify the model based on several reasonable assumptions to obtain a control-oriented model of the fuel cell system (fuel cell system model), which is used to calculate the state variables and control targets of the fuel cell system; the control targets are calculated from the state variables and model parameters, and are used to characterize the working state of the fuel cell system;

[0077] In step S01, when the fuel cell system is a fuel cell air system, its state variables include but are not limited to cathode pressure , Pile pressure etc. The control targets include but are not limited to the oxygen ratio etc.; so, and , The following relationship exists: ;

[0078] in, is a constant and can be calculated from the model parameters. is the number of cells in the stack, is the stack current;

[0079] At the same time, the model is used for feedforward control of the fuel cell system to improve the control response speed and control quality. The model is reconstructed into the following form:

[0080] ;

[0081] In the formula, are parameters related to the model;

[0082] make , then there is a feedforward input:

[0083] .

[0084] S02. Design a controller to control the fuel cell system so that it can always be in the safe and efficient optimal working state;

[0085] In step S02, taking the air system as an example, there is a desired excess oxygen ratio The fuel cell air system is in the best working state, and a controller is designed to track and control the oxygen excess ratio. The controller consists of three parts: feedback control law, disturbance observer and feedforward control. The feedback control law is used to track and control the expected value of the system state variable, so that the fuel cell system is in the best working state. The disturbance observer is used to estimate the disturbance during the operation of the fuel cell system and compensate it to the virtual input to enhance the robustness of the control. The feedforward control makes the controller respond faster and improves the control quality.

[0086] Feedforward control: Taking model-based feedforward as an example, its principle is as described in step S01;

[0087] Feedback control law: Taking PI feedback control as an example, the feedback input is:

[0088] ;

[0089] Disturbance observer: Taking the extended state observer as an example, it is used to estimate the system disturbance :

[0090] ;

[0091] In the formula, Input variables for the system, is the input gain, is the observer gain, is the observed value of the system state variable;

[0092] Therefore, the overall control law of the controller is:

[0093] .

[0094] Since the fuel cell control-oriented model has been simplified in terms of mechanism model, it has certain model errors, which results in certain damage to the model accuracy. Secondly, during the operation of the fuel cell, the short-term operating condition changes and the long-term health status changes cause the fuel cell model parameters to change, which also reduces the model accuracy and leads to inaccurate calculation of the control target, which has a serious adverse effect on the control of the fuel cell system.

[0095] S03. To address the problem of decreased model accuracy, the present invention adopts a model parameter self-learning algorithm to calculate the model parameters at the next moment based on the fuel cell system state variables and the true values ​​of the input variables at the same moment, substitute them into the model to calculate the control target and state variables at the next moment, and compare them with the true values ​​of the state variables measured at the next moment to verify the effect of the model parameter self-learning;

[0096] In step S03, the model independent variable is set to , the dependent variable is , the model parameters are The existing parameter self-learning algorithms mainly include error-based self-learning and probability-based self-learning. Or probability density function is the objective function, that is, solving the optimization problem or , and get the optimal solution , which is the optimal value of the model parameters.

[0097] In the example described in the present invention, , , , then the model parameters are .

[0098] The parameter self-learning algorithm adopts Bayesian estimation:

[0099] The fuel cell system model is regarded as a Gaussian noise model, and the input variables and state variables of the model are set to , the output variable is set to , the model parameters are set to , its equivalent vector expression is:

[0100] ;

[0101] is the noise of the model, with a mean of 0 and a variance of Gaussian distribution of: ;

[0102] The model parameters is regarded as a random variable that follows a Gaussian distribution, that is, , assuming that the prior probability of the model parameters and noise is known, the posterior probability is calculated according to the Bayesian formula, and then the calculated posterior probability is used as the prior probability of the next iteration, and the cycle is repeated, then the iteration formula is:

[0103] ;

[0104] ;

[0105] in, For the previous moment The covariance matrix of For this moment The covariance matrix of For the previous moment The mathematical expectation of For this moment The mathematical expectation of , that is, the optimal value of the model parameters at this moment.

[0106] Large-scale changes in operating conditions may cause the fuel cell controller parameters to be incompatible: under certain operating conditions, the fuel cell controller can achieve good control accuracy; but under other operating conditions, the controller's control accuracy decreases, resulting in poor working conditions of the fuel cell system or even system crash. In addition, due to the time-varying model parameters, the controller parameters may also be incompatible.

[0107] S04. To solve the above problems, the present invention adopts a controller self-learning algorithm to update controller parameters in real time;

[0108] Controller parameter self-learning principle: design evaluation index ,in, The weight parameters are manually set and must meet the following requirements: ; is the error, is the overshoot, is time; construct objective function , solve the optimization problem , the optimal solution is obtained, which is the optimal value of the controller parameters;

[0109] According to the bandwidth method, the feedback control law and disturbance observer parameters can be respectively expressed by the controller bandwidth and observer bandwidth Adjustment, that is: , , , , ; In the example described in the present invention, the controller parameters are .

[0110] The controller self-learning algorithm selects the Pelican optimization algorithm;

[0111] 1) Construct the objective function , It must be a monotonically decreasing function;

[0112] 2) Initialize the position of each population member;

[0113] ;

[0114] For the The position of the first pelican, The candidate solution The value of a variable, and Respectively A lower and upper bound, represents a random vector between 0 and 1;

[0115] 3) Catch-up stage:

[0116] ;

[0117] In the formula Indicates The pelican new position in the catch-up phase; Represents a random number equal to 1 or 2; For the The location of the prey; For the The best objective function value for a pelican; For the The objective function value of a pelican is When, the Pelican will generate more displacement to enhance exploration;

[0118] In order to prevent the pelican from moving to a suboptimal area, the following judgment conditions are designed:

[0119] ;

[0120] 4) Attack phase;

[0121] ;

[0122] In the formula Indicates The new position of the pelicans in the jth dimension according to the attack phase, express The neighborhood radius of and are the current iteration and the maximum iteration respectively;

[0123] 5) Output result: The optimal population member position is the optimal value of the controller parameter.

[0124] S05. Since two algorithms are used to self-learn and optimize the model and controller, the above self-learning control method requires high computing power and is difficult to run in real time on the vehicle chip. Figure 2 Therefore, the present invention uses a multi-core processor to distribute the fuel cell system self-learning control tasks to each core of the processor and execute them in parallel. It can simultaneously realize model optimization, controller optimization and real-time control of the fuel cell system, reduce the load of the controller, reduce the algorithm running time, and ensure the real-time and accuracy of the control.

[0125] The present invention includes the following components: fuel cell system model and controller solution, model parameter self-learning, and controller parameter self-learning. In order to enable the above tasks to be run efficiently and safely at the same time, the present invention uses a fuel cell controller equipped with a multi-core processor to distribute the tasks of the fuel cell system to the three cores of the processor, CPU0, CPU1, and CPU2, in a parallel manner.

[0126] The fuel cell system model and controller solution tasks are assigned to the first core CPU0 of the multi-core controller and executed in parallel. The execution process of the fuel cell system model and controller solution tasks in CPU0 is as follows:

[0127] The fuel cell starts to work. CPU0 performs the first cycle, sets the model and controller parameters, state variables, and initial values ​​of input variables, solves the model and controller, generates the first set of system overshoot and error data, and sends the data to the shared memory for storage, so that CPU1 and CPU2 can call and perform the next cycle.

[0128] In the loop after CPU0, a different calculation process is adopted:

[0129] The optimal values ​​of the controller parameters sent by CPU2 are read from the shared memory and substituted into the controller; the optimal values ​​of the model parameters sent by CPU1 are read from the shared memory and substituted into the model;

[0130] Based on the updated parameters, the controller calculates the control input required by the system and sends it to the actuator to control the fuel cell system. The control input is substituted into the model to calculate the new system overshoot and error, which are sent to the shared memory for CPU1 and CPU2 to read and perform the next cycle.

[0131] This enables real-time updating of the fuel cell system model and real-time control of the fuel cell system;

[0132] Specifically, the operating steps of CPU0 are as follows:

[0133] (2.1) The fuel cell starts working;

[0134] (2.2) Determine whether the fuel cell is in the state of just starting up;

[0135] (2.3) If it is in the just-started state, preset the controller parameters, state variables, and model parameters. The preset values ​​are determined by empirical data and transferred to (2.16);

[0136] (2.4) If it is not in the just-started state, an interrupt is triggered and timing starts;

[0137] (2.5) CPU0 reads the optimal value of controller parameters from the shared memory in real time;

[0138] (2.6) If CPU2 has not updated the data, wait for CPU2 to update the data;

[0139] (2.7) If the waiting time exceeds 1ms, read the optimal value of the controller parameter at the previous moment and clear the interrupt;

[0140] (2.8) If CPU2 updates data within 1ms, the new optimal value of the controller parameter is read and the interrupt is cleared;

[0141] (2.9) End timing;

[0142] (2.10) Trigger the interrupt and start timing;

[0143] (2.11) CPU0 reads the optimal value of model parameters from the shared memory in real time;

[0144] (2.12) If CPU1 has not updated the data, wait for CPU1 to update the data;

[0145] (2.13) If the waiting time exceeds 1ms, read the optimal value of the model parameter at the previous moment and clear the interrupt;

[0146] (2.14) If CPU1 updates the data within 1ms, the new optimal value of the model parameter is read and the interrupt is cleared;

[0147] (2.15) End timing;

[0148] (2.16) The model and controller are solved to obtain the calculated values ​​of state variables and control targets;

[0149] (2.17) The control input Sent to the actuator to adjust the working state of the fuel cell system;

[0150] (2.18) Write the system overshoot and error into the shared memory;

[0151] (2.19) Trigger an interrupt and wait for CPU2 to read the shared memory data;

[0152] (2.20) If CPU2 completes reading the shared memory data, clear the interrupt;

[0153] (2.21) Enter the next loop.

[0154] The fuel cell system model parameter self-learning task is assigned to the second core CPU1 of the multi-core controller and executed in parallel.

[0155] When the operating conditions do not change much, the model may maintain a high accuracy. Similarly, when the fuel cell system is running on a short time scale, the degradation and aging of the fuel cell system is not obvious. In order to save processor resources, there is no need to continuously perform model self-learning.

[0156] Therefore, we must first determine whether the above fuel cell system model needs self-learning optimization. The judgment condition can be set as follows: the system error is greater than or equal to a threshold, which can be manually set through experimental data. If the judgment condition is not met, the model parameter self-learning will not be started, and the model will still be solved with the existing model parameters; otherwise, the model self-learning algorithm will be started.

[0157] The execution process is as follows:

[0158] The system error sent by CPU0 is read from the shared memory. If the error is less than the threshold, the model parameters of the previous time are adopted and sent to the shared memory for CPU0 to read and perform the next cycle. If the error is greater than or equal to the threshold, the state variables and input variables of the fuel cell system at this moment measured by the sensor are read, and the model parameters are self-learned based on the read data.

[0159] The updated model parameters are sent to the shared memory for CPU0 to read and proceed to the next cycle.

[0160] Specifically, the operating steps of CPU1 are as follows:

[0161] (3.1) The fuel cell starts working;

[0162] (3.2) CPU1 reads the fuel cell system state variables and actual values ​​of input variables in real time;

[0163] (3.3) Trigger the interrupt and start timing;

[0164] (3.4) CPU1 reads the system error from the shared memory in real time;

[0165] (3.5) If CPU0 has not updated the data, wait for CPU0 to update the data;

[0166] (3.6) If the waiting time exceeds 1ms, read the system error at the previous moment and clear the interrupt;

[0167] (3.7) If CPU0 updates data within 1ms, the new system error is read and the interrupt is cleared;

[0168] (3.8) End timing;

[0169] (3.9) If the system error is greater than the threshold, go to (3.10); otherwise, use the previous model parameters and go to (3.11);

[0170] (3.10) Importing the actual value data of the fuel cell system state variables and input variables into the self-learning algorithm to calculate the optimal values ​​of the fuel cell system model parameters in real time;

[0171] (3.10.1) The fuel cell system model is written in the following matrix form:

[0172] ;

[0173] is the noise of the model, with a mean of 0 and a variance of Gaussian distribution of: .

[0174] (3.10.2) Manual setting based on empirical data The mean of the prior distribution and the covariance matrix , Must be a diagonal matrix.

[0175] (3.10.3) The algorithm is trained based on the input and output data of the previous moment, and the prior covariance matrix Get the covariance matrix of the posterior distribution at this time :

[0176] .

[0177] (3.10.4) The algorithm is trained based on the input and output data of the previous moment and before, so the covariance matrix at this time , the prior covariance matrix and the prior model mean , calculate the model parameters The most likely value of :

[0178] ;

[0179] (3.11) Write the optimal values ​​of the model parameters into the shared memory;

[0180] (3.12) Trigger an interrupt and wait for CPU0 to read the shared memory data;

[0181] (3.13) If CPU0 completes reading the shared memory data, clear the interrupt;

[0182] (3.14) Enter the next loop.

[0183] The present invention distributes the controller parameter self-learning task to the third core CPU2 of the multi-core controller and executes it in parallel. The execution process is as follows:

[0184] Similar to model parameter self-learning, since a set of controller parameters may enable the controller to maintain good performance when the operating conditions remain unchanged or similar, the impact of fuel cell system degradation and aging on controller performance on a short time scale can be ignored. Therefore, it is not necessary to keep the controller parameter self-learning running continuously, and a threshold can be set to determine whether to start the controller parameter self-learning.

[0185] The execution process of the controller parameter self-learning task in CPU2 is as follows:

[0186] Read the system error and overshoot sent by CPU0 from the shared memory, use the weighted value of the two as the evaluation index, and set the weighting coefficient manually;

[0187] If the evaluation index is less than the threshold, the previous controller parameters are sent to the shared memory for CPU0 to read and perform the next cycle; if the evaluation index is greater than or equal to the threshold, the controller parameter self-learning is started;

[0188] The optimal values ​​of the controller parameters are sent to the shared memory for CPU0 to read and proceed to the next cycle.

[0189] Specifically, the operating steps of CPU2 are as follows:

[0190] (4.1) The fuel cell starts working;

[0191] (4.2) Trigger the interrupt and start timing;

[0192] (4.2) CPU2 reads the system error and overshoot in real time from the shared memory;

[0193] (4.3) If CPU0 has not updated the data, wait for CPU0 to update the data;

[0194] (4.4) If the waiting time exceeds 1ms, read the system error and overshoot at the previous moment and clear the interrupt;

[0195] (4.5) If CPU0 updates data within 1ms, the new system error and overshoot are read and the interrupt is cleared;

[0196] (4.6) End timing;

[0197] (4.7) If the evaluation index is greater than or equal to the threshold, proceed to (4.8); otherwise, use the previous controller parameters and proceed to (4.9);

[0198] (4.8) Importing the data into the controller parameter self-learning method to calculate the optimal value of the controller parameters;

[0199] (4.8.1) Design objective function F ;

[0200] (4.8.2) Initialize the position of each population member.

[0201] (4.8.3) Catch-up phase.

[0202] (4.8.4) Attack phase.

[0203] (4.8.5) Output result: The optimal population member position is output as the optimal value of the controller parameter.

[0204] (4.9) Write the optimal values ​​of controller parameters into the shared memory;

[0205] (4.10) Trigger an interrupt and wait for CPU0 to read the shared memory data;

[0206] (4.11) If CPU0 completes reading the shared memory data, clear the interrupt;

[0207] (4.12) Enter the next loop.

[0208] The feedback control law, feedforward control and disturbance observer used by the controller of the present invention are not limited to a specific method. The above control architecture implemented by other methods is also within the scope of this solution.

[0209] The model parameter self-learning algorithm used in the present invention is not limited to a specific algorithm.

[0210] The controller parameter self-learning algorithm used in the present invention is not limited to a specific algorithm.

[0211] The task allocation of the multi-core controller used in the present invention is not limited to three cores. For processors using different numbers of cores, allocating fuel cell system tasks to different cores is also within the scope of this solution.

[0212] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0213] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A fuel cell self-learning control method for a vehicle-mounted multi-core controller, characterized in that: The method comprises: S01. Establish a fuel cell system mechanism model based on the research of fuel cell mechanism, and then simplify the model based on several reasonable assumptions to obtain a control-oriented model of the fuel cell system, which is used to calculate the state variables and control targets of the fuel cell system; wherein the control targets are calculated from the state variables and model parameters, and are used to characterize the working state of the fuel cell system; S02. Design a controller to control the fuel cell system; S03. Using the model parameter self-learning algorithm, according to the fuel cell system state variables and the true values ​​of the input variables at the same moment, the model parameters at the next moment are calculated, and the control targets and state variables at the next moment are calculated by substituting them into the model, and the control targets and state variables at the next moment are compared with the true values ​​of the state variables measured at the next moment to verify the effect of the model parameter self-learning; S04, using the controller self-learning algorithm to update the controller parameters in real time; S05. Using a multi-core processor, the fuel cell system self-learning control task is distributed to each core of the processor, and executed in parallel, so as to simultaneously realize model optimization, controller optimization and real-time control of the fuel cell system; In step S05, the fuel cell system model and controller solution tasks in steps S01 and S02 are assigned to the first core CPU0 of the multi-core controller for parallel execution. The execution process of the fuel cell system model and controller solution tasks in CPU0 is as follows: The fuel cell starts to work. CPU0 performs the first cycle, sets the model and controller parameters, state variables, and initial values ​​of input variables, solves the model and controller, generates the first set of system overshoot and error data, and sends the data to the shared memory for storage, so that CPU1 and CPU2 can call and perform the next cycle. In the loop after CPU0, a different calculation process is adopted: The optimal values ​​of the controller parameters sent by CPU2 are read from the shared memory and substituted into the controller; the optimal values ​​of the model parameters sent by CPU1 are read from the shared memory and substituted into the model; Based on the updated parameters, the controller calculates the control input required by the system and sends it to the actuator to control the fuel cell system. The control input is substituted into the model to calculate the new system overshoot and error, which are sent to the shared memory for CPU1 and CPU2 to read and perform the next cycle. In step S05, the fuel cell system model parameter self-learning task in step S03 is assigned to the second core CPU1 of the multi-core controller and executed in parallel. The execution process is as follows: The system error sent by CPU0 is read from the shared memory. If the error is less than the threshold, the model parameters of the previous time are adopted and sent to the shared memory for CPU0 to read and perform the next cycle. If the error is greater than or equal to the threshold, the state variables and input variables of the fuel cell system at this moment measured by the sensor are read, and the model parameters are self-learned based on the read data. Send the updated model parameters to the shared memory for CPU0 to read and proceed to the next cycle; In step S05, the controller parameter self-learning task in step S04 is assigned to the third core CPU2 of the multi-core controller and executed in parallel. The execution process is as follows: Read the system error and overshoot sent by CPU0 from the shared memory, use the weighted value of the two as the evaluation index, and set the weighting coefficient manually; If the evaluation index is less than the threshold, the previous controller parameters are sent to the shared memory for CPU0 to read and perform the next cycle; if the evaluation index is greater than or equal to the threshold, the controller parameter self-learning is started; The optimal values ​​of the controller parameters are sent to the shared memory for CPU0 to read and proceed to the next cycle.

2. The fuel cell self-learning control method for a vehicle-mounted multi-core controller according to claim 1, characterized in that: In step S01, when the fuel cell system is a fuel cell air system, its state variables include but are not limited to cathode pressure and pile pressure , the control targets include but are not limited to the oxygen ratio ; and , The following relationship exists: in, , is a constant, is the number of cells in the stack, is the stack current; At the same time, the model is used for the feedforward control of the fuel cell system and reconstructed into the following form: ; In the formula, , , , are parameters related to the model, , They are First and second order derivatives with respect to time; make , , ,in is the expected value of the excess oxygen ratio, then there is a feedforward input : .

3. The fuel cell self-learning control method for a vehicle-mounted multi-core controller according to claim 2, characterized in that: In step S02, there is a desired excess oxygen ratio The fuel cell air system is in the best working state, and a controller is designed to track and control the oxygen excess ratio. The controller consists of three parts: feedback control law, disturbance observer and feedforward control. The feedback control law is used to track and control the expected value of the system state variable, so that the fuel cell system is in the best working state. The disturbance observer is used to estimate the disturbance during the operation of the fuel cell system and compensate it to the virtual input to enhance the robustness of the control. The feedforward control makes the controller respond faster and improves the control quality. Feedforward control: Take model-based feedforward as an example; Feedback control law: Taking PI feedback control as an example, the feedback input for: , is the controller parameter, is the difference between the model state variable and the expected value; Disturbance observer: Taking the extended state observer as an example, it is used to estimate the system disturbance : In the formula, Input variables for the system, is the input gain, , , is the observer gain, , is the observed value of the system state variable, is the system disturbance observation value, , , They are , , Derivatives with respect to time; Therefore, the overall control law of the controller is: .

4. The fuel cell self-learning control method for a vehicle-mounted multi-core controller according to claim 2, characterized in that: In step S03, the model independent variable is set to , the dependent variable is , the model parameters are ; The parameter self-learning algorithms mainly include error-based self-learning and probability-based self-learning. Or probability density function is the objective function, that is, solving the optimization problem or , and get the optimal solution , which is the optimal value of the model parameters.

5. The fuel cell self-learning control method for a vehicle-mounted multi-core controller according to claim 4, characterized in that: The model parameter self-learning algorithm adopts Bayesian estimation: The fuel cell system model is regarded as a Gaussian noise model, and the input variables and state variables of the model are set to , the output variable is set to , the model parameters are set to , its equivalent vector expression is: is the noise of the model, with a mean of 0 and a covariance of Gaussian distribution of: , 0 is the zero vector, is the identity matrix; The model parameters is regarded as a random variable that follows a Gaussian distribution, that is, , assuming that the prior probability of the model parameters and noise is known, the posterior probability is calculated according to the Bayesian formula, and then the calculated posterior probability is used as the prior probability of the next iteration, and the cycle is repeated, then the iteration formula is: in, , For this moment The covariance matrix of For the previous moment The mathematical expectation of For this moment The mathematical expectation of , that is, the optimal value of the model parameters at this moment, Represents matrix transpose.

6. The fuel cell self-learning control method for a vehicle-mounted multi-core controller according to claim 5, characterized in that: In step S04, the evaluation index is designed ,in, , The weight parameters are manually set and must meet the following requirements: >0, >0, ; is the error, is the overshoot, is time; construct objective function , solve the optimization problem , and the optimal solution is obtained, which is the optimal value of the controller parameters.

7. The fuel cell self-learning control method for a vehicle-mounted multi-core controller according to claim 6, characterized in that: The controller self-learning algorithm selects the Pelican optimization algorithm; 1) Construct the objective function , It must be a monotonically decreasing function; 2) Initialize the position of each population member; ; For the The position of the first pelican, The candidate solution The value of a variable, and Respectively A lower and upper bound, represents a random vector between 0 and 1; 3) Catch-up stage: In the formula Indicates The pelican new position in the catch-up phase; Represents a random number equal to 1 or 2; For the The location of the prey; For the The best objective function value for a pelican; For the The objective function value of a pelican is When, the Pelican will generate more displacement to enhance exploration; In order to prevent the pelican from moving to a suboptimal area, the following judgment conditions are designed: 4) Attack phase; ; In the formula Indicates The new position of the pelicans in the jth dimension according to the attack phase, express The neighborhood radius of and are the current iteration and the maximum iteration respectively; 5) Output result: The optimal population member position is the optimal value of the controller parameter.

Citation Information

Patent Citations

  • Neural network prediction control method for fuel cell oxygen surplus coefficient

    CN107728478A

  • Control method for predicting air supply system model of fuel cell

    CN109524693A

  • Fuel cell thermal management system optimization control method based on multi-core chip

    CN117638168A

  • Control-oriented fuel cell air system mechanism-data modeling method

    CN117832546A