A motor position and speed double closed loop control method based on improved carbon black four-angle bee algorithm
By improving the carbon black four-corner bee algorithm to optimize the dual closed-loop control of motor position and speed, the problem of weak adaptive capability and insufficient control accuracy of traditional PID parameter tuning methods under complex working conditions is solved, and fast response and high-precision motor control are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNIV OF JINAN
- Filing Date
- 2026-03-13
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional dual-loop control systems struggle to simultaneously achieve speed, overshoot suppression, and steady-state accuracy when faced with complex nonlinear loads, disturbances, and dynamic operating conditions, resulting in slow system response, oscillations, and even decreased stability.
An improved carbon black quad-corner bee algorithm is adopted to optimize the dual closed-loop control method of motor position and speed. By introducing a nonlinear temperature balance mechanism, a chaotic gravitational inertial guidance strategy and an asymmetric power-law sinusoidal disturbance, combined with a multi-source fusion update method, the PID controller parameters are optimized to improve the global exploration and local convergence performance.
It significantly improves the dynamic response speed and steady-state accuracy of the dual closed-loop control system, enhances the system's robustness and anti-interference ability, and ensures efficient and stable control performance under complex operating conditions.
Smart Images

Figure CN121832250B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of PID control optimization technology, and in particular relates to a dual closed-loop control method for motor position and speed based on an improved carbon black four-corner bee algorithm. Background Technology
[0002] In industrial automation and precision control systems, dual-loop control structures for position and velocity are widely used in high-precision drive devices such as servo motors, robot joints, and CNC machine tools. This structure, through the synergistic effect of inner-loop velocity control and outer-loop position control, effectively improves the dynamic response accuracy and anti-interference capability of the system. However, traditional dual-loop control often employs fixed-parameter PID regulation. While structurally simple, it often struggles to simultaneously achieve speed, overshoot suppression, and steady-state accuracy when facing complex nonlinear loads, disturbances, and dynamic conditions. This can easily lead to slow system response, oscillations, and even decreased stability, limiting the application effectiveness of dual-loop control systems in high-performance scenarios. Therefore, achieving adaptive adjustment of PID parameters using intelligent optimization methods to improve the overall dynamic and steady-state performance of the system has significant practical importance and application value.
[0003] The carbon black tetrahorn bee optimization algorithm is a novel swarm intelligence optimization algorithm that simulates the temperature regulation and spiral nest-building behavior of carbon black tetrahorn bee colonies during nest building. This algorithm simulates three different mechanisms of carbon black tetrahorn bees: slight wing-flapping for warmth at low temperatures, spiral nest building at medium temperatures, and strong wing-flapping for heat dissipation at high temperatures, forming a dynamic optimization strategy that balances global search and local exploitation. The carbon black tetrahorn bee algorithm demonstrates good performance in multidimensional function optimization and engineering constraint problems. However, when facing multivariable, strongly coupled dual-loop control parameter optimization problems, the algorithm still suffers from limited convergence speed and susceptibility to local optima. Its robustness and convergence accuracy still have room for improvement. Summary of the Invention
[0004] This invention proposes a dual-loop control method for motor position and speed based on an improved carbon black quadrangular bee algorithm. This method addresses the weaknesses in adaptive capability and control accuracy exhibited by traditional PID parameter tuning methods when dealing with the strong coupling, nonlinearity, and dynamic uncertainties inherent in dual-loop control systems. By improving the carbon black quadrangular bee algorithm, the global exploration capability and local convergence performance in complex parameter spaces are enhanced, effectively avoiding premature convergence and achieving coordinated optimization of the PID controller parameters for both the speed and position loops. This method not only effectively reduces overshoot and steady-state error under complex load and disturbance conditions but also improves the dynamic response speed, tracking accuracy, and anti-interference capability of the dual-loop control system, ensuring excellent control stability and robustness even under complex operating conditions.
[0005] The present invention adopts the following technical solution:
[0006] A dual closed-loop control method for motor position and speed based on an improved carbon black four-corner bee algorithm is described below.
[0007] S1. Establish a dual closed-loop control model for position and velocity based on a PID controller.
[0008] S2, Improved carbon black four-corner bee algorithm.
[0009] S3. The improved carbon black quadrangular bee algorithm is used to optimize the control parameters of the PID controller in the position and velocity dual closed-loop control model. A set of optimal PID control parameters Kp, Ki, and Kd are obtained through algorithm optimization.
[0010] S4. Simulate the position and velocity dual closed-loop control model using MATLAB and Simulink.
[0011] In S1, the dual closed-loop 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.
[0012] The position error calculation module calculates the deviation between the target and the actual position, providing a core error basis for position loop adjustment.
[0013] 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.
[0014] 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.
[0015] 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;
[0016] 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.
[0017] 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.
[0018] 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.
[0019] Furthermore, there are four improvements to the algorithm in S2, as detailed below.
[0020] Firstly, a nonlinear temperature balancing strategy is used to improve the simple temperature-driven approach in the carbon black four-corner bee algorithm. 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:
[0021] ;
[0022] ;
[0023] ;
[0024] In the formula, Here, t represents the sinusoidal perturbation term, t is the current iteration number, and T is the maximum iteration number. This is the perturbation amplitude factor, which controls the amplitude of the random perturbation. `rand` 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 nonlinear exponent that controls the degree of nonlinearity in temperature variation with iteration progress; MeanDiversity is the mean of the population standard deviation. MaxDiversity is used to measure population diversity; it represents the maximum standard deviation of the population. dim represents the problem dimension. This is the scaling factor for the sinusoidal disturbance.
[0025] 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:
[0026] ;
[0027] ;
[0028] ;
[0029] 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, t is the adjustment coefficient for inertia weight, t is the current iteration number, and T is the maximum iteration number.
[0030] 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:
[0031] ;
[0032] ;
[0033] 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.
[0034] 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:
[0035] ;
[0036] 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.
[0037] Furthermore, 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:
[0038] 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.
[0039] S32. Select a fitness function to quantify the global optimality of the solution. The fitness function formula is:
[0040] ;
[0041] In the formula, J is the fitness value. Total system uptime The difference between a given target value and the actual value;
[0042] 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).
[0043] 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:
[0044] ;
[0045] 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;
[0046] 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).
[0047] ;
[0048] ;
[0049] 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.
[0050] 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:
[0051] ;
[0052] 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.
[0053] S35. Population position update is performed by integrating chaotic gravitational inertial guidance strategy. The relevant formulas are shown in equation (4) and equation (6).
[0054] S36. Population position update is performed using an asymmetric power-law sinusoidal perturbation strategy. The relevant formula is shown in equation (8).
[0055] 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).
[0056] 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.
[0057] 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.
[0058] Furthermore, in S4, MATLAB and Simulink are used to simulate the PID controller of the position and velocity dual closed-loop 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:
[0059] ;
[0060] In the formula, Let s be the transfer function, and s be the function variable.
[0061] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0062] This invention proposes a dual-loop control method for motor position and speed based on an improved carbon black quad-corner bee algorithm. 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, a dynamic balance between global exploration and local exploitation capabilities is achieved. This avoids the problems of basic algorithms easily getting trapped in local optima, slow convergence speed, and insufficient accuracy, significantly improving optimization accuracy and robustness. By optimizing the PID controller parameters of the speed and position loops using the improved algorithm, not only is the dynamic response speed and steady-state accuracy of the dual-loop control system improved, but the robustness and anti-interference ability of the system are also significantly enhanced, thereby ensuring the efficient and stable operation of the motor under complex working conditions. Attached Figure Description
[0063] Figure 1 The flowchart shows the PID control process for a dual closed-loop system of position and velocity based on an improved carbon black quadrangular bee algorithm.
[0064] Figure 2 The diagram shows the model of a dual closed-loop PID controller for position and velocity based on an improved carbon black four-corner bee algorithm.
[0065] Figure 3 This is a block diagram of a dual closed-loop control system for position and velocity.
[0066] Figure 4 A comparison of fitness value changes during the optimization process of the improved carbon black quadrangular bee algorithm and the basic carbon black quadrangular bee algorithm.
[0067] Figure 5 A comparison of the control effects of the improved carbon black four-corner bee algorithm and the basic carbon black four-corner bee algorithm optimized PID control. Detailed Implementation
[0068] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0069] Please refer to Figures 1 to 5 The present invention provides a technical solution:
[0070] A dual closed-loop control method for motor position and speed based on an improved carbon black four-corner bee algorithm is described below.
[0071] S1, such as Figure 3 As shown, a dual closed-loop control model for position and velocity based on a PID controller is established.
[0072] S2, Improved carbon black four-corner bee algorithm.
[0073] S3. The improved carbon black quadrangular bee algorithm is used to optimize the control parameters of the PID controller in the position and velocity dual closed-loop control model. A set of optimal PID control parameters Kp, Ki, and Kd are obtained through algorithm optimization.
[0074] S4. Simulate the position and velocity dual closed-loop control model using MATLAB and Simulink.
[0075] Among them, the position and speed dual closed-loop control model of the PID controller in S1 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;
[0076] The position error calculation module calculates the deviation between the target and the actual position, providing a core error basis for position loop adjustment.
[0077] 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.
[0078] 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.
[0079] 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;
[0080] 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.
[0081] 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.
[0082] 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.
[0083] Furthermore, there are four improvements to the algorithm in S2, as detailed below.
[0084] Firstly, a nonlinear temperature balancing strategy is used to improve the simple temperature-driven approach in the carbon black four-corner bee algorithm. 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:
[0085] ;
[0086] ;
[0087] ;
[0088] In the formula, Here, t represents the sinusoidal perturbation term, t is the current iteration number, and T is the maximum iteration number. This is the perturbation amplitude factor, which controls the amplitude of the random perturbation. `rand` 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 nonlinear exponent that controls the degree of nonlinearity in temperature variation with iteration progress; MeanDiversity is the mean of the population standard deviation. MaxDiversity is used to measure population diversity; it represents the maximum standard deviation of the population. dim represents the problem dimension. This is the scaling factor for the sinusoidal disturbance.
[0089] 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:
[0090] ;
[0091] ;
[0092] ;
[0093] 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, t is the adjustment coefficient for inertia weight, t is the current iteration number, and T is the maximum iteration number.
[0094] 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:
[0095] ;
[0096] ;
[0097] 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.
[0098] 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:
[0099] ;
[0100] 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.
[0101] 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:
[0102] 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.
[0103] S32. Select a fitness function to quantify the global optimality of the solution. The fitness function formula is:
[0104] ;
[0105] In the formula, J is the fitness value. Total system uptime The difference between a given target value and the actual value;
[0106] 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).
[0107] 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:
[0108] ;
[0109] 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;
[0110] 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).
[0111] ;
[0112] ;
[0113] 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.
[0114] 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:
[0115] ;
[0116] 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.
[0117] S35. Population position update is performed by integrating chaotic gravitational inertial guidance strategy. The relevant formulas are shown in equation (4) and equation (6).
[0118] S36. Population position update is performed using an asymmetric power-law sinusoidal perturbation strategy. The relevant formula is shown in equation (8).
[0119] 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).
[0120] 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.
[0121] 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.
[0122] 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:
[0123] ;
[0124] In the formula, Let s be the transfer function, and s be the function variable.
[0125] Furthermore, Figure 4The 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, including four improvements, as follows: S21. An improved method for temperature-driven processing in the carbon black four-corner bee algorithm is proposed using a nonlinear temperature balancing strategy. This is achieved by introducing a nonlinear cooling term for the iteration progress and combining it with a sinusoidal perturbation factor to simulate temperature fluctuations in a real bee colony during heating and cooling processes. 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 the inertia weight, t is the current iteration number, and T is the maximum iteration number; 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 position and speed dual closed-loop control model of the PID controller 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 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.
4. 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.
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 4, 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, This is the adjustment coefficient; 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, denoted as the number of wing flaps per second, t as the current iteration number, and T as the maximum iteration number.
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: 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.