Optimization method for control parameters of PID (Proportion Integration Differentiation) controller, heating system and control method of heating system
By generating multiple sets of control parameters and calculating the fitness, and selecting the optimal control parameters as the new parameters of the PID controller, the problem of performance fluctuations in some scenarios is solved, and more efficient and precise control is achieved.
Patent Information
- Application Number
- CN202510094889.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-03-18
AI Technical Summary
The control parameters of the PID controller are fixed, resulting in large fluctuations in performance in some scenarios and inaccurate control.
By generating multiple sets of control parameters based on the parameter optimization model, obtaining the current deviation and calculating the fitness of each set of control parameters, selecting the control parameter with the fitness closest to the target value as the new control parameter of the PID controller.
It realizes adaptive adjustment of the control parameters of the PID controller in a dynamic environment, improving the efficiency and accuracy of PID control.
Smart Images

Figure CN119644713A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of controllers, and in particular to a method for optimizing control parameters of a PID controller, a heating system and a control method thereof. Background Art
[0002] PID (Proportional-Integral-Derivative) control is a linear control consisting of a proportional unit P, an integral unit I, and a differential unit D. It forms a control quantity by linearly combining the proportion (P), integral (I), and differential (D) of the deviation e(t) between the given value r(t) and the actual output value y(t) to control the controlled object. The mathematical expression of PID control is as follows:
[0003]
[0004] Therefore, the performance of the PID controller depends on the proportional coefficient K P , integration coefficient K i and the differential coefficient K d Setting of three control parameters. At present, the control parameters of equipment equipped with PID controller are fixed when they leave the factory, which leads to large fluctuations in the performance of PID controller in some scenarios. Summary of the invention
[0005] The technical problem solved by the present invention is to provide a method for optimizing control parameters of a PID controller, a heating system and a control method thereof, which effectively solve the problem of inaccurate control of the PID controller.
[0006] The above technical problems are solved by the following technical solutions:
[0007] A method for optimizing control parameters of a PID controller, characterized in that the method comprises:
[0008] Generate multiple groups of control parameters based on the parameter optimization model;
[0009] The current deviation is obtained, and the fitness corresponding to each group of control parameters is calculated based on the current deviation; the fitness is determined according to the following formula:
[0010]
[0011] Among them, e(t) represents the current deviation, t u represents the rise time, b u represents the overshoot, W1, W2 and W3 represent the preset weighted values, and the rise time and overshoot correspond to each group of control parameters;
[0012] The control parameter whose fitness is closest to the target value is selected as the new control parameter of the PID controller.
[0013] The embodiment of the present invention provides a method for optimizing the control parameters of a PID controller, including generating multiple groups of control parameters based on a parameter optimization model; obtaining a current deviation, and calculating the fitness corresponding to each group of control parameters based on the current deviation; and selecting a control parameter with a fitness closest to a target value as a new control parameter of the PID controller. This method automatically generates control parameters of a PID controller based on a parameter optimization model, thereby finding the optimal control parameter combination that meets preset conditions. This method can be used in a dynamic environment to adaptively adjust the control parameters of a PID controller, thereby improving the efficiency of PID control.
[0014] In one embodiment, the parameter optimization model is a grey wolf algorithm model and / or a genetic algorithm model.
[0015] In one embodiment, the generating multiple groups of control parameters based on the parameter optimization model includes:
[0016] In the process of generating multiple groups of control parameters based on the parameter optimization model, the parameter optimization model corresponding to the current number of iterations is determined based on the parity of the current number of iterations; if the current number of iterations is an odd number, the parameter optimization model corresponds to a first optimization algorithm; if the current number of iterations is an even number, the parameter optimization model corresponds to a second optimization algorithm; the first optimization algorithm and the second optimization algorithm are respectively one of a gray wolf algorithm and a genetic algorithm;
[0017] Generate multiple groups of control parameters based on the optimization algorithm corresponding to the current number of iterations.
[0018] In one embodiment, the generating of multiple groups of control parameters based on the optimization algorithm corresponding to the current number of iterations includes:
[0019] Calculating a first output result of a first optimization algorithm corresponding to the current number of iterations, and generating a control parameter based on the first output result and a second optimization algorithm corresponding to a next iteration of the current number of iterations;
[0020] The first optimization algorithm and the second optimization algorithm are cycled until the number of iterations reaches a preset total number of iterations.
[0021] In one embodiment, the step of calculating the fitness corresponding to each group of control parameters based on the current deviation includes:
[0022] Based on the preset simulation model, the rise time and overshoot corresponding to each group of control parameters are obtained;
[0023] The fitness corresponding to each group of control parameters is calculated according to the current deviation and the rise time and overshoot corresponding to each group of control parameters.
[0024] A heating system is provided, which heats an indoor heating area. The heating system comprises a PID controller corresponding to the indoor heating area. The PID controller applies the above method, and the current deviation is the difference between the current ambient temperature and the user-set temperature.
[0025] In one of the embodiments, there are multiple indoor heating zones, and the heating system includes multiple PID controllers, and the PID controllers correspond one-to-one to the indoor heating zones.
[0026] A control method for a heating system, the method being applied to the above-mentioned heating system, wherein a floor heating coil is provided in an indoor heating area, a water inlet valve is provided at a water inlet of the floor heating coil, and the PID controller calculates a target opening of the water inlet valve based on a current deviation;
[0027] The water inlet valve adjusts its opening to the target opening;
[0028] The target opening is determined according to the following formula:
[0029]
[0030] u=u(t)*K
[0031] Where K represents the conversion coefficient, u(t) represents the control signal, and K p Represents the proportionality coefficient, K i Indicates the integral coefficient, K d represents the differential coefficient, u represents the target opening, and e(t) represents the current deviation.
[0032] A control method for a heating system, the method being applied to the above-mentioned heating system, the method comprising: obtaining current environmental parameters and climate data of each indoor heating area, the current environmental parameters at least comprising current environmental temperature or current environmental humidity;
[0033] Perform heating prediction on each indoor heating area based on the current environmental parameters and climate data to obtain a heating prediction result, wherein the heating prediction result at least includes whether heating is required or not required;
[0034] The control parameters of the PID controller in the target heating area are optimized based on the heating prediction result, and the heating prediction result of the target heating area is that heating is required.
[0035] This method performs heating prediction based on multiple environmental parameters to optimize controller parameters of each target heating area according to the heating prediction results, thereby improving energy efficiency and the accuracy of heating control in each area under the condition of realizing regional heating control. In one embodiment, the control parameters of the PID controller in the target heating area are optimized based on the heating prediction results, including:
[0036] Determining a target prediction result corresponding to the target heating area from the heating prediction results;
[0037] During the iterative optimization of the control parameters of the controller, the optimization algorithm corresponding to the current number of iterations is determined based on the parity of the current number of iterations, and the control parameters of the PID controller in the target heating area are optimized based on the optimization algorithm corresponding to the current number of iterations and the target prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 Schematic diagram of a flow chart of a method for optimizing control parameters of a PID controller according to an embodiment of the present invention;
[0040] Figure 2 is a schematic diagram of a response curve of an embodiment of the present invention;
[0041] Figure 3 is a schematic diagram of an indoor heating system according to an embodiment of the present invention;
[0042] Figure 4 A schematic diagram of a parameter optimization process of a hybrid algorithm according to an embodiment of the present invention;
[0043] Figure 5 is a schematic diagram of a control method for a heating system according to an embodiment of the present invention;
[0044] Figure 6 is a processing flow chart of a heating system according to an embodiment of the present invention;
[0045] Figure 7 A schematic flow chart of a method for controlling a heating system according to an embodiment of the present invention;
[0046] Figure 8 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] In the description of the present application, it should be understood that the terms "center", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0049] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0050] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0051] According to an embodiment of the present invention, a method for optimizing control parameters of a PID controller is provided. Figure 1 is a flow chart of a method for optimizing control parameters of a PID controller according to an embodiment of the present invention, such as Figure 1 As shown, the process includes the following steps:
[0052] Step S101, generating multiple groups of control parameters based on a parameter optimization model.
[0053] The parameter optimization model is an algorithmic model based on the intelligent optimization algorithm. The parameter optimization model can simulate the optimization process in nature (such as wolf predation behavior or biological evolution) and search for the optimal or approximately optimal solution in the solution space. The parameter optimization model can be one or more models that can simulate the system response.
[0054] A set of control parameters is obtained in each round of calculation through the parameter optimization model, and new control parameters can be calculated again based on the obtained control parameters.
[0055] Step S102, obtaining the current deviation, and calculating the fitness corresponding to each group of control parameters based on the current deviation.
[0056] The fitness is determined according to the following formula:
[0057]
[0058] Among them, e(t) represents the current deviation, t u represents the rise time, b u represents overshoot, W1, W2 and W3 represent preset weighted values, and the rise time and overshoot correspond to each group of control parameters.
[0059] The current deviation refers to the difference between the actual output and the expected output of the system. The calculation method of the current deviation is different in different application scenarios. In the fitness function, the integral of the square of the current deviation over time reflects the steady-state error of the system, and the rise time reflects the response speed of the system. The rise time and overshoot can be calculated through the PID curve. Specifically, the PID controller can be run in a simulation environment, and the corresponding response results can be recorded, so as to determine the rise time and overshoot from these response results.
[0060] Step S103: Select the control parameter whose fitness is closest to the target value as the new control parameter of the PID controller.
[0061] The target value is the optimal fitness value, and a set of control parameters whose calculated fitness is closest to the target value is used as the control parameters of the PID controller, so that the PID controller can output a control signal based on the set of control parameters. In some optional embodiments, the target value can be set to 1 in this embodiment.
[0062] The embodiment of the present invention provides a method for optimizing the control parameters of a PID controller, including generating multiple groups of control parameters based on a parameter optimization model; obtaining a current deviation, and calculating the fitness corresponding to each group of control parameters based on the current deviation; and selecting a control parameter with a fitness closest to a target value as a new control parameter of the PID controller. This method automatically generates control parameters of a PID controller based on a parameter optimization model, thereby finding the optimal control parameter combination that meets preset conditions. This method can be used in a dynamic environment to adaptively adjust the control parameters of a PID controller, thereby improving the efficiency of PID control.
[0063] In some optional embodiments, the parameter optimization model is a gray wolf algorithm model and / or a genetic algorithm model. That is, the parameter optimization model can be a gray wolf algorithm model, a genetic algorithm model, or a combination of a gray wolf algorithm and a genetic algorithm model. Among them, the gray wolf algorithm imitates the social hierarchy and hunting behavior of the wolf pack, guides the search process through the leader wolf, and finds the global optimal solution; the genetic algorithm simulates natural selection and genetic mechanisms, and gradually optimizes the individuals in the population through operations such as selection, crossover, and mutation, and finally approaches the optimal solution.
[0064] In some optional implementations, the above step S101 includes:
[0065] In the process of generating multiple groups of control parameters based on the parameter optimization model, the parameter optimization model corresponding to the current number of iterations is determined based on the parity of the current number of iterations; if the current number of iterations is an odd number, the parameter optimization model corresponds to the first optimization algorithm; if the current number of iterations is an even number, the parameter optimization model corresponds to the second optimization algorithm; the first optimization algorithm and the second optimization algorithm are respectively one of the grey wolf algorithm and the genetic algorithm; multiple groups of control parameters are generated based on the optimization algorithm corresponding to the current number of iterations.
[0066] Based on the hybrid algorithm, the control parameters of the PID controller are iteratively optimized, the total number of iterations is pre-set, and the corresponding parameter optimization model is adopted according to the parity of the current number of iterations, and then the corresponding optimization algorithm is adopted. For example, the gray wolf algorithm and the genetic algorithm can be used in the global search process, which helps to quickly find the global optimal PID parameters in the complex system parameter space; the genetic algorithm is used in the parallel processing process, and multiple individuals in the population of three PID control parameters can be processed in parallel at the same time.
[0067] Furthermore, generating multiple groups of control parameters based on the optimization algorithm corresponding to the current number of iterations includes: obtaining the rise time and overshoot corresponding to each group of control parameters based on a preset simulation model; and calculating the fitness corresponding to each group of control parameters based on the current deviation and the rise time and overshoot corresponding to each group of control parameters.
[0068] The preset simulation model is a mathematical model that can simulate the response of the system. It can take PID control parameters as input and output the response curve of the system. Rise time and overshoot are important indicators for evaluating the response characteristics of the system. Rise time refers to the time required for the system response to reach its final steady-state value (or a specified threshold) from the initial value, and overshoot refers to the part of the system response that exceeds its final steady-state value for the first time, usually expressed as a percentage. For each set of generated control parameters, it is input into the preset simulation model, and the simulation is run to obtain the response curve of the system. The values of rise time and overshoot are extracted from the response curve to obtain the response curve of the system. Figure 2 Take the response curve shown in the figure as an example, where the overshoot σ% = A / B%, and the rise time is t r , the peak time is t p , the adjustment time is t s .
[0069] The current deviation represents the difference between the actual output and the expected output. In PID control, the current deviation is the main basis for the controller to adjust its output. For each set of control parameters, the corresponding rise time and overshoot are used to calculate the fitness.
[0070] An embodiment of the present invention provides a control method for a heating system, wherein the heating system heats an indoor heating area, and the heating system includes a PID controller corresponding to the indoor heating area, and the PID controller is applied as described above. Figure 1 The corresponding method and implementation method, in this application scenario, the current deviation is the difference between the current ambient temperature and the user-set temperature.
[0071] In some optional embodiments, there are multiple indoor heating zones, and the heating system includes multiple PID controllers, and the PID controllers correspond one-to-one to the indoor heating zones.
[0072] As an example, Figure 3 As shown, the PID controller controls the manifolds of the corresponding heating areas. The indoor heating areas include the living room, bedroom, dining room, etc.
[0073] According to an embodiment of the present invention, a control method for a heating system is provided, which is applied to the above-mentioned heating system, wherein the heating system is used to heat an indoor heating area, wherein the indoor heating area is provided with a floor heating coil, and the water inlet of the floor heating coil is provided with a water inlet valve, and the PID controller calculates the target opening of the water inlet valve based on the current deviation, and the water inlet valve adjusts the opening to the target opening. The target opening is determined according to the following formula:
[0074]
[0075] u=u(t)*K
[0076] Where K represents the conversion coefficient, u(t) represents the control signal, and K p Represents the proportionality coefficient, K i Indicates the integral coefficient, K d represents the differential coefficient, u represents the target opening, and e(t) represents the current deviation.
[0077] First, the actual temperature of the indoor heating area is collected, and the actual temperature is compared with the expected temperature to obtain the current deviation. The control signal is calculated based on the PID calculation formula and the current deviation. The control signal is converted to obtain the target opening, and then the opening of the water inlet valve is adjusted to the target opening.
[0078] The heating system used in this method is designed to maintain the temperature of the indoor heating area within a preset comfortable range. The floor heating coil is the main medium for heat transfer, and its water inlet is equipped with an adjustable water inlet valve. The PID controller is used to intelligently control the opening of the water inlet valve, thereby achieving precise management of the heating intensity. The PID controller generates a control signal by integrating the three components of the current deviation (i.e., the difference between the actual temperature and the expected temperature), namely the proportional, integral and differential components, which are then converted into the target opening of the water inlet valve. The control signal is calculated based on the PID calculation formula. In order to convert the control signal u(t) into the target opening u that can be recognized by the water inlet valve, a conversion coefficient K is introduced. The conversion coefficient K can be set according to the specific characteristics of the heating system and the performance of the floor heating coil to ensure that the control signal can be accurately mapped to the valve opening.
[0079] According to an embodiment of the present invention, a control method for an indoor heating system is provided, which is applied to a computer, a tablet computer, etc. The method is applied to the above heating system, and the method comprises the following steps:
[0080] Step S201, obtaining current environmental parameters and climate data of each indoor heating area.
[0081] Among them, the current environmental parameters at least include the current environmental temperature or the current environmental humidity. The current environmental parameters may also include climate data, indoor heat load, and outlet and return water temperatures. Environmental parameters are collected by a data acquisition system, which is connected to the heating system for communication. Climate data may be collected through a meteorological instrument, and climate data may specifically include weather changes, wind speed, outdoor humidity and other data. The data acquisition system is also equipped with an ultrasonic calorimeter device for collecting indoor heat load data. The current environmental temperature, current environmental humidity and outlet and return water temperatures are collected through a variety of sensor devices in the data acquisition system.
[0082] Step S202: Perform heating prediction for each indoor heating area based on current environmental parameters and climate data to obtain a heating prediction result.
[0083] Heating prediction is performed based on the collected environmental parameters, and specifically, heating prediction can be performed through a preset heating prediction model. Optionally, there can be one or more heating prediction models, and different heating models can be used to make predictions for different scenarios. The corresponding environmental parameters in the environmental parameters are used as the input of the heating model, and then the corresponding heating prediction results are output. The heating prediction results may include human activity time prediction, human activity area prediction, heating preheating prediction, heating flow prediction, etc. It can be understood that the heating prediction results include one or more prediction types, and the heating area involved in each type of prediction result is the target heating area. By counting all the heating prediction results, all the heating areas involved, namely the target heating area, can be determined. The heating demand of each target heating area can be the same or different. The heating prediction results at least include the need for heating and the need for heating.
[0084] Specifically, one or more preset heating models can be constructed for the prediction target according to actual needs, and the optimized preset heating model can be trained based on the corresponding environmental parameters. The preset heating model corresponds to the heating prediction result one by one. The input data of the preset heating model is determined from the environmental parameters, and the heating prediction result corresponding to the model is output.
[0085] In some optional implementations, the heating prediction results include at least a human activity time prediction, a human activity area prediction, a heating preheating prediction, and a heating flow prediction.
[0086] Exemplarily, each preset heating model is used to perform heating prediction respectively. The environmental parameters required for different types of predictions may be different. The prediction of human activity time is to predict the demand for future heating. For example, the time after get off work is from 17:00 to 8:00 the next day, and the basic heating temperature is turned on. The basic heating temperature can be set to 20°C. The heating area involved in the prediction of human activity time at this time can include all indoor heating areas. The heat load change pattern in different time periods can be identified by analyzing the historical data of heat load. For example, activities such as bathing and cooking will cause a significant increase in heat load, while the heat load will decrease when no one is there for a long time. Combined with the indoor temperature and indoor humidity data to judge the changes in the indoor environment, human activities will cause changes in temperature and humidity. Therefore, the prediction of human activity time is carried out in combination with environmental parameters such as indoor temperature, indoor humidity and heat load. If the heat load is low for a long time, the heating temperature can be lowered, and the heating temperature can be increased when the heat load increases.
[0087] The human activity area prediction determines the specific area of human activity, and after determining the specific area of human activity, sets the heating temperature of the specific area. For example, if the specific area of human activity is the living room, the heating temperature of the living room can be set to 26°C.
[0088] The heating flow prediction can determine the current energy consumption based on the heat load, and determine how to adjust the heating water flow in each area based on the collected heat load of each area. For example, if 10 people are in the living room, the consumption is large, and if one person is less, the water flow in the living room area should be increased when there are many people. This is to reduce the impact of disturbances. Otherwise, it is difficult to maintain the set temperature of the area (for example, 26°C) when there are many people. The temperature of the area can be maintained by adjusting the heating water flow.
[0089] Heating preheating prediction is to determine whether it is necessary to turn on the heating in advance for preheating based on climate data. It can determine the time and temperature to turn on in advance. If the heating is turned on originally, it can also determine whether the basic heating temperature needs to be increased based on the prediction results.
[0090] Step S203: Optimize the control parameters of the PID controller in the target heating area based on the heating prediction result.
[0091] Among them, the heating prediction result of the target heating area is that heating is required. The PID controller is used to control the heating of the target heating area based on the optimized parameters. The controller is a key component of the heating system and is responsible for controlling the operation of the heating equipment according to the set parameters. By optimizing the controller parameters, the system can achieve more precise heating control, improve heating efficiency and reduce energy consumption. The control parameters of the PID controller include proportional coefficient, integral coefficient and differential coefficient. Each target heating area has its corresponding controller. After optimizing the control parameters of each controller, the optimized parameters are sent to the controller, so that the controller generates a control signal based on the optimized parameters, thereby adjusting the opening of the manifold corresponding to the target heating area, adjusting the water flow, and realizing temperature regulation of the target heating area.
[0092] This method performs heating prediction based on multiple environmental parameters to optimize the controller parameters of each target heating area according to the heating prediction results, thereby improving energy utilization efficiency and the accuracy of heating control in each area while realizing regional heating control.
[0093] In some optional implementations, the above step S203 includes:
[0094] Step S2031, determining a target prediction result corresponding to a target heating area from the heating prediction results.
[0095] The heating prediction result may involve multiple prediction results, each prediction result has its corresponding heating area, and all heating areas to be heated are summarized according to all heating prediction results, that is, the target heating area. The target heating result corresponding to the target heating area may include one or more temperature prediction data.
[0096] In some optional embodiments, if the target prediction result corresponding to the target heating area includes more than one kind of prediction data, the controller performs heating control on the target heating area based on the priority of the heating prediction result corresponding to the prediction data.
[0097] For example, if the heating prediction result includes human activity time prediction A, human activity area prediction B, and heating flow prediction C. If the prediction data included in A is to set areas 1 to 4 to open at 20°C from 17:00 to 8:00 the next day, the prediction data included in B is to set area 4 to open at 26°C, and the prediction data included in C is to maintain area 4 at 26°C, but the water flow needs to be increased due to the large number of people in area 4.
[0098] It can be determined that the target heating area is area 1 to area 4, wherein the target prediction result corresponding to area 4 involves turning on 20°C from 17:00 to 8:00 the next day, and turning on 26°C and maintaining it at the current moment. The prediction data included in the target prediction result is 20°C from 17:00 to 8:00 the next day and 26°C at the current moment. It can be seen that there may be two kinds of prediction data of 26°C and 20°C at the current moment, that is, the target prediction result corresponding to the target heating area (area 4) includes more than one kind of prediction data. The heating prediction results are set with execution priorities in advance. In this embodiment, the priority of heating flow prediction C is higher than that of human activity area prediction B, and human activity area prediction B is higher than that of human activity time prediction A. Based on this, at the current moment, the controller gives priority to executing the heating prediction result with a higher priority, that is, controlling the temperature at the current moment to be 26°C.
[0099] Step S2032, during the iterative optimization of the control parameters of the controller, the optimization algorithm corresponding to the current number of iterations is determined based on the parity of the current number of iterations, and the control parameters of the PID controller in the target heating area are optimized based on the optimization algorithm corresponding to the current number of iterations and the target prediction results.
[0100] The control parameters of the controller are iteratively optimized based on the hybrid algorithm. The total number of iterations is pre-set, and the corresponding optimization algorithm is adopted according to the parity of the current number of iterations. In each iteration, the control parameters of the controller in the target heating area are optimized by the corresponding optimization algorithm and the target prediction results.
[0101] In some optional implementations, if the current number of iterations is an odd number, the optimization algorithm is the first optimization algorithm; if the current number of iterations is an even number, the optimization algorithm is the second optimization algorithm; the first optimization algorithm is the gray wolf algorithm, and the second optimization algorithm is the genetic algorithm.
[0102] Exemplarily, a hybrid algorithm is used for parameter optimization, which combines the characteristics of a genetic algorithm and a gray wolf algorithm. The gray wolf algorithm is used in the global search process, which helps to quickly find the globally optimal PID parameters in a complex system parameter space; the genetic algorithm is used in the parallel processing process, which can simultaneously process multiple individuals in a population of three PID parameters in parallel.
[0103] Figure 4 Schematic diagram of parameter optimization process of hybrid algorithm (IHGWO algorithm), one or more of proportional coefficient, integral coefficient and differential coefficient is used as parameter to be optimized. First, the algorithm is initialized. In practical applications, the parameter setting of hybrid algorithm is crucial for the optimization effect. Parameter setting includes population size, maximum number of iterations, upper and lower bounds of search space, etc. Exemplarily, in order to improve the running speed of the algorithm, the number of iterations is set to 100, the population size is set to 50, the initial crossover probability is 0.8, and the mutation probability is 0.05.
[0104] Next, the algorithm fitness calculation is performed, and the fitness function is used to evaluate the performance of the solved parameters. In this embodiment, the fitness function is set to:
[0105]
[0106] Where, e(t) represents the temperature error value, t u represents the rise time, b u represents the overshoot, and W1, W2, and W3 represent the weighted values of the fitness function. The temperature error value can be obtained by calculating the difference between the predicted set temperature and the current temperature, and the rise time and overshoot are calculated by the PID curve. Based on the predicted temperature, the PID controller can be run in a simulation environment, and the corresponding temperature response can be recorded, so that the rise time and overshoot can be determined from these temperature responses.
[0107] By judging whether the current iteration number L is an odd number or an even number, the genetic algorithm or the gray wolf algorithm is cross-circulated. In the gray wolf algorithm, the algorithm simulates the social hierarchy and hunting behavior of gray wolves, including four levels of gray wolves: Alpha, Beta, Delta, and Omega. The steps are as follows:
[0108] Step 1: Update of the leader wolf. In each iteration, the positions of Alpha, Beta, and Delta wolves are determined according to the fitness function. These positions represent the three best solutions in the current population.
[0109] Step 2: The wolf pack updates its position. Other wolves (Omega wolves) update their positions based on the positions of Alpha, Beta, and Delta wolves. The position update formula is as follows:
[0110] Dα =|C·P α -P i |
[0111] D β =|C·P β -P i |
[0112] D δ =|C·P δ -P i |
[0113] Among them, P α , P β and P δ Represent the positions of Alpha, Beta and Delta wolves respectively, P i represents the position of the i-th wolf, and C represents a random number used to control the randomness of the search process.
[0114] Step 3: Update the new position of the wolf. The new position of the wolf is calculated by the following formula:
[0115] P i (t+1)=P α -A.D α +P β -A.D β +P δ -A.D δ
[0116] Among them, A represents a coefficient that decreases as the number of iterations decreases, which is used to control the balance between exploration and development during the search process.
[0117] After one iteration of optimization is completed through the Grey Wolf Algorithm, the controller parameters obtained by this optimization are optimized again based on the genetic algorithm.
[0118] In genetic algorithms, the algorithm simulates the biological evolution process and performs an iterative process of crossover, mutation, and selection based on the basic idea of "survival of the fittest". The steps include:
[0119] Step 1: The genetic algorithm adjusts the crossover probability and mutation probability in real time according to the fitness, thereby improving the convergence speed and performance of the algorithm. The functions of the improved adaptive crossover probability and mutation probability are:
[0120]
[0121] Among them, P c represents the crossover probability, P m represents the probability of mutation; P c1 , P c2 Respectively represent the upper and lower limits of the crossover probability, Pm1 , P m2 Respectively represent the upper and lower limits of the mutation probability; f c represents the maximum fitness between the two individuals involved in the crossover; f max is the maximum fitness of the current population; f avg It represents the average fitness of the current population, and the initial value of the average fitness is set to 0.5. When the individual fitness is lower than the average fitness and the difference is large, the value of the crossover probability can be appropriately increased, that is, P c1 Take 0.9. It can expand the global search ability in the early stage of evolution and speed up the regeneration of the population. In the later stage of evolution, each individual in the population tends to be stable. Appropriately reducing the value of the crossover probability can preserve and continue the excellent genetic structure. During evolution, the average fitness will also be adjusted appropriately according to the optimization performance. The calculation method of the mutation probability is similar to that of the crossover probability.
[0122] Step 2: Perform a crossover operation on the selected parent individuals to produce offspring, using the uniform crossover method.
[0123] Step 3: Randomly change certain genes of certain individuals according to the mutation probability calculated in step 1 in order to increase the diversity of the population.
[0124] Step 4: Perform a selection operation and use a roulette wheel method to select individuals with higher fitness as parents of the next generation.
[0125] Until the maximum number of iterations is reached, the optimal target parameter, i.e. the proportional coefficient K, is output. p , integral coefficient K i and the differential coefficient K d .
[0126] The output signal of the PID controller is determined by the optimized target parameters, and then the manifold valve is controlled. Figure 5 After adjusting the manifold valves in the target heating area, continue to collect environmental parameters in real time, and then continue to make heating predictions based on the environmental parameters, and optimize the corresponding controller parameters based on the target heating prediction results of the target heating area.
[0127] The method provided in this embodiment uses a hybrid algorithm to optimize the control parameters of the PID controller online. By real-time adaptive adjustment of the crossover probability and the mutation probability, the generation of new individuals is accelerated, while the better individuals are also protected. The method of simultaneous optimization of the gray wolf algorithm and the genetic algorithm is adopted to make the global optimal PID parameters better; the genetic algorithm is used in the parallel processing process, and multiple parameters of the controller can be processed in parallel at the same time. Improve the response time, overshoot and control accuracy of the system. The method can automatically adjust the controller parameters according to the real-time temperature and the prediction results to achieve more accurate and faster temperature control.
[0128] The embodiment of the present invention provides a control method for an indoor heating system. Figure 6 As shown in the heating system flow chart, the heating system of this embodiment specifically includes: a data acquisition system, an intelligent heating state prediction system, an algorithm control system, a control panel system, a heating heat source system, a circulating water system, and a manifold water flow control system. The data acquisition system is used to obtain environmental data to provide data support for heating predictions. The intelligent heating state prediction system is used to make comprehensive heating predictions based on environmental data, including human activity time predictions, human activity area predictions, heating preheating predictions, and heating flow predictions. The algorithm control system is used to optimize PID parameters based on a hybrid algorithm. The control panel system is connected to the water flow control system, and the control panel system feeds back setting information to the water flow control system and receives flow information sent by the water flow control system. An air source heat pump is used as a heating heat source in the heating heat source system to provide a heat source for the heating system. The circulating water system includes a circulating water pump, a dynamically adjustable manifold and a pipe, which are used to circulate the heated water and transport the heat to the heating terminal. It includes a four-way water circulation system (a total of 4 heating areas). The dynamically adjustable manifold can achieve 0-100 duty cycle water flow control through the controller to achieve regional heating. The manifold water flow control system includes a temperature sensor, a humidity sensor, a wind speed sensor, a controller and an actuator, which can obtain the outlet water temperature and return water temperature in real time, and determine the actual outlet and return water temperature difference of the water circulation system according to the outlet water temperature and the return water temperature. According to the actual outlet and return water temperature difference, the difference between the current indoor temperature and the thermal comfort temperature is determined, and then the duty cycle of the electronic valve of the water circulation system is controlled to achieve water flow control, which is used to monitor the thermal comfort of the human body indoors and control the water flow of the manifold to ensure indoor thermal comfort and energy saving of the air source heat pump system. Floor radiation heating is adopted in the heating terminal system. Specific methods such as Figure 7 As shown, it includes collecting environmental parameters, processing the collected environmental parameters and performing heating prediction, optimizing PID parameters based on a hybrid algorithm, and adjusting the temperature by a PID controller based on the optimized parameters.
[0129] The present invention also provides an electronic device. Figure 8 , Figure 8 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Figure 8As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.
[0130] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0131] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0132] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0133] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0134] The electronic device further comprises a communication interface 30 for the electronic device to communicate with other devices or a communication network.
[0135] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0136] In the specific contents of the above-mentioned specific implementation methods, the various technical features can be combined in any non-contradictory manner. In order to make the description concise, not all possible combinations of the above-mentioned technical features are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0137] The specific contents of the above specific embodiments only express several embodiments of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
Claims
1. A method for optimizing control parameters of a PID controller, characterized in that: The method comprises: Generate multiple groups of control parameters based on the parameter optimization model; The current deviation is obtained, and the fitness corresponding to each group of control parameters is calculated based on the current deviation; the fitness is determined according to the following formula: Among them, e(t) represents the current deviation, t u represents the rise time, b u represents the overshoot, W1, W2 and W3 represent the preset weighted values, and the rise time and overshoot correspond to each group of control parameters; The control parameter whose fitness is closest to the target value is selected as the new control parameter of the PID controller.
2. The method according to claim 1, characterized in that The parameter optimization model is a grey wolf algorithm model and / or a genetic algorithm model.
3. The method according to claim 2, characterized in that The generating of multiple groups of control parameters based on the parameter optimization model includes: In the process of generating multiple groups of control parameters based on the parameter optimization model, the parameter optimization model corresponding to the current number of iterations is determined based on the parity of the current number of iterations; if the current number of iterations is an odd number, the parameter optimization model corresponds to a first optimization algorithm; if the current number of iterations is an even number, the parameter optimization model corresponds to a second optimization algorithm; the first optimization algorithm and the second optimization algorithm are respectively one of a gray wolf algorithm and a genetic algorithm; Generate multiple groups of control parameters based on the optimization algorithm corresponding to the current number of iterations.
4. The method according to claim 3, characterized in that: The generating of multiple groups of control parameters based on the optimization algorithm corresponding to the current number of iterations includes: Calculating a first output result of a first optimization algorithm corresponding to the current number of iterations, and generating a control parameter based on the first output result and a second optimization algorithm corresponding to a next iteration of the current number of iterations; The first optimization algorithm and the second optimization algorithm are cycled until the number of iterations reaches a preset total number of iterations.
5. The method according to claim 1, characterized in that The step of calculating the fitness corresponding to each group of control parameters based on the current deviation includes: Based on the preset simulation model, the rise time and overshoot corresponding to each group of control parameters are obtained; The fitness corresponding to each group of control parameters is calculated according to the current deviation and the rise time and overshoot corresponding to each group of control parameters.
6. A heating system, characterized in that: The heating system heats an indoor heating area, and the heating system includes a PID controller corresponding to the indoor heating area. The PID controller applies the method described in any one of claims 1-4, and the current deviation is the difference between the current ambient temperature and the user-set temperature.
7. The heating system according to claim 6, characterized in that: There are multiple indoor heating zones, and the heating system includes multiple PID controllers, and the PID controllers correspond to the indoor heating zones one by one.
8. A method for controlling a heating system, characterized in that: The method is applied to the heating system according to claim 6 or 7, wherein a floor heating coil is provided in the indoor heating area, and a water inlet valve is provided at the water inlet of the floor heating coil. The PID controller calculates the target opening of the water inlet valve based on the current deviation; The water inlet valve adjusts its opening to the target opening; The target opening is determined according to the following formula: u=u(t)*K Where K represents the conversion coefficient, u(t) represents the control signal, and K p Represents the proportionality coefficient, K i Indicates the integral coefficient, K d represents the differential coefficient, u represents the target opening, and e(t) represents the current deviation.
9. A method for controlling a heating system, characterized in that: The method is applied to the heating system according to claim 6 or 7, and the method comprises: obtaining current environmental parameters and climate data of each indoor heating area, wherein the current environmental parameters at least include current ambient temperature or current ambient humidity; Perform heating prediction on each indoor heating area based on the current environmental parameters and climate data to obtain a heating prediction result, wherein the heating prediction result at least includes whether heating is required or not required; The control parameters of the PID controller in the target heating area are optimized based on the heating prediction result, and the heating prediction result of the target heating area is that heating is required.
10. The method according to claim 9, characterized in that The optimizing the control parameters of the PID controller in the target heating area based on the heating prediction result comprises: Determining a target prediction result corresponding to the target heating area from the heating prediction results; During the iterative optimization of the control parameters of the controller, the optimization algorithm corresponding to the current number of iterations is determined based on the parity of the current number of iterations, and the control parameters of the PID controller in the target heating area are optimized based on the optimization algorithm corresponding to the current number of iterations and the target prediction results.
Citation Information
Patent Citations
Alternate search method for solving optimal power flow of power system
CN110929943A
Oxidation tank temperature control method based on fractional order controller
CN112000003A
Regional electric heating load prediction method based on agent modeling
CN113837665A
Learning condition prediction method based on big data
CN114169595A
Semiconductor temperature control system parameter optimization method based on myxobacteria algorithm
CN115857583A
Cited By
Fresh air handling unit energy-saving regulation and control system based on distributed collaboration
CN120593374A