A parameter optimization method for an improved cascade PID controller
By improving the Pied Kingfisher optimization algorithm and introducing disturbance and adaptive t-distribution adjustment strategies, the problem of localization of the algorithm in the search process is solved, the robustness and stability of the system are improved, and a more efficient PID controller is achieved Parameter optimization.
Patent Information
- Application Number
- CN202411238797.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2025-01-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The Kingfisher optimization algorithm is easy to localize during the search process, and loses the optimal solution, resulting in delays and uncertainties in the system process, and insufficient robustness and stability to external perturbations.
The Pied Kingfisher optimization algorithm is improved by introducing disturbance and random changes in the development stage, using linear interpolation method to dynamically adjust the defeat factor BF, and introducing an adaptive t-distribution adjustment strategy in the exploration stage to improve the exploration and development capabilities of the algorithm.
It effectively solves the localization problem of the Pied Kingfisher optimization algorithm in the exploration and development stages, improves the robustness and stability of the system, reduces process delays and uncertainties, and improves the resistance to external disturbances.
Smart Images

Figure CN118759831B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of PID control optimization, and in particular relates to a parameter optimization method of an improved cascade PID controller. Background Art
[0002] At present, PID controllers are widely used in various industrial process control scenarios, including temperature control, pressure control, flow control, and position control. Whether it is simple single-variable control or complex multi-variable control, the PID control system can be flexibly applied and is a very important and effective control technology. The parameters (proportional, integral, and differential) of the PID controller are relatively easy to adjust. Usually, the PID parameters can be optimized through experiments and experience to meet the performance requirements of the system. This flexibility makes the PID control system easier to adjust and optimize in practical applications.
[0003] Cascade PID control is a control system structure in which there are two or more PID controllers, and the output of one PID controller is used as the input of another PID controller. This structure is usually used to solve the control problems of complex systems, especially when the system has multiple interrelated control targets. In cascade PID control, there is usually a main PID controller and one or more secondary PID controllers. The main PID controller is responsible for controlling the main output of the control system, while the secondary PID controller is responsible for controlling the input of the main PID controller to improve the system's response speed, stability or reduce residual errors.
[0004] The Pied Kingfisher Optimizer (PKO) is a novel heuristic optimization algorithm, which is inspired by the unique hunting behavior and symbiotic relationship of the Pied Kingfisher in nature. The Pied Kingfisher is a small but agile bird that exhibits effective optimization strategies in its foraging process, such as food-finding skills, teamwork, and resource sharing. The Pied Kingfisher Optimizer is built around three different stages: perching and hovering, diving for prey, and cultivating symbiotic relationships. These behavioral aspects are transformed into mathematical models that can effectively solve various optimization challenges in various search spaces. The algorithm is compared with six well-known optimization techniques: Harris Hawk Optimizer (HHO), Whale Optimizer (WOA), Sin-Cosine Optimizer (SCA), Gray Wolf Optimizer (GWO), Gravitational Search Algorithm (GSA), and Moth Flame Optimizer (MFO). The overall results highlight the special ability of the Pied Kingfisher Optimizer to handle complex optimization problems. The Pied Kingfisher Optimizer shows superior exploration and development capabilities, but the algorithm is prone to lose the optimal solution during the exploration and development stages, thus falling into local optimality. Summary of the invention
[0005] In view of the shortcomings of the existing algorithms, the present invention improves the development and exploration stages of the Pied Kingfisher optimization algorithm, thereby solving the problems of localization of the search process of the Pied Kingfisher optimization algorithm, easy loss of the optimal solution, and falling into the local optimum, reducing the process delay and uncertainty of the system, and improving the system's robustness to external disturbances and the stability of the system.
[0006] The present invention adopts the following technical solutions:
[0007] A parameter optimization method for an improved cascade PID controller, the specific steps are as follows.
[0008] Step 1: Design the system model of the improved cascade PID controller.
[0009] Step 2: Improve the optimization algorithm of the spotted kingfisher. The improved optimization algorithm of the spotted kingfisher includes: D1: Improve the hunting ability of the spotted kingfisher in the development stage O ,D2. Use linear interpolation method to dynamically adjust the defeat factor BF. ,D3. Introduce adaptive t-distribution adjustment strategy in the population individual position update method in the exploration phase of the Pied Kingfisher optimization algorithm.
[0010] Step 3: Use the improved Kingfisher optimization algorithm to optimize the cascade PID controller parameter setting, and iterate to obtain the optimal PID controller parameter value.
[0011] Step 4: Use MATLAB to simulate the cascade PID control system.
[0012] Further, in the step 1, if Figure 2 As shown, the system model of the improved cascade PID controller includes a feedback module, an error calculation module, an external PID controller module, an internal PID controller module, an improved spotted kingfisher optimization algorithm module, and a controlled object module. The feedback module calculates the error between the expected target value and the actual output value, and is the input of the internal PID controller and the external PID controller. The error calculation module generates a control output based on the error signal, including three parts: proportional (P), integral (I), and differential (D). The external PID controller module is responsible for controlling the main process variables, achieving the final control goal of the system, and indirectly controlling the intermediate process variables. The internal PID controller module is responsible for controlling the intermediate process variables, quickly responding to disturbances and changes in the system, and providing a stable environment for the external PID controller. The improved spotted kingfisher optimization algorithm module is an improved standard spotted kingfisher optimization algorithm. The optimal solution obtained after multiple iterations of the algorithm is used as the parameter of the PID controller. The controlled object module receives the control signal output by the internal PID controller and feeds back the parameters in the process accordingly to achieve the control goal.
[0013] Furthermore, in step 1, the mathematical model of the improved cascade PID is:
[0014]
[0015] e1(t)=r(t)-y1(t) (2);
[0016] In formula (1), K p1 , K i1 , K d1 are the proportional, integral and differential coefficients of the external PID controller, e1(t) is the error signal of the external process, r(t) is the expected target value of the external process, and y1(t) is the actual output value of the external process;
[0017]
[0018] e2(t)=u1(t)-y2(t) (4);
[0019] In formula (3), K p2 , K i2 , K d2 are the proportional, integral and differential coefficients of the internal PID controller, e2(t) is the error signal of the internal process, u1(t) is the expected target value of the internal process, and y2(t) is the actual output value of the internal process.
[0020] Furthermore, the output y1(t) of the external PID controller is the input of the internal PID controller, and the output y2(t) of the internal PID controller is the control input acting on the external process. This cascade structure allows the internal PID controller to adjust the output of the external PID controller to improve the performance of the system.
[0021] Furthermore, in the step 2, the hunting ability O of the spotted kingfisher in the development stage is improved, and disturbances and random changes are introduced. When the spotted kingfisher preys, the energy of the prey will gradually decrease during the escape process. The prey escape energy dynamically selects the development behavior or the exploration behavior for hunting, which helps the algorithm to jump out of the local optimum and continue to search for a better solution. The improved mathematical model formula is:
[0022]
[0023] In formula (5), E0 is the initial escape energy of the prey, which is a random number between (-1, 1), t is the current iteration number, Max_Iter is the maximum iteration number, and when |O| >=1 When entering the exploration phase, |O| <1 Entering the development phase.
[0024] Furthermore, in the step 2, the linear interpolation method is used to dynamically adjust the defeat factor BF. In the standard Pied Kingfisher optimization algorithm, BF is set to a fixed value of 8, which simplifies the parameter setting, lacks adaptability, cannot balance exploration and development, is difficult to deal with different types of problems, and has unstable performance. The improved Pied Kingfisher optimization algorithm uses a linear interpolation method to dynamically adjust BF, so that it can adapt to different needs during the entire optimization process, improve the overall performance of the algorithm, and then improve the flexibility of the algorithm. The improved defeat factor BF mathematical model formula is:
[0025]
[0026] In formula (6), BF min The minimum value of BF is 2, BF max The maximum value of BF is 16, t is the current number of iterations, and Max_Iter is the maximum number of iterations.
[0027] Furthermore, in the step 2, an adaptive t distribution adjustment strategy is introduced in the exploration phase. The dynamic strategy value T in the individual position update of the standard piebald kingfisher optimization algorithm in the exploration phase is too dependent on the selection of angle Crest_angles, which will lead to unstable results. The expression of T is shown in formula (7). The cosine function cos(Crest_angles) will cause the individual position update to deviate in a specific direction. The unreasonable selection of Crest_angles or the update method is too dependent on the cosine function will cause the search process to be localized and fall into the local optimal solution and cannot jump out. The formula on which the standard piebald kingfisher optimization algorithm position update depends is shown in formula (8). After the introduction of the adaptive t distribution adjustment strategy, the scale parameter of the t distribution is adjusted according to the individual position change, so that when the fitness is low or the search space is relatively local, the amplitude of the disturbance is increased to jump out of the local optimal solution. When the fitness is high or the search space is relatively global, the amplitude of the disturbance is reduced to maintain the stability of the search. The formula is shown in formula (9):
[0028]
[0029] X i (t+1)=X i (t)+α×T×(X j (t)-X i (t)), i, j=1, 2,..., N and j≠i (8);
[0030]
[0031] In formula (7), Max_Iter is the maximum number of iterations, BF is the beat factor, t is the current number of iterations, Crest_angles is a random value in [0, 2π], and X in formula (8) is i (t+1) represents the solution of the next iteration, X i (t) represents the position of the current iteration, α is 2×randn(1, Dim), Dim is the spatial dimension 6, and T is the dynamic strategy value as shown in formula (7). In formula (9), is the position of the optimal solution in the jth dimension after the adaptive t distribution is adjusted, is the position of the optimal solution in the jth dimension before adaptive t-distribution adjustment, and t(iter) is the adaptive t-distribution adjustment function with the number of population iterations as a parameter.
[0032] Furthermore, in the step three, the improved kingfisher optimization algorithm is used to optimize the parameters of the cascade PID controller, and the parameters of the optimal cascade PID controller are iteratively optimized. The cascade PID controller simulator is combined with the improved kingfisher optimization algorithm, and the optimization algorithm is used to optimize the PID parameters. In each iteration, the position of the individual is updated according to the value of the objective function until the maximum number of iterations is reached. The specific steps are:
[0033] S1. Initialize the population of spotted kingfishers, generate a random position for each individual, which is located within the boundary of the search space, set the population size N, the maximum number of iterations Max_iteration, the spatial dimension Dim, the search upper bound UP, the search lower bound LB, the optimal position fval and the optimal cost bestX of the global optimal solution, and the initial position of the spotted kingfisher is the initial solution of the PID controller parameters in the algorithm optimization process;
[0034] S2. The purpose of PID parameter tuning is to select the parameter values of the PID controller, and then judge whether the PID parameters are optimal through performance indicators. The Pied Kingfisher algorithm is very sensitive to time, while ITAE takes the time factor into consideration, and the system response speed and steady-state performance have good results. Therefore, the performance indicator evaluation formula ITAE is selected as the fitness function, and the formula is as follows:
[0035]
[0036] In formula (10), e(t) is the difference between the expected target value and the actual output value of the controlled object at the iteration time t;
[0037] S3, simulating the three stages of the pied kingfisher's perching and hovering, diving for prey, and cultivating symbiosis, updating the position of the individual pied kingfisher, and the position update of the pied kingfisher population is the parameter update of the PID controller;
[0038] S4, start the iterative optimization process, perform Max_Iter iterations, compare the current fitness value with the historical optimal fitness value in each cycle to determine whether to update the optimal fitness value, and update the optimal solution of the group according to the adaptive value of each individual;
[0039] S5, determine whether the number of iterations t has reached the maximum number of iterations Max_Iter, if so, stop outputting the optimal solution, if not, continue to execute steps S3 and S4;
[0040] S6. Assign the optimal solution to the K of the cascade internal PID controller p2 , K i2 , K d2 and K of the external PID controller p1 , K i1 , K d1 Among the 6 parameters, the parameter optimization of the cascade PID controller is completed.
[0041] Furthermore, in S1, the initial population position of the Pied Kingfisher population is initialized randomly, and the mathematical model of the randomly initialized population position is:
[0042] X i,j =LB+(UB-LB)×rand, i=1, 2,..., N; j=1, 2,..., Dim (11);
[0043] In formula (11), X i,j is the initial position of the j-th dimension of the ith individual of the Pied Kingfisher algorithm, LB is the search lower bound of the Pied Kingfisher algorithm, UB is the search upper bound of the Pied Kingfisher algorithm, and rand is a random number between 0 and 1.
[0044] Furthermore, in S3, the simulated perching and hovering phase of the pied kingfisher is to simulate the pied kingfisher's alternating attacks between the perching position and the hovering position, the diving prey phase is to simulate the process of the pied kingfisher observing prey from the perching position to diving for hunting, and the cultivating symbiosis phase is to simulate the availability of prey, the hunting skills of the pied kingfisher and the factors that other predators affect the successful hunting of the pied kingfisher.
[0045] Furthermore, in the step four, MATLAB is used to simulate the cascade PID control system, and simulation is performed within the controlled object. The external PID controller receives the error between the target expected value and the actual output value, and the internal PID controller receives the error between the output of the external PID controller and the actual output of the controlled object. The performance of the optimized parameter combination is evaluated, and the optimal PID parameter combination is searched based on the situation of meeting the optimization goal, thereby completing the parameter optimization of the cascade PID controller.
[0046] Furthermore, the controlled object should have appropriate dynamic characteristics so that it can be effectively controlled by the PID controller. The selected object should have significant lag time, time constant and gain characteristics.
[0047] The transfer function formula of the controlled object is selected as:
[0048]
[0049] In formula (12), G(s) is the transfer function and s is the function variable.
[0050] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0051] The hunting ability O of the improved Pied Kingfisher in the development stage is adopted, and the linear interpolation method is used to dynamically adjust the defeat factor BF and the adaptive t-distribution adjustment strategy is introduced into the population individual position update method in the exploration stage of the Pied Kingfisher optimization algorithm to solve the problems that the standard Pied Kingfisher algorithm cannot balance exploration and development, has unstable performance, depends on the cosine function, localizes the search process, and is trapped in the local optimal solution and cannot jump out. The parameters of the cascade PID controller are optimized by improving the Pied Kingfisher algorithm, and the interaction and mutual feedback between the two PID controllers of the traditional cascade PID controller cause oscillation, instability and delayed control response problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 Flowchart for cascade PID parameter optimization to improve the Pied Kingfisher optimization algorithm.
[0053] Figure 2 System model of cascade PID controller for improving the optimization algorithm of Pied Kingfisher.
[0054] Figure 3 This is a comparison curve of the effects of optimizing PID between the improved Pied Kingfisher optimization algorithm and the standard Pied Kingfisher optimization algorithm.
[0055] Figure 4 This is a comparison curve of the optimal fitness values of the improved Pied Kingfisher optimization algorithm and the standard Pied Kingfisher optimization algorithm. DETAILED DESCRIPTION
[0056] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0057] The present invention provides a technical solution: a parameter optimization method for an improved cascade PID controller, the specific steps are as follows: Figure 1 shown.
[0058] Step 1: Design the system model of the improved cascade PID controller.
[0059] Further, in the step 1, if Figure 2 As shown, the system model of the improved cascade PID controller includes a feedback module, an error calculation module, an external PID controller module, an internal PID controller module, an improved spotted kingfisher optimization algorithm module, and a controlled object module. The feedback module calculates the error between the expected target value and the actual output value, and is the input of the external PID controller. The error calculation module generates a control output based on the error signal, including three parts: proportional (P), integral (I), and differential (D). The external PID controller module is responsible for controlling the main process variables, achieving the final control goal of the system, and indirectly controlling the intermediate process variables. The internal PID controller module is responsible for controlling the intermediate process variables, quickly responding to disturbances and changes in the system, and providing a stable environment for the external PID controller. The improved spotted kingfisher optimization algorithm module is an improved standard spotted kingfisher optimization algorithm. The optimal solution obtained after multiple iterations of the algorithm is used as the parameter of the PID controller. The controlled object module receives the control signal output by the internal PID controller and feeds back the parameters in the process accordingly to achieve the control goal.
[0060] Furthermore, in step 1, the mathematical model of the improved cascade PID is:
[0061]
[0062] e1(t)=r(t)-y1(t) (2);
[0063] In formula (1), K p1 , K i1 , K d1 are the proportional, integral and differential coefficients of the external PID controller, e1(t) is the error signal of the external process, r(t) is the expected target value of the external process, and y1(t) is the actual output value of the external process;
[0064]
[0065] e2(t)=u1(t)-y2(t) (4);
[0066] In formula (3), K p2 , K i2 , K d2are the proportional, integral and differential coefficients of the internal PID controller, e2(t) is the error signal of the internal process, u1(t) is the expected target value of the internal process, and y2(t) is the actual output value of the internal process.
[0067] Furthermore, the output y1(t) of the external PID controller is the input of the internal PID controller, and the output y2(t) of the internal PID controller is the control input acting on the external process. This cascade structure allows the internal PID controller to adjust the output of the external PID controller to improve the performance of the system.
[0068] Step 2, improving the optimization algorithm of the pied kingfisher, the improved pied kingfisher optimization algorithm includes: D1, mainly improving the hunting ability O of the pied kingfisher in the development stage, D2, using the linear interpolation method to dynamically adjust the defeat factor BF, D3, introducing an adaptive t distribution adjustment strategy in the population individual position update method in the exploration stage of the pied kingfisher optimization algorithm.
[0069] Furthermore, in the step 2, the hunting ability O of the spotted kingfisher in the development stage is improved, and disturbances and random changes are introduced. When the spotted kingfisher preys, the energy of the prey will gradually decrease during the escape process. The prey escape energy dynamically selects the development behavior or the exploration behavior for hunting, which helps the algorithm to jump out of the local optimum and continue to search for a better solution. The improved mathematical model formula is:
[0070]
[0071] In formula (5), E0 is the initial escape energy of the prey, which is a random number between (-1, 1), t is the current iteration number, Max_Iter is the maximum iteration number, and when |O| >=1 When entering the exploration phase, |O| <1 Entering the development phase.
[0072] Furthermore, in the step 2, the linear interpolation method is used to dynamically adjust the defeat factor BF. In the standard Pied Kingfisher optimization algorithm, BF is set to a fixed value of 8, which simplifies the parameter setting, lacks adaptability, cannot balance exploration and development, is difficult to deal with different types of problems, and has unstable performance. The improved Pied Kingfisher optimization algorithm uses a linear interpolation method to dynamically adjust BF, so that it can adapt to different needs during the entire optimization process, improve the overall performance of the algorithm, and then improve the flexibility of the algorithm. The improved defeat factor BF mathematical model formula is:
[0073]
[0074] In formula (6), BF min The minimum value of BF is 2, BF maxThe maximum value of BF is 16, t is the current iteration number, and Max_Iter is the maximum iteration number.
[0075] Furthermore, in the step 2, an adaptive t distribution adjustment strategy is introduced in the exploration phase. The dynamic strategy value T in the individual position update of the standard piebald kingfisher optimization algorithm in the exploration phase is too dependent on the selection of angle Crest_angles, which will lead to unstable results. The expression of T is shown in formula (7). The cosine function cos(Crest_angles) will cause the individual position update to deviate in a specific direction. The unreasonable selection of Crest_angles or the update method is too dependent on the cosine function will cause the search process to be localized and fall into the local optimal solution and cannot jump out. The formula on which the standard piebald kingfisher optimization algorithm position update depends is shown in formula (8). After the introduction of the adaptive t distribution adjustment strategy, the scale parameter of the t distribution is adjusted according to the individual position change, so that when the fitness is low or the search space is relatively local, the amplitude of the disturbance is increased to jump out of the local optimal solution. When the fitness is high or the search space is relatively global, the amplitude of the disturbance is reduced to maintain the stability of the search. The formula is shown in formula (9):
[0076]
[0077] X i (t+1)=X i (t)+α×T×(X j (t)-X i (t)), i, j=1, 2,…,N αnd j≠i (8);
[0078]
[0079] In formula (7), Max_Iter is the maximum number of iterations, BF is the beat factor, t is the current number of iterations, Crest_angles is a random value in [0, 2π], and X in formula (8) is i (t+1) represents the solution of the next iteration, X i (t) represents the position of the current iteration, α is 2×randn(1, Dim), Dim is the spatial dimension 6, and T is the dynamic strategy value as shown in formula (7). In formula (9), is the position of the optimal solution in the jth dimension after the adaptive t distribution is adjusted, is the position of the optimal solution in the jth dimension before adaptive t-distribution adjustment, and t(iter) is the adaptive t-distribution adjustment function with the number of population iterations as a parameter.
[0080] Step 3: Use the improved Kingfisher optimization algorithm to optimize the cascade PID controller parameter setting, and iterate to obtain the optimal PID controller parameter value.
[0081] Furthermore, in the step three, the improved kingfisher optimization algorithm is used to optimize the parameters of the cascade PID controller, and the parameters of the optimal cascade PID controller are iteratively optimized. The cascade PID controller simulator is combined with the improved kingfisher optimization algorithm, and the optimization algorithm is used to optimize the PID parameters. In each iteration, the position of the individual is updated according to the value of the objective function until the maximum number of iterations is reached. The specific steps are:
[0082] S1. Initialize the population of spotted kingfishers, generate a random position for each individual, which is located within the boundary of the search space, set the population size N, the maximum number of iterations Max_iteration, the spatial dimension Dim, the search upper bound UP, the search lower bound LB, the optimal position fval and the optimal cost bestX of the global optimal solution, and the initial position of the spotted kingfisher is the initial solution of the PID controller parameters in the algorithm optimization process;
[0083] S2. The purpose of PID parameter tuning is to select the parameter values of the PID controller, and then judge whether the PID parameters are optimal through performance indicators. The Pied Kingfisher algorithm is very sensitive to time, while ITAE takes the time factor into consideration, and the system response speed and steady-state performance have good results. Therefore, the performance indicator evaluation formula ITAE is selected as the fitness function, and the formula is as follows:
[0084]
[0085] In formula (10), e(t) is the difference between the expected target value and the actual output value of the controlled object at the iteration time t;
[0086] S3, simulating the three stages of the pied kingfisher's perching and hovering, diving for prey, and cultivating symbiosis, updating the position of the individual pied kingfisher, and the position update of the pied kingfisher population is the parameter update of the PID controller;
[0087] S4, start the iterative optimization process, perform Max_Iter iterations, compare the current fitness value with the historical optimal fitness value in each cycle to determine whether to update the optimal fitness value, and update the optimal solution of the group according to the adaptive value of each individual;
[0088] S5, determine whether the number of iterations t has reached the maximum number of iterations Max_iter, if so, stop outputting the optimal solution, if not, continue to execute steps S3 and S4;
[0089] S6. Assign the optimal solution to the K of the cascade internal PID controller p2 , K i2 , K d2 and K of the external PID controllerp1 , K i1 , K d1 Among the 6 parameters, the parameter optimization of the cascade PID controller is completed.
[0090] Furthermore, in S1, the initial population position of the Pied Kingfisher population is initialized randomly, and the mathematical model of the randomly initialized population position is:
[0091] X i,j =LB+(UB-LB)×rand, i=1, 2,..., N; j=1, 2,..., Dim (11);
[0092] In formula (11), X i,j is the initial position of the j-th dimension of the ith individual of the Pied Kingfisher algorithm, LB is the search lower bound of the Pied Kingfisher algorithm, UB is the search upper bound of the Pied Kingfisher algorithm, and rand is a random number between 0 and 1.
[0093] Furthermore, in S3, the simulated perching and hovering phase of the pied kingfisher is to simulate the pied kingfisher's alternating attacks between the perching position and the hovering position, the diving prey phase is to simulate the process of the pied kingfisher observing prey from the perching position to diving for hunting, and the cultivating symbiosis phase is to simulate the availability of prey, the hunting skills of the pied kingfisher and the factors that other predators affect the successful hunting of the pied kingfisher.
[0094] Step 4: Use MATLAB to simulate the cascade PID control system.
[0095] Furthermore, in the step four, MATLAB is used to simulate the cascade PID control system, and simulation is performed within the controlled object. The external PID controller receives the error between the target expected value and the actual output value, and the internal PID controller receives the error between the output of the external PID controller and the actual output of the controlled object. The performance of the optimized parameter combination is evaluated, and the optimal PID parameter combination is searched based on the situation of meeting the optimization goal, thereby completing the parameter optimization of the cascade PID controller.
[0096] Furthermore, the controlled object should have appropriate dynamic characteristics so that it can be effectively controlled by the PID controller. The selected object should have significant lag time, time constant and gain characteristics. The transfer function formula of the selected controlled object is:
[0097]
[0098] In formula (12), G(s) is the transfer function and s is the function variable.
[0099] Figure 3The comparison curve of the effect of optimizing cascade PID by the improved piebald kingfisher optimization algorithm IPKO and the standard piebald kingfisher optimization algorithm PKO is shown. According to the set target value 1, it can be shown that under the condition of achieving the same target value 1, the improved piebald kingfisher optimization algorithm takes less time, has a smaller oscillation amplitude, and has a lower overshoot than the standard piebald kingfisher optimization algorithm. It can be shown that in a complex environment, the cascade PID controller system based on the improved piebald kingfisher optimization algorithm has a better parameter optimization effect than the cascade PID controller system based on the standard piebald kingfisher optimization algorithm.
[0100] Figure 4 The comparison curve of the optimal fitness values of the improved Pied Kingfisher Optimization Algorithm (IPKO) and the standard Pied Kingfisher Optimization Algorithm (PKO) shows that from the beginning to the end of the iteration, the fitness value obtained by the improved Pied Kingfisher Optimization Algorithm is continuously smaller than the fitness value obtained by the standard Pied Kingfisher Optimization Algorithm. According to the principle that the smaller the fitness value, the better the algorithm performance, and the closer to zero, the better the individual solution and the better the algorithm performance, the improved Pied Kingfisher Optimization Algorithm can obtain a better fitness value within the same number of iterations, that is, the improved Pied Kingfisher Optimization Algorithm has a better optimization effect than the standard Pied Kingfisher Optimization Algorithm.
Claims
1. A parameter optimization method for an improved cascade PID controller, characterized in that: The development and exploration phase of the Pied Kingfisher optimization algorithm was improved. The control parameters of the cascade PID controller were tuned and optimized using the improved Pied Kingfisher optimization algorithm. The specific steps are as follows: Step 1: Design a system model of an improved cascade PID controller; Step 2: Improve the optimization algorithm of the spotted kingfisher, the improved optimization algorithm of the spotted kingfisher includes: D1. Improve the hunting ability of the Pied Kingfisher in the development stage. By introducing disturbance and random changes, when the Pied Kingfisher preys, the energy of the prey will gradually decrease during the escape process. The prey escape energy dynamically selects the development behavior or exploration behavior for hunting, which helps the algorithm to jump out of the local optimum and continue to search for a better solution. The improved mathematical model formula is: In formula (5), E0 is the initial escape energy of the prey, which is a random number between (-1, 1), t is the current iteration number, Max_Iter is the maximum iteration number, and when |O| >=1 When entering the exploration phase, |O| <1 Enter the development phase; D2. Use linear interpolation method to dynamically adjust the defeat factor BF. In the standard Pied Kingfisher optimization algorithm, BF is set to a fixed value of 8, which simplifies the parameter setting, lacks adaptability, cannot balance exploration and development, is difficult to deal with different types of problems, and has unstable performance. The improved Pied Kingfisher optimization algorithm uses linear interpolation method to dynamically adjust BF, so that it can adapt to different needs in the entire optimization process, optimizes the adaptability and flexibility of the algorithm, and the improved defeat factor BF mathematical model formula is: In formula (6), BF min The minimum value of BF is 2, BF max The maximum value of BF is 16, t is the current number of iterations, and Max_Iter is the maximum number of iterations; D3. Introduce an adaptive t-distribution adjustment strategy in the individual position update method of the population in the exploration phase of the Pied Kingfisher optimization algorithm. The dynamic strategy value T in the individual position update of the standard Pied Kingfisher optimization algorithm in the exploration phase is too dependent on the angle Crest_angles selection, which will lead to unstable results. The expression of T is shown in formula (7). The cosine function cos(Crest_angles) will cause the individual position update to deviate in a specific direction. The unreasonable selection of Crest_angles or the update method is too dependent on the cosine function will cause the search process to be localized and fall into the local optimal solution and cannot jump out. The formula that the standard Pied Kingfisher optimization algorithm relies on for position update is shown in formula (8). After introducing the adaptive t-distribution adjustment strategy, the scale parameter of the t-distribution is adjusted according to the individual position change. When the fitness is low or the search space is relatively local, the amplitude of the disturbance is increased to jump out of the local optimal solution. When the fitness is high or the search space is relatively global, the amplitude of the disturbance is reduced to maintain the stability of the search. The formula is shown in formula (9): X i (t+1)=X i (t)+α×T×(X j (t)-X i (t)),i,j=1,2,…,N and j≠i(8); In formula (7), Max_Iter is the maximum number of iterations, BF is the beat factor, t is the current number of iterations, Crest_angles is a random value in [0, 2π], and X in formula (8) is i (t+1) represents the solution of the next iteration, X i (t) represents the position of the current iteration, α is 2×randn(1, Dim), Dim is the spatial dimension 6, and T is the dynamic strategy value as shown in formula (7). In formula (9), is the position of the optimal solution in the jth dimension after the adaptive t distribution is adjusted, is the position of the optimal solution in the jth dimension before the adaptive t-distribution adjustment, and t(iter) is the adaptive t-distribution adjustment function with the number of population iterations as a parameter; Step 3: Optimize the parameters of the cascade PID controller by using the improved kingfisher optimization algorithm, and iterate to obtain the optimal parameter value of the PID controller after optimization; Step 4: Use MATLAB to simulate the cascade PID control system.
2. The parameter optimization method of an improved cascade PID controller according to claim 1, characterized in that: The step 1 designs a system model of an improved cascade PID controller, including a feedback module, an error calculation module, an external PID controller module, an internal PID controller module, an improved kingfisher optimization algorithm module, and a controlled object module. The feedback module calculates the error between the expected target value and the actual output value, and is the input of the internal PID controller and the external PID controller. The error calculation module generates a control output according to the error signal, including three parts: proportional (P), integral (I), and differential (D). The external PID controller module is responsible for controlling the main process variables, achieving the final control target of the system, and indirectly controlling the intermediate process variables. The internal PID controller module is responsible for controlling the intermediate process variables, quickly responding to system disturbances and changes, and providing a stable environment for the external PID controller. The improved Pied Kingfisher optimization algorithm module is an improved standard Pied Kingfisher optimization algorithm. The optimal solution obtained after multiple iterations of the algorithm is used as the parameter of the PID controller. The controlled object module receives the control signal output by the internal PID controller and accordingly feeds back the parameters in the process to achieve the control target.
3. The parameter optimization method of an improved cascade PID controller according to claim 2 is characterized in that: The step 3 uses the improved Kingfisher optimization algorithm to optimize the parameters of the cascade PID controller, and iterates to obtain the parameters of the optimal cascade PID controller after optimization. The cascade PID controller simulator is combined with the improved Kingfisher optimization algorithm, and the optimization algorithm is used to optimize the PID parameters. In each iteration, the position of the individual is updated according to the value of the objective function until the maximum number of iterations is reached. The specific steps are: S1. Initialize the population of spotted kingfishers, generate a random position for each individual, which is located within the boundary of the search space, set the population size N, the maximum number of iterations Max_iteration, the spatial dimension Dim, the search upper bound UP, the search lower bound LB, the optimal position fval and the optimal cost bestX of the global optimal solution, and the initial position of the spotted kingfisher is the initial solution of the PID controller parameters in the algorithm optimization process; S2. PID parameter tuning. The parameter values of the PID controller are selected through tuning, and then the performance indicators are used to determine whether the PID parameters are optimal. The Pied Kingfisher algorithm is very sensitive to time. The performance indicator evaluation formula ITAE is selected as the fitness function. The formula is as follows: ITAE=∫0 ∞ t|e(t)|dx (9); In formula (9), e(t) is the difference between the expected target value and the actual output value of the controlled object at the iteration time t; S3, simulating the three stages of the pied kingfisher's perching and hovering, diving for prey, and cultivating symbiosis, updating the position of the individual pied kingfisher, and the position update of the pied kingfisher population is the parameter update of the PID controller; S4, start the iterative optimization process, perform Max_Iter iterations, compare the current fitness value with the historical optimal fitness value in each cycle to determine whether to update the optimal fitness value, and update the optimal solution of the group according to the adaptive value of each individual; S5, determine whether the number of iterations t has reached the maximum number of iterations Max_Iter, if so, stop outputting the optimal solution, if not, continue to execute steps S3 and S4; S6. Assign the optimal solution to the K of the cascade internal PID controller p2 , K i2 , K d2 and K of the external PID controller p1 , K i1 , K d1 Among the 6 parameters, the parameter optimization of the cascade PID controller is completed.
4. The parameter optimization method of an improved cascade PID controller according to claim 3 is characterized in that: In S1, the initial population position of the Pied Kingfisher population is initialized randomly, and the mathematical model of the randomly initialized population position is: X i,j =LB+(UB-LB)×rand,i=1,2,......,N;j=1,2,......,Dim(10); In formula (10), X i,j is the initial position of the j-th dimension of the ith individual of the Pied Kingfisher algorithm, LB is the search lower bound of the Pied Kingfisher algorithm, UB is the search upper bound of the Pied Kingfisher algorithm, and rand is a random number between 0 and 1.
5. The parameter optimization method of an improved cascade PID controller according to claim 4 is characterized in that: In the S3, the simulation of the perching and hovering phase of the pied kingfisher is to simulate the pied kingfisher's alternating attacks between the perching position and the hovering position, the diving prey phase is to simulate the process of the pied kingfisher observing prey from the perching position to diving for hunting, and the cultivation symbiosis phase is to simulate the availability of prey, the hunting skills of the pied kingfisher and the factors that other predators affect the successful hunting of the pied kingfisher.