Air conditioner chilled water PID parameter optimization method based on improved sparrow search algorithm
By improving the sparrow search algorithm to optimize the PID controller parameters of the air conditioning chilled water system, the problem of PID controller parameter tuning relying on manual experience was solved, achieving more efficient and accurate parameter tuning, improving the system's control performance and anti-interference ability, and adapting to a wide range of application scenarios.
Patent Information
- Application Number
- CN202511379301.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2025-11-18
AI Technical Summary
In existing air conditioning chilled water systems, the parameter tuning of PID controllers relies on manual experience, which makes the adjustment process cumbersome, time-consuming, and difficult to achieve precise control under complex operating conditions. In particular, when the cooling load changes drastically or the system operating conditions change frequently, it exhibits defects such as large overshoot, slow response, or large steady-state error.
An improved sparrow search algorithm is used to optimize the parameters of a PID controller. By improving the population initialization, discoverer and follower position update formulas of the sparrow search algorithm, and combining refraction back learning, the sine and cosine theorems and Cauchy mutation strategy, the proportional, integral and derivative coefficients of the PID controller are dynamically adjusted to achieve automatic optimization of PID parameters.
It improves the tuning efficiency and accuracy of the PID controller, enhances the control performance and stability of the system, improves the anti-interference capability, and can achieve fast response, reduce overshoot and reduce steady-state error under complex dynamic conditions. It also has strong adaptive capability and good versatility.
Smart Images

Figure CN120970026A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for optimizing PID parameters of chilled water in air conditioning systems based on an improved sparrow search algorithm, belonging to the field of building air conditioning control technology. Background Technology
[0002] Currently, the most common control strategy used in air conditioning chilled water systems is constant temperature difference control. This method uses a fixed temperature difference between the supply and return water as the control basis, and monitors the return water temperature in real time, comparing it to a set target value. When the detected temperature deviates from the target value, the operating frequency of the chilled water pump is adjusted according to the magnitude and direction of the error, thereby changing the pump speed and flow rate. In this way, the supply and return water temperature difference is kept within a relatively stable range, ensuring a balanced cooling process.
[0003] The general principle of chilled water control is to use a temperature sensor to detect the chilled water return temperature in real time, using this as a key control parameter. The chilled water supply temperature is set at approximately 7°C, while the system design requires a supply-return temperature difference of typically 5°C. The control objective is to ensure the return water temperature is maintained at around 12°C. When the return water temperature deviates from the set value due to load fluctuations, the control system immediately triggers the adjustment mechanism. At this time, the PID controller calculates the detected temperature deviation based on pre-set proportional, integral, and derivative gain coefficients and generates a corresponding control quantity, thereby adjusting the operating frequency of the circulating water pump. By changing the pump speed, the system's circulating water flow rate is adjusted, allowing the chilled water to better match the demands of the terminal air conditioning load.
[0004] Proportional-Integral-Derivative (PID) controllers are widely used in chilled water system control due to their simple structure, clear principle, and convenient engineering implementation. The performance of a PID controller is highly dependent on the proper tuning of its parameters. PID parameter adjustment typically relies on manual experience or trial-and-error methods, which are not only cumbersome and time-consuming but also difficult to achieve optimal control under complex operating conditions. When the cooling load changes drastically or the system conditions change frequently, fixed-parameter PID controllers often fail to achieve precise control, exhibiting defects such as large overshoot, slow response, or large steady-state error.
[0005] To address these issues, recent years have seen an increasing number of studies incorporating intelligent optimization algorithms into the PID controller parameter tuning process, such as Particle Swarm Optimization (PSO), Grey Wolf Optimization (GWO), Ant Colony Optimization (ACO), Genetic Algorithm (GA), and Sparrow Search Algorithm (SSA). These algorithms can automatically find near-optimal control parameters within a large search space, effectively improving system control performance. However, some traditional optimization algorithms still suffer from premature convergence, getting trapped in local optima, and low computational efficiency, limiting their application in highly dynamic and complex systems. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the existing technology and provide a method for optimizing PID parameters of air conditioning chilled water based on an improved sparrow search algorithm, which aims to solve problems such as nonlinearity, time delay and complex operating conditions in the control of air conditioning chilled water systems.
[0007] The objective of this invention is achieved through the following technical solution:
[0008] A method for optimizing PID parameters of chilled water in air conditioning systems based on an improved sparrow search algorithm, characterized by the following steps:
[0009] S1: Improvements to the population initialization, discoverer update formula, and follower update formula in the sparrow search algorithm;
[0010] S2: Detect the return water temperature difference signal of the air conditioning chilled water system and input it to the improved sparrow search algorithm optimized PID controller. The improved sparrow search algorithm dynamically adjusts the proportional coefficient, integral coefficient and derivative coefficient of the PID controller.
[0011] S3: Improve the sparrow search algorithm to iteratively calculate the optimal parameter combination. The PID controller performs optimal control of the chilled water system based on the optimal parameter combination and provides anti-interference test.
[0012] Furthermore, in the above-mentioned method for optimizing PID parameters of air conditioning chilled water based on the improved sparrow search algorithm, step S1 includes:
[0013] S11: Optimize the initial distribution of sparrow population using refraction-backward learning;
[0014] S12: Enhance the global search capability for discoverer location updates using the sine and cosine laws;
[0015] S13: Optimize the follower position update formula using Cauchy's mutation formula.
[0016] Furthermore, in the above-mentioned method for optimizing PID parameters of air conditioning chilled water based on the improved sparrow search algorithm, step S2 includes:
[0017] S21: Set the initial parameters of the improved sparrow search algorithm, including population size, optimization dimension and number of iterations, and use the refraction inverse strategy to initialize the population distribution;
[0018] S22: Define the integral time-weighted absolute error (ITAE) as the algorithm's fitness function. Simultaneously, calculate and sort the fitness function values based on the initial sparrow population distribution to obtain the optimal position of the initial population.
[0019] S23: Update the positions of discoverers and followers based on the sine and cosine laws and Cauchy's mutation formula, continuously approaching the optimal solution, and output the optimal position of the population, i.e., K. p K i and K d When the iteration conditions are met, the optimal parameter combination is output.
[0020] Furthermore, in the above-mentioned method for optimizing PID parameters of air conditioning chilled water based on the improved sparrow search algorithm, step S3 includes:
[0021] S31: The control objective is to keep the return water temperature at 12℃. Input the optimal combination of PID parameters and measure its performance curve.
[0022] S32: Add a disturbance signal during 1200s of simulation to test its resistance to external interference.
[0023] Furthermore, in the above-mentioned method for optimizing PID parameters of air conditioning chilled water based on the improved sparrow search algorithm, the individual positions of the sparrow search algorithm population are established as follows:
[0024]
[0025] Where n is the number of sparrows in the population, and d represents the dimension of the variable to be optimized;
[0026] The initial population position and the position update based on the fitness function value are expressed as follows:
[0027]
[0028] Where f(*) represents the fitness value of an individual sparrow;
[0029] The population is initialized using the reverse learning optimization based on the refraction theorem to obtain the optimal initial population distribution. The core of the reverse learning is to generate its symmetric reverse solution based on the current solution, thereby obtaining new candidate solutions.
[0030] Assuming the range of the variable to be optimized, x, is [a, b], then the complementary solution... Defined as:
[0031]
[0032] Where a and b represent the upper and lower limits of the variable x to be optimized. Indicate the opposite solution;
[0033] By using the refraction theorem to optimize back-learning, setting the interval [a, b] as the boundary for the optimal solution, and setting the refractive index to λ, the following formula is obtained:
[0034]
[0035] Where x and x' represent the solution to be optimized and its corresponding solution after refraction, θ1 and θ2 are the incident angle and the reflection angle, and l and l' are the incident angle and the length of the reflected ray;
[0036] The simplified formula for the initial population location distribution is as follows:
[0037]
[0038] Where the scaling factor n = l / l', when both n and λ are 1, the x' position is learned in reverse from the base.
[0039] The sparrow search algorithm works by having discoverers, followers, and watchers in the population cooperate to continuously approach the optimal solution based on the fitness function value, i.e. the position.
[0040] In sparrow populations, the discoverer primarily undertakes the global search task, guiding the entire group's foraging direction and motivating other individuals to search. The number of discoverers constitutes 10%–20% of the population size; this proportion helps balance the algorithm's global exploration and local exploitation capabilities, as shown in the following formula:
[0041]
[0042] Where t represents the current iteration number, Let iter be the position of the i-th sparrow in the j-th dimension during the t-th iteration. max The maximum number of iterations is given by , a is a random number in the interval [0,1] used to adjust the update amplitude; R and ST are the safety threshold and warning threshold, respectively; Q is a normally distributed random number; and L is a matrix with all elements being 1.
[0043] When R < ST, the sparrow is in a safe state, and the finder narrows the search range to improve accuracy; when R ≥ ST, it means that the population is threatened and a large leap is needed to avoid getting trapped in a local optimum.
[0044] Equation (6) shows that the discoverer plays a core role in guiding the direction of the population, but its position update mainly depends on random walks, which can easily lead the algorithm to get stuck in local optima. At the same time, the update strategy of the followers takes the discoverer as a reference. Once the discoverer gets stuck, the followers will lack the motivation to explore, which will affect the overall optimization efficiency.
[0045] The discoverer update formula of the traditional sparrow search algorithm is optimized and improved by utilizing the sine and cosine theorems;
[0046] A step-size factor strategy is introduced into the sine and cosine mechanisms. The position update formula is improved by using a step-size factor r1, and its update form is as follows:
[0047] r1=1-t / M (25)
[0048] Where t is the current iteration number and M is the total number of iterations;
[0049] The Sigmoid function is introduced to dynamically adjust the dependence on individual information at the current moment, as shown in the following formula:
[0050]
[0051] Where Ω is the dependency factor and k is the control factor;
[0052] Regarding r1 and Ω, in the early stages of optimization, r1 has a larger weight and Ω has a smaller weight, which is beneficial for global search; in the later stages, r1 becomes smaller and Ω becomes larger, which is beneficial for improving local search ability and accelerating convergence speed.
[0053] The discovery position update formula, which combines the dependency factor Ω and the optimization factor r1, is as follows:
[0054]
[0055] Where r2 is a random number in the interval [0, 2π], used to control the sparrow's movement range, r1 is the step size factor, and Ω is the dependency factor. Let X be the position of the i-th sparrow in the j-th dimension at iteration t. best R and ST represent the current optimal position of the population, respectively, and the safety value and warning value are the same. The sine and cosine theorems are introduced into the discoverer position update formula for optimization, which enhances the global search capability of the algorithm.
[0056] When R < ST, the discoverer updates its position using a sine function; when R ≥ ST, a cosine function is used for updating.
[0057] By leveraging the periodic oscillations of sine and cosine functions, the diversity of individual discoverers is maintained, thereby enhancing the algorithm's global optimization capability and accelerating convergence.
[0058] In sparrow populations, followers undertake local search tasks and optimize parameters by following the discoverer; in SSA, the position update formula for followers is as follows:
[0059]
[0060] in, The location of the discoverer with the best global fitness. The position of the sparrow with the worst global fitness; A + =A T (AA T ) -1A is a 1*d matrix whose elements are randomly selected as 1 or -1; when i > n / 2, it means that the follower is in a poor position and needs to go to other areas to forage; when i ≤ n / 2, it means that the follower should conduct a local search near the discoverer.
[0061] In population activities, followers forage around the discoverer, resulting in insufficient search variability and a tendency to get trapped in local optima. By introducing the Cauchy mutation formula to update the follower positions, population diversity is enhanced, the search range is expanded, and the algorithm's global exploration capability is improved.
[0062] The probability density function of the standard Cauchy distribution is shown below:
[0063]
[0064] Where μ and σ are the position parameter and size parameter, respectively. Setting the position parameter to 0 and the size parameter to 1, the Cauchy variation formula is obtained as follows:
[0065]
[0066] An improvement to the follower position update is achieved using the Cauchy mutation formula, as follows:
[0067]
[0068] in, X is the updated position of the follower. best (t) represents the optimal position in the current iteration, and R is a random number generated by a Cauchy distribution with a degree of freedom parameter of 1. The Cauchy distribution has a heavy-tailed characteristic, and the generated random numbers will have a large deviation, which enhances the search diversity.
[0069] By employing the Cauchy mutation strategy, individual followers are dynamically updated based on the globally optimal position, achieving an effective balance between global exploration and local development, thereby improving the overall performance of the algorithm.
[0070] To prevent the search process from getting stuck in local optima, the SSA algorithm designates 10%–20% of individuals as vigilant individuals, with the position update formula as follows:
[0071]
[0072] in, The current global optimal position is given by β, which is a control step size parameter and follows a normal distribution with a mean of 0 and a variance of 1; K is a random number in the interval [-1, 1]; f i f is the fitness value of the sparrow. g and f w These are the current best and worst fitness values, respectively, with ε being a constant to prevent the denominator from being 0;
[0073] When fi >f g When f indicates that the individual is on the edge of the population and needs to move towards the center; when f i =f g At this time, individuals move randomly within the population to improve predation efficiency;
[0074] The sparrow search algorithm is improved in three aspects: sparrow population initialization, discoverer position update formula, and follower position update formula. The improved sparrow search algorithm is then used to optimize three parameters K of the PID controller for air conditioning chilled water. p K i and K d ,as follows:
[0075] First, set the initial parameters of the sparrow search algorithm and initialize the population: the population size is set to 50; the number of iterations is 50; the search dimension is 3; the proportion of discoverers is 0.8; and the proportion of followers is 0.2.
[0076] The integral-time weighted absolute error performance index function in the PID controller is used as the fitness function of the improved sparrow search algorithm. The PID controller parameters are optimized to rank the population positions and determine the quality of individual positions. The formula is as follows:
[0077]
[0078] Where T represents the total control time, and e(t) is the PID control error;
[0079] In the population, the discoverer updates its position using the improved law of sine and cosine formula, while the follower updates its position using the Cauchy mutation formula.
[0080] The individual fitness function value is recalculated based on the updated population position. If the current fitness function value is better than the previous one, the current individual position is taken as the current optimal solution, and the process is iterated and output sequentially.
[0081] If the iteration termination condition is met, stop the iteration, take the current optimal value as the algorithm optimization result, and output the optimal parameter combination, i.e., the optimal parameter solution for PID control: K. p K i and K d .
[0082] Furthermore, the above-mentioned method for optimizing PID parameters of air conditioning chilled water based on the improved sparrow search algorithm involves PID control of the air conditioning chilled water system and mathematical modeling of the system. The air conditioning chilled water system is a second-order time-delay system, and the mathematical model of its transfer function is established as follows:
[0083] Using the controller frequency as the input to the air conditioning chilled water system and the chilled water flow rate as the output, its corresponding transfer function is:
[0084]
[0085] Where K1 is the actuator amplification factor, and T1 is the time constant of the frequency converter and the water pump;
[0086] The second stage uses chilled water flow rate as the input to the chilled water system and return water temperature as the output, specifically:
[0087]
[0088] Where K2 is the temperature difference amplification factor, t is the temperature difference lag time constant, and T2 is the chilled water time constant;
[0089] Based on the above transfer function, the mathematical model of the chilled water system is as follows:
[0090]
[0091] Where K is K1·K2;
[0092] Simultaneously setting K=3, T1=48, T2=1, and defining the system time lag constant τ=100s, the mathematical model is as follows:
[0093]
[0094] When optimizing PID parameters and controlling an air conditioning chilled water system using the improved sparrow search algorithm, interference signals were introduced during the control process to verify the anti-interference performance.
[0095] Compared with the prior art, the present invention has significant advantages and beneficial effects, specifically reflected in the following aspects:
[0096] ① This invention improves the tuning efficiency and accuracy of PID controllers by using an improved sparrow search algorithm to automatically optimize the parameters of the PID controller, avoiding the inefficiency and uncertainty caused by relying on manual experience for parameter tuning, and effectively improving the globality and convergence speed of parameter search.
[0097] ② Enhance the control performance and stability of the system. By introducing the reverse learning mechanism optimized by the refraction principle, the sine and cosine transformation strategy and the Cauchy mutation mechanism, the optimization process has stronger population diversity and the ability to escape local optima. As a result, the PID controller can perform better control when facing the complex dynamic conditions of the chilled water system, with faster response, smaller overshoot and lower steady-state error.
[0098] ③ Improve the robustness and anti-interference ability of the system. The optimized PID controller has strong adaptive ability and can effectively adjust according to the system operating status. Even when there are disturbances or model uncertainties in the system, it can still maintain good control performance, which improves the practicality and reliability of the control system.
[0099] ④ The algorithm is highly versatile and adaptable to a wide range of application scenarios. The improved ISSA algorithm has good global optimization capabilities and computational efficiency. It is not only suitable for PID parameter optimization in air conditioning chilled water systems, but can also be extended to control parameter tuning of other nonlinear and time-delay systems. It has strong versatility and promotion value.
[0100] ⑤ It is easy to implement and has good prospects for practical application. It retains the simplicity of PID control structure while optimizing algorithm design, making it easy to deploy and implement in existing engineering control platforms without requiring major changes to the system hardware structure. It is easy to promote and apply to actual industrial control scenarios.
[0101] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing specific embodiments of the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings. Attached Figure Description
[0102] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0103] Figure 1 Flowchart of a method for optimizing PID parameters of chilled water in air conditioning based on an improved sparrow search algorithm;
[0104] Figure 2 : Control principle diagram of PID parameter optimization method for air conditioning chilled water based on improved sparrow search algorithm. Detailed Implementation
[0105] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0106] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, directional and ordinal terms are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0107] This invention presents a method for optimizing PID parameters in air conditioning chilled water systems based on an improved sparrow search algorithm. On one hand, it optimizes the sparrow search algorithm by improving population initialization, the discoverer update formula, and the follower update formula, thereby increasing the algorithm's search efficiency. On the other hand, it optimizes the parameters of the PID controller in the air conditioning chilled water system using the improved sparrow search algorithm, including establishing a mathematical model of the air conditioning chilled water system and improving the fitness function and initial parameter settings of the sparrow search algorithm. Furthermore, it verifies the control performance of the chilled water system using the optimized PID parameters and conducts anti-interference tests on the system.
[0108] The Improved Sparrow Search Algorithm (ISSA) enhances population diversity by introducing a back-learning mechanism based on the refraction principle during the sparrow population initialization phase. Simultaneously, it integrates sine and cosine mechanisms and Cauchy mutation strategies during the discoverer and follower position updates, effectively improving global search capabilities and the probability of escaping local optima. This results in ISSA exhibiting higher optimization accuracy and convergence efficiency in engineering optimization problems such as function optimization and PID parameter tuning.
[0109] like Figure 1 As shown, the method for optimizing PID parameters of air conditioning chilled water based on the improved sparrow search algorithm includes the following steps:
[0110] S1: Improvements to the population initialization, discoverer update formula, and follower update formula in the sparrow search algorithm; specifically including:
[0111] S11: Optimize the initial distribution of sparrow population using refraction-backward learning;
[0112] S12: Enhance the global search capability for discoverer location updates using the sine and cosine laws;
[0113] S13: Optimize the follower position update formula using Cauchy's mutation formula;
[0114] S2: Detects the return water temperature difference signal of the air conditioning chilled water system and inputs it to the improved sparrow search algorithm-optimized PID controller. The improved sparrow search algorithm dynamically adjusts the proportional coefficient, integral coefficient, and derivative coefficient of the PID controller; specifically including:
[0115] S21: Set the initial parameters of the improved sparrow search algorithm, including population size, optimization dimension and number of iterations, and use the refraction inverse strategy to initialize the population distribution;
[0116] S22: Define the integral time-weighted absolute error (ITAE) as the algorithm's fitness function. Simultaneously, calculate and sort the fitness function values based on the initial sparrow population distribution to obtain the optimal position of the initial population.
[0117] S23: Update the positions of discoverers and followers based on the sine and cosine laws and Cauchy's mutation formula, continuously approaching the optimal solution, and output the optimal position of the population, i.e., K. p K i and K d When the iteration conditions are met, the optimal parameter combination is output.
[0118] S3: Improved sparrow search algorithm iteratively calculates the optimal parameter combination, and the PID controller performs optimal control of the chilled water system based on the optimal parameter combination, providing anti-interference testing; specifically including:
[0119] S31: The control objective is to keep the return water temperature at 12℃. Input the optimal combination of PID parameters and measure its performance curve.
[0120] S32: Add a disturbance signal during 1200s of simulation to test its resistance to external interference.
[0121] An improved Sparrow Search Algorithm (ISSA) is used to evaluate the K-axis of the PID controller. p K i and K d The parameters are optimized to obtain the optimal parameter combination, thereby achieving efficient and stable control of the air conditioning chilled water system. It has good anti-interference ability and can maintain efficient control of the system even in the presence of external disturbances.
[0122] Specifically, the individual positions of the sparrow search algorithm population are first established as follows:
[0123]
[0124] Where n is the number of sparrows in the population, and d represents the dimension of the variable to be optimized;
[0125] The initial population position and the position update based on the fitness function value are expressed as follows:
[0126]
[0127] Where f(*) represents the fitness value of an individual sparrow.
[0128] Traditional sparrow search algorithms typically rely on random generation during population initialization; however, this often leads to uneven distribution of individuals in the solution space, affecting the overall performance of the algorithm. Generally, when the population can cover the search space relatively evenly, the algorithm's global search capability and diversity are improved, thereby increasing the accuracy and stability of optimization. Conversely, if the initial individuals are concentrated or there are large gaps, it is easy to cause insufficient searching or even get trapped in local optima.
[0129] The population is initialized using the reverse learning optimization based on the refraction theorem to obtain the optimal initial population distribution. The core of the reverse learning is to generate its symmetric reverse solution based on the current solution, thereby obtaining new candidate solutions.
[0130] The reverse refraction theorem is introduced in the population initialization part to enhance the comprehensiveness of the algorithm's initialization distribution and improve the quality of the initial solution;
[0131] Assuming the range of the variable to be optimized, x, is [a, b], then the complementary solution... Defined as:
[0132]
[0133] Where a and b represent the upper and lower limits of the variable x to be optimized. Indicate the opposite solution;
[0134] Although the symmetric reverse mechanism of reverse learning can expand the search space to some extent, the reverse solution it generates is always strictly symmetric to the current solution, lacking flexibility. When the solution space structure of the optimization problem is relatively complex, relying solely on this symmetric reverse solution often fails to fully cover the global region, limiting the optimization performance.
[0135] By using the refraction theorem to optimize back-learning, setting the interval [a, b] as the boundary for the optimal solution, and setting the refractive index to λ, the following formula is obtained:
[0136]
[0137] Where x and x' represent the solution to be optimized and its corresponding solution after refraction, θ1 and θ2 are the incident angle and the reflection angle, and l and l' are the incident angle and the length of the reflected ray;
[0138] The simplified formula for the initial population location distribution is as follows:
[0139]
[0140] Where the scaling factor n = l / l', when both n and λ are 1, the x' position is learned in reverse from the base.
[0141] By introducing a refraction-backward learning mechanism during the population initialization process of the sparrow search algorithm, the problems of uneven distribution in traditional random initialization and insufficient flexibility of symmetric backward learning are improved, making the population distribution in the solution space more reasonable, thereby enhancing the algorithm's global search capability and convergence accuracy, and improving the overall optimization performance.
[0142] The sparrow search algorithm works by having discoverers, followers, and watchers in the population cooperate to continuously approach the optimal solution based on the fitness function value, i.e. the position.
[0143] In sparrow populations, the discoverer primarily undertakes the global search task, guiding the entire group's foraging direction and motivating other individuals to search. The number of discoverers constitutes 10%–20% of the population size; this proportion helps balance the algorithm's global exploration and local exploitation capabilities, as shown in the following formula:
[0144]
[0145] Where t represents the current iteration number, Let iter be the position of the i-th sparrow in the j-th dimension during the t-th iteration. max The maximum number of iterations is given by , a is a random number in the interval [0,1] used to adjust the update amplitude; R and ST are the safety threshold and warning threshold, respectively; Q is a normally distributed random number; and L is a matrix with all elements being 1.
[0146] When R < ST, the sparrow is in a safe state, and the finder narrows the search range to improve accuracy; when R ≥ ST, it means that the population is threatened and a large leap is needed to avoid getting trapped in a local optimum.
[0147] Equation (6) shows that the discoverer plays a core role in guiding the direction of the population, but its position update mainly depends on random walks, which can easily lead the algorithm to get stuck in local optima. At the same time, the update strategy of the followers takes the discoverer as a reference. Once the discoverer gets stuck, the followers will lack the motivation to explore, which will affect the overall optimization efficiency.
[0148] The discoverer update formula of the traditional sparrow search algorithm is optimized and improved by utilizing the sine and cosine theorems;
[0149] The sine and cosine functions have natural periodicity and fluctuation characteristics, which can guide the search to explore a wider range in the solution space and reduce the risk of getting trapped in local optima.
[0150] A step-size factor strategy is introduced into the sine and cosine mechanisms. The position update formula is improved by using a step-size factor r1, and its update form is as follows:
[0151] r1=1-t / M (43)
[0152] Where t is the current iteration number and M is the total number of iterations;
[0153] The Sigmoid function is introduced to dynamically adjust the dependence on individual information at the current moment, as shown in the following formula:
[0154]
[0155] Where Ω is the dependency factor and k is the control factor;
[0156] Regarding r1 and Ω, in the early stages of optimization, r1 has a larger weight and Ω has a smaller weight, which is beneficial for global search; in the later stages, r1 becomes smaller and Ω becomes larger, which is beneficial for improving local search ability and accelerating convergence speed.
[0157] The discovery position update formula, which combines the dependency factor Ω and the optimization factor r1, is as follows:
[0158]
[0159] Where r2 is a random number in the interval [0, 2π], used to control the sparrow's movement range, r1 is the step size factor, and Ω is the dependency factor. Let X be the position of the i-th sparrow in the j-th dimension at iteration t. best R and ST represent the current optimal position of the population, respectively, and the safety value and warning value are the same. The sine and cosine theorems are introduced into the discoverer position update formula for optimization, which enhances the global search capability of the algorithm.
[0160] When R < ST, the discoverer updates its position using a sine function; when R ≥ ST, a cosine function is used for updating.
[0161] By leveraging the periodic oscillations of sine and cosine functions, the diversity of individual discoverers is maintained, thereby enhancing the algorithm's global optimization capability and accelerating convergence.
[0162] In sparrow populations, followers undertake local search tasks and optimize parameters by following the discoverer; in SSA, the position update formula for followers is as follows:
[0163]
[0164] in, The position of the discoverer with the best global fitness. The position of the sparrow with the worst global fitness; A + =A T (AA T ) -1 A is a 1*d matrix whose elements are randomly selected as 1 or -1; when i > n / 2, it means that the follower is in a poor position and needs to go to other areas to forage; when i ≤ n / 2, it means that the follower should conduct a local search near the discoverer.
[0165] In population activities, followers forage around the discoverer, resulting in insufficient search variability and a tendency to get trapped in local optima. By introducing the Cauchy mutation formula to update the follower positions, population diversity is enhanced, the search range is expanded, and the algorithm's global exploration capability is improved.
[0166] The probability density function of the standard Cauchy distribution is shown below:
[0167]
[0168] Where μ and σ are the position parameter and size parameter, respectively. Setting the position parameter to 0 and the size parameter to 1, the Cauchy variation formula is obtained as follows:
[0169]
[0170] The follower position update is improved using the Cauchy mutation formula to avoid local optima. The update formula is as follows:
[0171]
[0172] in, X is the updated position of the follower. best (t) represents the optimal position in the current iteration, and R is a random number generated by a Cauchy distribution with a degree of freedom parameter of 1. The Cauchy distribution has a heavy-tailed characteristic, and the generated random numbers will have a large deviation, which enhances the search diversity.
[0173] By employing the Cauchy mutation strategy, individual followers are dynamically updated based on the globally optimal position, achieving an effective balance between global exploration and local development, thereby improving the overall performance of the algorithm.
[0174] To prevent the search process from getting stuck in local optima, the SSA algorithm designates 10%–20% of individuals as vigilant individuals, with the position update formula as follows:
[0175]
[0176] in, The current global optimal position is given by β, which is a control step size parameter and follows a normal distribution with a mean of 0 and a variance of 1; K is a random number in the interval [-1, 1]; f i f is the fitness value of the sparrow. g and f w These are the current best and worst fitness values, respectively, with ε being a constant to prevent the denominator from being 0;
[0177] When f i >f g When f indicates that the individual is on the edge of the population and needs to move towards the center; when f i =f g At this time, individuals move randomly within the population to improve predation efficiency;
[0178] like Figure 2 The sparrow search algorithm was improved to optimize the control principle of the PID controller, so that the chilled water return temperature output is fixed, and the difference between the detected return water temperature and the set return water temperature is minimized, thus finding the optimal K. p K i and K d Combine and output;
[0179] The sparrow search algorithm is improved in three aspects: sparrow population initialization, discoverer position update formula, and follower position update formula. The improved sparrow search algorithm is then used to optimize three parameters K of the PID controller for air conditioning chilled water. p K i and K d ,as follows:
[0180] First, set the initial parameters of the sparrow search algorithm and initialize the population: the population size is set to 50; the number of iterations is 50; the search dimension is 3; the proportion of discoverers is 0.8; and the proportion of followers is 0.2.
[0181] The integral-time weighted absolute error performance index function in the PID controller is used as the fitness function of the improved sparrow search algorithm. The PID controller parameters are optimized to rank the population positions and determine the quality of individual positions. The formula is as follows:
[0182]
[0183] Where T represents the total control time, and e(t) is the PID control error;
[0184] In the population, the discoverer updates its position using the improved law of sine and cosine formula, while the follower updates its position using the Cauchy mutation formula.
[0185] The individual fitness function value is recalculated based on the updated population position. If the current fitness function value is better than the previous one, the current individual position is taken as the current optimal solution, and the process is iterated and output sequentially. When the iteration termination condition is met, the iteration stops, and the current optimal value is taken as the algorithm optimization result. The optimal parameter combination, i.e., the optimal parameter solution for PID control, is output: K. p K i and K d ;
[0186] Calculate and sort the initial population fitness function values, then iteratively update the individual positions according to the discoverer and follower position update formulas, continuously compare the fitness function values to reselect the optimal fitness value and optimal position; when the iteration stops, the iteration stops and the final optimal parameter combination of the PID controller is output.
[0187] PID control is applied to the air conditioning chilled water system. A mathematical model of the air conditioning chilled water system, which is a second-order time-delay system, is established as follows:
[0188] Using the controller frequency as the input to the air conditioning chilled water system and the chilled water flow rate as the output, its corresponding transfer function is:
[0189]
[0190] Where K1 is the actuator amplification factor, and T1 is the time constant of the frequency converter and the water pump;
[0191] The second stage uses chilled water flow rate as the input to the chilled water system and return water temperature as the output, specifically:
[0192]
[0193] Where K2 is the temperature difference amplification factor, t is the temperature difference lag time constant, and T2 is the chilled water time constant;
[0194] Based on the above transfer function, the mathematical model of the chilled water system is as follows:
[0195]
[0196] Where K is K1·K2;
[0197] Simultaneously setting K=3, T1=48, T2=1, and defining the system time lag constant τ=100s, the mathematical model is as follows:
[0198]
[0199] Given a control objective, determine its output performance curve;
[0200] When optimizing PID parameters and controlling the air conditioning chilled water system using the improved sparrow search algorithm, an interference signal was introduced during the 1200-second control process to verify the anti-interference performance.
[0201] The ISSA-PID controller of this invention outperforms PID and other optimization algorithms in terms of system response speed, smoothness of the adjustment process, and final stabilization effect. ISSA-PID can achieve setpoint tracking in a shorter time, exhibiting a faster rise time and a shorter settling time, indicating faster response speed and stronger dynamic performance. Simultaneously, overshoot is significantly reduced during the adjustment process, and system fluctuations are noticeably weakened, reflecting excellent control smoothness.
[0202] After the system ran for 1200 seconds, a disturbance was introduced to test the algorithm's anti-interference performance. Traditional PID controllers and some intelligent optimized PID controllers showed significant fluctuations after being disturbed, and the time required to recover the setpoint was relatively long, indicating poor stability. However, the ISSA-PID controller of this invention, after incorporating the anti-interference mechanism, exhibited good interference suppression capabilities, with small system oscillation amplitude, smooth adjustment process, and no obvious secondary overshoot or delayed response.
[0203] Temperature deviation signals generated during system operation are collected and input to a PID controller based on an improved sparrow search algorithm. The improved algorithm initializes the population by introducing a back-learning strategy optimized by the refraction principle, thereby enhancing initial population diversity. Sine and cosine transforms and Cauchy mutation mechanisms are introduced during the position update phases of the discoverer and follower, respectively, to effectively avoid getting trapped in local optima. The PID controller dynamically adjusts its proportional coefficient K based on the improved algorithm. p Integral coefficient K i and differential coefficient K d This allows for optimal parameter tuning; the optimized PID parameters control the chilled water system, improving system control performance and anti-interference capabilities. It boasts higher optimization efficiency, stronger global search capability, and better control performance. The fitness evaluation process quantifies optimization results, resulting in faster system response and smaller temperature fluctuations.
[0204] In summary, this invention addresses the nonlinearity, time delay, and complex operating conditions inherent in air conditioning chilled water systems. It employs an improved sparrow search algorithm to optimize the parameters of the PID controller, fully leveraging the algorithm's global search capabilities and ability to escape local optima to find the optimal PID parameter combination. This avoids the inefficiencies and inaccuracies associated with manual parameter tuning based on experience. Compared to traditional PID control methods, this invention ensures rapid system response while exhibiting stronger suppression of return water temperature fluctuations, effectively shortening the system's settling time and enabling it to reach steady state more quickly, thus significantly improving control performance. Furthermore, it demonstrates excellent anti-interference capabilities, maintaining stable and reliable temperature control even under external disturbances.
[0205] To improve the tuning efficiency and accuracy of PID controllers, an improved Sparrow Search Algorithm (ISSA) is used to automatically optimize the parameters of the PID controller, avoiding the inefficiency and uncertainty caused by relying on manual experience for parameter tuning, and effectively improving the globality and convergence speed of parameter search.
[0206] To enhance the control performance and stability of the system, the reverse learning mechanism optimized by the refraction principle, the sine and cosine transformation strategy and the Cauchy mutation mechanism are introduced, which makes the optimization process more diverse and capable of escaping local optima. As a result, the PID controller can perform better control when facing the complex dynamic conditions of the chilled water system, with faster response, smaller overshoot and lower steady-state error.
[0207] The optimized PID controller enhances the robustness and anti-interference capability of the system, and has strong adaptive capability. It can effectively adjust according to the system operating status. Even when there are disturbances or model uncertainties in the system, it can still maintain good control performance, thus improving the practicality and reliability of the control system.
[0208] The algorithm is highly versatile and adaptable to a wide range of application scenarios. The improved ISSA algorithm has good global optimization capabilities and computational efficiency. It is not only suitable for PID parameter optimization in air conditioning chilled water systems, but can also be extended to control parameter tuning of other nonlinear and time-delay systems. It has strong versatility and promotion value.
[0209] The engineering implementation is simple and has good prospects for practical application. It retains the simplicity of the PID control structure while optimizing the algorithm design, making it easy to deploy and implement in existing engineering control platforms without requiring major changes to the system hardware structure. It is easy to promote and apply to actual industrial control scenarios.
[0210] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the scope of protection of the invention. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0211] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
[0212] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. An air conditioning chilled water PID parameter optimization method based on an improved sparrow search algorithm, characterized in that: The method comprises the following steps: S1: improving the population initialization, finder update formula and follower update formula in the sparrow search algorithm; S2: detecting the return water temperature difference signal of the chilled water system of the air conditioner and inputting the signal to the improved sparrow search algorithm PID controller to dynamically adjust the proportional coefficient, integral coefficient and differential coefficient of the PID controller by the improved sparrow search algorithm; S3: iteratively calculating the optimal parameter combination by the improved sparrow search algorithm, and performing optimal control on the chilled water system by the PID controller based on the optimal parameter combination, and giving an anti-interference test.
2. The method for PID parameter optimization of chilled water in air conditioning based on improved sparrow search algorithm according to claim 1, characterized in that: Step S1 comprises: S11: using the refraction reverse learning to optimize the sparrow population initialization distribution; S12: using the sine theorem to enhance the global search ability of the finder position update; S13: using the Cauchy mutation formula to optimize the follower position update formula.
3. The method of claim 1, wherein the method is based on an improved sparrow search algorithm for PID parameter optimization of chilled water in an air conditioner. Step S2 comprises: S21: setting the initial parameters of the improved sparrow search algorithm, including the population size, optimization dimension and iteration number, and using the refraction reverse strategy to initialize the population distribution; S22: defining the integral time weighted absolute error ITAE as the algorithm fitness function, calculating the fitness function value according to the initial sparrow population distribution and sorting, and obtaining the initial population optimal position; S23: According to the law of sines and cosine variation formula, the position of the discoverer and the follower is updated, and the optimal solution is approached, and the optimal position of the population is output, that is, K p , K i and K d , and the optimal parameter combination is output when the iteration condition is met.
4. The method for PID parameter optimization of chilled water in air conditioning based on improved sparrow search algorithm according to claim 1, characterized in that: Step S3 comprises: S31: the control target is to make the return water temperature 12℃, input the optimal PID parameter combination, and measure the performance curve; S32: adding a disturbance signal in the simulation running for 1200s to test the external ability.
5. The method for PID parameter optimization of chilled water in air conditioning based on improved sparrow search algorithm according to claim 1, characterized in that: The individual position of the sparrow search algorithm population is established as follows: Wherein, n is the number of sparrows in the population, and d represents the dimension of the to-be-optimized variable; The population initialization position and the position update are based on the advantages and disadvantages of the fitness function value, and are expressed as: Wherein, f(*) represents the fitness value of the sparrow individual; The refraction theorem is used for reverse learning to optimize the population initialization to obtain the best population initial distribution. The core of the reverse learning is to generate a symmetric reverse solution according to the current solution to obtain a new candidate solution. Assuming that the range of the variable x to be optimized is [a, b], the inverse solution is defined as: wherein a, b represent the upper and lower limits of the variable x to be optimized, denotes the opposite solution; The refraction theorem is used for reverse learning, the interval [a, b] is set as the optimization solution limit, the refraction rate is set as λ, and the following formula is obtained: Wherein, x and x' represent the to-be-optimized solution and the corresponding solution after refraction, θ1 and θ2 are the incident angle and the reflection angle, and l and l' are the incident angle and the reflected light length; The initial population position distribution formula is simplified as follows: Wherein, the scaling factor n = l / l', when n and λ are both 1, the x' position is the same as the basic reverse learning; The sparrow search algorithm cooperates with the finder, follower and alarm in the population, and continuously approaches the optimal solution according to the advantages and disadvantages of the fitness function value, i.e. the position is good or bad. In the sparrow population, the finder individual mainly undertakes the global search task, guides the search direction of the whole group, and drives the remaining individuals to carry out search; the number of finders accounts for 10% to 20% of the population size, and this proportion helps to balance the global exploration and local development ability of the algorithm, and the formula is as follows: where t represents the current iteration number, is the position of the ith sparrow in the jth dimension in the tth iteration, iter max is the maximum iteration number, a is a random number in the interval [0, 1] to adjust the update amplitude; R and ST are the security threshold and the early warning threshold, respectively, Q is a random number of normal distribution, and L is a matrix with all elements being 1. Wherein, when R < ST, the sparrow individual is in a safe state, the finder shrinks the search range to improve the precision; when R ≥ ST, it indicates that the population is threatened, and a large step jump is needed to avoid falling into a local optimum. Equation (6) shows that the discoverer plays a core role in guiding the direction in the population, but its position update mainly depends on random walk, which is easy to lead the algorithm into local optimum; at the same time, the update strategy of the follower is based on the discoverer, and once the discoverer is trapped in stagnation, the follower will lack the motivation to explore, affecting the overall optimization efficiency; The discoverer update formula of the traditional sparrow search algorithm based on the sine-cosine theorem is optimized and improved. The step factor strategy is introduced into the sine and cosine mechanism, and the step factor r1 is used to improve the position update formula, which is as follows: r1 = 1-t / M (7) where t is the current iteration number and M is the total iteration number. The Sigmoid function is introduced to dynamically adjust the dependence of the individual information at the current time, and the formula is as follows: where Ω is the dependence factor and k is the control factor. For r1 and Ω, in the early stage of optimization, r1 has a larger weight and Ω is smaller, which is beneficial to global search; in the later stage, r1 becomes smaller and Ω becomes larger, which is beneficial to improve the local search ability and speed up the convergence speed. The dependence factor Ω and the optimization factor r1 are fused, and the discoverer position update formula is as follows: where r2 is a random number in the interval [0, 2π] for controlling the moving range of sparrow, r1 is a step factor, and Ω is a dependence factor, is the position of the ith sparrow in the jth dimension at iteration t, X best is the current optimal position of the population, R and ST are safety and alert values, respectively; the positive sine theorem is introduced in the position update formula of the discoverer to optimize and enhance the global search ability of the algorithm; When R < ST, the discoverer updates the position through the sine function; when R ≥ ST, the cosine function is used for update. The periodic oscillation of the sine-cosine function is used to maintain the diversity of the discoverer individuals, improve the global optimization ability of the algorithm, and speed up the convergence speed. In the sparrow population, the follower undertakes the task of local search and optimizes the parameters by following the discoverer. In SSA, the position update formula of the follower is as follows: wherein, is the position of the fittest discoverer, is the position of the worst sparrow; A + = A T (AA T ) -1 A is a 1*d matrix, whose elements are randomly taken as 1 or -1; when i > n / 2, it means that the follower position is poor and needs to go to other areas to forage; when i≤n / 2, it means that the follower should search locally near the discoverer; In the population activity, the follower searches around the discoverer, and the search variability is insufficient, which is easy to fall into local optimum. The Cauchy mutation formula is introduced to update the position of the follower, which enhances the population diversity, expands the search range, and improves the global exploration ability of the algorithm. The probability density function of the standard Cauchy distribution is as follows: where μ and σ are the position parameter and size parameter, respectively. The position parameter is set to 0 and the size parameter is set to 1, and the Cauchy mutation formula is obtained as follows: The Cauchy mutation formula is used to improve the position update of the follower, and the update formula is as follows: wherein, X is the updated position of the follower, best (t) is the optimal position of the current iteration, R is a random number generated by a Cauchy distribution with a degree of freedom parameter equal to 1; the Cauchy distribution has a heavy-tailed characteristic, and the generated random number will have a large deviation, enhancing the search diversity; Through the Cauchy mutation strategy, the individual of the follower is dynamically updated based on the global optimal position, achieving an effective balance between global exploration and local development, and improving the overall performance of the algorithm. To prevent the search process from falling into local optimum, 10% to 20% of the individuals in the SSA algorithm are set as guards, and the position update formula is as follows: wherein, is the current global optimal position, β is a control step parameter, and is a normally distributed random number with a mean of 0 and a variance of 1; K is a random number in the interval [-1, 1]; f i is the fitness value of the sparrow, f g and f w are the current optimal and worst fitness values, respectively, and ε is a constant used to prevent the denominator from being 0. When f i > f g , it indicates that the individual is at the edge of the population and needs to move towards the center; when f i = f g , the individual moves randomly in the middle of the population to improve the efficiency of predation; The sparrow search algorithm is improved from three aspects of sparrow population initialization, finder position updating formula and follower position updating formula, and the three parameters K p , K i and K d of the air conditioner chilled water PID controller are optimized by using the improved sparrow search algorithm as follows: First, set the initial parameters of the sparrow search algorithm and initialize the population: the population size is set to 50; the iteration number is 50; the search dimension is 3; the discoverer proportion is 0.8; and the follower proportion is 0.
2. The integral time weighted absolute error performance index function in the PID controller is used as the fitness function of the improved sparrow search algorithm to optimize the PID controller parameters. The goodness or badness of the population position is determined by sorting the population position, and the formula is as follows: where T represents the total control time and e(t) is the PID control error. The discoverer in the population updates its position based on the improved sine-cosine theorem formula, and the follower updates its position based on the Cauchy mutation formula. According to the updated population position to recalculate the individual fitness function value, if the fitness function value is better than the last time, the individual position is taken as the current optimal solution, and the iteration output is sequentially iterated; Satisfy the iteration termination condition, stop iteration, take the current optimal value as the algorithm optimization result, output the optimal parameter combination, that is, the optimal parameter solution of PID control: K p , K i and K d .
6. The method of claim 5, wherein the PID parameter optimization method for chilled water of an air conditioner based on the improved sparrow search algorithm is characterized by: PID control is performed on the air conditioning chilled water system, and a mathematical model of the air conditioning chilled water system is established. The air conditioning chilled water system is a second-order time-delay system, and the mathematical model of the air conditioning chilled water transfer function is as follows: Taking the controller frequency as the input of the air conditioning chilled water system and the chilled water flow as the output, the corresponding transfer function is: Wherein, K1 is the actuator amplification coefficient, T1 is the time constant of the frequency converter and the water pump; Taking the chilled water flow as the input of the chilled water system and the return water temperature as the output, the specific is: Wherein, K2 is the temperature difference amplification coefficient, t is the temperature difference time constant, T2 is the chilled water time constant; The mathematical model of the chilled water system is obtained by combining the above transfer functions, which is as follows: Wherein, K is K1·K2; At the same time, take K=3, T1=48, T2=1, set the system lag time constant τ=100s, the mathematical model is as follows: The improved sparrow search algorithm is used to optimize the PID parameters and control the air conditioning chilled water system. The anti-interference performance is verified by introducing interference signals in the control process.
Citation Information
Cited By
Blood flow control optimization method for extracorporeal circulation detection system
CN121522995A
Metro station air conditioner energy-saving optimization method and system
CN121723436A
A metro station air conditioning energy-saving optimization method and system
CN121723436B