CN117970783B - Numerical control high-speed milling and drilling machine control method based on improved river horse algorithm - Google Patents

Numerical control high-speed milling and drilling machine control method based on improved river horse algorithm Download PDF

Info

Publication number
CN117970783B
CN117970783B CN202410381777.0A CN202410381777A CN117970783B CN 117970783 B CN117970783 B CN 117970783B CN 202410381777 A CN202410381777 A CN 202410381777A CN 117970783 B CN117970783 B CN 117970783B
Authority
CN
China
Prior art keywords
speed
algorithm
river
formula
river horse
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410381777.0A
Other languages
Chinese (zh)
Other versions
CN117970783A (en
Inventor
罗洪波
王乐乐
王海路
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Sansen Cnc Machinery Co ltd
Original Assignee
Shandong Sansen Cnc Machinery Co ltd
Filing date
Publication date
Application filed by Shandong Sansen Cnc Machinery Co ltd filed Critical Shandong Sansen Cnc Machinery Co ltd
Priority to CN202410381777.0A priority Critical patent/CN117970783B/en
Publication of CN117970783A publication Critical patent/CN117970783A/en
Application granted granted Critical
Publication of CN117970783B publication Critical patent/CN117970783B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a numerical control high-speed milling and drilling machine control method based on an improved river horse algorithm, which belongs to the technical field of PID control optimization and comprises the following specific steps: step one, establishing a simulation model of a speed control system of a numerical control high-speed drilling and milling machine; establishing an improved river horse algorithm mathematical model, writing test codes, and verifying the performance of the improved river horse algorithm optimized PID controller, wherein the improved river horse algorithm comprises the following steps: introducing a chaotic mapping improvement algorithm population initialization formula, introducing a self-adaptive weight w to improve a predator position formula, and introducing a triangular migration strategy to improve a position formula of a river horse in a predator escaping stage; optimizing the PID controller by utilizing an improved river horse algorithm to obtain optimal Kp, ki and Kd parameters of the PID controller; inputting the obtained optimal parameters Kp, ki and Kd into a simulation model of a speed control system of the numerical control high-speed milling and drilling machine, and obtaining the optimal effect of speed control simulation of the numerical control high-speed milling and drilling machine by debugging.

Description

Numerical control high-speed milling and drilling machine control method based on improved river horse algorithm
Technical Field
The invention belongs to the field of PID control optimization, and particularly relates to a numerical control high-speed milling and drilling machine control method based on an improved river horse algorithm.
Background
The numerical control high-speed drilling and milling machine is high-efficiency machine tool equipment and is mainly used for high-efficiency drilling and processing of workpieces. The numerical control operation of drilling through holes, blind holes and the like can be realized on simple substance material parts and composite materials. The processing process realizes stepless speed change by digital control and matching with a servo spindle motor, and the accurate positioning is ensured by a full digital control system and a photoelectric edge finder. Therefore, the performance of the all-digital control system is a key for determining the precision and the safety of the numerical control high-speed milling and drilling machine. In industrial application, the numerical control high-speed milling and drilling machine generally adopts a PID control method.
PID control combines three links of proportion, integration and differentiation into a whole, performs proportion, integration and differentiation operation on input deviation, and then controls an executing mechanism by using a superposition result. The device has strong stability and simple structure, is widely applied to industrial control, and generally adopts a closed-loop control mode; while widely used, PID control suffers from some significant drawbacks; firstly, the traditional PID control directly takes the error between the set value and the output as the control basis, which may cause the overshoot or oscillation of the system, and produces certain interference to the stability of the speed control system of the numerical control high-speed milling and drilling machine, secondly, the traditional PID control adopts a linear combination mode to form control quantity, which is not applicable to all systems, especially the effect may be poor when dealing with nonlinear, time-varying and other complex processes, the accuracy of the speed control system of the numerical control high-speed milling and drilling machine may be affected, finally, the parameter adjustment of the PID controller requires the experience and skill of staff, and the parameter selection is improper and consumes a great amount of time.
The Hippopotamus Optimization (HO) algorithm is a population intelligent algorithm, which is conceived by drawing inspiration from the inherent behaviors observed by the hippopotamus, and realizes the update of the hippopotamus position by simulating the update of the hippopotamus position in rivers or ponds, the defense of predators and the strategy of escaping predators. The algorithm can find the optimal solution rapidly and accurately by adaptively adjusting the resolution and the searching speed of the searching space, and has the characteristics of high convergence speed, high solving precision and the like. However, as with other swarm intelligence algorithms, the prey evasion stage (development stage) at the later stage of the algorithm is easy to fall into a local optimal solution, and cannot jump out, so that optimal parameters cannot be found in the actual PID control.
Disclosure of Invention
The invention aims at: by improving the hippocampus algorithm and utilizing the improved hippocampus algorithm (IHO), the Kp, ki and Kd parameters of a PID controller of a speed control system of the numerical control high-speed milling and drilling machine are optimized, the overshoot of the PID controller is reduced, and the response speed of PID control is improved, so that the problems of insufficient stability and low control precision of the traditional PID control under the speed control system of the numerical control high-speed milling and drilling machine are solved.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
A PID optimal robust control method based on an improved river horse algorithm comprises the following specific steps:
Step one, establishing a simulation model of a speed control system of the numerical control high-speed drilling and milling machine by using Simulink software.
Establishing an improved hippopotamus algorithm mathematical model by using Matlab software, writing a test function, and verifying the performance of the improved hippopotamus algorithm optimized PID controller; the improved river horse algorithm comprises the following steps: s21, introducing a chaotic mapping improvement algorithm population initialization position formula, S22, introducing a self-adaptive weight improvement predator position update formula, S23, introducing a triangular migration strategy improvement algorithm river horse population escape predator stage position update formula, and specifically comprising the following steps:
Step1, introducing a chaotic mapping improvement algorithm population initialization position formula, wherein the introduced chaotic mapping formula is Tent mapping, and the improved initialization formula is as follows:
(1);
(2);
In the formula (1), i=1, 2, …, N, N is the number of river horse population, Location initialized for first river horse,/>For the lower limit value of the river horse position,/>For the upper bound value at the hippocampus position,/>For the position of the ith river horse,/>For the position of the (i+1) th river horse, r is a random number with a value between [0,1], A is a random number with a value between (0, 0.5), the position of the first river horse is initialized by adopting a pseudo-random sequence in the formula (1), and then the position of the rest river horses is initialized by adopting a chaotic mapping mode in the formula (2);
step2, then, introducing an adaptive weight w to improve a predator position update formula when the hippopotamus algorithm is in a hippopotamus predator defending stage, wherein the improved predator position update formula is as follows:
Wherein, predator (t) is the position of Predator, lb and ub are the same as above, w is self-adaptive weight, and r is the same as above;
the formula of w is as follows:
Wherein, max_Iter is the maximum evolution algebra, t is the current round of evolution algebra;
step3, finally, introducing a triangular walk strategy improvement algorithm river horse population to avoid the position updating formula of predator stage, wherein the formula is as follows:
(3);
In the method, in the process of the invention, For the improved ith river horse position,/>For the river horse position calculated by the original river horse position updating formula,/>For the randomly selected position of one river horse, i and r are as above.
And thirdly, optimizing the speed PID controller of the numerical control high-speed milling and drilling machine by utilizing the improved river horse algorithm to obtain optimal Kp, ki and Kd parameters of the speed PID controller of the numerical control high-speed milling and drilling machine.
And step four, inputting the obtained optimal parameters Kp, ki and Kd into a simulation model of the speed control system of the numerical control high-speed milling and drilling machine, which is established by Simulink software, and debugging to obtain the optimal effect of PID control of the speed control system of the numerical control high-speed milling and drilling machine.
Further, in the first step, the speed control system of the numerical control high-speed drilling and milling machine comprises a signal input unit, a PID controller unit, an improved river horse algorithm unit, an electric control controller unit, an alternating current asynchronous motor unit and a position and speed information acquisition unit; the target rotating speed is input from the signal input unit, the deviation e (t) is obtained by making a difference with the actual rotating speed acquired by the position and speed information acquisition unit, the obtained e (t) is input into the PID controller unit, the e (t) is regulated by the PID controller optimized by the improved river horse algorithm, the control quantity u (t) is output to the electric regulating controller, and the electric regulating controller generates a pulse signal to control the operation of the alternating current asynchronous motor, so that the speed control of the whole numerical control high-speed milling and drilling machine is realized.
In the first step, the problem of controlling the motor speed of the numerical control high-speed milling and drilling machine is converted into a mathematical model to be optimized, and the mathematical model is an objective function for improving the river horse algorithm.
Furthermore, in the second step, a chaotic mapping improvement algorithm population initialization position formula is introduced, and in the population initialization stage, initialized particles or individuals can be made to be more random and diversified; the method is favorable for increasing diversity of population, improving global searching capability of an algorithm, reducing possibility of sinking into a local optimal solution, and simultaneously, the ergodic characteristic of the chaotic sequence is favorable for improving convergence speed of the algorithm, so that the algorithm can reach the optimal solution more quickly.
Further, in the second step, when the hippopotamus algorithm is in the stage of hippopotamus prey prevention, the adaptive weight w is introduced to improve the predator position updating formula, so that the optimizing precision of the algorithm can be improved, and the situation that the algorithm falls into a local optimal solution in the later period of evolution is avoided.
Furthermore, in the second step, a triangular migration strategy is introduced to improve a position updating formula of the river horse group of the river horse algorithm in the stage of escaping predators, so that the local searching capability of the river horse algorithm is enhanced.
In the third step, the improved hippopotamus algorithm is utilized to optimize the PID controller of the speed control system of the numerical control high-speed milling and drilling machine, so as to obtain optimal Kp, ki and Kd parameters, and the specific steps are as follows:
s1, simulating the working condition of a speed control system of the numerical control high-speed milling and drilling machine, designing a transfer function by using Simulink simulation software, and simulating the working process of the rotating speed of a motor of the numerical control high-speed milling and drilling machine by using a transfer function model by adopting a second-order nonlinear function;
s2, giving an input signal of a speed control system of the numerical control high-speed milling and drilling machine, wherein the input signal is the target rotating speed of a motor of the numerical control high-speed milling and drilling machine;
s3, initializing a population scale N of an improved river horse algorithm (IHO), a problem dimension dim, an algorithm search space upper bound ub, an algorithm search space lower bound lb and a maximum iteration number Max_Iter;
s4, encoding parameters of PID controllers Kp, ki and Kd of a speed control system of the numerical control high-speed milling and drilling machine into three dimensions for improving a position solution of a river horse algorithm;
S5, selecting ITAE as an objective function of the improved river horse algorithm (IHO), wherein the formula of the objective function is as follows:
Wherein J is an adaptability value obtained by an improved river horse algorithm, e (t) is the deviation between the target rotating speed of a motor of a numerical control high-speed milling and drilling machine speed control system and the real-time rotating speed of the motor acquired by a position and speed information acquisition module, t is the current iteration number, The calculated iteration times;
s6, initializing an initial position of a hippopotamus population through chaotic mapping, calculating fitness of positions of individual hippopotamus, selecting a hippopotamus position with minimum fitness as an optimal position of the population, and recording the fitness value of the position as best_PD;
s7, simulating social behaviors of the river horses, establishing a position update strategy mathematical model for improving the river horse algorithm, and updating the river horse position by using the mathematical model, namely updating Kp, ki and Kd parameters of a speed PID controller of the numerical control high-speed milling and drilling machine;
S8, determining whether to update the position of the river horse by adopting a greedy selection mode, and recording the optimal river horse position and the optimal river horse fitness in the current round of evolution, wherein the evolution algebra t is added 1 time;
S9, circularly executing S6-S8, judging whether the current iteration number reaches the maximum iteration number, if so, exiting the cycle, outputting a global optimal solution, and transmitting the global optimal solution to three parameters Kp, ki and Kd of a PID controller of a speed control system of the numerical control high-speed milling and drilling machine.
Furthermore, in the step S1, in order to better simulate the working condition of the speed control system of the numerical control high-speed milling and drilling machine, a second-order nonlinear function is designed by using Simulink simulation software to simulate the working process of the speed motor of the numerical control high-speed milling and drilling machine, so that the speed of the numerical control high-speed milling and drilling machine enhances the working precision, meanwhile, the steady-state error and the dynamic error of the system are reduced, the stability and the safety of the control system are improved, and the formula of the transfer function is as follows:
Where s is a complex frequency variable.
Further, in S5, e (t) is a deviation between a given target rotation speed and an actual rotation speed of the motor of the numerically controlled high-speed milling and drilling machine speed control system, and the formula of the output control quantity u (t) of the PID controller of the numerically controlled high-speed milling and drilling machine speed control system is calculated by e (t) as follows:
In the formula, u (t) is the output control quantity of a PID controller of a numerical control high-speed milling and drilling machine speed control system, and Kp, ki and Kd are the same as the meaning.
Further, the step S7 of simulating the social behavior of the river horse and establishing a position updating strategy mathematical model for improving the river horse algorithm comprises the following specific steps:
S71, simulating the river entrance behavior of half of the river horses in the river horse population, and establishing a position update mathematical model of the river horse population in a river stage according to the formula (4) and the formula (5);
(4);
(5);
In the formula (4), the amino acid sequence of the compound, Updating the formula for the position of the ith male hippocampus,/>For the position of the ith hippocampus in the previous evolution,/>To take the value of the random number between 0 and 1For the best hippopotamus position in the previous evolution,/>And/>To take a random vector with a value between [1,2], in equation (5)/>Updating the formula for the position of the ith female hippocampus,/>To take the value of the random vector between [0,1 ]/>An average value of each random number selected currently;
S72, calculating the fitness value of each updated hippopotamus position through an objective function, and selecting the position with small fitness as the latest position of the hippopotamus in the current round of evolution according to a formula (6) and a formula (7) in a greedy selection mode;
(6);
(7);
In the method, in the process of the invention, For the latest position of the ith river horse in the evolution of the current round,/>、/>Meaning same as step S71,/>And/>Fitness after position update for ith male river horse and ith female river horse,/>Fitness for the position of the ith river horse in the previous evolution;
s73, simulating the river horses to patrol in the self-collar land, enabling predators to realize the behavior in the river horses collar land, and establishing a position update mathematical model of the river horse population in the stage of defending the predators according to a formula (8);
(8);
In the method, in the process of the invention, For the ith river horse updated position, RL is a random vector with the rhein flight,For improved predator position, b is the random number between values [2,4], c is the random number between values [1,1.5], D is the random number between values [2,3], g is the random vector between values [0,1 ]/>Is a random vector with the value between 0 and 1;
s74, simulating entering a river horse escape predator stage, when the river horse cannot resist predators, selecting a behavior of leaving the region to enter a nearest river or pond region so as to avoid the injury of the predators, and establishing a position update mathematical model of the river horse escape predator stage according to a formula (9);
(9);
In the method, in the process of the invention, And/>Is as per-To take a random vector with a value between [0,1], lb is the lower bound at the hippopotamus location, ub is the lower bound at the hippopotamus location,/>The random number is a random number with values of [0,1], [1,2] and conforming to the three conditions of normal distribution;
And S75, introducing a triangular migration strategy according to a formula (3) to improve a position updating formula of the river horse population in the stage of escaping predators, and updating the individual positions of the river horses.
In summary, due to the adoption of the technical scheme, the beneficial effects of the invention are as follows:
The invention provides a numerical control high-speed milling and drilling machine speed control method based on an improved hippocampus algorithm, which comprises the steps of initializing a population by introducing chaotic mapping, introducing a self-adaptive weight to improve predator position updating formula and introducing a triangle walk strategy to improve the hippocampus algorithm, so that the improved hippocampus algorithm initializes the population by the chaotic mapping in the initial stage of the algorithm, and initialized particles or individuals become more random and diversified in the population initialization stage, thereby being beneficial to increasing the diversity of the population and improving the global searching capability of the algorithm; the self-adaptive weight is introduced in the stage of defending predators of the algorithm, so that the optimizing precision of the algorithm can be improved, and the situation that the algorithm falls into a local optimal solution in the later period of evolution is avoided; the triangular migration strategy is introduced when the algorithm is in the predator avoidance stage, so that the local searching capability of the algorithm can be enhanced, the improved river horse algorithm is applied to the PID controller of the speed control system of the numerical control high-speed milling and drilling machine, and the precision and stability of the parameters of the PID controller are improved; when facing the nonlinear and time-varying numerical control high-speed drilling and milling machine speed control system, the problems of low speed response speed, unstable motor operation and insufficient control precision of the numerical control high-speed drilling and milling machine are effectively solved.
Drawings
FIG. 1 is a flow chart of a method for controlling the speed of a numerical control high-speed milling and drilling machine based on an improved river horse algorithm.
FIG. 2 is a model diagram of a PID controller of a modified hippopotamus algorithm optimized numerical control high speed milling and drilling machine speed control system.
FIG. 3 is a Simulink simulation diagram of a PID controller of a modified hippocampus algorithm optimized numerical control high-speed milling and drilling machine speed control system.
FIG. 4 is a flowchart of the steps for building a location update strategy mathematical model of an improved river horse algorithm.
FIG. 5 is a graph comparing fitness values of a modified hippopotamus algorithm with those of a basic hippopotamus algorithm.
FIG. 6 is a graph comparing the effects of the improved hippopotamus algorithm with other methods of optimizing PID controllers.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention; all other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1-6, the present invention provides a technical solution:
A numerical control high-speed milling and drilling machine speed control method based on an improved river horse algorithm is shown in figure 1, and comprises the following specific steps:
Step one, using Simulink software to establish a simulation model of a speed control system of the numerical control high-speed milling and drilling machine, and converting the speed control problem of a motor of the numerical control high-speed milling and drilling machine into a mathematical model to be optimized, wherein the speed control system of the numerical control high-speed milling and drilling machine comprises a signal input unit, a PID controller unit, an improved river horse algorithm unit, an electric control controller unit, an alternating current asynchronous motor unit and a position and speed information acquisition unit as shown in figure 2; the target rotating speed is input from the signal input unit, the deviation e (t) is obtained by making a difference with the actual rotating speed acquired by the position and speed information acquisition unit, the obtained e (t) is input into the PID controller unit, the e (t) is regulated by the PID controller optimized by the improved river horse algorithm, the control quantity u (t) is output to the electric regulating controller, and the electric regulating controller generates a pulse signal to control the operation of the alternating current asynchronous motor, so that the speed control of the whole numerical control high-speed milling and drilling machine is realized.
Furthermore, the working condition of the speed control system of the numerical control high-speed milling and drilling machine is simulated, the transfer function of the control system is designed, the transfer function model adopts a second-order nonlinear function to simulate the working process of the speed motor of the numerical control high-speed milling and drilling machine, and the formula of the transfer function is as follows:
Where s is a complex frequency variable.
Furthermore, the ITAE is selected as an evaluation index of the PID performance of the numerical control high-speed milling and drilling machine, and is also an objective function of an improved river horse algorithm (IHO), and the ITAE simultaneously considers the accuracy of errors and the speed of error convergence, which means that the ITAE not only can evaluate the error magnitude of a system or algorithm at a certain moment, but also can reflect the change condition of the errors along with time, and can provide a comprehensive and accurate performance evaluation index for the performance of a PID controller, wherein the ITAE has the formula:
Wherein J is an adaptability value obtained by an improved river horse algorithm, e (t) is the deviation between the target rotating speed of a motor of a numerical control high-speed milling and drilling machine speed control system and the real-time rotating speed of the motor acquired by a position and speed information acquisition module, t is the current iteration number, The calculated iteration times;
Further, in S5, e (t) is a deviation between a given target rotation speed and an actual rotation speed of the motor of the numerically controlled high-speed milling and drilling machine speed control system, and the formula of the output control quantity u (t) of the PID controller of the numerically controlled high-speed milling and drilling machine speed control system is calculated by e (t) as follows:
In the formula, u (t) is the output control quantity of a PID controller of a numerical control high-speed milling and drilling machine speed control system, and Kp, ki and Kd are the same as the meaning.
Further, since the discretization process must be performed on the PID controller in all control systems, the PID control on e (t) needs to be started at the second sampling point when the differentiation process is performed on e (t), so in fig. 3, it can be seen that a delay module is added to the system after the PID control, and the response of the system is delayed for 2 seconds, and meanwhile, in fig. 6, it can be seen that the PID controller starts to display data at the second sampling time y axis.
Further, as shown in fig. 3, given a step signal of the speed PID control system of the numerically controlled high-speed milling and drilling machine as an input signal, the input signal is the target rotation speed of the speed motor of the numerically controlled high-speed milling and drilling machine, the target rotation speed is set to be 1RPM, the running time of the system is set to be 30 seconds, and the sampling frequency of the system is set to be 1 second for sampling once.
Establishing an improved hippopotamus algorithm mathematical model by using Matlab software, writing a test function, and verifying the performance of the improved hippopotamus algorithm optimized PID controller; the improved river horse algorithm comprises the following steps: s21, introducing a chaotic mapping improvement algorithm population initialization position formula, S22, introducing a self-adaptive weight improvement predator position update formula, S23, introducing a triangular migration strategy improvement algorithm river horse population escape predator stage position update formula, and specifically comprising the following steps:
Step1, introducing a chaotic mapping improvement algorithm population initialization position formula, wherein the introduced chaotic mapping formula is Tent mapping; the chaotic mapping improvement algorithm population initialization position formula is introduced, and in the population initialization stage, initialized particles or individuals can be made to be more random and diversified; the method is favorable for increasing diversity of population, improving global searching capability of an algorithm, reducing possibility of sinking into a local optimal solution, and meanwhile, the ergodic characteristic of a chaotic sequence is favorable for improving convergence rate of the algorithm, so that the algorithm can reach the optimal solution more quickly, and an improved initialization formula is as follows:
;(1)
;(2)
In the formula (1), i=1, 2, …, N, N is the number of river horse population, Location initialized for first river horse,/>For the lower limit value of the river horse position,/>For the upper bound value at the hippocampus position,/>For the position of the ith river horse,/>For the position of the (i+1) th river horse, r is a random number with a value between [0,1], A is a random number with a value between (0, 0.5), the position of the first river horse is initialized by adopting a pseudo-random sequence in the formula (1), and then the position of the rest river horses is initialized by adopting a chaotic mapping mode in the formula (2);
step2, then, introducing an adaptive weight w to improve a predator position update formula when the hippopotamus algorithm is in a hippopotamus predator defending stage, wherein the improved predator position update formula is as follows:
Wherein, predator (t) is the position of Predator, lb and ub are the same as above, w is self-adaptive weight, and r is the same as above;
the formula of w is as follows:
Wherein, max_Iter is the maximum evolution algebra, t is the current round of evolution algebra;
step3, finally, introducing a triangular walk strategy improvement algorithm river horse population to avoid the position updating formula of predator stage, wherein the formula is as follows:
(3);
In the method, in the process of the invention, For the improved ith river horse position,/>For the river horse position calculated by the original river horse position updating formula,/>For the randomly selected position of one river horse, i and r are as above.
Optimizing the speed PID controller of the numerical control high-speed drilling and milling machine by utilizing the improved river horse algorithm to obtain optimal Kp, ki and Kd parameters of the speed PID controller of the numerical control high-speed drilling and milling machine, wherein the method comprises the following specific steps of:
s1, simulating the working condition of a speed control system of the numerical control high-speed milling and drilling machine, designing a transfer function by using Simulink simulation software, and simulating the working process of the rotating speed of a motor of the numerical control high-speed milling and drilling machine by using a transfer function model by adopting a second-order nonlinear function;
s2, giving an input signal of a speed control system of the numerical control high-speed milling and drilling machine, wherein the input signal is the target rotating speed of a motor of the numerical control high-speed milling and drilling machine;
S3, initializing a population scale N of an improved river horse algorithm, a problem dimension dim, an algorithm search space upper bound ub, an algorithm search space lower bound lb and a maximum iteration number Max_Iter, wherein the algorithm search space upper bound ub and the algorithm search space lower bound lb are parameter ranges of a PID controller of a speed control system of the numerical control high-speed milling machine, the initialized river horse position is an initial value of a PID controller parameter of the speed control system of the numerical control high-speed milling machine, and in the process of algorithm evolution, the updating of the river horse population position is a process of optimizing the PID controller parameter of the speed control system of the numerical control high-speed milling machine;
s4, encoding parameters of PID controllers Kp, ki and Kd of a speed control system of the numerical control high-speed milling and drilling machine into three dimensions for improving a position solution of a river horse algorithm;
S5, selecting ITAE as an objective function of the improved river horse algorithm (IHO), wherein the formula of the objective function is as follows:
Wherein J is an adaptability value obtained by an improved river horse algorithm, e (t) is the deviation between the target rotating speed of a motor of a numerical control high-speed milling and drilling machine speed control system and the real-time rotating speed of the motor acquired by a position and speed information acquisition module, t is the current iteration number, The calculated iteration times;
s6, initializing an initial position of a hippopotamus population through chaotic mapping, calculating fitness of positions of individual hippopotamus, selecting a hippopotamus position with minimum fitness as an optimal position of the population, and recording the fitness value of the position as best_PD;
s7, simulating social behaviors of the river horses, establishing a position update strategy mathematical model for improving the river horse algorithm, and updating the river horse position by using the mathematical model, namely updating Kp, ki and Kd parameters of a speed PID controller of the numerical control high-speed milling and drilling machine;
S8, determining whether to update the position of the river horse by adopting a greedy selection mode, and recording the optimal river horse position and the optimal river horse fitness in the current round of evolution, wherein the evolution algebra t is added 1 time;
S9, circularly executing S6-S8, judging whether the current iteration number reaches the maximum iteration number, if so, exiting the cycle, outputting a global optimal solution, and transmitting the global optimal solution to three parameters Kp, ki and Kd of a PID controller of a speed control system of the numerical control high-speed milling and drilling machine.
Further, as shown in fig. 4, the specific steps of simulating the social behavior of the river horse and establishing the mathematical model of the position update strategy of the improved river horse algorithm are as follows:
S71, simulating the river entrance behavior of half of the river horses in the river horse population, and establishing a position update mathematical model of the river horse population in a river stage according to the formula (4) and the formula (5);
(4);
(5);
In the formula (4), the amino acid sequence of the compound, Updating the formula for the position of the ith male hippocampus,/>For the position of the ith hippocampus in the previous evolution,/>To take the value of the random number between 0 and 1For the best hippopotamus position in the previous evolution,/>And/>To take a random vector with a value between [1,2], in equation (5)/>Updating the formula for the position of the ith female hippocampus,/>To take the value of the random vector between [0,1 ]/>An average value of each random number selected currently;
S72, calculating the fitness value of each updated hippopotamus position through an objective function, and selecting the position with small fitness as the latest position of the hippopotamus in the current round of evolution according to a formula (6) and a formula (7) in a greedy selection mode;
(6);
(7);
In the method, in the process of the invention, For the latest position of the ith river horse in the evolution of the current round,/>、/>Meaning same as step S71,/>And/>Fitness after position update for ith male river horse and ith female river horse,/>Fitness for the position of the ith river horse in the previous evolution;
s73, simulating the river horses to patrol in the self-collar land, enabling predators to realize the behavior in the river horses collar land, and establishing a position update mathematical model of the river horse population in the stage of defending the predators according to a formula (8);
(8);
In the method, in the process of the invention, For the ith river horse updated position, RL is a random vector with the rhein flight,For improved predator position, b is the random number between values [2,4], c is the random number between values [1,1.5], D is the random number between values [2,3], g is the random vector between values [0,1 ]/>Is a random vector with the value between 0 and 1;
s74, simulating entering a river horse escape predator stage, when the river horse cannot resist predators, selecting a behavior of leaving the region to enter a nearest river or pond region so as to avoid the injury of the predators, and establishing a position update mathematical model of the river horse escape predator stage according to a formula (9);
(9);
In the method, in the process of the invention, And/>Is as per-To take a random vector with a value between [0,1], lb is the lower bound at the hippopotamus location, ub is the lower bound at the hippopotamus location,/>The random number is a random number with values of [0,1], [1,2] and conforming to the three conditions of normal distribution;
And S75, introducing a triangular migration strategy according to a formula (3) to improve a position updating formula of the river horse population in the stage of escaping predators, and updating the individual positions of the river horses.
And step four, inputting the obtained optimal parameters Kp, ki and Kd into a simulation model of the speed control system of the numerical control high-speed milling and drilling machine, which is established by Simulink software, and debugging to obtain the optimal effect of PID control of the speed control system of the numerical control high-speed milling and drilling machine.
In order to verify that the performance of the numerical control high-speed milling and drilling machine speed control method based on the improved hippocampus algorithm is stronger than that of other methods, the performance of the PID controller in the numerical control high-speed milling and drilling machine speed control system determines the running stability and the control precision of a speed motor of the numerical control high-speed milling and drilling machine, and the performance of the algorithm determines the overshoot of the PID controller, the response speed and the dynamic error.
In order to verify that the performance of the improved hippopotamus algorithm is superior to that of the basic hippopotamus algorithm, in a test code, setting the population scale N of the improved hippopotamus algorithm to be 100, the problem dimension dim to be 3 and the maximum iteration number Max_Iter to be 500, and running the code, as shown in fig. 5, the improved hippopotamus algorithm has higher optimizing precision compared with the basic hippopotamus algorithm, and jumps out of a local optimal solution under the condition that the algorithm later stage algorithm falls into the local optimal solution; it can be seen that the adaptability value of the basic hippopotamus algorithm is 5.7112e -6, and the adaptability value of the improved hippopotamus algorithm is 4.7595e -8; according to the principle that the smaller the fitness value is, the better the algorithm performance is, the improvement of the performance degree of the river horse algorithm can be fully described to exceed the basic river horse algorithm.
FIG. 6 is a graph showing the comparison of the effects of improved river horse algorithm optimized PID control and basic river horse algorithm optimized PID control and common PID control, and it can be seen from the graph that compared with other control methods, the improved river horse algorithm optimized PID control has the best effect, the fastest time reaches the stable effect, and the overshoot is the smallest.
The numerical control high-speed milling and drilling machine speed control method based on the improved river horse algorithm has excellent performance and innovation in numerical control high-speed milling and drilling machine speed control.

Claims (2)

1. A numerical control high-speed milling and drilling machine control method based on an improved river horse algorithm is characterized by comprising the following specific steps:
Step one, establishing a simulation model of a speed control system of a numerical control high-speed drilling and milling machine by using Simulink software;
Establishing an improved hippopotamus algorithm mathematical model by using Matlab software, writing a test function, and verifying the performance of the improved hippopotamus algorithm optimized PID controller; the improved river horse algorithm comprises the following steps: s21, introducing a chaotic mapping improvement algorithm population initialization position formula, S22, introducing a self-adaptive weight improvement predator position update formula, S23, introducing a triangular migration strategy improvement algorithm river horse population escape predator stage position update formula; the steps of the improved river horse algorithm are specifically as follows:
Step1, introducing a chaotic mapping improvement algorithm population initialization position formula, wherein the introduced chaotic mapping formula is Tent mapping, and the improved initialization formula is as follows:
X1=lb+r*(ub-lb)(1);
In the formula (1), i=1, 2, …, N is the number of river horses, X 1 is the initial position of the first river horse, lb is the lower limit value of the position of the river horse, ub is the upper limit value of the position of the river horse, X i is the initial position of the ith river horse, X i+1 is the initial position of the (i+1) th river horse, r is a random number with the value between [0,1], A is a random number with the value between (0, 0.5), the position of the first river horse is initialized by adopting a pseudo-random sequence through the formula (1), and the position of the rest river horses is initialized by adopting a chaotic mapping mode through the formula (2);
step2, introducing an adaptive weight w to improve a predator position updating formula when the hippopotamus algorithm is in a hippopotamus predator defending stage, wherein the improved predator position updating formula is as follows:
Predator(t)=lb+w*r*(ub-lb);
Wherein, the Predator (t) is the position of Predator, the significance of 1b, ub and r is the same as Step1, and w is the self-adaptive weight; the formula of w is as follows:
Wherein, max_Iter is the maximum evolution algebra, t is the current round of evolution algebra;
Step3, introducing a triangular migration strategy to improve a position updating formula of the river horse population during the prey evasion stage, wherein the formula is as follows:
In the method, in the process of the invention, For the position to be updated of the ith river horse after improvement, X b (t) is the river horse position calculated by the original river horse position updating formula, X c (t) is the position of one river horse selected randomly, and the meaning of i and r is the same as that of Step1;
optimizing the speed PID controller of the numerical control high-speed milling and drilling machine by utilizing the improved river horse algorithm to obtain optimal Kp, ki and Kd parameters of the speed PID controller of the numerical control high-speed milling and drilling machine; the method comprises the following specific steps:
s1, simulating the working condition of a speed control system of the numerical control high-speed milling and drilling machine, designing a transfer function by using Simulink simulation software, and simulating the working process of the rotating speed of a motor of the numerical control high-speed milling and drilling machine by using a transfer function model by adopting a second-order nonlinear function;
s2, giving an input signal of a speed control system of the numerical control high-speed milling and drilling machine, wherein the input signal is the target rotating speed of a motor of the numerical control high-speed milling and drilling machine;
s3, initializing a population scale N of an improved river horse algorithm, a problem dimension dim, an algorithm search space upper bound ub, an algorithm search space lower bound 1b and a maximum iteration number Max_Iter;
s4, encoding parameters of PID controllers Kp, ki and Kd of a speed control system of the numerical control high-speed milling and drilling machine into three dimensions for improving a position solution of a river horse algorithm;
s5, selecting ITAE as an objective function of the improved river horse algorithm, wherein an objective function formula is as follows:
J=∫0 T1t|e(t)|dt;
Wherein J is an adaptability value obtained by an improved river horse algorithm, e (T) is a deviation between a target rotating speed of a motor of a numerical control high-speed milling and drilling machine speed control system and a real-time rotating speed of the motor acquired by a position and speed information acquisition module, T is a current iteration number, and T1 is a calculated iteration number;
S6, initializing an initial position of a hippopotamus population through chaotic mapping, calculating fitness of positions of individual hippopotamus individuals, selecting a hippopotamus position with minimum fitness as a population optimal position, and recording a fitness value of the population optimal position as best_PD;
S7, simulating social behaviors of the river horses, establishing a position update strategy mathematical model for improving the river horse algorithm, and updating the river horse position by using the mathematical model, namely updating Kp, ki and Kd parameters of a speed PID controller of the numerical control high-speed milling and drilling machine; the method for simulating the social behavior of the river horses comprises the following specific steps of establishing a position updating strategy mathematical model of an improved river horse algorithm:
S71, simulating the river entrance behavior of half of the river horses in the river horse population, and establishing a position update mathematical model of the river horse population in a river stage according to the formula (4) and the formula (5);
In the formula (4), the amino acid sequence of the compound, For the position updating formula of the ith male hippocampus, X i (t) is the position of the ith hippocampus in the previous evolution, y 1 is a random number with a value of [0,1], X Dhippo (t) is the position of the best hippocampus in the previous evolution, I 1 and I 2 are random vectors with a value of [1,2], and in formula (5)/>Updating a formula for the position of the ith female hippocampus, wherein h 1 is a random vector with a value between [0,1], and MG i (t) is the average value of all random numbers selected currently;
S72, calculating the fitness value of each updated hippopotamus position through an objective function, and selecting the position with small fitness as the latest position of the hippopotamus in the current round of evolution according to a formula (6) and a formula (7) in a greedy selection mode;
In the method, in the process of the invention, For the latest position of the ith river horse in the evolution of the current round,/>Xi(t)、/>Meaning as in step s71,/>And/>The fitness after the position update of the ith male hippocampus and the ith female hippocampus is f i (t), and the fitness of the position of the ith hippocampus in the previous evolution is f i (t);
S73, simulating the river horses to patrol in the self-collar land, enabling predators to realize the behavior in the river horses collar land, and establishing a position update mathematical model of the river horse population in the stage of defending the predators according to a formula (8);
In the method, in the process of the invention, For the ith river horse updated position, RL is a random vector with Rhin flight, predator (t) is an improved Predator position, b is a random number between values [2,4], c is a random number between values [1,1.5], D is a random number between values [2,3], g is a random vector between values [0,1], r 9 is a random vector between values [0,1 ];
S74, simulating entering a river horse escape predator stage, when the river horse cannot resist predators, selecting a behavior of leaving the region to enter a nearest river or pond region so as to avoid the injury of the predators, and establishing a position update mathematical model of the river horse escape predator stage according to a formula (9);
In the method, in the process of the invention, In the same sense as X i (t), r 10 is a random vector with a value between 0 and 1, 1b is a lower limit value at the hippopotamus position, ub is a lower limit value at the hippopotamus position, and S 1 is a random number with a value between 0 and 1 and 2 and conforming to the three conditions of normal distribution;
s75, introducing a triangular migration strategy according to a formula (3) to improve a position updating formula of a river horse population in a stage of escaping predators, and updating individual river horse positions;
S8, determining whether to update the position of the river horse by adopting a greedy selection mode, and recording the optimal river horse position and the optimal river horse fitness in the current round of evolution, wherein the evolution algebra t is added 1 time;
S9, circularly executing S6-S8, judging whether the current iteration number reaches the maximum iteration number, if so, exiting the cycle, outputting a global optimal solution, and transmitting the global optimal solution to three parameters Kp, ki and Kd of a PID controller of a speed control system of the numerical control high-speed milling and drilling machine;
and step four, inputting the obtained optimal parameters Kp, ki and Kd into a simulation model of the speed control system of the numerical control high-speed milling and drilling machine, which is established by Simulink software, and debugging to obtain the optimal effect of PID control of the speed control system of the numerical control high-speed milling and drilling machine.
2. The method for controlling the numerical control high-speed milling and drilling machine based on the improved hippocampus algorithm as claimed in claim 1, wherein in the first step, a simulation model of a speed control system of the numerical control high-speed milling and drilling machine is established by using Simulink software, the speed control problem of a motor of the numerical control high-speed milling and drilling machine is converted into a mathematical model to be optimized, and the speed control system of the numerical control high-speed milling and drilling machine comprises a signal input unit, a PID controller unit, an improved hippocampus algorithm unit, an electric control unit, an alternating current asynchronous motor unit and a position and speed information acquisition unit; the target rotating speed is input from the signal input unit, the deviation e (t) is obtained by making a difference with the actual rotating speed acquired by the position and speed information acquisition unit, the obtained e (t) is input into the PID controller unit, the e (t) is regulated by the PID controller optimized by the improved river horse algorithm, the control quantity u (t) is output to the electric regulating controller, and the electric regulating controller generates a pulse signal to control the operation of the alternating current asynchronous motor, so that the speed control of the whole numerical control high-speed milling and drilling machine is realized.
CN202410381777.0A 2024-04-01 Numerical control high-speed milling and drilling machine control method based on improved river horse algorithm Active CN117970783B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410381777.0A CN117970783B (en) 2024-04-01 Numerical control high-speed milling and drilling machine control method based on improved river horse algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410381777.0A CN117970783B (en) 2024-04-01 Numerical control high-speed milling and drilling machine control method based on improved river horse algorithm

Publications (2)

Publication Number Publication Date
CN117970783A CN117970783A (en) 2024-05-03
CN117970783B true CN117970783B (en) 2024-06-07

Family

ID=

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101211177A (en) * 2006-12-29 2008-07-02 中国科学院沈阳计算技术研究所有限公司 Filter technique based numerical control system acceleration and deceleration control method
CN101710236A (en) * 2009-10-22 2010-05-19 中国第一重型机械股份公司 Numerical-control processing method of multi-space hole welding groove on large-scale spherical space curved surface
CN101984376A (en) * 2010-11-19 2011-03-09 华中科技大学 Fault simulation device of numerical control machine
CN103056589A (en) * 2013-01-24 2013-04-24 北京理工大学 Computerized numerical control rolling machine for torsion shaft rolling process
CN212071074U (en) * 2020-01-03 2020-12-04 山东三森数控机械有限公司 Angle steel processing combined production line
AU2020102666A4 (en) * 2020-10-11 2021-01-14 Adhithan, Balamurugan MR Coupled multibody dynamic approach on directional drilling system in oil rigs
CN112486091A (en) * 2020-11-27 2021-03-12 江苏科技大学 Method for machining key hole series of medium-low speed diesel engine
CN116776922A (en) * 2023-06-30 2023-09-19 福州大学 Optimizing method for TC4 high-speed milling process parameters

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101211177A (en) * 2006-12-29 2008-07-02 中国科学院沈阳计算技术研究所有限公司 Filter technique based numerical control system acceleration and deceleration control method
CN101710236A (en) * 2009-10-22 2010-05-19 中国第一重型机械股份公司 Numerical-control processing method of multi-space hole welding groove on large-scale spherical space curved surface
CN101984376A (en) * 2010-11-19 2011-03-09 华中科技大学 Fault simulation device of numerical control machine
CN103056589A (en) * 2013-01-24 2013-04-24 北京理工大学 Computerized numerical control rolling machine for torsion shaft rolling process
CN212071074U (en) * 2020-01-03 2020-12-04 山东三森数控机械有限公司 Angle steel processing combined production line
AU2020102666A4 (en) * 2020-10-11 2021-01-14 Adhithan, Balamurugan MR Coupled multibody dynamic approach on directional drilling system in oil rigs
CN112486091A (en) * 2020-11-27 2021-03-12 江苏科技大学 Method for machining key hole series of medium-low speed diesel engine
CN116776922A (en) * 2023-06-30 2023-09-19 福州大学 Optimizing method for TC4 high-speed milling process parameters

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于神经网络 PID 控制器的外骨骼系统设计;游博洋;《计算机技术与发展》;20210531;第31卷(第5期);第1-6页 *

Similar Documents

Publication Publication Date Title
CN107272403A (en) A kind of PID controller parameter setting algorithm based on improvement particle cluster algorithm
GirirajKumar et al. PSO based tuning of a PID controller for a high performance drilling machine
CN116149166B (en) Unmanned rescue boat course control method based on improved beluga algorithm
Issa et al. PID controller tuning parameters using meta-heuristics algorithms: comparative analysis
Cheng et al. PID controller parameters optimization based on artificial fish swarm algorithm
Jatoth et al. Liquid level control of three tank system using hybrid GA-PSO algorithm
Hein et al. Interpretable control by reinforcement learning
CN117970783B (en) Numerical control high-speed milling and drilling machine control method based on improved river horse algorithm
Hoshino et al. PSO training of the neural network application for a controller of the line tracing car
CN110197250A (en) A kind of power battery on-line parameter identification method of multifactor impact
Jalilvand et al. Advanced particle swarm optimization-based PID controller parameters tuning
Harshitha et al. A review of various controller techniques designed for the operational control of dc and servo motors
CN117970783A (en) Numerical control high-speed milling and drilling machine control method based on improved river horse algorithm
CN105511270B (en) A kind of PID controller parameter optimization method and system based on coevolution
Park et al. Robust receding horizon control of discrete-time Markovian jump uncertain systems
CN116880191A (en) Intelligent control method of process industrial production system based on time sequence prediction
CN114527642B (en) Method for automatically adjusting PID parameters by AGV based on deep reinforcement learning
Yue et al. Application of Fuzzy PID Control Algorithm Based on Genetic Self-tuning in Constant Temperature Incubator
CN113110046A (en) Desulfurization system control method based on big data self-learning prediction control
Singh et al. Neuro-evolutionary based controller design for linear and non-linear systems
CN117492371B (en) Optimization method, system and equipment for active power filter model predictive control
CN117970782B (en) Fuzzy PID control method based on fish scale evolution GSOM improvement
CN113065693B (en) Traffic flow prediction method based on radial basis function neural network
Peng An improved PSO-based optimum design of speed controller for BLDC motor
Xiaolong et al. Parameters optimization of mechanical arm PID controllers based on CLPSO algorithm

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant