A PID parameter tuning method based on dung beetle algorithm

By applying the dung beetle optimization algorithm in PID parameter setting, the problem of time-consuming and poor stability of traditional methods is solved, and more efficient and accurate PID parameter optimization is achieved.

CN119758703APending Publication Date: 2025-04-04WUHAN LEISHEN SPECIAL EQUIP
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311248310.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The traditional PID parameter setting method takes a long time and has poor stability, making it difficult to achieve ideal control indicators in the control system.

Method used

The Duckling Optimization Algorithm is used to optimize the PID parameters. By establishing a third-order time delay model, initializing the duckling parameters, updating the duckling position, calculating the fitness function value, iteratively optimizing until the global optimal position is reached.

Benefits of technology

It improves the performance indicators of the PID control system, shortens the setting time, and enhances the stability and accuracy of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119758703A_ABST
    Figure CN119758703A_ABST
Patent Text Reader

Abstract

The present invention discloses a PID parameter tuning method based on the dung beetle algorithm, which optimizes the PID parameters by using the dung beetle optimization algorithm, and takes the parameters that minimize the global value of the performance index function of the PID control system as the optimal tuning parameters. The method solves the problems of the traditional PID parameter tuning method, such as long time consumption and poor stability, and improves the accuracy of the PID controller in the actual control system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of PID parameter setting, and in particular to a PID parameter setting method based on a dung beetle algorithm. Background Art

[0002] In the industrial production process, PID controller has been widely used due to its simple structure and strong robustness. PID continuously adjusts parameters so that the control system that has been designed and installed can achieve the most ideal control index requirements during the transition process. Appropriate PID controller parameters will enable the control system to achieve relatively ideal control indicators, while inappropriate PID controller parameters will cause the control performance of the control system to deteriorate or even make the control system ineffective. Traditional PID parameter tuning methods have problems such as long time consumption and poor stability. Therefore, how to use intelligent algorithms to optimize PID parameters is the key to improving system control performance. Summary of the invention

[0003] The purpose of the present invention is to optimize PID parameters by using the dung beetle optimization algorithm, and to use the parameters that minimize the global value of the performance index function of the PID control system as the optimal setting parameters. This solves the problems of the traditional PID parameter setting method, such as long time consumption and poor stability, and improves the accuracy of the PID controller in the actual control system.

[0004] In order to achieve the above object, the present invention adopts the following technical scheme:

[0005] A PID parameter tuning method based on the dung beetle algorithm comprises the following steps:

[0006] Step 1, establishing a third-order time-delay model according to the objective function to be optimized;

[0007] Step 2: Initialize the parameters of dung beetles, including the total population of dung beetles, spatial search dimension, maximum number of iterations, and initial position; determine the number and weight coefficient of rolling dung beetles, egg-laying dung beetles, small dung beetles, and thief dung beetles, and assign the position components of dung beetle individuals in different dimensional spaces to the PID controller parameters K in turn. p , K i , K d , run the simulation model, calculate the fitness function value of each dung beetle in the population, and obtain the global optimal position corresponding to the objective function value and the worst position corresponding to the maximum objective function value;

[0008] Step 3, update the position of the ball-rolling dung beetle, determine the next behavior of the dung beetle individual by probability method, whether it will continue to roll the ball or dance, and update the corresponding positions of the ball-rolling dung beetle and the dancing dung beetle according to the corresponding position formula, so as to determine the current local optimal position;

[0009] Step 4, updating the positions of the egg-laying dung beetle, the small dung beetle, and the thief dung beetle, and updating the corresponding positions according to the corresponding position formula;

[0010] Step 5, calculating the objective function value of the dung beetle individual at the current position, and obtaining the global optimal position corresponding to the minimum objective function value;

[0011] Step 6, determine whether the number of iterations meets the maximum number of iterations, if so, the iteration is terminated; otherwise, repeat steps 3-5 to find the optimal iteration process.

[0012] Furthermore, the expressions of the PID system error signal e(t)=r(t)-y(t) and the control quantity u(t) in step 1 are: Where y(t) is the actual output value, r(t) is the given target value, and the transfer function of the PID controller is Where K p is the scale parameter; K i is the integration parameter, K d is the differential parameter, T d is the differential time constant.

[0013] Furthermore, in step 2, the absolute value of the error multiplied by the time integral ITAE criterion is selected as the fitness function of the algorithm according to the mathematical model of the PID control system. The specific expression is:

[0014]

[0015] Furthermore, updating the positions of all dung beetles includes: simulating five behavior modes of dung beetles and updating the positions according to the models.

[0016] Furthermore, the behaviors of the dung beetle include:

[0017] (1) The behavior pattern of the ball-rolling dung beetle, which is the ball-rolling behavior when there is no obstacle and the dancing behavior when there is an obstacle;

[0018] When there is no obstacle, its position is updated as follows:

[0019] x i (t+1)=x i (t)+a*k*x i (t-1)+b*|x i (t)+X w |,

[0020] Among them, t represents the current iteration number, x i represents the position information of the i-th dung beetle, k represents the deflection coefficient, α∈(0,1) is a random number, a is a natural coefficient, which is -1 or 1; X w is the global worst position;

[0021] When there is an obstacle, its position is updated as follows:

[0022] x i (t+1)=x i (t)+tan(θ)|x i (t)-x i (t-1)|

[0023] Among them, tan(θ) is the deflection system angle;

[0024] (2) Oviposition dung beetle behavior pattern: implement oviposition behavior, and its position is updated as follows:

[0025] B i (t+1)=X * +b 1 *(B i (t)-Lb * )+b 2 *(B i (t)-Ub * ),

[0026]

[0027] Among them, B i is the position of the egg, b 1 and b 2 is a random vector, X * is the current best position, Lb is the lower bound, and Ub is the upper bound;

[0028] (3) The behavior pattern of the small dung beetle, its position is updated as follows:

[0029] x i (t+1)=x i (t)+C 1 *(x i (t)-Lb * )+C 2 *(x i (t)-Ub * ),

[0030] C 1 is a random number that follows a normal distribution, C 2 ∈(0,1) is a random vector;

[0031] (4) Behavior patterns of thief dung beetles:

[0032] Fighting for the best food spots b It is the best place to compete for food, and its location is updated as follows:

[0033] x i (t+1)=Xb +S*g*(|x i (t)-X * |+|x i (t)-X b |) (4)

[0034] Among them, g is a random vector that obeys a state distribution with a mean of 0 and a variance of 1, and S is a constant.

[0035] Beneficial effects of the present invention:

[0036] The present invention can use the optimization algorithm to set the PID parameters by itself, which is time-saving and accurate, and solves the problem that the traditional PID parameter tuning method is difficult to achieve good control effect for control systems with nonlinearity, time lag and other characteristics. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a schematic diagram of the process of the present invention;

[0038] Figure 2 It is the principle diagram of the present invention;

[0039] Figure 3 This is a schematic diagram of a control system according to an embodiment of the present invention;

[0040] Figure 4 It is a schematic diagram of the effect of the present invention. DETAILED DESCRIPTION

[0041] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0042] Reference Figure 3 The present invention is mainly used for PID parameter setting. To this end, according to actual needs, a three-loop PID control system for the motor is designed, as shown in the figure below. The K of the system position loop is optimized using the dung beetle optimization algorithm. p Parameters, K of the current loop p and K i Parameter, speed loop K p and K i Parameters, the ITAE of the actual value and the target value is taken as the fitness value of the system. During the model simulation, it is observed that the dung beetle algorithm can obtain more ideal control parameters, so that the system has a smaller steady-state error, overshoot and adjustment time, and improves the performance of the control system.

[0043] Reference Figure 1-2 Taking the three-loop PID control system of the motor as an example, a PID parameter setting method based on the dung beetle algorithm of the present invention comprises the following steps:

[0044] Step 1, establishing a three-loop PID model of the motor according to the objective function to be optimized;

[0045] Step 2, initialize the dung beetle parameters, including the total number of dung beetle populations, spatial search dimension, maximum number of iterations, and initial position; determine the number and weight coefficients of rolling dung beetles, egg-laying dung beetles, small dung beetles, and thief dung beetles.

[0046] Among them, the dung beetle optimization algorithm is a new type of swarm intelligence optimization algorithm, which is mainly inspired by the rolling, dancing, foraging, stealing and breeding behaviors of dung beetles. According to the different ways in which dung beetles use dung balls, the dung beetle population can be divided into four sub-populations: rolling dung beetles, egg-laying dung beetles, small dung beetles, and thief dung beetles. Different dung beetle sub-populations correspond to different behavior patterns.

[0047] Behavior of the rolling dung beetle:

[0048] The ball-rolling dung beetle rolls its feces into a ball and then pushes it to a safe place, completing the exploration of space at the same time. It can be mainly divided into ball-rolling behavior when there are no obstacles and dancing behavior when there are obstacles.

[0049] When there are no obstacles, the position of the dung beetle responsible for rolling the ball changes as follows:

[0050] x i (t+1)=x i (t)+a*k*x i (t-1)+b*|x i (t)+X w | (1),

[0051] Among them, t represents the current iteration number, x i represents the position information of the i-th dung beetle, k represents the deflection coefficient, α∈(0,1) is a random number, a is a natural coefficient, which is -1 or 1; X w is the global worst position.

[0052] When there is an obstacle, the dung beetle will dance to reorient itself, and its position will be updated as follows:

[0053] x i (t+1)=x i (t)+tan(θ)|x i (t)-x i (t-1)| (2),

[0054] Where tan(θ) is the deflection angle.

[0055] Ovipositing dung beetle behavior patterns:

[0056] The egg-laying dung beetle rolls the dung ball to a safe place suitable for laying eggs and hides it, providing a safe environment for its offspring. When the egg-laying dung beetle is in a safe area, it lays eggs and the calculation formula for the position update is:

[0057] B i (t+1)=X * +b 1 *(B i (t)-Lb * )+b 2 *(B i (t)-Ub * ) (3),

[0058] Lb b =max(X b *(1-R),Lb) (4),

[0059] Ub b =max(X b *(1+R),Lb) (5),

[0060] Among them, B i is the position of the egg, b 1 and b 2 is a random vector, X * is the current best position, Lb is the lower bound, and Ub is the upper bound.

[0061] Small dung beetle behavior pattern:

[0062] The dung beetle needs to find food, and its activity area is limited to the best foraging area. Therefore, the position of the dung beetle is updated to:

[0063] x i (t+1)=x i (t)+C 1 *(x i (t)-Lb * )+C 2 *(x i (t)-Ub * ) (6),

[0064] C 1 is a random number that follows a normal distribution, C 2 ∈(0,1) is a random vector.

[0065] Thief Dung Beetle Behavior Pattern:

[0066] Assume X b It is the best place to compete for food. The updated location description of the dung beetles with stealing behavior is as follows:

[0067] x i(t+1)=X b +S*g*(|x i (t)-X * |+|x i (t)-X b |) (7),

[0068] Among them, g is a random vector that obeys a state distribution with a mean of 0 and a variance of 1, and S is a constant.

[0069] The position components of the dung beetle individuals in different dimensional spaces are assigned to the K of the position ring in turn. p Parameters, K of current loop p and K i Parameters, speed loop K p and K i Parameters, run the simulation model, calculate the fitness function value of each dung beetle in the population, and obtain the global optimal position corresponding to the objective function value and the worst position corresponding to the maximum objective function value;

[0070] Step 3, update the position of the ball-rolling dung beetle, and determine by probability whether the dung beetle individual will continue to roll the ball or dance; if it is a ball-rolling dung beetle, update the position according to formula (1); if it is a dancing dung beetle, update the position according to formula (2), and then determine the current local optimal position;

[0071] Step 4, update the positions of egg-laying dung beetles, small dung beetles, and thief dung beetles. If the dung beetle individual is an egg-laying dung beetle, update the position according to formula (3); if it is a dung beetle, update the position according to formula (6); if it is a thief dung beetle, update the position according to formula (7).

[0072] Step 5, calculating the objective function value of the dung beetle individual at the current position according to step 4, and obtaining the global optimal position corresponding to the minimum objective function value;

[0073] Step 6, determine whether the number of iterations meets the maximum number of iterations, if so, the iteration is terminated; otherwise, repeat steps 3-5 to find the optimal iteration process.

[0074] In this embodiment, the expressions of the PID system error signal e(t)=r(t)-y(t) and the control quantity u(t) in step 1 are: Where y(t) is the actual output value, r(t) is the given target value, and the transfer function of the PID controller is Where K p is the scale parameter; K i is the integration parameter, K d is the differential parameter, T d is the differential time constant.

[0075] In step 2, the absolute value of the error multiplied by the time integral ITAE criterion is selected as the fitness function of the algorithm according to the mathematical model of the PID control system. The specific expression is:

[0076]

[0077] Reference Figure 4 The input signal of the simulation model adopts a unit step signal. As can be seen from the figure, the response curve obtained by optimizing the PID parameters using the dung beetle optimization algorithm has the advantages of small overshoot and short rise time, which makes the system less likely to oscillate and quickly reach a stable state.

[0078] Finally, it should be noted that the above only describes in detail the specific embodiments of the present invention. However, the present invention is not limited to the specific embodiments described above. Equivalent modifications and substitutions made by those skilled in the art to the present invention are also within the scope of the present invention. Therefore, equal changes and modifications made without departing from the spirit and scope of the present invention are all within the scope of the present invention.

Claims

1. A PID parameter tuning method based on the dung beetle algorithm, characterized in that: The following steps are included: Step 1, establishing a third-order time-delay model according to the objective function to be optimized; Step 2: Initialize the parameters of dung beetles, including the total population of dung beetles, spatial search dimension, maximum number of iterations, and initial position; determine the number and weight coefficient of rolling dung beetles, egg-laying dung beetles, small dung beetles, and thief dung beetles, and assign the position components of dung beetle individuals in different dimensional spaces to the PID controller parameters K in turn. p , K i , K d , run the simulation model, calculate the fitness function value of each dung beetle in the population, and obtain the global optimal position corresponding to the objective function value and the worst position corresponding to the maximum objective function value; Step 3, update the position of the ball-rolling dung beetle, determine the next behavior of the dung beetle individual by probability method, whether it will continue to roll the ball or dance, and update the corresponding positions of the ball-rolling dung beetle and the dancing dung beetle according to the corresponding position formula, so as to determine the current local optimal position; Step 4, updating the positions of the egg-laying dung beetle, the small dung beetle, and the thief dung beetle, and updating the corresponding positions according to the corresponding position formula; Step 5, calculating the objective function value of the dung beetle individual at the current position, and obtaining the global optimal position corresponding to the minimum objective function value; Step 6, determine whether the number of iterations meets the maximum number of iterations, if so, the iteration is terminated; Otherwise, repeat steps 3-5 to iterate the optimization process.

2. The PID parameter setting method based on the dung beetle algorithm according to claim 1, characterized in that: The expressions of the PID system error signal e(t)=r(t)-y(t) and the control quantity u(t) in step 1 are: Where y(t) is the actual output value, r(t) is the given target value, and the transfer function of the PID controller is Where K p is the scale parameter; K i is the integration parameter, K d is the differential parameter, T d is the differential time constant.

3. The PID parameter setting method based on the dung beetle algorithm according to claim 1, characterized in that: In step 2, the absolute value of the error multiplied by the time integral ITAE criterion is selected as the fitness function of the algorithm according to the mathematical model of the PID control system. The specific expression is:

4. The PID parameter setting method based on the dung beetle algorithm according to claim 1, characterized in that: Updating the positions of all dung beetles includes: simulating five behavior modes of dung beetles and updating the positions according to the models.

5. The PID parameter setting method based on the dung beetle algorithm according to claim 4 is characterized in that: The behaviors of dung beetles include: (1) The behavior pattern of the ball-rolling dung beetle, which is the ball-rolling behavior when there is no obstacle and the dancing behavior when there is an obstacle; When there is no obstacle, its position is updated as follows: x i (t+1)=x i (t)+a*k*x i (t-1)+b*|x i (t)+X w |, Among them, t represents the current iteration number, x i represents the position information of the i-th dung beetle, k represents the deflection coefficient, α∈(0,1) is a random number, a is a natural coefficient, which is -1 or 1; X w is the global worst position; When there is an obstacle, its position is updated as follows: x i (t+1)=x i (t)+tan(θ)|x i (t)-x i (t-1)| Among them, tan(θ) is the deflection system angle; (2) Oviposition dung beetle behavior pattern: implement oviposition behavior, and its position is updated as follows: B i (t+1)=X * +b1*(B i (t)-Lb * )+b2*(B i (t)-Ub * ), Among them, B i is the position of the egg, b1 and b2 are random vectors, X * is the current best position, Lb is the lower bound, and Ub is the upper bound; (3) The behavior pattern of the small dung beetle, its position is updated as follows: x i (t+1)=x i (t)+C1*(x i (t)-Lb * )+C2*(x i (t)-Ub * ), C1 is a random number that follows a normal distribution, and C2∈(0,1) is a random vector; (4) Behavior patterns of thief dung beetles: Fighting for the best food spot X b It is the best place to compete for food, and its location is updated as follows: x i (t+1)=X b +S*g*(|x i (t)-X * |+|x i (t)-X b |) (4) Among them, g is a random vector that obeys a state distribution with a mean of 0 and a variance of 1, and S is a constant.

Citation Information

Cited By

  • Control method based on vehicle-mounted equipment rotation system

    CN119995424A

  • A control method based on a vehicle-mounted equipment slewing system

    CN119995424B