Centrifuge control method, device, equipment and medium based on improved PID
Through the improved elk herd optimization algorithm, the parameters of the centrifuge speed PID controller are optimized, which solves the problems of complex parameter setting and poor stability in traditional PID control methods, improves the performance and robustness of the centrifuge control system, and achieves better performance and reliability control effect.
Patent Information
- Application Number
- CN202411108647.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-08-13
AI Technical Summary
Traditional PID control methods have problems such as complex parameter setting and poor stability in centrifuges, making it difficult to effectively optimize the control performance of the centrifuge.
The improved elk herd optimization algorithm is adopted to optimize the parameters Kp, Ki, and Kd of the PID controller through the diversity measurement mechanism and nonlinear transformation, and a mathematical model is constructed and the improved elk herd algorithm is used to optimize the centrifuge speed PID controller.
The performance and robustness of the centrifuge control system are improved, and better control effects and stability are achieved, avoiding local optimal solutions and early convergence problems.
Smart Images

Figure CN118642352B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of PID control, and in particular relates to a centrifuge control method, device, equipment and medium based on improved PID. Background Art
[0002] A centrifuge is a device that uses the centrifugal force generated by high-speed rotation to separate materials of different densities. Its working principle is based on the action of centrifugal force. Through the high-speed rotation of the rotating shaft, the particles in the mixture are forced to move radially, so that the particles with higher density move outward, while the particles with lower density move inward, thereby achieving separation. Centrifuges can be divided into centrifugal sedimentation machines and centrifugal filters according to their separation methods. Centrifugal sedimentation machines are mainly used to separate solid particles or droplets suspended in liquids, and are suitable for treating suspensions with low solid content. Centrifugal filters use centrifugal force to pass liquid through a filter screen or filter cloth to intercept solid particles, achieve solid-liquid separation, and are suitable for treating suspensions with high solid content. According to the purpose and design, centrifuges can also be divided into laboratory centrifuges, industrial centrifuges, ultracentrifuges and other types. Centrifuges are widely used in chemical, pharmaceutical, food, biotechnology and other fields, with the advantages of simple operation, high separation efficiency and wide application range.
[0003] The key to the centrifuge control system lies in the precise control of the centrifugal speed and the stable operation of the system. First of all, the centrifugal speed control usually uses the PID control algorithm to ensure that the centrifuge runs within the set speed range by detecting the centrifugal speed in real time and adjusting the input of the motor. Secondly, the stability of the system is particularly important, and vibration and imbalance need to be prevented. PID control is a control algorithm widely used in control systems. By adjusting the proportional, integral and differential parameters, it can cope with fast response changes in working conditions and realize real-time control of the system. However, it has the disadvantages of complex parameter setting and poor stability in the face of nonlinear complex systems.
[0004] Elk herd optimizer (EHO) is a new meta-heuristic algorithm inspired by the reproduction process of elk herds. Elk have two main breeding seasons: rutting season and calving season. In the rutting season, the elk herd is divided into different families of different sizes. This division is based on the competition for dominance between male deer. Stronger male deer can form a family with a large harem. In the calving season, each family will give birth to new fawns from male deer and harem. The algorithm is divided into three stages: initialization, rutting season, and calving season. The algorithm has good optimization performance, but it is easy to fall into local optimal solutions and reach convergence early to a certain extent. Summary of the invention
[0005] The purpose of the present invention is to provide a centrifuge control method and device, equipment, and storage medium based on improved PID, which can solve the problems of complex parameter setting and poor stability caused by the traditional PID control method of the centrifuge, and optimize the control parameters Kp, Ki, and Kd of the centrifuge speed PID controller by improving the elk herd algorithm, thereby improving the performance and robustness of the centrifuge control system.
[0006] The first aspect of the present invention discloses a centrifuge control method based on improved PID, comprising:
[0007] Based on the centrifuge control problem, the mathematical model to be optimized is constructed;
[0008] Establish the PID control model of the centrifuge control system;
[0009] Adopt diversity measurement mechanism and adjust the parameters in elk herd algorithm Perform nonlinear transformation to obtain the improved elk herd algorithm;
[0010] Taking the mathematical model to be optimized as the objective function, the improved elk herd algorithm is used to optimize the centrifuge speed PID controller and obtain the optimal control parameters Kp, Ki, and Kd.
[0011] The obtained optimal control parameters Kp, Ki, and Kd are input into the PID control model of the centrifuge control system to control the centrifuge.
[0012] In some embodiments, the formula of the mathematical model to be optimized is:
[0013] ;
[0014] In the formula, J is the fitness value, is the output value of the centrifuge speed PID controller, is the weight factor used to balance the system error, is the current control time, is the total control time, for The derivative of for The derivative of .
[0015] In some embodiments, the PID control model of the centrifuge control system includes an input module, an error calculation module, a speed PID controller module, an improved elk herd algorithm module, a speed detection module, a motor module and a centrifuge module; the input module is used to input the expected speed value, the error calculation module is used to difference the expected speed value and the actual speed value detected by the speed detection module to obtain a speed error value, the speed PID controller module is used to receive the speed error value, and apply the PID parameters optimized by the improved elk herd algorithm module to calculate and obtain a reference speed value, the motor module is used to control the motor operation and drive the centrifuge to rotate with reference to the speed value, and the centrifuge module is used to control the centrifuge speed.
[0016] In some embodiments, the diversity metric mechanism is used to adjust the parameters in the elk herd algorithm. The specific steps of performing nonlinear transformation and obtaining the improved elk herd algorithm are as follows:
[0017] During the rutting season of the simulation algorithm, a diversity measurement mechanism was introduced to improve the selection strategy for male elk. The formula is:
[0018] ;
[0019] ;
[0020] ;
[0021] ;
[0022] In the formula, B is the total number of households, is the male elk rate, EHS is the population size, is the male elk with the best fitness value, is the fitness value of the j-th male elk, λ is the weight coefficient, is the diversity measure of the j-th male elk, is the jth male elk in the population, is the mth male elk in the population, is the selection probability, is the absolute fitness value of all male elks;
[0023] Simulation algorithm calving season phase, parameters Perform nonlinear transformations to improve strategies for breeding elk calves.
[0024] In some embodiments, the simulation algorithm simulates the calving season phase, and the parameters Perform nonlinear transformations to improve the strategy for breeding elk calves, including:
[0025] If the young elk has the same fitness index as the father elk, the formula for the young elk's reproduction strategy is:
[0026] ;
[0027] ;
[0028] In the formula, The jth elk calf bred for the i-th family, is the breeding mother elk of the i-th family, is the parameter that determines the inheritance attribute ratio. is the kth elk from the randomly selected i-th family, is the fitness value of the j-th elk in the it-th iteration, is the average fitness value of the elk population in the it-th iteration, To adjust the parameters;
[0029] If the young elk has the same fitness index as the mother elk, the formula for the young elk's reproduction strategy is:
[0030] ;
[0031] In the formula, and is a random number between 0 and 2, is the sire elk of the i-th family, is a random bull elk in the bull elk population, is the breeding mother elk of the i-th family, The j-th elk calf bred for the i-th family.
[0032] In some embodiments, the mathematical model to be optimized is used as the objective function, and the improved elk herd algorithm is used to optimize the centrifuge speed PID controller to obtain the optimal control parameters Kp, Ki, and Kd. The specific steps are:
[0033] S1. The mathematical model to be optimized is used as the objective function of the improved elk herd algorithm, wherein the objective function is used as a fitness function to evaluate the superiority of each candidate solution;
[0034] S2. Simulate the working conditions of the centrifuge control system and design transfer functions to describe the dynamic characteristics of the system;
[0035] S3, given centrifuge control system input;
[0036] S4, initialize the population size, problem dimension, algorithm search upper bound, algorithm search lower bound, and maximum number of iterations of the improved elk herd algorithm;
[0037] S5, encoding the parameters Kp, Ki, and Kd of the centrifuge speed PID controller as the solution of the improved elk herd algorithm search space, iterating the algorithm, and setting the updated population individuals as the speed PID controller parameter solution;
[0038] S6. Calculate the individual fitness values of the current iteration population according to the fitness function, record the minimum fitness value, and compare it with the optimal fitness value of the population in the previous iteration, and retain the optimal fitness value;
[0039] S7, simulating the optimization process of each stage of the elk herd algorithm, and updating the Kp, Ki, and Kd parameters of the centrifuge speed PID controller;
[0040] S8. If the updated elk population individuals are better than those updated in the previous iteration, the current optimal solution is retained;
[0041] S9. Determine whether the current number of iterations reaches the maximum number of iterations. If so, exit the loop, output the global optimal solution, and obtain Kp, Ki, and Kd parameters according to the centrifuge speed PID controller. Otherwise, return to execute S3.
[0042] In some embodiments, the optimization process of each stage of the simulated elk herd algorithm includes the following specific steps:
[0043] During the initialization phase of the simulation algorithm, a mathematical model of the initial population position is established;
[0044] During the rutting season, the algorithm simulates the rutting season and introduces a diversity measurement mechanism to improve the selection strategy for bull elk;
[0045] Simulation algorithm calving season phase, parameters Perform nonlinear transformations to improve strategies for breeding elk calves.
[0046] The second aspect of the present invention discloses a centrifuge control device based on improved PID, comprising:
[0047] The optimization model module is used to construct the mathematical model to be optimized based on the centrifuge control problem;
[0048] PID control model module, used to establish the PID control model of the centrifuge control system;
[0049] Elk herd algorithm module, used to adopt diversity measurement mechanism and adjust the parameters in the elk herd algorithm Perform nonlinear transformation to obtain the improved elk herd algorithm;
[0050] The optimal control parameter module is used to optimize the centrifuge speed PID controller using the improved elk herd algorithm with the mathematical model to be optimized as the objective function to obtain the optimal control parameters Kp, Ki, and Kd;
[0051] The control module is used to input the obtained optimal control parameters Kp, Ki, Kd into the PID control model of the centrifuge control system to control the centrifuge.
[0052] The third aspect of the present invention discloses an electronic device, comprising a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the centrifuge control method based on improved PID disclosed in the first aspect.
[0053] The fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the centrifuge control method based on improved PID disclosed in the first aspect.
[0054] The beneficial effect of the present invention is that by introducing a diversity measurement mechanism in the estrus season stage of the algorithm and adjusting the parameters in the calving season stage, Nonlinear transformation is performed to improve the elk herd algorithm, thereby improving the performance and accuracy of the algorithm. The improved elk herd algorithm is used to optimize the centrifuge speed PID controller to obtain the optimal control parameters Kp, Ki, and Kd. The obtained optimal control parameters Kp, Ki, and Kd are input into the PID control model of the centrifuge control system to achieve optimal robust control of the centrifuge. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings herein show specific examples of the technical solutions described in the present invention, and together with the specific implementation methods, constitute a part of the specification, and are used to explain the technical solutions, principles and effects of the present invention.
[0056] Unless otherwise specified or defined, the same figure marks in different drawings represent the same or similar technical features, and the same or similar technical features may also be represented by different figure marks.
[0057] Figure 1 It is a flow chart of a centrifuge control method based on improved PID disclosed in an embodiment of the present invention;
[0058] Figure 2 Schematic diagram of a PID control model of a centrifuge control system according to an embodiment of the present invention;
[0059] Figure 3 is a flow chart of the steps of optimizing the centrifuge speed PID controller using the improved elk herd algorithm according to an embodiment of the present invention;
[0060] Figure 4 is a fitness value comparison curve diagram of the basic elk herd algorithm and the improved elk herd algorithm according to the embodiment of the present invention;
[0061] Figure 5 : is a comparison diagram of the effects of optimizing PID control parameters by the basic elk herd algorithm and the improved elk herd algorithm in an embodiment of the present invention;
[0062] Figure 6 1 is a schematic structural diagram of a centrifuge control device based on improved PID according to an embodiment of the present invention;
[0063] Figure 7 It is a structural schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0064] Unless otherwise specified or defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art. In combination with the technical solution of the present invention in a realistic scenario, all technical and scientific terms used herein may also have meanings corresponding to the purpose of implementing the technical solution of the present invention. The "first, second..." used herein is only used to distinguish the names and does not represent a specific quantity or order. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0065] It should be noted that when a component is considered to be "fixed to" another component, it can be directly fixed to the other component or there can be a central component; when an component is considered to be "connected to" another component, it can be directly connected to the other component or there can be a central component at the same time; when an component is considered to be "installed on" another component, it can be directly installed on the other component or there can be a central component at the same time. When an component is considered to be "set on" another component, it can be directly set on the other component or there can be a central component at the same time.
[0066] Unless otherwise specified or defined, the "said" and "the" used in this document refer to the technical features or technical contents mentioned or described before the corresponding position, and the technical features or technical contents may be the same as or similar to the technical features or technical contents mentioned therein. In addition, the terms "including" and "having" and any variations thereof used in this document are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0067] The embodiment of the present invention discloses a centrifuge control method based on improved PID, which is used to control the centrifuge. The method can be implemented by computer programming. The execution subject of the method can be an electronic device such as a computer, a laptop computer, a tablet computer, or a centrifuge control device based on improved PID embedded in an electronic device, and the present invention is not limited to this. In order to facilitate the understanding of the present invention, the specific embodiments of the present invention will be described in more detail below with reference to the drawings of the specification.
[0068] like Figure 1 As shown, the method comprises the following steps:
[0069] Step S100: constructing a mathematical model to be optimized based on the centrifuge control problem;
[0070] The centrifuge control problem is converted into a mathematical model to be optimized. The formula of the mathematical model to be optimized is:
[0071] ;
[0072] In the formula, J is the fitness value, is the output value of the centrifuge speed PID controller, is the weight factor used to balance the system error, is the current control time, is the total control time, for The derivative of for The derivative of .
[0073] In some examples, the mathematical model formula to be optimized uses a weighted control output energy function, which comprehensively considers the energy and change rate of the control output to achieve the goal of minimizing the total energy and change rate of the control signal.
[0074] Step S200: Establishing a PID control model of a centrifuge control system;
[0075] Establish as Figure 2 The PID control model of the centrifuge control system shown in the figure specifically includes an input module, an error calculation module, a speed PID controller module, an improved elk herd algorithm module, a motor module, a speed detection module, and a centrifuge module; the input module is used to input the expected speed value, the error calculation module is used to make a difference between the expected speed value and the actual speed value detected by the speed detection module to obtain a speed error value, the speed PID controller module is used to receive the speed error value, and apply the PID parameters optimized by the improved elk herd algorithm module to calculate and obtain a reference speed value, the motor module is used to control the motor operation and drive the centrifuge to rotate based on the reference speed value, and the centrifuge module is used to control the centrifuge speed.
[0076] The specific control process is as follows: the expected speed value is input from the input module, and is input together with the actual speed value detected by the speed detection module into the error calculation module for subtraction to obtain the speed error value; the speed PID controller module receives the speed error value, and applies the PID parameters optimized by the improved elk herd algorithm module to calculate the reference speed value, and then controls the motor to drive the centrifuge to rotate according to the reference speed value, thereby realizing the control of the centrifuge speed.
[0077] Step S300: Adopting the diversity measurement mechanism and adjusting the parameters in the elk herd algorithm Perform nonlinear transformation to obtain the improved elk herd algorithm;
[0078] Matlab software was used to establish the mathematical model of the elk herd algorithm. By introducing the diversity measurement mechanism and adjusting the parameters Perform nonlinear transformation, improve the elk herd algorithm, obtain the improved elk herd algorithm, and verify the performance of the improved elk herd algorithm in optimizing the PID controller. Used to adjust the behavior and characteristics of the elk herd algorithm, also known as the "learning factor" or "adaptation factor". It can affect the search efficiency and convergence speed of the algorithm.
[0079] Specifically, the algorithm simulates the rutting season and introduces a diversity measurement mechanism to improve the selection strategy for male elk. The formula is:
[0080] (1);
[0081] (2);
[0082] (3);
[0083] (4);
[0084] In the formula, B is the total number of households, is the male elk rate, EHS is the population size, is the male elk with the best fitness value, is the fitness value of the j-th male elk, λ is the weight coefficient, which is 2. is the diversity measure of the j-th male elk, is the jth male elk in the population, is the mth male elk in the population, is the selection probability, is the absolute fitness value of all male elks;
[0085] By introducing a diversity measurement mechanism, the selection strategy for bull elk is improved, and individuals with better fitness and higher diversity are selected, the diversity of the population can be maintained, thereby delaying premature convergence and improving the global search capability; secondly, the diversity measurement mechanism prompts the population to explore more different areas during the search process, increasing the probability of finding the global optimal solution, thereby improving the quality of the final solution.
[0086] Simulation algorithm calving season phase, parameters Perform nonlinear transformations to improve strategies for breeding elk calves.
[0087] In this embodiment, the strategy for improving breeding of young elk includes the following specific steps:
[0088] If the young elk has the same fitness index as the father elk, the formula for the young elk's reproduction strategy is:
[0089] (5);
[0090] (6);
[0091] In the formula, The jth elk calf bred for the i-th family, is the breeding mother elk of the i-th family, is the parameter that determines the inheritance attribute ratio. is the kth elk from the randomly selected i-th family, is the fitness value of the j-th elk in the it-th iteration, is the average fitness value of the elk population in the it-th iteration, To adjust the parameter, the value is 0.5;
[0092] If the young elk has the same fitness index as the mother elk, the formula for the young elk's reproduction strategy is:
[0093] (7);
[0094] In the formula, and is a random number between 0 and 2, is the sire elk of the i-th family, is a random bull elk in the bull elk population, is the breeding mother elk of the i-th family, The j-th elk calf bred for the i-th family.
[0095] By the parameters Perform nonlinear transformation to improve the strategy of breeding elk, based on fitness The parameters can flexibly adjust the search step size according to the relative fitness of the individuals, so that individuals with lower fitness can perform fine search with small steps, while individuals with higher fitness can perform global exploration with large steps, increasing the possibility of escaping the local optimal solution, thereby balancing global search and local development.
[0096] Step S400: Taking the mathematical model to be optimized as the objective function, the improved elk herd algorithm is used to optimize the centrifuge speed PID controller to obtain the optimal control parameters Kp, Ki, and Kd;
[0097] Specific steps are as follows Figure 3 As shown, including:
[0098] S1. The mathematical model to be optimized is used as the objective function of the improved elk herd algorithm, wherein the objective function is used as a fitness function to evaluate the superiority of each candidate solution;
[0099] S2. Simulate the working conditions of the centrifuge control system and design transfer functions to describe the dynamic characteristics of the system;
[0100] S3, giving an input of a centrifuge control system, wherein the input is a desired speed value of the centrifuge in the control system;
[0101] S4, initialize the population size EHS of the improved elk herd algorithm, the problem dimension d, the algorithm search upper bound ub, the algorithm search lower bound lb, and the maximum number of iterations T;
[0102] S5, encoding the parameters Kp, Ki, and Kd of the centrifuge speed PID controller as the solution of the improved elk herd algorithm search space, and as the algorithm is iterated, the updated population individuals reflect the corresponding speed PID controller parameter solutions;
[0103] S6. Calculate the individual fitness values of the current iteration population according to the fitness function, record the minimum fitness value, and compare it with the optimal fitness value of the population in the previous iteration, and retain the optimal fitness value;
[0104] S7, simulating the optimization process of each stage of the elk herd algorithm, that is, updating the Kp, Ki, and Kd parameters of the centrifuge speed PID controller;
[0105] S8. If the updated elk population individuals are better than those updated in the previous iteration, the current optimal solution is retained;
[0106] S9. Determine whether the current number of iterations reaches the maximum number of iterations. If so, exit the loop, output the global optimal solution, and assign it to the centrifuge speed PID controller as the three parameters Kp, Ki, and Kd. Otherwise, return to execute S3.
[0107] In one example, step S2 simulates the working condition of the centrifuge control system and designs a transfer function to describe the dynamic characteristics of the system; wherein the transfer function formula is:
[0108] ;
[0109] Where s is a complex frequency variable.
[0110] In one example, in step S5, the parameters Kp, Ki, and Kd of the centrifuge speed PID controller are encoded as a solution of the elk herd algorithm search space, wherein the population encoding vector is:
[0111] ;
[0112] Where x is the population encoding vector, Kp, Ki, and Kd are the parameters of the centrifuge speed PID controller, and n is the population size.
[0113] In one example, step S7 simulates the optimization process of each stage of the elk herd algorithm, and the specific steps are:
[0114] In the initialization phase of the simulation algorithm, the mathematical model of the initial population position is established according to formula (8);
[0115] (8);
[0116] In the formula, x is the initial position of the individual elk population, lb is the algorithm search lower bound, ub is the algorithm search upper bound, is a random value between 0 and 1;
[0117] During the rutting season, the algorithm simulates the rutting season and executes formulas (1)-(4). The diversity measurement mechanism is introduced to improve the selection strategy for male elk.
[0118] During the calving season, the algorithm simulates the calving season and executes formulas (5)-(7) to calculate the parameters Perform nonlinear transformations to improve strategies for breeding elk calves.
[0119] Step S500: input the obtained optimal control parameters Kp, Ki, Kd into the PID control model of the centrifuge control system to control the centrifuge.
[0120] This embodiment uses Matlab simulation modeling to compare the basic elk herd algorithm optimization PID control and the improved elk herd algorithm optimization PID control. The parameters are set as follows: population size EHS=30, problem dimension d=3, algorithm search upper bound ub=100, algorithm search lower bound lb=0, and maximum number of iterations T=30. The objective function is used to calculate the fitness value of the basic elk herd algorithm and the improved elk herd algorithm in the optimization process, and the following is obtained: Figure 4The fitness value comparison curve is shown in Figure 2. Figure 4 It can be seen that from the trend of the overall curve, the improved elk herd algorithm has a wider search range and stronger search ability; the basic elk herd algorithm shows a phenomenon of being easily trapped in the local optimum for a long time in terms of the change characteristics of the fitness value, while the improved elk herd algorithm is trapped in the local optimum for a shorter time during the tuning process and has a certain ability to jump out of the local optimum; in general, according to the principle that the smaller the fitness value, the better the performance, the improved elk herd algorithm is better in the quality of finding solutions; in addition, from Figure 4 It can be clearly seen that the improved elk group algorithm has a faster convergence speed, which means that the improved elk group algorithm is also faster in finding solutions.
[0121] The obtained optimal control parameters Kp, Ki, Kd are input into the PID control model of the centrifuge control system, and the control effect is output as follows: Figure 5 The effect comparison chart of optimizing PID control parameters is shown in the figure; Figure 5 It can be seen that the PID control system using the improved elk herd algorithm shows lower overshoot and smaller oscillation amplitude than the PID control system using the basic elk herd algorithm, and can reach steady state in a shorter time; this shows that the improved elk herd algorithm significantly improves the stability of the PID control system, and the system is more robust when facing parameter changes and external disturbances.
[0122] In summary, this embodiment introduces a diversity measurement mechanism in the estrus season stage of the algorithm and adjusts the parameters in the calving season stage. Nonlinear transformation is performed to improve the elk herd algorithm, thereby improving the performance and accuracy of the algorithm. The improved elk herd algorithm is used to optimize the centrifuge speed PID controller to obtain the optimal control parameters Kp, Ki, and Kd. The obtained optimal control parameters Kp, Ki, and Kd are input into the PID control model of the centrifuge control system to achieve optimal robust control of the centrifuge.
[0123] like Figure 6 As shown, the embodiment of the present invention discloses a centrifuge control device based on improved PID, comprising:
[0124] The optimization model module 610 is used to construct a mathematical model to be optimized based on the centrifuge control problem;
[0125] PID control model module 620, used to establish a PID control model of the centrifuge control system;
[0126] Elk herd algorithm module 630, for using a diversity metric mechanism and adjusting the parameters in the elk herd algorithm Perform nonlinear transformation to obtain the improved elk herd algorithm;
[0127] The optimal control parameter module 640 is used to optimize the centrifuge speed PID controller by using the improved elk herd algorithm with the mathematical model to be optimized as the objective function to obtain the optimal control parameters Kp, Ki, and Kd;
[0128] The control module 650 is used to input the obtained optimal control parameters Kp, Ki, Kd into the PID control model of the centrifuge control system to control the centrifuge.
[0129] like Figure 7 As shown, an embodiment of the present invention discloses an electronic device, including a memory 401 storing executable program codes and a processor 402 coupled to the memory 401;
[0130] The processor 402 calls the executable program code stored in the memory 401 to execute the centrifuge control method based on improved PID described in the above embodiments.
[0131] An embodiment of the present invention further discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the centrifuge control method based on improved PID described in the above embodiments.
[0132] The purpose of the above embodiments is to exemplarily reproduce and deduce the technical solution of the present invention, and to fully describe the technical solution, purpose and effect of the present invention. Its purpose is to make the public understand the disclosed content of the present invention more thoroughly and comprehensively, and it does not limit the protection scope of the present invention.
[0133] The above embodiments are not exhaustive enumerations of the present invention, and there may be multiple other implementations not listed. Any replacement and improvement made without violating the concept of the present invention shall fall within the protection scope of the present invention.
Claims
1. A centrifuge control method based on improved PID, characterized in that: include: Based on the centrifuge control problem, the mathematical model to be optimized is constructed; Establish the PID control model of the centrifuge control system; Adopt diversity measurement mechanism and adjust the parameters in elk herd algorithm Perform nonlinear transformation to obtain the improved elk herd algorithm; Taking the mathematical model to be optimized as the objective function, the improved elk herd algorithm is used to optimize the centrifuge speed PID controller and obtain the optimal control parameters Kp, Ki, and Kd. The obtained optimal control parameters Kp, Ki, and Kd are input into the PID control model of the centrifuge control system to control the centrifuge; The formula of the mathematical model to be optimized is: ; In the formula, J is the fitness value, is the output value of the centrifuge speed PID controller, is the weight factor used to balance the system error, is the current control time, is the total control time, for The derivative of for The derivative of The diversity measurement mechanism is used to adjust the parameters of the elk herd algorithm. The specific steps of performing nonlinear transformation and obtaining the improved elk herd algorithm are as follows: During the rutting season of the simulation algorithm, a diversity measurement mechanism was introduced to improve the selection strategy for male elk. The formula is: ; ; ; ; In the formula, B is the total number of households, is the male elk rate, EHS is the population size, is the male elk with the best fitness value, is the fitness value of the j-th male elk, λ is the weight coefficient, is the diversity measure of the j-th bull elk, is the jth male elk in the population, is the mth male elk in the population, is the selection probability, is the absolute fitness value of all male elks; Simulation algorithm calving season phase, parameters Perform nonlinear transformation to improve the strategy of breeding elk calves; The simulation algorithm is used for the calving season phase and the parameters Perform nonlinear transformations to improve the strategy for breeding elk calves, including: If the young elk has the same fitness index as the father elk, the reproductive strategy formula of the young elk is: ; ; In the formula, The jth elk calf bred for the i-th family, is the breeding mother elk of the i-th family, is the parameter that determines the inheritance attribute ratio. is the kth elk from the randomly selected i-th family, is the fitness value of the j-th elk in the it-th iteration, is the average fitness value of the elk population in the it-th iteration, To adjust the parameters; If the young elk has the same fitness index as the mother elk, the formula for the young elk's reproduction strategy is: ; In the formula, and is a random number between 0 and 2, is the sire elk of the i-th family, is a random bull elk in the bull elk population, is the breeding mother elk of the i-th family, The jth elk calf bred for the i-th family; The mathematical model to be optimized is used as the objective function, and the improved elk herd algorithm is used to optimize the centrifuge speed PID controller to obtain the optimal control parameters Kp, Ki, and Kd. The specific steps are: S1. The mathematical model to be optimized is used as the objective function of the improved elk herd algorithm, wherein the objective function is used as a fitness function to evaluate the superiority of each candidate solution; S2. Simulate the working conditions of the centrifuge control system and design transfer functions to describe the dynamic characteristics of the system; S3, given centrifuge control system input; S4, initialize the population size, problem dimension, algorithm search upper bound, algorithm search lower bound, and maximum number of iterations of the improved elk herd algorithm; S5, encoding the parameters Kp, Ki, and Kd of the centrifuge speed PID controller as the solution of the improved elk herd algorithm search space, iterating the algorithm, and setting the updated population individuals as the speed PID controller parameter solution; S6. Calculate the individual fitness values of the current iteration population according to the fitness function, record the minimum fitness value, and compare it with the optimal fitness value of the population in the previous iteration, and retain the optimal fitness value; S7, simulating the optimization process of each stage of the elk herd algorithm, and updating the Kp, Ki, and Kd parameters of the centrifuge speed PID controller; S8. If the updated elk population individuals are better than those updated in the previous iteration, the current optimal solution is retained; S9, determine whether the current number of iterations reaches the maximum number of iterations, if so, exit the loop, output the global optimal solution, and obtain Kp, Ki, and Kd parameters according to the centrifuge speed PID controller, otherwise return to execute S3; In step S5, the parameters Kp, Ki, and Kd of the centrifuge speed PID controller are encoded into the solution of the elk herd algorithm search space, where the population encoding vector is: ; Where x is the population encoding vector, Kp, Ki, and Kd are the parameters of the centrifuge speed PID controller, and n is the population size.
2. The centrifuge control method based on improved PID as claimed in claim 1, characterized in that: The PID control model of the centrifuge control system includes an input module, an error calculation module, a speed PID controller module, an improved elk herd algorithm module, a speed detection module, a motor module and a centrifuge module; the input module is used to input an expected speed value, the error calculation module is used to make a difference between the expected speed value and the actual speed value detected by the speed detection module to obtain a speed error value, the speed PID controller module is used to receive the speed error value, and apply the PID parameters optimized by the improved elk herd algorithm module to calculate and obtain a reference speed value, the motor module is used to control the motor operation and drive the centrifuge to rotate with reference to the speed value, and the centrifuge module is used to control the centrifuge speed.
3. The centrifuge control method based on improved PID as claimed in claim 1, characterized in that: The optimization process of each stage of the simulated elk herd algorithm is as follows: During the initialization phase of the simulation algorithm, a mathematical model of the initial population position is established; During the rutting season, the algorithm simulates the rutting season and introduces a diversity measurement mechanism to improve the selection strategy for bull elk; Simulation algorithm calving season phase, parameters Perform nonlinear transformations to improve strategies for breeding elk calves.
4. A centrifuge control device based on improved PID, characterized in that: include: The optimization model module is used to construct the mathematical model to be optimized based on the centrifuge control problem; PID control model module, used to establish the PID control model of the centrifuge control system; Elk herd algorithm module, used to adopt diversity measurement mechanism and adjust the parameters in the elk herd algorithm Perform nonlinear transformation to obtain the improved elk herd algorithm; The optimal control parameter module is used to optimize the centrifuge speed PID controller using the improved elk herd algorithm with the mathematical model to be optimized as the objective function to obtain the optimal control parameters Kp, Ki, and Kd; A control module is used to input the obtained optimal control parameters Kp, Ki, and Kd into a PID control model of a centrifuge control system to control the centrifuge; The formula of the mathematical model to be optimized is: ; In the formula, J is the fitness value, is the output value of the centrifuge speed PID controller, is the weight factor used to balance the system error, is the current control time, is the total control time, for The derivative of for The derivative of The diversity measurement mechanism is used to adjust the parameters of the elk herd algorithm. The specific steps of performing nonlinear transformation and obtaining the improved elk herd algorithm are as follows: During the rutting season of the simulation algorithm, a diversity measurement mechanism was introduced to improve the selection strategy for male elk. The formula is: ; ; ; ; In the formula, B is the total number of households, is the male elk rate, EHS is the population size, is the male elk with the best fitness value, is the fitness value of the j-th male elk, λ is the weight coefficient, is the diversity measure of the j-th bull elk, is the jth male elk in the population, is the mth male elk in the population, is the selection probability, is the absolute fitness value of all male elks; Simulation algorithm calving season phase, parameters Perform nonlinear transformation to improve the strategy of breeding elk calves; The simulation algorithm is used for the calving season phase and the parameters Perform nonlinear transformations to improve the strategy for breeding elk calves, including: If the young elk has the same fitness index as the father elk, the reproductive strategy formula of the young elk is: ; ; In the formula, The jth elk calf bred for the i-th family, is the breeding mother elk of the i-th family, is the parameter that determines the inheritance attribute ratio. is the kth elk from the randomly selected i-th family, is the fitness value of the j-th elk in the it-th iteration, is the average fitness value of the elk population in the it-th iteration, To adjust the parameters; If the young elk has the same fitness index as the mother elk, the formula for the young elk's reproduction strategy is: ; In the formula, and is a random number between 0 and 2, is the sire elk of the i-th family, is a random bull elk in the bull elk population, is the breeding mother elk of the i-th family, The jth elk calf bred for the i-th family; The mathematical model to be optimized is used as the objective function, and the improved elk herd algorithm is used to optimize the centrifuge speed PID controller to obtain the optimal control parameters Kp, Ki, and Kd. The specific steps are: S1. The mathematical model to be optimized is used as the objective function of the improved elk herd algorithm, wherein the objective function is used as a fitness function to evaluate the superiority of each candidate solution; S2. Simulate the working conditions of the centrifuge control system and design transfer functions to describe the dynamic characteristics of the system; S3, given centrifuge control system input; S4, initialize the population size, problem dimension, algorithm search upper bound, algorithm search lower bound, and maximum number of iterations of the improved elk herd algorithm; S5, encoding the parameters Kp, Ki, and Kd of the centrifuge speed PID controller as the solution of the improved elk herd algorithm search space, iterating the algorithm, and setting the updated population individuals as the speed PID controller parameter solution; S6. Calculate the individual fitness values of the current iteration population according to the fitness function, record the minimum fitness value, and compare it with the optimal fitness value of the population in the previous iteration, and retain the optimal fitness value; S7, simulating the optimization process of each stage of the elk herd algorithm, and updating the Kp, Ki, and Kd parameters of the centrifuge speed PID controller; S8. If the updated elk population individuals are better than those updated in the previous iteration, the current optimal solution is retained; S9, determine whether the current number of iterations reaches the maximum number of iterations, if so, exit the loop, output the global optimal solution, and obtain Kp, Ki, and Kd parameters according to the centrifuge speed PID controller, otherwise return to execute S3; In step S5, the parameters Kp, Ki, and Kd of the centrifuge speed PID controller are encoded into the solution of the elk herd algorithm search space, where the population encoding vector is: ; Where x is the population encoding vector, Kp, Ki, and Kd are the parameters of the centrifuge speed PID controller, and n is the population size.
5. An electronic device, characterized in that: It comprises a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the centrifuge control method based on improved PID as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute the centrifuge control method based on improved PID according to any one of claims 1 to 3.
