Motor position and speed double-closed-loop control method based on improved carbon black quadrangle algorithm
By improving the carbon black four-corner bee algorithm to optimize the PID controller parameters, the problems of speed and stability of the traditional dual closed-loop control system under complex working conditions were solved, and efficient and stable motor position and speed control was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- UNIV OF JINAN
- Filing Date
- 2026-03-13
- Publication Date
- 2026-04-10
AI Technical Summary
Traditional dual-loop control systems struggle to balance speed, overshoot suppression, and steady-state accuracy when faced with complex nonlinear loads and disturbances, resulting in slow system response, oscillations, and even decreased stability. Furthermore, the carbon black quad-bee algorithm is limited in convergence speed and prone to getting trapped in local optima in the optimization of multivariable, strongly coupled dual-loop control parameters.
An improved carbon black quad-corner bee algorithm is adopted. By introducing a nonlinear temperature balance mechanism, a chaotic gravitational inertial guidance strategy and asymmetric power-law sinusoidal perturbation, combined with a multi-source fusion update method, the parameters of the velocity loop and position loop PID controllers are optimized, thereby enhancing the global exploration capability and local convergence performance.
It significantly improves the dynamic response speed, steady-state accuracy and anti-interference capability of the dual closed-loop control system, ensuring the efficient and stable operation of the system under complex working conditions.
Smart Images

Figure CN121832250A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of PID control optimization, and particularly relates to a motor position and speed double closed-loop control method based on an improved carbon black four-angle bee algorithm. BACKGROUND
[0002] In industrial automation and precision control systems, position and speed double closed-loop control structures are widely used in high-precision driving devices such as servo motors, robot joints, numerical control machine tools, etc. Through the synergistic effect of inner loop speed control and outer loop position control, the structure can effectively improve the dynamic response accuracy and anti-interference ability of the system. However, the traditional double closed-loop control mostly uses fixed parameter PID regulation method, which is simple in structure, but when facing complex nonlinear load, disturbance and dynamic working conditions, it is often difficult to consider rapidity, overshoot suppression and steady-state accuracy at the same time, which easily leads to slow system response, oscillation and even stability decline, limiting the application effect of double closed-loop control system in high-performance scenarios. Therefore, it has important practical significance and application value to realize adaptive adjustment of PID parameters by means of intelligent optimization method and improve the dynamic and steady-state comprehensive performance of the system.
[0003] The carbon black four-angle bee optimization algorithm is a new type of swarm intelligence optimization algorithm that simulates the temperature regulation and spiral nest building behavior of carbon black four-angle bees during nest building. The algorithm simulates the three different mechanisms of carbon black four-angle bees: slight wing vibration gathering at low temperature, spiral honeycomb construction at medium temperature, and strong wing vibration heat dissipation at high temperature, forming a dynamic optimization strategy that balances global search and local development. The carbon black four-angle bee algorithm performs well in multi-dimensional function optimization and engineering constraint problems, but when faced with multi-variable, strongly coupled double-loop control parameter optimization problems, the algorithm still has the shortcomings of limited convergence speed and easy to fall into local optimum, and its robustness and convergence accuracy still have room for improvement. SUMMARY
[0004] The application proposes a motor position and speed double closed-loop control method based on an improved carbon black four-angle bee algorithm to solve the problems of weak adaptive ability and insufficient control accuracy of traditional PID parameter setting methods in dealing with the strong coupling, nonlinearity and dynamic uncertainty of double closed-loop control systems. By improving the carbon black four-angle bee algorithm, the global exploration ability and local convergence performance of the algorithm in complex parameter space are enhanced, the premature convergence phenomenon is effectively avoided, and the cooperative optimization of the speed loop and position loop PID controller parameters is realized. This method not only effectively reduces the overshoot and steady-state error of the system under complex load and disturbance conditions, but also improves the dynamic response speed, tracking accuracy and anti-interference ability of the double closed-loop control system, ensuring that the system can still maintain excellent control stability and robustness under complex working conditions.
[0005] The application adopts the technical solutions below. A motor position and speed double closed loop control method based on an improved carbon black four-angle bee algorithm, the specific steps are as follows.
[0006] S1, a position and speed double closed loop control model based on a PID controller is established.
[0007] S2, the carbon black four-angle bee algorithm is improved.
[0008] S3, the control parameters of the PID controller in the position and speed double closed loop control model are optimized by using the improved carbon black four-angle bee algorithm, and a set of optimal PID control parameters Kp, Ki and Kd are obtained through algorithm optimization.
[0009] S4, the position and speed double closed loop control model is simulated by using MATLAB and Simulink.
[0010] In S1, the position and speed double closed loop model of the PID controller mainly includes the following modules: a speed error calculation module, a position error calculation module, a position loop PID control module, a speed loop PID control module, an improved carbon black four-angle bee algorithm module, a motor drive module and an encoder module. The position error calculation module calculates the target and actual position deviation value, and provides the core error basis for position loop adjustment. The speed error calculation module receives the target speed output by the position loop, combines the actual motor speed, calculates the speed loop deviation value, and inputs it as the speed loop adjustment input. The improved carbon black four-angle bee algorithm module iteratively optimizes the speed loop and position loop PID parameters and inputs them into the corresponding modules, dynamically corrects the parameter adaptation to the load change, and improves the system response speed and stability. The position loop PID control module adjusts the output position loop control signal according to the position deviation value and the optimized PID parameters, and transmits it to the speed error module. The speed loop PID control module generates the speed loop control signal according to the speed deviation value and the optimized PID parameters, and outputs it to the motor drive module. The motor drive module converts the speed loop control signal into a motor drive signal to drive the motor speed and position following. The encoder module collects the motor speed and position information in real time, feeds back to the corresponding error module, forms a double loop closed loop feedback, and provides real-time data for accurate system adjustment.
[0011] Further, the algorithm improvement in S2 has four aspects, which are improved as follows.
[0012] Firstly, a nonlinear temperature balancing strategy is used to improve the simple temperature-driven method in the carbon black four-angle bee algorithm. By introducing a nonlinear cooling term of iteration progress and combining a sinusoidal disturbance factor, the temperature fluctuations in the process of warming and cooling of the real bee colony are effectively simulated. The related formula is: ; ; ; wherein, is a sinusoidal disturbance term, t is the current iteration number, T is the maximum iteration number, is a disturbance amplitude factor, which controls the amplitude of random disturbance, rand is a random number between [0, 1], is the standard deviation of the jth dimension, N is the population size, is the position of individual i in the jth dimension, is the mean value of the jth dimension, is a dynamic temperature factor, lT is the minimum temperature threshold, uT is the maximum temperature threshold, is a nonlinear index, which controls the nonlinear degree of temperature change with iteration progress, MeanDiversity is the mean value of population standard deviation, measures the diversity of the population, MaxDiversity is the maximum standard deviation of the population, dim is the dimension of the problem, is a sinusoidal disturbance scaling coefficient.
[0013] Secondly, a population position updating mechanism is used to fuse the chaos gravity inertia guidance strategy. By calculating the population centroid to guide the individual to the global center, a chaotic adaptive inertia term is formed by introducing a Logistic chaotic sequence to dynamically adjust the inertia factor. The related formula is: ; ; ; wherein, is the target position of individual i after centroid guidance, is the position of the individual with the optimal fitness value in the population, is the scaling coefficient of centroid guidance, is the population centroid, is the current position of individual i, is a Logistic chaotic variable, is a control parameter of Logistic mapping, is the target position of individual i after chaotic adaptive inertia adjustment, is the initial inertia weight, is the adjustment coefficient of inertia weight, t is the current iteration number, and T is the maximum iteration number.
[0014] Thirdly, a population position updating mechanism with asymmetric power-law sinusoidal perturbation is used. The perturbation step is asymmetrically modulated by the power-law tail distribution control factor, and the dynamic perturbation is realized by combining the sinusoidal function. The related formula is: ; ; In the formula, Step is the perturbation step, is a normal noise vector, is the power-law base value, is a variable increment, rand is a random number between [0, 1], t is the current iteration number, and T is the maximum iteration number, is the target position of individual i after asymmetric power-law sinusoidal perturbation, is the current position of individual i, is the perturbation scaling coefficient, , are the upper and lower bounds of the search space, respectively.
[0015] Fourthly, a multi-source fusion updating population position strategy is used. The updating vector based on temperature driving, the centroid guiding vector, the chaotic inertia vector, and the sinusoidal perturbation vector are weightedly fused, and the weight coefficient is adaptively adjusted according to the iteration progress, realizing the organic combination of global exploration in the early stage and rapid convergence in the later stage, thereby improving the overall optimization performance. The related formula is: ; In the formula, is the current position of individual i, is the reference weight, , is the position of individual i after updating by the temperature selection strategy, is the centroid weight, t is the current iteration number, and T is the maximum iteration number, is the centroid weight base value, is the target position of individual i after being guided by the centroid, is the chaotic adaptive inertia weight, , is the inertia weight ratio, is the target position of individual i after being adjusted by the chaotic adaptive inertia, is the asymmetric power-law sinusoidal perturbation weight, , is the perturbation weight base value, for variable amplitude, rand is a random number between [0, 1], for the target position of individual i after asymmetric power-law sinusoidal perturbation.
[0016] Further, in the S3, the control parameters of the PID controller in the position and speed double closed loop control model are optimized by using the improved carbon black four-corner bee algorithm, and the specific steps are as follows: S31, initialize the parameters of the improved carbon black four-corner bee algorithm: population size N, problem dimension dim, maximum iteration number T, search space upper bound ub, search space lower bound lb, and generate the initial population of individuals by initializing the parameters; S32, select the fitness function for quantifying the global optimality of the solution, and the fitness function formula is: ; In the formula, J is the fitness value, is the total running time of the system, is the difference between the given target value and the actual value; S33, in the nest building or body temperature regulation strategy selection stage, the dynamic temperature factor fT is calculated using the improved nonlinear temperature balance strategy, and the related formula of the nonlinear temperature balance strategy is seen in formula (3); S34, in the nest building and body temperature regulation stage, when the dynamic temperature factor fT is 10-17, the position of the population is updated by simulating the slight wing movement of the carbon black four-corner bee and the cluster warm nest behavior of the carbon black four-corner bee, and the position update formula is: ; In the formula, is the updated position of individual i, is the position of the individual with the optimal fitness value in the population, is the temperature change amount, , is a randomly generated integer representing the number of carbon black four-corner bees gathered to warm the nest, is the current position of the randomly generated individual r, is the wing amplitude, which is a random number between [0.2, 0.3], is the thermal conductivity; When the dynamic temperature factor fT is 18-29, the position of the population is updated by simulating the spiral nest building behavior of the carbon black four-corner bee, if the random number rand is less than or equal to 0.2, a nest chamber is built around itself, and the position update related formula is seen in formula (12), if the random number rand is greater than 0.2, the nest is built according to the geometric structure of the Archimedes spiral, and the position update related formula is seen in formula (13): ; ; wherein, is a moving disturbance factor, which is a random number between [0, 1], is a random number generated in a standard Cauchy distribution, the median of which is set to 0 and the scale parameter is set to 1, is a spiral angle, , , a is the distance from the origin to the start of the spiral, b is the distance of the spiral expanding outward from the origin per unit angle, is an angle parameter, which controls the spiral tightening, is an initial angle, is a normalization factor, which is used to adjust the influence of the spiral angle, is an adjustment coefficient, which represents the average distance between the nest chambers in the nest structure, wherein the remaining parameters and functions have the same meaning as S34; When the dynamic temperature factor fT> 29, the position of the population is updated by simulating the strong fluttering motion of carbon black four-corner bees to reduce the temperature, and the position updating formula is: ; wherein, is the number of wing beats per second, t is the current iteration number, T is the maximum iteration number, wherein the remaining parameters and functions have the same meaning as S34; S35, the position of the population is updated by fusing the chaotic gravity inertia guidance strategy, and the related formula is seen in formula (4) and formula (6); S36, the position of the population is updated by the asymmetric power-law sinusoidal disturbance strategy, and the related formula is seen in formula (8); S37, the position vectors updated based on temperature driving, the centroid-guided position vector, the chaotic inertia position vector and the sinusoidal disturbance position vector are fused by weighting to update the position, and the weight coefficients of each position vector are adaptively adjusted based on the iteration progress, and the related formula is seen in formula (9); S38, the fitness function value of all individuals updated in the current iteration is recalculated, the fitness is updated, and the position of the optimal individual in the population is also updated; S39, it is judged whether the maximum iteration number of the population is reached: if the maximum iteration number is reached, the iteration process is terminated, and the obtained optimal solution is decomposed into the proportional coefficient Kp, the integral coefficient Ki and the differential coefficient Kd, which are input into the PID controller to complete the parameter optimization setting; if the maximum iteration number is not reached, the iteration optimization process continues to be executed by returning to S33.
[0017] Further, in the S4, the PID controller of the position and speed double closed loop model is simulated by using MATLAB and Simulink, and the PID controller comprises: a desired position value, a position error calculation module, a position loop PID controller module, a speed error calculation module, a speed loop PID controller module, an output control quantity module, an execution unit module, a controlled object module and an output position value; the position loop PID controller obtains the deviation between the desired position value and the actual position value through the position error calculation module, and outputs the speed instruction as the input of the speed loop by using the position loop Kp1, Ki1 and Kd1 parameters calculated by the improved algorithm; the speed loop PID controller obtains the deviation between the speed instruction and the actual speed value through the speed error calculation module, and outputs the control signal to the execution unit module by using the speed loop Kp2, Ki2 and Kd2 parameters calculated by the improved algorithm, and then sends the command to the controlled object to control the controlled object to adjust the actual speed and position, so that the actual position value is rapidly stabilized near the desired position value. In the simulation process, the transfer function of the corresponding system controlled object is selected, and the superiority of the improved carbon black four corner bee algorithm in optimizing the parameters of the PID controller is proved, and the transfer function formula is: ; In the formula, is the transfer function, and s is the function variable.
[0018] In summary, due to the adoption of the above technical scheme, the beneficial effects of the present application are: The motor position and speed double closed loop control method based on the improved carbon black four corner bee algorithm introduced in the present application realizes the dynamic balance of global exploration and local development ability by introducing the nonlinear temperature balance mechanism, the chaotic gravity inertia guidance strategy and the asymmetric power law sinusoidal disturbance, and combining the multi-source fusion update method, avoids the problems of easy falling into local optimum, slow convergence speed and insufficient precision of the basic algorithm, and significantly improves the optimization precision and robustness. By optimizing the parameters of the speed loop and position loop PID controller by using the improved algorithm, not only the dynamic response speed and steady state precision of the double closed loop control system are improved, but also the robustness and anti-interference ability of the system are significantly enhanced, so as to ensure the efficient and stable operation of the motor under complex working conditions. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 It is a PID control flowchart of the position and speed double closed loop system optimized based on the improved carbon black four corner bee algorithm.
[0020] Figure 2 It is a position and speed double closed loop PID controller model diagram optimized based on the improved carbon black four corner bee algorithm.
[0021] Figure 3 It is a position and speed double closed loop control system block diagram.
[0022] Figure 4 The comparison chart of the fitness value change in the optimization process of the improved carbon black four-angle bee algorithm and the basic carbon black four-angle bee algorithm.
[0023] Figure 5 The comparison chart of the control effect of the PID optimized by the improved carbon black four-angle bee algorithm and the basic carbon black four-angle bee algorithm. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0025] Please refer to Figures 1 to 5 The present application provides a technical solution: A motor position and speed double-loop control method based on an improved carbon black four-angle bee algorithm, and the specific steps are as follows.
[0026] S1, as Figure 3 shown, a position and speed double-loop control model based on a PID controller is established.
[0027] S2, the carbon black four-angle bee algorithm is improved.
[0028] S3, the control parameters of the PID controller in the position and speed double-loop control model are optimized by using the improved carbon black four-angle bee algorithm, and a set of optimal PID control parameters Kp, Ki and Kd are obtained through algorithm optimization.
[0029] S4, the position and speed double-loop control model is simulated by using MATLAB and Simulink.
[0030] In S1, the position and speed double-loop control model of the PID controller mainly includes the following modules: a speed error calculation module, a position error calculation module, a position loop PID control module, a speed loop PID control module, an improved carbon black four-angle bee algorithm module, a motor driving module and an encoder module. The position error calculation module calculates the target and actual position deviation value, which provides the core error basis for position loop adjustment. The speed error calculation module receives the target speed output by the position loop, combines the actual speed of the motor, calculates the speed loop deviation value, and inputs it as the speed loop adjustment. The improved carbon black four-angle bee algorithm module iteratively optimizes the speed loop and position loop PID parameters and transmits them to the corresponding module to dynamically correct the parameter adaptation to load changes and improve the system response speed and stability. The position loop PID control module adjusts the output position loop control signal using the optimized PID parameters according to the position deviation value and transmits it to the speed error module. The speed loop PID control module generates a speed loop control signal using the optimized PID parameters according to the speed deviation value and outputs it to the motor drive module. The motor drive module converts the speed loop control signal into a motor drive signal to drive the motor speed and position following. The encoder module collects real-time motor speed and position information and feeds it back to the corresponding error module to form a double-loop closed-loop feedback for real-time data for system precise regulation.
[0031] Further, the algorithm improvement in S2 has four common improvements, as follows.
[0032] First, a nonlinear temperature balancing strategy is used to improve the simple temperature driving method in the carbon black four-angle bee algorithm. By introducing a nonlinear cooling term for iteration progress and combining a sinusoidal disturbance factor, the temperature fluctuations in the warming and cooling processes of real bee colonies are effectively simulated. The relevant formula is: ; ; ; In the formula, is the sinusoidal disturbance term, t is the current iteration number, T is the maximum iteration number, is the disturbance amplitude factor, which controls the amplitude of random disturbance, rand is a random number between 0 and 1, is the standard deviation of the jth dimension, N is the population size, is the position of individual i in the jth dimension, is the mean value of the jth dimension, , fT is the dynamic temperature factor, lT is the minimum temperature threshold, uT is the maximum temperature threshold, is the nonlinear index, which controls the degree of nonlinearity of temperature change with iteration progress, MeanDiversity is the mean of population standard deviation, , which measures population diversity, MaxDiversity is the maximum population standard deviation, , dim is the problem dimension, is the sinusoidal disturbance scaling factor.
[0033] Secondly, a population position update mechanism incorporating chaotic gravitational inertial guidance is used. This mechanism calculates the population centroid to guide individuals toward the global center, while simultaneously introducing a Logistic chaotic sequence to dynamically adjust the inertial factor, forming a chaotic adaptive inertial term. The relevant formula is: ; ; ; In the formula, Let i be the target position of individual i after being guided by the centroid. This represents the position of the individual with the best fitness value in the population. The scaling factor is the centroid-guided scaling factor. For population mass center, Let i be the current position of individual i. For Logistic chaotic variables, These are the control parameters for the Logistic mapping. Let i be the target position of individual i after chaotic adaptive inertial adjustment. As the initial inertia weight, is the adjustment coefficient for inertia weight, t is the current iteration number, and T is the maximum iteration number.
[0034] Thirdly, a population position update mechanism incorporating asymmetric power-law sinusoidal perturbations is used. The perturbation step size is asymmetrically modulated through a power-law tail distribution control factor, and dynamic perturbation is achieved by combining this with a sinusoidal function. The relevant formula is: ; ; In the formula, Step is the perturbation step size. It is a normal noise vector. For power-law base values, The increment is variable, rand is a random number between [0,1], t is the current iteration number, and T is the maximum iteration number. Let i be the target position of individual i after undergoing an asymmetric power-law sinusoidal perturbation. Let i be the current position of individual i. This is the perturbation scaling factor. , These are the upper and lower bounds of the search space, respectively.
[0035] Fourthly, a multi-source fusion strategy for updating population positions is used. This strategy weights and fuses the temperature-driven update vector, centroid guidance vector, chaotic inertia vector, and sinusoidal perturbation vector, and adaptively adjusts the weight coefficients according to the iteration progress. This achieves an organic combination of early-stage global exploration and later-stage rapid convergence, thereby improving the overall optimization performance. The relevant formula is: ; In the formula, Let i be the current position of individual i. As the benchmark weight, , The position of individual i after updating by the temperature selection strategy. For the centroid weight, t is the current iteration number, and T is the maximum iteration number. The centroid weight base value, Let i be the target position of individual i after being guided by the centroid. For chaotic adaptive inertia weights, , The inertia weight ratio, Let i be the target position of individual i after chaotic adaptive inertial adjustment. For asymmetric power-law sinusoidal perturbation weights, , The base value for the perturbation weights, The amplitude is variable, and rand is a random number between [0,1]. Let i be the target position of individual i after undergoing asymmetric power-law sinusoidal perturbation.
[0036] Furthermore, such as Figure 1 As shown, in step S3, the control parameters of the PID controller in the position and velocity dual closed-loop control model are optimized using the improved carbon black four-corner bee algorithm. The specific steps are as follows: S31. Initialize the parameters of the improved carbon black quadrangular bee algorithm: population size N, problem dimension dim, maximum number of iterations T, upper bound of search space ub, lower bound of search space lb, and generate the individual positions in the initial population by initializing the parameters. S32. Select a fitness function to quantify the global optimality of the solution. The fitness function formula is: ; In the formula, J is the fitness value. Total system uptime The difference between a given target value and the actual value; S33. During the selection of nest building or thermoregulation strategy, the dynamic temperature factor fT is calculated using an improved nonlinear temperature balance strategy. The relevant formula for the nonlinear temperature balance strategy is shown in equation (3). S34. During the hive construction and thermoregulation phases, when the dynamic temperature factor fT is between 10 and 17, the population position is updated by simulating the slight wing-flapping movements and warming hive behavior of the charcoal tetragonium. The position update formula is as follows: ; In the formula, For the updated position of individual i, This represents the position of the individual with the best fitness value in the population. The change in temperature , The integer is randomly generated, representing the number of charcoal four-cornered bees that gather to warm the hive. Let r be the current position of a randomly generated individual. The amplitude of the wingbeats is a random number between [0.2, 0.3]. Thermal conductivity; When the dynamic temperature factor fT is between 18 and 29, the population position is updated by simulating the spiral nesting behavior of the carbon black tetragonal bee. If the random number rand is less than or equal to 0.2, the bee builds nest cells around itself. The relevant formula for position update is shown in Equation (12). If the random number rand is greater than 0.2, the beehive is built according to the geometric structure of the Archimedean spiral. The relevant formula for position update is shown in Equation (13). ; ; In the formula, The motion disturbance factor has a value of a random number between [0,1]. These are random numbers generated from a standard Cauchy distribution, where the median is set to 0 and the scale parameter is set to 1. For the helix angle, , 'a' is the distance from the origin to the starting point of the spiral, and 'b' is the distance the spiral extends outward from the origin for each unit angle increase. The angle parameter controls the tightening of the screw. As the initial angle, This is a normalization factor used to adjust the effect of the spiral angle. The adjustment coefficient represents the average distance between cells in the nest comb structure. The meanings of the other parameters and functions in the formula are the same as in S34. When the dynamic temperature factor fT > 29, the population position is updated by simulating the strong fluttering cooling behavior of the carbon black tetragonal wasp. The position update formula is: ; In the formula, The number of wing flaps per second is t, the current iteration number is t, and the maximum iteration number is T. The meanings of the other parameters and functions in the formula are the same as in S34. S35. Population position update is performed by integrating chaotic gravitational inertial guidance strategy. The relevant formulas are shown in equation (4) and equation (6). S36. Population position update is performed using an asymmetric power-law sinusoidal perturbation strategy. The relevant formula is shown in equation (8). S37. The position is updated by weighted fusion of the temperature-driven updated position vector, the centroid-guided position vector, the chaotic inertial position vector and the sinusoidal perturbation position vector, and the weight coefficient of each position vector is adaptively adjusted based on the iteration progress. The relevant formula is shown in equation (9). S38. Recalculate the fitness function value for all individuals after the current iteration, update the fitness, and update the position of the best individual in the population. S39. Determine if the maximum number of iterations for the population has been reached: If the maximum number of iterations has been reached, terminate the iteration process, decompose the obtained optimal solution into proportional coefficient Kp, integral coefficient Ki, and derivative coefficient Kd, and input them into the PID controller to complete the parameter optimization tuning; if the maximum number of iterations has not been reached, return to S33 to continue the iterative optimization process.
[0037] Furthermore, such as Figure 2 As shown, in step S4, MATLAB and Simulink are used to simulate the PID controller of the position and velocity dual closed-loop control model. The PID controller includes: a desired position value module, a position error calculation module, a position loop PID controller module, a velocity error calculation module, a velocity loop PID controller module, an output control quantity module, an execution unit module, a controlled object module, and an output position value. The position loop PID controller obtains the deviation between the desired position value and the actual position value through the position error calculation module, and outputs a velocity command as the input of the velocity loop using the position loop parameters Kp1, Ki1, and Kd1 calculated by the improved algorithm. The velocity loop PID controller obtains the deviation between the velocity command and the actual velocity value through the velocity error calculation module, and outputs a control signal to the execution unit module using the velocity loop parameters Kp2, Ki2, and Kd2 calculated by the improved algorithm. The execution unit module then sends a command to the controlled object to control the controlled object to adjust the actual velocity and position, so that the actual position value quickly stabilizes near the desired position value. During the simulation, the transfer function of the corresponding system controlled object was selected, proving the superiority of the improved carbon black four-corner bee algorithm for PID controller parameter optimization. The transfer function formula is: ; In the formula, Let s be the transfer function, and s be the function variable.
[0038] Furthermore,Figure 4 The graph shows a comparison of the fitness values during the optimization process of the improved carbon black quadrangular bee algorithm and the basic carbon black quadrangular bee algorithm. It can be seen from the graph that the fitness value of the improved carbon black quadrangular bee algorithm decreases faster. After a few iterations, it quickly approaches a very low and stable value. This indicates that the improved carbon black quadrangular bee algorithm can quickly explore a better solution space during the optimization process, which greatly improves the optimization efficiency and has superior performance. Figure 5 The comparison chart shows the control effects of the improved carbon black quadrangular bee algorithm and the basic carbon black quadrangular bee algorithm optimized PID. As can be seen from the chart, the improved carbon black quadrangular bee algorithm has a faster response speed, can approach the target value in a shorter time, has a smaller overshoot, and can more smoothly and quickly approach the target after the curve rises, which greatly improves the stability and accuracy of PID control.
Claims
1. A dual closed-loop control method for motor position and speed based on an improved carbon black four-corner honeycomb algorithm, characterized in that, An improved carbon black quadrangular bee algorithm is used to optimize the control parameters of the position and velocity dual closed-loop PID controller. The specific steps are as follows: S1. Establish a dual closed-loop control model for position and velocity based on a PID controller; S2. Improved carbon black four-corner bee algorithm; S3. The improved carbon black quadrangular bee algorithm is used to optimize the control parameters of the PID controller in the dual closed-loop control model of motor position and speed. A set of optimal PID control parameters Kp, Ki, and Kd are obtained through algorithm optimization. S4. Simulate the position and velocity dual closed-loop control model using MATLAB and Simulink.
2. The dual closed-loop control method for motor position and speed based on the improved carbon black four-corner bee algorithm according to claim 1, characterized in that, In S1, the dual closed-loop control model of the PID controller for position and speed mainly includes the following modules: speed error calculation module, position error calculation module, position loop PID control module, speed loop PID control module, improved carbon black four-corner bee algorithm module, motor drive module, and encoder module. The position error calculation module calculates the deviation between the target and the actual position, providing a core error basis for position loop adjustment. The speed error calculation module receives the target speed output by the position loop, combines it with the actual speed of the motor, calculates the speed loop deviation value, and uses it as the speed loop adjustment input. The improved carbon black quadrangular bee algorithm module iteratively optimizes and obtains the PID parameters of the speed loop and position loop and inputs them into the corresponding module, dynamically corrects the parameters to adapt to load changes, and improves the system response speed and stability. The position loop PID control module adjusts the output position loop control signal according to the position deviation value using optimized PID parameters, and transmits it to the speed error module; The speed loop PID control module generates a speed loop control signal based on the speed deviation value using optimized PID parameters, and outputs it to the motor drive module. The motor drive module converts the speed loop control signal into a motor drive signal to drive the motor for speed adjustment and position following. The encoder module collects motor speed and position information in real time and feeds it back to the corresponding error module, forming a double-loop closed-loop feedback to provide real-time data for precise system adjustment.
3. The dual closed-loop control method for motor position and speed based on the improved carbon black four-corner bee algorithm according to claim 1, characterized in that, S2 includes: S21. An improved method for temperature-driven processing in the carbon black four-corner bee algorithm is proposed using a nonlinear temperature balancing strategy. By introducing a nonlinear cooling term for the iteration progress and combining it with a sinusoidal perturbation factor, the temperature fluctuations of a real bee colony during heating and cooling processes are effectively simulated. The relevant formula is as follows: ; ; ; In the formula, Here, t represents the sinusoidal perturbation term, t is the current iteration number, and T is the maximum iteration number. The disturbance amplitude factor is denoted by rand, which is a random number between [0,1]. Let be the standard deviation of the j-th dimension, and N be the population size. Let i be the position of individual i in the j-th dimension. Let j be the mean of the j-th dimension. fT is the dynamic temperature factor, lT is the minimum temperature threshold, and uT is the maximum temperature threshold. is a non-linear exponent, and MeanDiversity is the mean of the population standard deviation. MaxDiversity is the maximum standard deviation of the population. dim represents the problem dimension. The scaling factor is the sinusoidal perturbation factor. S22. A population position update mechanism employing a fusion of chaotic gravitational inertial guidance strategy is used. This mechanism calculates the population centroid to guide individuals toward the global center, while simultaneously introducing a Logistic chaotic sequence to dynamically adjust the inertial factor, forming a chaotic adaptive inertial term. The relevant formula is: ; ; ; In the formula, Let i be the target position of individual i after being guided by the centroid. This represents the position of the individual with the best fitness value in the population. The scaling factor is the centroid-guided scaling factor. For the population mass center, Let i be the current position of individual i. For Logistic chaotic variables, These are the control parameters for the Logistic mapping. Let i be the target position of individual i after chaotic adaptive inertial adjustment. As the initial inertia weight, is the adjustment coefficient for inertia weight, t is the current iteration number, and T is the maximum iteration number.
4. The dual closed-loop control method for motor position and speed based on the improved carbon black four-corner bee algorithm according to claim 3, characterized in that, S2 also includes: S23. A population position update mechanism incorporating asymmetric power-law sinusoidal perturbations is used. The perturbation step size is asymmetrically modulated through a power-law tail distribution control factor, and dynamic perturbation is achieved by combining this with a sinusoidal function. The relevant formula is: ; ; In the formula, Step is the perturbation step size. It is a normal noise vector. For power-law base values, The increment is variable, rand is a random number between [0,1], t is the current iteration number, and T is the maximum iteration number. Let i be the target position of individual i after undergoing an asymmetric power-law sinusoidal perturbation. Let i be the current position of individual i. This is the perturbation scaling factor. , These are the upper and lower bounds of the search space, respectively; S24. A multi-source fusion strategy for updating population positions is used. This strategy weights and fuses the temperature-driven update vector, centroid guidance vector, chaotic inertia vector, and sinusoidal perturbation vector, and adaptively adjusts the weight coefficients according to the iteration progress. This achieves an organic combination of early-stage global exploration and later-stage rapid convergence, thereby improving the overall optimization performance. The relevant formula is: ; In the formula, As the benchmark weight, , The position of individual i after updating by the temperature selection strategy. For the centroid weight, , The centroid weight base value, Let i be the target position of individual i after being guided by the centroid. For chaotic adaptive inertia weights, , The inertia weight ratio, Let i be the target position of individual i after chaotic adaptive inertial adjustment. For asymmetric power-law sinusoidal perturbation weights, , The base value for the perturbation weights, It is a variable amplitude.
5. The dual closed-loop control method for motor position and speed based on the improved carbon black four-corner bee algorithm as described in claim 1, characterized in that, In step S3, the control parameters of the PID controller in the position and velocity dual closed-loop control model are optimized using the improved carbon black four-corner bee algorithm. The specific steps are as follows: S31. Initialize the parameters of the improved carbon black quadrangular bee algorithm: population size N, problem dimension dim, maximum number of iterations T, upper bound of search space ub, lower bound of search space lb, and generate the individual positions in the initial population by initializing the parameters. S32. Select a fitness function to quantify the global optimality of the solution. The fitness function formula is: ; In the formula, J is the fitness value. Total system uptime The difference between a given target value and the actual value; S33. During the selection of nest building or thermoregulation strategy, the dynamic temperature factor fT is calculated using an improved nonlinear temperature balance strategy. The relevant formula for the nonlinear temperature balance strategy is shown in equation (3). S34. During the hive construction and thermoregulation phases, when the dynamic temperature factor fT is between 10 and 17, the population position is updated by simulating the slight wing-flapping movements and warming hive behavior of the charcoal tetragonium. The position update formula is: ; In the formula, For the updated position of individual i, This represents the position of the individual with the best fitness value in the population. The change in temperature , A randomly generated integer. Let r be the current position of a randomly generated individual. The amplitude of the wingbeats is a random number between [0.2, 0.3]. is the thermal conductivity.
6. The dual closed-loop control method for motor position and speed based on the improved carbon black four-corner bee algorithm as described in claim 5, characterized in that, S3 further includes: When the dynamic temperature factor fT is between 18 and 29, the population position is updated by simulating the spiral nest-building behavior of the carbon black tetragonal bee. If the random number rand is less than or equal to 0.2, the bee builds nest cells around itself. The relevant formula for position update is shown in Equation (12). If the random number rand is greater than 0.2, the beehive is built according to the geometric structure of the Archimedean spiral. The relevant formula for position update is shown in Equation (13). ; ; In the formula, The motion disturbance factor has a value of a random number between [0,1]. These are random numbers generated from a standard Cauchy distribution, where the median is set to 0 and the scale parameter is set to 1. For the helix angle, , 'a' is the distance from the origin to the starting point of the spiral, and 'b' is the distance the spiral extends outward from the origin for each unit angle increase. The angle parameter controls the tightening of the screw. As the initial angle, As the normalization factor, The adjustment coefficient is used; the meanings of the other parameters and functions in the formula are the same as in S34. When the dynamic temperature factor fT > 29, the population position is updated by simulating the strong fluttering cooling behavior of the carbon black tetragonal wasp. The position update formula is: ; In the formula, The number of wing flaps per second is denoted as t, the current iteration number is t, and the maximum iteration number is T. The meanings of the other parameters and functions in the formula are the same as in S34.
7. The dual closed-loop control method for motor position and speed based on the improved carbon black four-corner bee algorithm as described in claim 6, characterized in that, S3 further includes: S35. Population position update is performed by integrating chaotic gravitational inertial guidance strategy. The relevant formulas are shown in equation (4) and equation (6). S36. Population position update is performed using an asymmetric power-law sinusoidal perturbation strategy. The relevant formula is shown in equation (8). S37. The position is updated by weighted fusion of the temperature-driven updated position vector, the centroid-guided position vector, the chaotic inertial position vector and the sinusoidal perturbation position vector, and the weight coefficient of each position vector is adaptively adjusted based on the iteration progress. The relevant formula is shown in equation (9). S38. Recalculate the fitness function value for all individuals after the current iteration, update the fitness, and update the position of the best individual in the population. S39. Determine if the maximum number of iterations for the population has been reached: If the maximum number of iterations has been reached, terminate the iteration process, decompose the obtained optimal solution into proportional coefficient Kp, integral coefficient Ki, and derivative coefficient Kd, and input them into the PID controller to complete the parameter optimization tuning; if the maximum number of iterations has not been reached, return to S33 to continue the iterative optimization process.
Citation Information
Patent Citations
Intelligent control method and system of brushless direct current motor, and storage medium
CN120185448A
PID (Proportion Integration Differentiation) control method for Taylor space external fixed bracket based on improved South goose algorithm
CN120831900A
Hub motor vector control method based on improved grey wolf particle swarm algorithm
CN121308606A
SMO-EKF brushless direct current motor position-free control method based on SBA-GWO double-layer optimization
CN121333152A
Motor fuzzy PID parameter tuning method based on improved whale algorithm
WO2025160684A1