A temperature control PID parameter setting method for improving gecko optimization algorithm
Patent Information
- Application Number
- CN202611071846.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2046-07-20
AI Technical Summary
[0004]本发明的目的在于提供一种改进壁虎优化算法的温度控制PID参数整定方法,用以解决传统PID参数整定方法依赖人工经验、整定效率低,以及基础壁虎优化算法在温度控制PID参数寻优中存在参数尺度差异影响搜索稳定性、个体搜索节奏容易趋同、易陷入局部最优和后期寻优精度不足的问题
本发明提出一种改进壁虎优化算法的温度控制PID参数整定方法,在基础壁虎优化算法上建立自适应编码搜索空间,减小待优化参数尺度差异的影响;通过排序相位引导和多分量协同位置更新,使个体保持差异化搜索节奏,增强算法的全局探索和局部开发能力;同时结合历史漂移、Levy跳跃、折返搜索、停滞重置、边界反射和局部单维修整,提高种群跳出局部最优及后期精细寻优能力,改善算法的收敛速度、寻优精度和搜索稳定性。将所述算法用于PID控制器Kp、Ki和Kd的优化整定,能够减少人工整定依赖,使温度控制系统具有较快响应速度、较小超调量和稳态误差,并提高系统的控制精度、稳定性。
Smart Images

Figure CN122613693B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of PID control optimization technology, and in particular relates to an improved gecko optimization algorithm for temperature control PID parameter tuning. Background Technology
[0002] Temperature control systems are widely used in industrial heating furnaces, heat treatment equipment, and other industrial control scenarios requiring stable temperature regulation. Because temperature-sensitive objects typically exhibit high thermal inertia, significant response lag, propagation delay, and uncertainty in external disturbances, control systems often suffer from slow response speed, large overshoot, difficulty in eliminating steady-state errors, and insufficient anti-interference capabilities during actual operation. PID controllers are widely used in temperature control systems due to their simple structure, clear parameter physical meaning, and ease of engineering implementation. However, the control effect of PID controllers is highly dependent on the proper tuning of the proportional coefficient Kp, integral coefficient Ki, and derivative coefficient Kd. Traditional PID parameter tuning methods often rely on manual experience and trial-and-error approaches, making it difficult to simultaneously achieve optimal response speed, steady-state accuracy, and control stability.
[0003] To improve the automation and optimization accuracy of PID parameter tuning, swarm intelligence optimization algorithms are increasingly being applied to the field of control parameter optimization. The gecko optimization algorithm is a swarm intelligence optimization algorithm that simulates the behaviors of geckos, such as predation, olfactory guidance, group pursuit of profit, tail shedding for escape, and historical memory. It possesses certain global search and local development capabilities. However, when used for PID parameter tuning in temperature control systems, the basic gecko optimization algorithm still suffers from problems such as the influence of different parameter scales on search stability, the tendency for individual search rhythms to converge, insufficient utilization of historical improvement directions, and limited fine-grained optimization capabilities during stagnant phases. Therefore, it is necessary to improve the gecko optimization algorithm and apply it to PID parameter tuning in temperature control systems to improve the dynamic response performance and steady-state accuracy of the temperature control system. Summary of the Invention
[0004] The purpose of this invention is to provide an improved method for tuning PID parameters for temperature control using the gecko optimization algorithm. This method addresses the problems of traditional PID parameter tuning methods, which rely on manual experience and have low tuning efficiency. It also addresses the issues of the basic gecko optimization algorithm in temperature control PID parameter optimization, such as parameter scale differences affecting search stability, individual search rhythms tending to converge, easy getting trapped in local optima, and insufficient optimization accuracy in the later stages.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: An improved gecko optimization algorithm is proposed for tuning PID parameters in temperature control. The improved gecko optimization algorithm is used to optimize the control parameters of the PID controller in the temperature control model. The specific steps are as follows.
[0006] S1. Establish a temperature control model based on a PID controller.
[0007] S2. Improved gecko optimization algorithm.
[0008] S3. The improved gecko optimization algorithm is used to optimize the control parameters of the PID controller in the temperature control model. A set of optimal PID control parameters Kp, Ki and Kd are obtained through algorithm optimization.
[0009] S4. The temperature control model is simulated using MATLAB and Simulink.
[0010] In step S1, the temperature control model includes a target temperature input module, a temperature error calculation module, a PID controller module, an inertial hysteresis temperature object module, a temperature output module, and a feedback module. The temperature error calculation module calculates the deviation between the target temperature and the actual temperature. The PID controller module generates a control quantity based on the temperature deviation. The inertial hysteresis temperature object module outputs a temperature response based on the control quantity, and a closed-loop temperature control is formed through the feedback module. The control law of the PID controller is: (1); In the formula, Let r be the control quantity at the k-th sampling time, and r be the target temperature. This is the actual temperature output at the k-th sampling time. The sampling period is , , These are the proportional coefficient, integral coefficient, and differential coefficient, respectively.
[0011] Furthermore, the algorithm in S2 is improved, specifically as follows.
[0012] First, establish an adaptive encoding search space. When the lower bound of the search for the parameters to be optimized is greater than 0, set an internal encoding variable Z in a unified internal encoding space from 0 to 1, and decode the internal encoding variable Z into the actual parameters to be optimized X through logarithmic mapping. The formula is as follows: (2); In the formula, For the j-th parameter to be optimized, For the j-th internal encoded variable, and These are the lower and upper bounds for the search of the j-th parameter, respectively.
[0013] Secondly, a sorting phase guidance mechanism is constructed. Based on the current iteration count, maximum iteration count, individual sorting index, and phase seed, a phase fluctuation term and a cross-phase term are constructed to give different sorted individuals different search rhythms. A contraction factor is also constructed to adjust the search amplitude. The formula is as follows: (3); (4); (5); In the formula, For phase fluctuation term, This represents the crossover phase term, where t is the current iteration number, T is the maximum iteration number, i is the individual index sorted by fitness value, and N is the population size. is the phase seed, and c is the contraction factor.
[0014] Thirdly, a multi-component collaborative candidate position update mechanism is constructed; the optimal traction component, phase swing component, cross traction component, historical drift component, and random perturbation component are jointly applied to the candidate individual update, as shown in the formula: (6); (7); (8); (9); (10); (11); In the formula, For the first The current location of each individual. For the first Candidate positions of each individual For the optimal traction component, For the phase swing component, For cross-traction components, As a component of historical drift, Let B be the random perturbation component, C be the current optimal position, and t be the current iteration number. This represents the historically optimal direction of change. For the search space width, For random vectors, It is a Gaussian random vector. This represents the element-wise product of the corresponding dimension.
[0015] Fourth, construct the Levy jump perturbation mechanism; when the jump perturbation trigger condition is met, the Levy jump perturbation is superimposed on the random perturbation component to expand the search range of candidate individuals. The formula is as follows: (12); In the formula, For the Levy jump perturbation component For the jump scale, Let t be a Levy random vector, and t be the current iteration number.
[0016] Fifthly, construct boundary reflection, backtracking search, stagnation reset, and local single-person maintenance adjustment mechanisms; perform boundary reflection processing on out-of-bounds candidate individuals; perform backtracking search on some candidate individuals to adjust them towards the population center; when no better solution is obtained after several consecutive iterations, reset individuals with larger fitness values and lower rankings to the neighborhood of the current optimal position; after completing the re-evaluation of candidate individual fitness, greedy selection, and updating of the current optimal individual, perform local single-person maintenance adjustment on the updated current optimal individual, with the following formula: (13); (14); (15); (16); In the formula, The first after boundary reflection Dimensional position, To return to the search location, To reset the position for a stalled state, For local detection location, It is a uniformly random vector whose elements take values between 0 and 1. It is a Gaussian random vector. ∈{−1,1} represents the local detection direction. Let m be the width of the search space in the m-th dimension. Let m be the unit direction vector.
[0017] Furthermore, in step S3, the control parameters of the PID controller in the temperature control model are optimized using an improved gecko optimization algorithm. The specific steps are as follows: S31. Set the population size N, problem dimension dim, maximum number of iterations T, upper bound of search space ub, and lower bound of search space lb. When the lower bound of the search space of the parameter to be optimized is greater than 0, establish an internal coding search space with a value range of 0 to 1, and generate an initial population in the internal coding search space. S32. According to equation (2), decode the internal encoded variables in the initial population into actual parameters to be optimized. Input the three components of each set of actual parameters to be optimized as proportional coefficient Kp, integral coefficient Ki, and derivative coefficient Kd into the temperature control model, respectively. Run the closed-loop control simulation and calculate the fitness value. The fitness function is: (17); In the formula, J is the fitness value, M is the number of simulation sampling points, and r is the target temperature. This is the actual temperature output at the k-th sampling time. S33. Sort the population in ascending order of fitness value, and determine the current best individual, the best fitness, and the population center; S34. Construct phase fluctuation terms, cross phase terms, and contraction factors according to the iteration progress and individual fitness ranking, so that individuals with different rankings have different search rhythms. The relevant formulas are shown in Equations (3), (4), and (5). S35. Calculate the optimal traction component, phase swing component, cross traction component, historical drift component and random disturbance component respectively. When the jump triggering condition is met, the Levy jump disturbance is superimposed on the random disturbance component, and each updated component is fused to generate the candidate individual position. The relevant formulas are shown in Equations (6) to (12). S36. Perform backtracking search on candidate individuals with the population center as a reference. When no better solution is obtained in several consecutive iterations, reset individuals with larger fitness values and lower ranking to the neighborhood of the current best position. Then perform boundary reflection processing on candidate individuals. The relevant formulas are shown in Equations (13), (14), and (15). S37. Decode the candidate individuals into actual parameters to be optimized and rerun the closed-loop control simulation to calculate the fitness value of the candidate individuals; use greedy selection to retain candidate solutions that are better than the original individuals, reorder and update the current best individual, and update the historical drift direction according to the change of the current best position before and after the update. When the current best fitness is not improved, the historical drift direction is decayed; on this basis, perform local single-maintenance adjustment on the updated current best individual, calculate the fitness value of each local detection position, and update the current best individual with the local detection position with better fitness. The local single-maintenance adjustment formula is shown in Equation (16). S38. Determine if the maximum number of iterations has been reached; if so, terminate the iteration and output the optimal PID control parameters Kp, Ki, and Kd; if not, return to S33 to continue the next iteration.
[0018] Furthermore, in step S4, a closed-loop temperature control model is established using MATLAB and Simulink. This model includes a target temperature input module, a temperature error calculation module, a PID controller module, an inertial hysteresis temperature object module, a temperature output module, and a feedback module. The transfer function of the inertial hysteresis temperature object is: (18); In the formula, G(s) is the transfer function of the inertial hysteresis object, and s is a complex frequency domain variable. It is a 3-second pure time delay element; Under the same temperature control model and PID parameter search range, the basic gecko optimization algorithm and the improved gecko optimization algorithm were used to optimize the parameters respectively. The obtained optimal Kp, Ki and Kd were input into the PID controller, and the PID parameter tuning effect of the two algorithms was compared by fitness convergence curve and temperature response curve.
[0019] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: This invention proposes an improved method for tuning PID parameters in temperature control using a gecko optimization algorithm. An adaptive coding search space is established on top of the basic gecko optimization algorithm to reduce the impact of scale differences in the parameters to be optimized. Through sorting phase guidance and multi-component cooperative position updates, individuals maintain a differentiated search rhythm, enhancing the algorithm's global exploration and local exploitation capabilities. Simultaneously, by combining history drift, Levy jumps, backtracking search, stagnation reset, boundary reflection, and local single-factor tuning, the ability of the population to escape local optima and perform fine-tuning in later stages is improved, thus enhancing the algorithm's convergence speed, optimization accuracy, and search stability. Applying this algorithm to the optimization tuning of PID controllers Kp, Ki, and Kd reduces reliance on manual tuning, resulting in a temperature control system with faster response speed, smaller overshoot and steady-state error, and improved system control accuracy and stability. Attached Figure Description
[0020] Figure 1 To improve the gecko optimization algorithm, the flowchart of PID parameters for the temperature control system is optimized.
[0021] Figure 2 A diagram of the PID closed-loop model for temperature control in order to improve the gecko optimization algorithm.
[0022] Figure 3 This is a comparison of the fitness convergence curves of the basic gecko optimization algorithm and the improved gecko optimization algorithm.
[0023] Figure 4 This is a comparison chart of the temperature response curves after tuning the PID parameters using the basic gecko optimization algorithm and the improved gecko optimization algorithm. Detailed Implementation
[0024] 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. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] Please see Figures 1 to 4 This embodiment provides an improved method for tuning PID parameters for temperature control using a gecko optimization algorithm. The specific steps are as follows.
[0026] S1. Establish a temperature control model based on a PID controller.
[0027] S2. Improved gecko optimization algorithm.
[0028] S3. The improved gecko optimization algorithm is used to optimize the control parameters of the PID controller in the temperature control model. A set of optimal PID control parameters Kp, Ki and Kd are obtained through algorithm optimization.
[0029] S4. The temperature control model is simulated using MATLAB and Simulink.
[0030] Wherein, in S1, as Figure 2 As shown, the temperature control model includes a target temperature input module, a temperature error calculation module, a PID controller module, an inertial hysteresis temperature object module, a temperature output module, and a feedback module. The target temperature input module provides the target temperature, the temperature error calculation module calculates the deviation between the target temperature and the actual temperature, the PID controller module generates a control input based on the temperature deviation, the inertial hysteresis temperature object module outputs a temperature response based on the control input, and the temperature output is returned to the temperature error calculation module via the feedback module to form a closed-loop temperature control. The PID controller uses discrete PID control, and its control law is as follows: (1); In the formula, Let r be the control quantity at the k-th sampling time, and r be the target temperature. This is the actual temperature output at the k-th sampling time. The sampling period is , , These are the proportional coefficient, integral coefficient, and differential coefficient, respectively.
[0031] Furthermore, there are five improvements to the algorithm in S2, as detailed below.
[0032] First, establish an adaptive encoding search space. When the lower bound of the search for the parameters to be optimized is greater than 0, set an internal encoding variable Z within a unified internal encoding space of 0 to 1, and decode the internal encoding variable Z into the actual parameters to be optimized X through logarithmic mapping. The formula is: (2); In the formula, For the j-th parameter to be optimized, For the j-th internal encoded variable, and These are the lower and upper bounds for the search of the j-th parameter, respectively.
[0033] The second part involves constructing a sorting phase guidance mechanism. Based on the current iteration count, maximum iteration count, individual fitness sorting index, and phase seed, a phase fluctuation term and a cross-phase term are constructed. A contraction factor is then used to adjust the search amplitude. The formula is as follows: (3); (4); (5); In the formula, For phase fluctuation term, This represents the crossover phase term, where t is the current iteration number, T is the maximum iteration number, i is the individual index sorted by fitness value, and N is the population size. Here, c is the phase seed and c is the contraction factor. By altering the phase term through individual fitness ranking, individuals ranked higher tend to focus on developing near desirable areas, while individuals ranked lower maintain a relatively large search range.
[0034] Thirdly, a multi-component collaborative candidate position update mechanism is constructed, which combines the optimal traction component, phase swing component, cross traction component, historical drift component, and random perturbation component to update the position of candidate individuals. The formula is as follows: (6); (7); (8); (9); (10); (11); In the formula, For the first The current location of each individual. For the first Candidate positions of each individual For the optimal traction component, For the phase swing component, For cross-traction components, As a component of historical drift, Let B be the random perturbation component, C be the current optimal position, and t be the current iteration number. This represents the historically optimal direction of change. For the search space width, For random vectors, It is a Gaussian random vector. Represents the element-wise product of the corresponding dimension; The historical drift component is used to utilize the changing trend of the current best position relative to the historical best position, so that the candidate individual update simultaneously refers to the current best position, the population center, and the historical improvement direction.
[0035] Fourth, construct a Levy jump perturbation mechanism. When the jump triggering condition is met, a Levy jump is superimposed on the random perturbation component to expand the search range of candidate individuals. The formula is as follows: (12); In the formula, For the Levy jump perturbation component For the jump scale, Let t be a Levy random vector, and t be the current iteration number.
[0036] Fifthly, a boundary reflection, backtracking search, stagnation reset, and local single-person maintenance adjustment mechanism is constructed. Boundary reflection is performed on out-of-bounds candidate individuals, backtracking search is performed on some candidate individuals, and when no better solution is obtained in several consecutive iterations, individuals with larger fitness values and lower rankings are reset. After updating the current best individual, local single-person maintenance adjustment is performed. The formula is as follows: (13); (14); (15); (16); In the formula, The first after boundary reflection Dimensional position, To return to the search location, To reset the position for a stalled state, For local detection location, It is a uniformly random vector whose elements take values between 0 and 1. It is a Gaussian random vector. ∈{−1,1} represents the local detection direction. Let m be the width of the search space in the m-th dimension. This is the m-th unit direction vector; The boundary reflection The backtracking search is used to reflect out-of-bounds locations back into the search range. Used to adjust candidate individuals toward the population center, Stagnation reset is used to update the worse individuals in the stagnant phase, the local single-item repair adjustment. Used to construct local detection locations along the positive and negative directions of each parameter dimension.
[0037] Furthermore, in step S3, the control parameters of the PID controller in the temperature control model are optimized using an improved gecko optimization algorithm. The specific steps are as follows: S31. Set the population size N of the improved gecko optimization algorithm to 30, the problem dimension dim to 3, and the maximum number of iterations T to 35. The three optimization dimensions correspond to the proportional coefficient Kp, integral coefficient Ki, and differential coefficient Kd, respectively. The search range of Kp is 0.2 to 12, the search range of Ki is 0.1 to 10, and the search range of Kd is 0.05 to 8. Since the lower bound of the search of the three parameters to be optimized is greater than 0, an internal coding search space with a value range of 0 to 1 is established, and an initial population is generated in the internal coding search space. S32. According to equation (2), the internal encoded variables in the initial population are decoded into actual PID parameter combinations. The three components in each PID parameter group are used as Kp, Ki, and Kd to input the temperature control model, respectively. A closed-loop control simulation is run from 0 to 100 s, and the fitness value of each individual in the population is calculated according to the fitness function. The target temperature r is set to 1. The smaller the fitness value, the better the corresponding PID parameter combination. The fitness function formula is: (17); In the formula, J is the fitness value, M is the number of simulation sampling points, and r is the target temperature. This is the actual temperature output at the k-th sampling time. S33. Sort the individuals in the population according to their fitness values from smallest to largest, and determine the current best individual, the current best fitness, and the population center; S34. Based on the current iteration progress and individual fitness ranking, construct phase fluctuation term, cross phase term and contraction factor according to Equations (3) to (5) so that individuals of different rankings have different search rhythms, and use the contraction factor to adjust the search amplitude of the population. S35. Calculate each update component according to equations (7) to (11). When the jump triggering condition is met, superimpose the Levy jump perturbation onto the random perturbation component according to equation (12), and fuse each update component according to equation (6) to generate candidate individual positions. In this embodiment, the triggering probability of Levy jump is set to 0.28, the Levy stability index gradually decreases from 1.10 to 0.36 according to the current iteration progress, and the jump scale is set to 0.16c+0.010. S36. Using the population center as a reference, perform a backtracking search on the candidate individuals. When the current optimal fitness does not improve after 5 consecutive iterations, reset some individuals with larger fitness values and ranked at the back of the population to the neighborhood of the current optimal position. Then, perform boundary reflection processing on the candidate individuals. S37. Decode the processed candidate individuals into actual PID parameters and rerun the closed-loop control simulation. Calculate the fitness value of the candidate individuals. Use a greedy selection method to retain candidate solutions with fitness values better than the original individuals. Reorder the population and update the current best individual. At the same time, update the historical drift direction according to the change of the current best position before and after the update. If the current best fitness is not improved, the historical drift direction is decayed. On this basis, perform local single-maintenance adjustment on the updated current best individual and update the current best individual with the local detection position with better fitness value. S38. Determine whether the current iteration count has reached the maximum iteration count. If the maximum iteration count has been reached, terminate the optimization and output the optimal PID control parameters Kp, Ki, and Kd. If the maximum iteration count has not been reached, return to S33 to continue the next iteration.
[0038] Furthermore, in step S4, the temperature control model is simulated using MATLAB and Simulink. The specific steps are as follows: S41. Establish a closed-loop temperature control model in Simulink. Set the target temperature to 1, the sampling period of the discrete PID controller to 0.5 s, and the inertial hysteresis temperature object consists of a transfer function element and a 3 s pure time delay element. Its transfer function is: (18); In the formula, G(s) is the transfer function of the inertial hysteresis object, and s is a complex frequency domain variable. It is a 3-second pure time delay element; S42. In MATLAB, call the basic gecko optimization algorithm and the improved gecko optimization algorithm respectively, and perform optimization under the same PID parameter search range, the same population size and the same maximum number of iterations. Run a closed-loop simulation from 0 to 100 seconds for each fitness evaluation, and record the optimal fitness changes of the two algorithms. S43. Input the optimal PID parameters obtained by the basic gecko optimization algorithm and the improved gecko optimization algorithm into the same temperature control model, run the closed-loop response simulation from 0 to 50s, and output the fitness convergence curve and temperature response curve.
[0039] Furthermore, Figure 3 The graph shows a comparison of the fitness convergence curves of the basic gecko optimization algorithm and the improved gecko optimization algorithm. As can be seen from the graph, the improved gecko optimization algorithm can obtain a lower fitness value more quickly, indicating that the improvement mechanism improves the convergence ability and optimization accuracy of PID parameter optimization. Figure 4The figure shows a comparison of the temperature response curves after tuning the PID parameters using the basic gecko optimization algorithm and the improved gecko optimization algorithm. As can be seen from the figure, after tuning the PID parameters using the improved gecko optimization algorithm, the temperature output can track the target temperature faster, with a smaller overshoot, and remains stable near the target temperature. This indicates that the improved method can improve the convergence performance of PID parameter optimization and enhance the response speed and steady-state tracking performance of the temperature control system.
Claims
1. A temperature control PID parameter setting method for improving a gecko optimization algorithm, characterized in that, The gecko optimization algorithm is improved, and the improved gecko optimization algorithm is used to optimize the control parameters of the PID controller in the temperature control model. The specific steps are as follows: S1. Establish a temperature control model based on a PID controller; S2. Improve the gecko optimization algorithm, including improving the search space construction strategy and adopting an adaptive encoding mechanism to establish an internal encoding search space; The individual search guidance strategy is improved by introducing a phase guidance mechanism based on fitness ranking; the individual position update and subsequent search strategy are improved by adopting a multi-component collaborative position update mechanism and introducing Levy jump, stagnation reset, boundary reflection, backtracking search and local single repair adjustment mechanisms. S3, the improved gecko optimization algorithm is used to optimize the control parameters of the PID controller in the temperature control model, and a set of optimal PID control parameters is obtained through algorithm optimization 、 、 ; S4. The temperature control model is simulated using MATLAB and Simulink.
2. The temperature control PID parameter tuning method for improving the gecko optimization algorithm according to claim 1, characterized in that, In S1, the temperature control model includes a target temperature input module, a temperature error calculation module, a PID controller module, an inertial hysteresis temperature object module, a temperature output module, and a feedback module. The temperature error calculation module calculates the deviation between the target temperature and the actual temperature. The PID controller module generates a control input based on the temperature deviation. The inertial hysteresis temperature object module outputs a temperature response based on the control input, and a closed-loop temperature control is formed through the feedback module. The PID control law is as follows: (1); In the formula, is the control quantity at the kth sampling moment, r is the target temperature, is the actual temperature output at the kth sampling moment, is the sampling period, , , are proportional coefficient, integral coefficient and differential coefficient respectively.
3. The temperature control PID parameter tuning method for improving the gecko optimization algorithm according to claim 1, characterized in that, S2 includes: S21. Establish an adaptive encoding search space. When the lower bound of the search for the parameters to be optimized is greater than 0, set an internal encoding variable Z in a unified internal encoding space from 0 to 1, and decode the internal encoding variable Z into the actual parameters to be optimized X through logarithmic mapping. The relevant formula is: (2); In the formula, is the jth parameter to be optimized, is the jth internal coded variable, , are the lower and upper bounds of the search, respectively. S22. Construct a sorting phase guidance mechanism to generate phase differences among individuals based on iteration progress and fitness, and construct a contraction factor to adjust the search amplitude. The relevant formula is: (3); (4); (5); In the formula, For phase fluctuation term, The term represents the cross-phase term, where t is the current iteration number, T is the maximum iteration number, and N is the population size. is the phase seed, c is the shrinkage factor, and i is the individual number sorted according to fitness value.
4. The method for tuning PID parameters for temperature control using an improved gecko optimization algorithm according to claim 3, characterized in that, S2 further includes: S23. Construct a multi-component collaborative candidate position update mechanism, which combines the optimal traction component, phase swing component, cross traction component, historical drift component, and random perturbation component to update candidate individuals. The relevant formula is as follows: (6); In the formula, For the first Candidate positions of individuals after multi-component collaborative updating For the first The current location of each individual. This is the optimal traction component, used to guide the individual towards the current optimal position; The phase swing component is used to generate discrete perturbations based on the sorted phase. In equation (6), the minus sign is used to adjust the offset of the individual relative to the population center. This is a cross-traction component used to guide the search by utilizing the difference between the current optimal position and the population center position; This is the historical drift component, used to provide feedback on the direction of change of the historical optimal position; This is a random perturbation component used to maintain local random exploration capability; S24. Construct each update component in equation (6) respectively, and when the jump trigger condition is met, superimpose the Levy jump perturbation onto the random perturbation component to expand the search range. The relevant formula is: (7); (8); (9); (10); (11); (12); In the formula, B is the current optimal position, and C is the population center position. This represents the historically optimal direction of change. For the search space width, It is a random vector. It is a Gaussian random vector. For the Levy jump perturbation component Let Levy be a random vector. For the jump scale, This represents the element-wise product of the corresponding dimension.
5. The method for tuning PID parameters for temperature control using an improved gecko optimization algorithm according to claim 4, characterized in that, S2 further includes: S25. Perform boundary reflection processing on candidate individuals; S26. Construct a backtracking search mechanism with the population center as a reference; S27. When a better solution is not obtained in several consecutive iterations, the individual with a larger fitness value and a lower ranking is reset to the neighborhood of the current best position. S28. After completing the re-evaluation of candidate individual fitness, greedy selection, and updating of the current best individual, perform local single-item maintenance adjustment on the current best individual. The relevant formulas in S25 to S28 are as follows: (13); (14); (15); (16); In the formula, The first after boundary reflection Dimensional position, To return to the search location, To reset the position for a stalled state, For local detection location, It is a uniformly random vector whose elements take values between 0 and 1. It is a Gaussian random vector. ∈{−1,1} represents the local detection direction. Let m be the width of the search space in the m-th dimension. Let m be the unit direction vector.
6. The method for tuning PID parameters for temperature control using an improved gecko optimization algorithm according to claim 1, characterized in that, S3 includes: S31. Set the population size, problem dimension, maximum number of iterations, upper bound of the search space, and lower bound of the search space. When the lower bound of the search space for the parameter to be optimized is greater than 0, establish an internal coding search space with a value range of 0 to 1, and generate an initial population in the internal coding search space. S32, According to the formula The internal encoded variables in the initial population are decoded into actual parameters to be optimized. Each set of actual parameters to be optimized is input into the temperature control model. A closed-loop control simulation is run, and the fitness value is calculated. The fitness function is: (17); In the formula, r is the target temperature. The actual temperature output at the k-th sampling time is given by M, where M is the number of sampling points and J is the fitness value. The smaller the fitness value, the better the corresponding PID parameter combination. S33. Sort the population in ascending order of fitness value, and determine the current best individual, the best fitness, and the population center; S34. Construct phase fluctuation terms based on iteration progress and individual fitness. Cross phase term and contractile factor This allows individuals with different rankings to have different search rhythms.
7. The method for tuning PID parameters for temperature control using an improved gecko optimization algorithm according to claim 6, characterized in that, S3 further includes: S35. Calculate the optimal traction component respectively. Phase swing component Cross-traction component Historical drift component and random perturbation components When the jump trigger condition is met, the Levy jump perturbation is superimposed on the random perturbation component, and the updated components are fused to generate candidate individual positions. The candidate individual position update formula is as follows: ; S36. Perform a backtracking search on candidate individuals with the population center as a reference, using the following formula: When no better solution is found in several consecutive iterations, individuals with higher fitness values and lower rankings are reset to the neighborhood of the current best position. Then, boundary reflection processing is performed on the candidate individuals. The boundary reflection processing formula is: ; S37. Decode the candidate individuals into actual parameters to be optimized and rerun the closed-loop control simulation. Calculate the fitness value of the candidate individuals. Use greedy selection to retain candidate solutions that are better than the original individuals. Reorder and update the current best individual and the historical drift direction. Then perform local single-maintenance adjustment on the current best individual and update the current best individual with the local detection position with better fitness. S38. Determine if the maximum number of iterations has been reached. If it has, terminate the iteration and output the optimal PID control parameters Kp, Ki, and Kd. If it has not been reached, return to S33 to continue the next iteration.
Citation Information
Patent Citations
Metallographic specimen grinding and polishing PID control method based on improved multi-material compatibility
CN119535952A
Fuzzy PID temperature control method and system based on improved PSO algorithm
CN120085700A