Temperature control method, system and equipment of cogeneration system and medium

By establishing the system model and state space equation of the combined heat and power supply system, the cost function of the linear quadratic regulator is constructed, and the problems of low adjustment accuracy and large overshoot when controlling the temperature of PID is solved, achieving more efficient temperature control.

CN120122749APending Publication Date: 2025-06-10XI AN JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510313054.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

When the combined heat and power supply system uses PID to control the temperature, the adjustment accuracy is low and the overshoot is large, making it difficult to effectively control the temperature of PEMFC.

Method used

Establish a system model of the combined heat and power supply system, construct a state space equation, obtain the control effect amount and state variables by applying different current disturbances, construct the cost function of the linear quadratic regulator, and minimize the cost function value for temperature control.

Benefits of technology

By combining system model information, considering the mutual influence between different state variables, the accuracy and efficiency of temperature control are improved, and the overshoot and adjustment time are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120122749A_ABST
    Figure CN120122749A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of fuel cells, and discloses a temperature control method, system and equipment of a combined heat and power system and a medium. The method comprises the following steps: establishing a system model of the combined heat and power system; according to the system model, establishing a state-space equation of the cogeneration system; according to the state-space equation, different current disturbances are applied to the combined heat and power system, and under the different current disturbances, the control action quantity enabling the combined heat and power system to reach a balance working point and the state variable of the combined heat and power system at the balance working point are obtained; constructing a cost function of a linear quadratic regulator by combining a control action quantity for enabling the cogeneration system to reach a balanced working point under different current disturbances and a state variable at the balanced working point; with the minimum value of the cost function as the target, the linear quadratic regulator is adopted to carry out temperature control on the combined heat and power system, and the temperature control effect of the combined heat and power system can be effectively improved.
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 particularly relates to a temperature control method, system, device and medium for a combined heat and power supply system. Background Art

[0002] The proton exchange membrane fuel cell (PEMFC) combined heat and power supply technology is a research direction with broad application prospects. Under normal operating conditions, the power generation efficiency of PEMFC is 40% - 60%, which means that about 50% of the chemical energy in the hydrogen participating in the electrochemical reaction is converted into heat energy. If this part of the heat energy cannot be reasonably and effectively utilized, the energy utilization efficiency of the entire system will be greatly reduced. Therefore, on the premise of ensuring normal power generation, it is necessary to recover and utilize the heat generated during the operation of PEMFC. Such a system that generates electricity and supplies heat simultaneously through PEMFC is a combined heat and power supply system.

[0003] The optimal operating temperature of PEMFC is relatively low, usually between 60 and 80 °C. Excessive temperature will cause the exchange membrane of PEMFC to dehydrate and crack, while too low temperature will seriously affect the reaction kinetics. Therefore, it is necessary to transfer the heat generated during the operation of PEMFC in a timely manner, and maintain the operation of the system at an efficient temperature by controlling the appropriate operating temperature.

[0004] Currently, in the field of PEMFC temperature control research, proportional-integral-derivative (PID) control is often used. However, PID belongs to model-free control and cannot reasonably apply the information of the combined heat and power supply system model, ignoring the connection between different state variables. For a strongly coupled and strongly nonlinear system such as PEMFC combined heat and power supply, PID control of temperature is prone to problems such as low adjustment accuracy and large overshoot. Summary of the Invention

[0005] The purpose of the present invention is to provide a temperature control method, system, device and medium for a combined heat and power supply system, which can solve the technical problems of low adjustment accuracy and large overshoot when the combined heat and power supply system controls temperature through PID.

[0006] To solve the above technical problems, an embodiment of the present invention provides a temperature control method for a combined heat and power supply system, including the following steps: Establish a system model of the combined heat and power supply system; Establish a state space equation of the combined heat and power supply system according to the system model; According to the state - space equation, different current disturbances are applied to the combined heat and power system, and the control action that enables the combined heat and power system to reach the equilibrium operating point and the state variables of the combined heat and power system at the equilibrium operating point are obtained under different current disturbances; Combining the control action that enables the combined heat and power system to reach the equilibrium operating point under different current disturbances and the state variables of the combined heat and power system at the equilibrium operating point, a cost function of the linear - quadratic regulator is constructed; With the goal of minimizing the value of the cost function, the linear - quadratic regulator is used to control the temperature of the combined heat and power system.

[0007] Optionally, the cost function of the linear - quadratic regulator is: In the formula, \(Q\) is the weight matrix of the control effect, \(R\) is the weight matrix of the control cost, is the value of the state variable deviating from the equilibrium operating point, is the value of the control action deviating from the equilibrium operating point.

[0008] Optionally, the use of the linear - quadratic regulator to control the temperature of the combined heat and power system includes: Controlling the coolant flow rate of the combined heat and power system through the linear - quadratic regulator to control the coolant outlet temperature of the combined heat and power system; Controlling the cooling water flow rate of the combined heat and power system through the linear - quadratic regulator to control the coolant inlet temperature of the combined heat and power system.

[0009] Optionally, the use of the linear - quadratic regulator to control the temperature of the combined heat and power system with the goal of minimizing the value of the cost function includes: According to the control action that enables the combined heat and power system to reach the equilibrium operating point under different current disturbances, a control - action matrix is constructed, and according to the state variables of the combined heat and power system at the equilibrium operating point under different current disturbances, a state - variable matrix is constructed; According to the state variables corresponding to the coolant flow rate and the cooling water flow rate in the state - space equation, the weight matrix of the control effect and the weight matrix of the control cost in the cost function are determined; Combining the control - action matrix, the state - variable matrix, the weight matrix of the control effect, and the weight matrix of the control cost, the feedback - gain matrix of the linear - quadratic regulator is obtained through the Riccati equation; When using the linear - quadratic regulator to control the temperature of the combined heat and power system, by adjusting the feedback - gain matrix, the value of the cost function is minimized.

[0010] Optionally, the construction of the cost function of the linear - quadratic regulator includes: Based on the particle swarm optimization algorithm, with the goal of minimizing the fitness function of the particle swarm optimization algorithm, the weight matrix of the control effect and the weight matrix of the control cost are updated; Among them, the fitness function is: In the formula, is the integral of the absolute error of the coolant outlet temperature, is the integral of the absolute error of the coolant inlet temperature, and a1 and a2 are preset weight coefficients; and are both obtained through the following formula: In the formula, is the integral of the absolute error of the coolant outlet temperature or the integral of the absolute error of the coolant inlet temperature, is the error of the coolant inlet temperature or the error of the coolant outlet temperature.

[0011] Optionally, establishing the system model of the combined heat and power system includes: Establishing a fuel cell stack model as follows: In the formula, is the output voltage, is the Nernst voltage, is the activation loss, is the ohmic loss, is the resistivity, is the concentration loss, is the activation loss coefficient, is the open-circuit current, is the external circuit resistance, is the water content of the exchange membrane, is the translational entropy, is the number of electrons transferred in the reaction, is the Faraday constant, is the standard temperature, is the gas constant, is the fuel cell temperature, is the hydrogen partial pressure, is the oxygen partial pressure, is the partial pressure of water vapor, is the oxygen concentration, is the working current, is the total current, is the reaction active area, is the total internal resistance, is the ohmic internal resistance, is the contact internal resistance, is the concentration loss coefficient, J is the current density, is the limiting current density; A thermal analysis model of the battery stack is established as follows: Wherein, is the mass of the battery stack, is the specific heat capacity of the battery stack, is the coolant outlet temperature of the battery stack, is the heat generation of the battery stack, is the heat taken away by the coolant; Wherein, is the total energy of the fuel, is the energy taken away by the gas entering and leaving the battery stack, is the heat radiation dissipation of the battery stack, is the power of the battery stack; Wherein, is the coolant flow rate, is the specific heat capacity of the coolant, is the coolant inlet temperature of the battery stack; A water storage tank model is established as follows: Wherein, is the mass of the coolant in the water tank, is the coolant outlet temperature of the water tank; A heat exchanger model is established as follows: Wherein, is the mass of the coolant in the heat exchanger, is the heat exchanged between cold and hot water; Wherein, is the mass of the cooling water in the heat exchanger, is the specific heat capacity of the cooling water, is the cooling water flow rate, is the temperature of the cooling water entering the heat exchanger, is the temperature of the cooling water leaving the heat exchanger; In the formula, is the surface heat transfer coefficient of the heat exchanger, is the heat transfer area; A hot water storage tank model is established as follows: In the formula, is the mass of the cooling water in the hot water storage tank, is the heat consumption.

[0012] Optionally, the establishment of the state space equation of the combined heat and power system includes: Establish a non-linear state space equation of the combined heat and power system as follows: In the formula, , is the state variable, is , is , is , is , is , is the control action, is , is ; Linearize the non-linear state space equation at the equilibrium operating point of the combined heat and power system as follows: A and B are as follows: ; ; In the formula, A is the state matrix and B is the input matrix, is the value of the state variable deviating from the equilibrium operating point, is the value of the state variable at the equilibrium operating point, is the value of the control action deviating from the equilibrium operating point, is the value of the control action at the equilibrium operating point.

[0013] An embodiment of the present invention also provides a temperature control system for a combined heat and power system, including: A model establishment module for establishing a system model of the combined heat and power system; An equation establishment module for establishing a state space equation of the combined heat and power system according to the system model; A variable acquisition module, configured to apply different current disturbances to the combined heat and power system according to the state - space equation, and acquire the control action quantity that enables the combined heat and power system to reach the equilibrium operating point and the state variables of the combined heat and power system at the equilibrium operating point under different current disturbances; A function construction module, configured to construct a cost function of a linear - quadratic regulator by combining the control action quantity that enables the combined heat and power system to reach the equilibrium operating point under different current disturbances and the state variables of the combined heat and power system at the equilibrium operating point; A temperature control module, configured to perform temperature control on the combined heat and power system by using a linear - quadratic regulator with the goal of minimizing the value of the cost function.

[0014] An embodiment of the present invention further provides a computer device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, instructions executable by the at least one processor are stored in the memory, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the temperature control method of the above - mentioned combined heat and power system.

[0015] An embodiment of the present invention further provides a computer - readable storage medium, storing a computer program, and when the computer program is executed by a processor, the temperature control method of the above - mentioned combined heat and power system is implemented.

[0016] The temperature control method of the combined heat and power system provided by the present invention has at least the following beneficial effects: After establishing the system model of the combined heat and power system, through the state - space equation of the combined heat and power system, determine the control action quantity that enables the combined heat and power system to reach the equilibrium operating point and the state variables of the combined heat and power system at the equilibrium operating point under different current disturbances, then construct a cost function of a linear - quadratic regulator based on this, and finally use this cost function to perform temperature control on the combined heat and power system.

[0017] Therefore, the controller (linear - quadratic regulator) for temperature control in the present invention combines the model information of the state - space equation of the combined heat and power system (i.e., the control action quantity that enables the combined heat and power system to reach the equilibrium operating point and the state variables of the combined heat and power system at the equilibrium operating point under different current disturbances), considers the mutual influence between different state variables, and using this controller to perform temperature control on the combined heat and power system can improve the temperature control effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings, and these exemplary illustrations do not constitute a limitation on the embodiments.

[0019] Figure 1It is a flowchart of a temperature control method for a combined heat and power supply system according to an embodiment of the present invention; Figure 2 It is a schematic structural diagram of a combined heat and power supply system according to an embodiment of the present invention; Figure 3 It is a schematic diagram of a PID control strategy according to an embodiment of the present invention; Figure 4 It is a schematic diagram of an LQR control strategy according to an embodiment of the present invention; Figure 5 It is a comparative schematic diagram of the control effects of PID and LQR on the inlet coolant temperature according to an embodiment of the present invention; Figure 6 It is a comparative schematic diagram of the control effects of PID and LQR on the outlet coolant temperature according to an embodiment of the present invention; Figure 7 It is a schematic diagram of a PSO iteration curve according to an embodiment of the present invention Figure 1 ; Figure 8 It is a schematic diagram of a PSO iteration curve according to an embodiment of the present invention Figure 2 ; Figure 9 It is a schematic diagram of the change situation of Q matrix elements according to an embodiment of the present invention; Figure 10 It is a schematic diagram of the change situation of R matrix elements according to an embodiment of the present invention. Detailed implementation manners

[0020] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those of ordinary skill in the art can understand that in the embodiments of the present invention, many technical details are provided for readers to better understand the present invention. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions required to be protected by the present invention can still be implemented. The division of the following embodiments is for convenience of description and should not constitute any limitation to the specific implementation manner of the present invention. The various embodiments can be combined and cross-referenced with each other on the premise of not conflicting with each other.

[0021] An embodiment of the present invention relates to a temperature control method for a combined heat and power supply system. The specific process of the temperature control method for the combined heat and power supply system in this embodiment can be as Figure 1 shown and includes: Step 101, establish a system model of the combined heat and power supply system.

[0022] Step 102: Establish the state - space equation of the combined heat and power (CHP) system according to the system model.

[0023] Step 103: Apply different current disturbances to the CHP system according to the state - space equation, and obtain the control action quantity that enables the CHP system to reach the equilibrium operating point and the state variables of the CHP system at the equilibrium operating point under different current disturbances.

[0024] Step 104: Combine the control action quantity that enables the CHP system to reach the equilibrium operating point under different current disturbances and the state variables of the CHP system at the equilibrium operating point to construct the cost function of the linear - quadratic regulator.

[0025] Step 105: Take the minimum value of the cost function as the goal, and use the linear - quadratic regulator to control the temperature of the CHP system.

[0026] In this embodiment, the controller for temperature control - the linear - quadratic regulator combines the model information of the state - space equation of the CHP system (that is, the control action quantity that enables the CHP system to reach the equilibrium operating point under different current disturbances and the state variables of the CHP system at the equilibrium operating point), considers the mutual influence between different state variables. Using this controller to control the temperature of the CHP system can improve the temperature control effect.

[0027] The following details the implementation of the temperature control method for the CHP system in this embodiment. The following content is only the implementation details provided for easy understanding and is not necessary for implementing this solution.

[0028] In step 101, based on the physical characteristics of the fuel cell stack, heat exchanger, and water tank in the CHP system, establish the system model of the CHP system on the Matlab / Simulink simulation platform.

[0029] Specifically, the structure diagram of the CHP system is as Figure 2 shown. The coolant flowing out of the fuel cell stack of the CHP system first passes through the water storage tank, then flows through the heat exchanger for heat exchange and heat release, and finally flows back into the fuel cell stack of the CHP system, circulating reciprocally under the action of pump 1. The cooling water flowing out of the hot water storage tank absorbs heat through the heat exchanger and then flows back into the hot water storage tank for heat release, circulating reciprocally under the action of pump 2, realizing the transfer of heat generated by the fuel cell stack to the hot water storage tank. It can be seen that the CHP system is mainly composed of a fuel cell stack, a heat exchanger, and a water tank. The following models its main components:

[0030] The PEMFC fuel cell stack model is often built using semi - empirical equations: Wherein, is the output voltage, is the Nernst voltage, is the activation loss, is the ohmic loss, is the resistivity, is the concentration loss, is the activation loss coefficient, is the open-circuit current, is the external circuit resistance, is the water content of the exchange membrane, is the translational entropy, is the number of electrons transferred in the reaction, is the Faraday constant, is the standard temperature, is the gas constant, is the battery temperature, is the partial pressure of hydrogen, is the partial pressure of oxygen, is the partial pressure of water vapor, is the oxygen concentration, is the working current, is the total current, is the reaction active area, is the total internal resistance, is the ohmic internal resistance, is the contact internal resistance, is the concentration loss coefficient, J is the current density, is the limiting current density.

[0031] The thermal analysis model of the battery stack is constructed by energy conservation and is mainly used to reflect the temperature change of the battery stack: Wherein, is the mass of the battery stack, is the specific heat capacity of the battery stack, is the outlet coolant temperature of the battery stack, is the heat generation of the battery stack, is the heat taken away by the coolant; Wherein, is the total energy of the fuel, is the energy taken away by the gas entering and leaving the battery stack, is the heat radiation loss of the battery stack, is the power of the battery stack; In the formula, is the coolant flow rate, is the specific heat capacity of the coolant, is the inlet coolant temperature of the battery stack.

[0032] The water storage tank model is constructed by the following equation: In the formula, is the mass of the coolant in the water tank, is the outlet coolant temperature of the water tank.

[0033] The heat exchanger model is constructed by the following equation, which is divided into the hot water side and the cold water side. The hot water side is the coolant after cooling the battery stack, and the cold water side is the cooling water flowing into the hot water storage tank: Hot water side: In the formula, is the mass of the coolant in the heat exchanger, is the heat exchanged between the cold and hot water; Cold water side: In the formula, is the mass of the cooling water in the heat exchanger, is the specific heat capacity of the cooling water, is the cooling water flow rate, is the temperature of the cooling water entering the heat exchanger, is the temperature of the cooling water leaving the heat exchanger; In the formula, is the surface heat transfer coefficient of the heat exchanger, is the heat transfer area.

[0034] Hot water storage tank model: In the formula, is the mass of the cooling water in the hot water storage tank, is the heat used.

[0035] In the combined heat and power supply system, it is necessary to control both the outlet temperature and the inlet temperature of the coolant. Generally speaking, the coolant will exchange heat with the battery stack sufficiently. Therefore, controlling the outlet temperature of the coolant is equivalent to controlling the temperature of the battery stack. At the same time, controlling the inlet temperature of the coolant is to ensure the uniformity of the internal temperature distribution of the battery stack, reduce the thermal stress caused by the temperature difference, and thus extend the service life of the PEMFC battery stack.

[0036] It can be continued to refer to Figure 2 , the coolant inlet temperature is controlled by adjusting the cooling water flow rate of the thermal storage water tank by the water pump 2, and the coolant outlet temperature is controlled by adjusting the coolant flow rate of the water storage tank by the water pump 1. In actual engineering, due to its high stability, simple structure, and easy implementation and maintenance, PID is widely used in industrial control. Therefore, traditional technologies generally use PID to achieve temperature control of the combined heat and power supply system. Since the PID controller belongs to a single-input single-output (SISO) controller, one PID controller can only control one controlled variable. As Figure 3 shown, two independent PIDs can be used to separately adjust the coolant flow rate and the cooling water flow rate to control the coolant outlet temperature and inlet temperature.

[0037] PID is a controller that calculates the control action based on the error: In the formula, is the proportional coefficient, is the integral coefficient, is the differential coefficient, is the control action, is the error between the given value and the actual value.

[0038] In the combined heat and power supply system, for the PID controller that adjusts the coolant flow rate, is the coolant flow rate, is the difference between the given value and the actual value of the outlet coolant temperature; for the PID controller that adjusts the cooling water flow rate, is the cooling water flow rate, is the difference between the given value and the actual value of the inlet coolant temperature.

[0039] The PID controller coefficients in Table 1 can be adopted: Table 1 However, the PID controller only generates the control action based on the error and does not make full use of the model information. Therefore, it is difficult to achieve a good control effect, and problems such as large overshoot and long adjustment time often occur.

[0040] To overcome the inherent defects of the PID controller, in this embodiment, a Linear Quadratic Regulator (LQR) controller designed based on model information is specifically adopted to achieve the temperature control of the combined heat and power system. The LQR controller adopts the same temperature control strategy as the PID controller, that is, by adjusting the coolant flow rate to control the coolant outlet temperature, and by adjusting the cooling water flow rate to control the coolant inlet temperature. Different from the PID single-input single-output (SISO) controller, the LQR controller belongs to a multi-input multi-output controller and can control multiple controlled variables simultaneously. As Figure 4 shown, in the combined heat and power system, the LQR controller can adjust the coolant flow rate and the cooling water flow rate simultaneously to control the coolant outlet temperature and its inlet temperature simultaneously.

[0041] The goal of the LQR controller is to minimize the weighted quadratic cost function of the system state and the control input. The cost function defined based on the error state space equation can be expressed as: In the formula, Q and R are positive definite symmetric weight matrices, which are used to represent the weights of the system state and the control input respectively, reflecting the degree of emphasis on the system state and the control input; is the value of the state variable deviating from the equilibrium operating point, is the value of the control action deviating from the equilibrium operating point. Among them, the increase of the elements of the matrix Q means that the error can quickly approach 0; the increase of the elements of the R matrix means that it is desired that the control input can be as small as possible, but the error decay will slow down.

[0042] The key to the design of the LQR controller is to design the state feedback control law to achieve the goal of minimizing the cost function . Among them, the feedback gain matrix is obtained by solving the Riccati equation:

[0043] In the formula, x is the state variable, M is the system matrix of the state space, N is the output matrix of the state space, P is the solution of the Riccati equation, and K is the feedback gain matrix.

[0044] Based on this theory, the design process of the LQR controller in this embodiment will be specifically described: First, in step 102, according to the equations of the components of the combined heat and power system, its nonlinear state space expression (i.e., the nonlinear state space equation) is sorted out as follows: In the formula, is the state variable, For , For , For , For , For , is the control action quantity, For , For .

[0045] It can be seen that the combined heat and power system has 5 state variables, and they are coupled with each other. If only a PID controller is used, the relationship between the state variables cannot be considered. However, the design of the LQR controller is based on the state space equation, so this model information can be utilized.

[0046] Since the LQR controller is a linear controller and can only handle linear state space equations, it is necessary to linearize the above nonlinear state space expression at the equilibrium operating point as follows: The linearized matrices A and B are as follows: ; .

[0047] In the formula, A is the state matrix, B is the input matrix, is the value by which the state variable deviates from the equilibrium operating point, is the value of the state variable at the equilibrium operating point, is the value by which the control action quantity deviates from the equilibrium operating point, is the value of the control action quantity at the equilibrium operating point.

[0048] Then, a total of 4 current disturbances are applied to the combined heat and power system in step 103, which are 100A, 150A, 300A, and 200A in sequence. Therefore, the state variables and the control action quantity are calculated for the corresponding equilibrium operating points of the currents, as shown in Table 2: Table 2 Next, in step 104, the matrices A and B at different equilibrium points are calculated from the above table data, and the cost function E of the LQR controller is constructed, so as to use the LQR controller to control the temperature of the combined heat and power system with the goal of minimizing the value of the cost function in step 105.

[0049] Specifically, according to the control action quantity that enables the combined heat and power supply system to reach the equilibrium operating point under different current disturbances, a control action quantity matrix is constructed, and according to the state variables of the combined heat and power supply system at the equilibrium operating point under different current disturbances, a state variable matrix is constructed; according to the state variables corresponding to the coolant flow rate and the cooling water flow rate in the state space equation, the weight matrix of the control effect and the weight matrix of the control cost in the cost function are determined; combining the control action quantity matrix, the state variable matrix, the weight matrix of the control effect, and the weight matrix of the control cost, through the Riccati equation, the feedback gain matrix of the linear quadratic regulator is obtained; when using the linear quadratic regulator to control the temperature of the combined heat and power supply system, by adjusting the feedback gain matrix, the value of the cost function is minimized.

[0050] Among them, the cost function of the LQR controller constructed in this embodiment is as follows: In the formula, Q is the weight matrix of the control effect, and R is the weight matrix of the control cost (used to represent the weights of the above system state and control input), is the value of the state variable deviating from the equilibrium operating point, is the value of the control action quantity deviating from the equilibrium operating point.

[0051] Since in this embodiment, the controlled quantities are only the coolant outlet and its inlet temperature, corresponding to the state variables and , therefore, in the Q matrix, the weights of and should be increased.

[0052] The weight matrices Q and R adopted in this embodiment are as follows: After obtaining the matrices M, N, Q, and R, the corresponding feedback gain matrix K can be calculated according to the Riccati equation to achieve LQR optimal control, that is, to minimize the cost function E: After obtaining the feedback gain matrix K, state feedback control can be achieved: By comparing the effects of using the PID controller to control the temperature of the combined heat and power supply system and using the LQR controller of this embodiment to control the temperature of the combined heat and power supply system, such as Figure 5 and Figure 6As shown, the LQR controller is far superior to the PID controller in both the coolant inlet and outlet temperature control effects. The overshoot is significantly reduced, and the adjustment time is significantly shortened, demonstrating the superiority of the advanced controller designed based on model information.

[0053] In some embodiments, by optimizing the weight matrices Q and R of the cost function of the LQR controller in the above embodiments, the temperature control effect of the combined heat and power system can be further improved. The following specifically describes the specific implementation plan for optimizing the weight matrices Q and R in this embodiment:

[0054] It can be seen from the above cost function E that the weight matrices Q and R reflect the emphasis on control effect and control cost. An increase in the elements of matrix Q means that the error can quickly approach 0; an increase in the elements of matrix R means that it is desired that the control input be as small as possible, but the error decay will slow down. To further improve the temperature control effect, this embodiment uses the Particle Swarm Optimization (PSO) algorithm to further optimize the weight matrices Q and R of the cost function of the LQR controller. Since the combined heat and power system after combining with the LQR controller is very complex, it is difficult to theoretically analyze the exact relationship between the element values of the weight matrices Q and R and the control effect. Therefore, this embodiment uses the PSO, a stochastic optimization algorithm, to approximate the optimal temperature control effect through the iterative evolution of the algorithm.

[0055] The PSO optimization algorithm is derived from the regularity of bird group activities and then uses swarm intelligence to establish a simplified model. It simulates the foraging behavior of birds, compares the search space for solving problems to the flight space of birds, and abstracts each bird into a particle without mass and volume to represent a possible solution to the problem. The process of finding the optimal solution to the problem is regarded as the process of birds finding food, and then complex optimization problems are solved. Like other evolutionary algorithms, the PSO optimization algorithm is also based on the concepts of "population" and "evolution", and realizes the search for the optimal solution in complex spaces through the cooperation and competition among individuals.

[0056] Specifically, the velocity update formula and position update formula of PSO are used to update the state of each particle. First is the velocity update formula:

[0057] In the formula, is the velocity of particle i at time t, is the inertia weight, which controls the degree of maintaining the particle velocity, and are acceleration constants, which control the pulling force of the particle towards the individual and group optimal solutions, and are random numbers between [0, 1], is the best position of the particle itself, is the global best position.

[0058] Then there is the position update formula: In the formula, is the position of the particle at time t, and the updated position is the current position plus the velocity.

[0059] In order to optimize both the coolant inlet temperature and the outlet temperature simultaneously, the fitness function of PSO is constructed as: In the formula, represents the integral of the absolute error of the coolant outlet temperature, represents the integral of the absolute error of the coolant inlet temperature, and a1 and a2 represent weights.

[0060] In this embodiment, and are both obtained through the following formula: In the formula, is the integral of the absolute error of the coolant outlet temperature or the integral of the absolute error of the coolant inlet temperature, is the error of the coolant inlet temperature or the error of the coolant outlet temperature.

[0061] The temperature control effect can be quantitatively measured by IAE, where the smaller the IAE, the better the control effect. Since the fitness function contains 2 IAE, the values of a1 and a2 need to be selected according to the design.

[0062] At the same time, in this embodiment, in order to prevent the control effect of one of the coolant temperatures from increasing significantly while causing the control effect of the other coolant temperature to decrease, a penalty term is introduced into the fitness function: In the formula, = 90.45, = 44.84, representing the control effects of the cooling water outlet temperature and the inlet temperature obtained by the LQR controller before optimization. That is, if the control effect of a certain temperature is worse than before optimization, the penalty term will cause a sharp increase in the fitness function.

[0063] Select the weight coefficients of the fitness function: a1 = 1, a2 = 1. The iteration curve of the PSO algorithm is as Figure 7 shown. It can be seen that the fitness function drops significantly and converges at about 70 times. The optimized control effect is shown in Table 3:

[0064] Table 3 It can be seen that by adopting the above weight coefficients, the control effect of the coolant inlet temperature has been improved to a certain extent, but the control effect of the coolant outlet temperature has hardly changed. Since in the combined heat and power supply system, the coolant outlet temperature represents the temperature of the battery stack, which is more important than the control of the coolant inlet temperature, a greater weight needs to be assigned to it.

[0065] Select the weight coefficients of the fitness function: a1 = 2, a2 = 1. The iteration curve of the PSO algorithm is as Figure 8 shown. It can be seen that the fitness function drops significantly and converges at around 80 times. The optimized control effect is shown in Table 4:

[0066] Table 4 It can be seen that by adopting the above weight coefficients, the control effect of the coolant outlet temperature has been improved to a certain extent, but the control effect of the coolant inlet temperature has hardly changed. And improving the control effect of the coolant outlet temperature is exactly what this embodiment requires. Therefore, it is considered that the selection of this set of weight coefficients is reasonable and the optimization effect meets the expectations. Figure 9 and Figure 10 show the changes in the elements of the weight matrices Q and R during the optimization process. Combining with Figure 8 the iteration curve of the fitness function shown, it shows that different values of the weight matrices Q and R will indeed affect the final control effect. It is necessary to select appropriate values to achieve the design expectations. For this reason, this embodiment provides a solution method for selecting the weight matrix by using the PSO optimization algorithm.

[0067] Based on the above embodiments, the temperature control method of the combined heat and power supply system of the present invention has at least the following beneficial technical effects: (1) Provide a method for controlling a nonlinear system by using an LQR controller: linearize the combined heat and power supply system at each equilibrium operating point to obtain a linear state space equation, and design an LQR controller according to this model information. Since the controller combines the model information and can consider the mutual influence between different state variables, it has a very prominent temperature control effect.

[0068] (2) Provide a method for optimizing the weight matrix of the LQR cost function by using the PSO algorithm: The final control effect of LQR control is closely related to the values of the weight matrices Q and R of its cost function. However, the combined heat and power supply system after combining the LQR controller is very complex, and it is difficult to accurately analyze the influence of the values of Q and R on the final temperature control effect. Therefore, using the PSO random optimization algorithm is an effective solution method.

[0069] In summary, the present invention combines advanced control and optimization algorithms, improves the control accuracy compared with traditional controllers, and has advantages such as small overshoot and fast adjustment time, providing a solution for controlling complex nonlinear systems such as cogeneration systems.

[0070] The step division of the above various methods is only for clear description. When implemented, they can be combined into one step or some steps can be split into multiple steps. As long as the same logical relationship is included, they are all within the protection scope of the present invention; adding insignificant modifications or introducing insignificant designs to the algorithm or process, but not changing the core design of its algorithm and process are all within the protection scope of the invention.

[0071] Another embodiment of the present invention relates to a temperature control system for a cogeneration system. The implementation details of the temperature control system for the cogeneration system in this embodiment will be specifically described below. The following content is only the implementation details provided for convenient understanding and is not necessary for implementing this solution. The temperature control system for the cogeneration system in this embodiment includes: A model establishment module for establishing a system model of the cogeneration system; An equation establishment module for establishing a state space equation of the cogeneration system according to the system model; A variable acquisition module for applying different current disturbances to the cogeneration system according to the state space equation, and acquiring the control action amount that makes the cogeneration system reach the equilibrium operating point and the state variables of the cogeneration system at the equilibrium operating point under different current disturbances; A function construction module for constructing a cost function of a linear quadratic regulator by combining the control action amount that makes the cogeneration system reach the equilibrium operating point and the state variables of the cogeneration system at the equilibrium operating point under different current disturbances; A temperature control module for performing temperature control on the cogeneration system using a linear quadratic regulator with the goal of minimizing the value of the cost function.

[0072] It is not difficult to find that this embodiment is a system embodiment corresponding to the above method embodiment, and this embodiment can be implemented in cooperation with the above method embodiment. The relevant technical details and technical effects mentioned in the above embodiment are still valid in this embodiment. To avoid repetition, they will not be elaborated here. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied to the above embodiment.

[0073] It is worth mentioning that each module involved in this embodiment is a logical module. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or implemented as a combination of multiple physical units. In addition, to highlight the innovative part of the present invention, units that are not closely related to solving the technical problems proposed by the present invention are not introduced in this embodiment, but this does not mean that there are no other units in this embodiment.

[0074] Another embodiment of the present invention relates to a computer device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the temperature control method of the cogeneration system in the above embodiments.

[0075] Among them, the memory and the processor are connected by a bus. The bus can include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art, so they will not be further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be an element or multiple elements, such as multiple receivers and transmitters, and provides a unit for communicating with various other devices on the transmission medium. The data processed by the processor is transmitted on the wireless medium through the antenna. Further, the antenna also receives data and transmits the data to the processor.

[0076] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. The memory can be used to store the data used by the processor when executing operations.

[0077] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the above method embodiments are implemented.

[0078] That is, those skilled in the art can understand that all or part of the steps in the methods of the above embodiments can be completed by instructing relevant hardware through a program. The program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.

[0079] Those of ordinary skill in the art can understand that the above embodiments are specific embodiments for implementing the present invention, and in actual applications, various changes can be made to them in form and details without departing from the spirit and scope of the present invention.

Claims

1. A temperature control method for a combined heat and power system, characterized in that: include: Establish a system model for the combined heat and power system; According to the system model, the state space equation of the cogeneration system is established; According to the state space equation, different current disturbances are applied to the cogeneration system, and the control action that enables the cogeneration system to reach the equilibrium operating point under different current disturbances and the state variables of the cogeneration system at the equilibrium operating point are obtained; The cost function of the linear quadratic regulator is constructed by combining the control action that enables the cogeneration system to reach the equilibrium operating point under different current disturbances and the state variables of the cogeneration system at the equilibrium operating point. Taking the minimum value of the cost function as the goal, a linear quadratic regulator is used to control the temperature of the combined heat and power system.

2. The temperature control method of the combined heat and power system according to claim 1, characterized in that: The cost function of the linear quadratic regulator is: In the formula, Q is the weight matrix of the control effect, R is the weight matrix of the control cost, is the value of the state variable deviating from the equilibrium operating point, It is the value of the control action deviating from the equilibrium operating point.

3. The temperature control method of the combined heat and power system according to claim 2, characterized in that: The method of using a linear secondary regulator to control the temperature of a combined heat and power system comprises: The coolant flow rate of the combined heat and power system is controlled by a linear quadratic regulator to control the coolant outlet temperature of the combined heat and power system; The cooling water flow of the combined heat and power system is controlled by a linear quadratic regulator to control the coolant inlet temperature of the combined heat and power system.

4. The temperature control method of the combined heat and power system according to claim 3, characterized in that: The method of controlling the temperature of the combined heat and power system by using a linear quadratic regulator with the minimum value of the cost function as the goal includes: According to the control action that makes the cogeneration system reach the equilibrium working point under different current disturbances, a control action matrix is ​​constructed, and according to the state variables of the cogeneration system at the equilibrium working point under different current disturbances, a state variable matrix is ​​constructed; According to the state variables corresponding to the coolant flow rate and the cooling water flow rate in the state space equation, a weight matrix of the control effect and a weight matrix of the control cost in the cost function are determined; Combining the control action matrix, the state variable matrix, the control effect weight matrix and the control cost weight matrix, the feedback gain matrix of the linear quadratic regulator is obtained through the Riccati equation; When a linear quadratic regulator is used to control the temperature of a combined heat and power system, the value of the cost function is minimized by adjusting the feedback gain matrix.

5. The temperature control method for a combined heat and power system according to claim 4, wherein the cost function of constructing a linear quadratic regulator comprises: Based on the particle swarm optimization algorithm, the weight matrix of the control effect and the weight matrix of the control cost are updated with the goal of minimizing the fitness function of the particle swarm optimization algorithm; Among them, the fitness function is: In the formula, is the absolute error integral of the coolant outlet temperature, is the absolute error integral of the coolant inlet temperature, a1 and a2 are the preset weight coefficients; and They are obtained through the following formula: In the formula, is the absolute error integral of the coolant outlet temperature or the absolute error integral of the coolant inlet temperature, is the error in the coolant inlet temperature or the error in the coolant outlet temperature.

6. The temperature control method for a combined heat and power system according to claim 1, wherein the step of establishing a system model of the combined heat and power system comprises: The battery stack model is established as follows: In the formula, is the output voltage, is the Nernst voltage, is the activation loss, is the ohmic loss, is the resistivity, is the concentration loss, is the activation loss coefficient, is the no-load current, is the external circuit resistance, is the water content of the exchange membrane, is the translation entropy, is the number of electrons transferred by the reaction, is the Faraday constant, is the standard temperature, is the gas constant, is the battery temperature, is the hydrogen partial pressure, is the partial pressure of oxygen, is the water vapor partial pressure, is the oxygen concentration, is the working current, is the total current, is the reaction activation area, is the total internal resistance, is the ohmic internal resistance, is the contact internal resistance, is the concentration loss coefficient, J is the current density, is the limiting current density; Establish the battery stack thermal analysis model as follows: In the formula, is the battery stack mass, is the specific heat capacity of the battery stack, is the coolant temperature at the battery stack outlet, Generate heat for the battery stack, To remove heat from the coolant; In the formula, is the total energy of fuel, To take away energy from the gas entering and leaving the battery stack, is the heat dissipated by the battery stack. is the battery stack power; In the formula, is the coolant flow rate, is the specific heat capacity of the coolant, is the coolant temperature at the inlet of the battery stack; Establish a water storage tank model as follows: In the formula, is the mass of coolant in the water tank, is the coolant temperature at the water tank outlet; The heat exchanger model is established as follows: In the formula, is the mass of coolant in the heat exchanger, Heat exchanged for hot and cold water; In the formula, is the mass of cooling water in the heat exchanger, is the specific heat capacity of cooling water, is the cooling water flow rate, is the temperature of cooling water entering the heat exchanger, is the temperature of cooling water leaving the heat exchanger; In the formula, is the heat transfer coefficient of the heat exchanger surface, is the heat exchange area; The hot water storage tank model is established as follows: In the formula, is the mass of cooling water in the hot water storage tank, For heat use.

7. The temperature control method of the combined heat and power system according to claim 6, wherein the step of establishing the state space equation of the combined heat and power system comprises: The nonlinear state space equation of the combined heat and power system is established as follows: In the formula, , is the state variable, for , for , for , for , for , To control the action amount, for , for ; The linearized nonlinear state space equation at the equilibrium operating point of the combined heat and power system is as follows: A and B are as follows: ; ; In the formula, A is the state matrix, B is the input matrix, is the value of the state variable deviating from the equilibrium operating point, is the value of the state variable at the equilibrium operating point, To control the deviation of the action from the equilibrium working point, is the value of the control action at the equilibrium operating point.

8. A temperature control system for a combined heat and power system, characterized in that: include: A model building module is used to build a system model of a combined heat and power system; An equation building module is used to build the state space equation of the combined heat and power system according to the system model; A variable acquisition module is used to apply different current disturbances to the cogeneration system according to the state space equation, and obtain the control action amount that enables the cogeneration system to reach the equilibrium working point under different current disturbances and the state variables of the cogeneration system at the equilibrium working point; A function construction module is used to construct a cost function of a linear quadratic regulator by combining the control action for making the combined heat and power system reach a balanced operating point under different current disturbances and the state variables of the combined heat and power system at the balanced operating point; The temperature control module is used to control the temperature of the combined heat and power system by using a linear quadratic regulator with the goal of minimizing the value of the cost function.

9. A computer device, characterized in that: include: at least one processor; And, a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the temperature control method of the cogeneration system as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the temperature control method for a combined heat and power system according to any one of claims 1 to 7 is implemented.