Motor and method, device, controller, medium and program product for controlling the rotational speed thereof

CN123034773APending Publication Date: 2026-11-03GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611004122.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-07
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

In the speed control system of permanent magnet synchronous motor (PMSM), the existing PID controller parameter tuning method is difficult to guarantee global optimality, which affects the accuracy of motor speed control.

Method used

A method based on an improved rime ice algorithm is adopted. By setting a fitness function and a swarm optimization algorithm, the PID control parameters are optimized. By combining the following error, control energy and response smoothness, the proportional, integral and derivative parameters of the PID controller are optimized.

Benefits of technology

It improves the accuracy of motor speed control, reduces system oscillation, and enhances the robustness and engineering practicality of the control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123034773A_ABST
    Figure CN123034773A_ABST
Patent Text Reader

Abstract

The application discloses a motor and a rotating speed control method and device thereof, a motor controller, a storage medium and a computer program product, and relates to the technical field of industrial automation control systems. The method comprises the following steps: adopting a PID controller in a rotating speed loop of a control system of the motor, and performing closed-loop simulation control by using set PID control parameters; based on a sampled rotating speed given value of the motor, a rotating speed feedback value of the motor and a control value of the PID controller, using a set fitness function and a set population optimization algorithm, optimizing the set PID control parameters; and performing PID control on the rotating speed of the motor by using the optimal PID control parameters obtained through optimization. According to the scheme, the PID control parameters are optimized by using a fitness function combining following errors, control energy and response smoothness based on a set population optimization algorithm such as a fog algorithm in the motor rotating speed PID control, so that the accuracy of the motor rotating speed control is improved. The motor controller relates to the manufacturing of industrial automation control system devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of motor technology, specifically relating to a method, device, motor controller, motor, storage medium, and computer program product for controlling the speed of a motor. More particularly, it relates to a method, device, motor controller, motor, storage medium, and computer program product for optimizing the parameters of a servo motor PID speed controller based on an improved frost algorithm. This motor controller is related to the manufacture of industrial automatic control system devices. Background Technology

[0002] In the field of industrial automation control, PID controllers (Proportional-Integral-Derivative controllers) are widely used in closed-loop control of various controlled objects due to their simple structure, ease of implementation, and strong robustness.

[0003] For example, when a PID controller is applied to the closed-loop control of a servo motor, it can be used for scenarios such as speed control, temperature control, and pressure control. The performance of the PID controller directly depends on the values ​​of three key parameters: the proportional gain K... p Integral coefficient K i and differential coefficient K d The value of .

[0004] When tuning the PID controller parameters in a speed control system for a motor such as a permanent magnet synchronous motor (PMSM), the PID controller parameter tuning methods in relevant schemes are difficult to guarantee global optimization, affecting the accuracy of motor speed control. This motor controller is related to the manufacturing of industrial automatic control system devices.

[0005] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0006] The purpose of this invention is to provide a method, device, motor controller, motor, storage medium, and computer program product for controlling the speed of a motor, to solve the problem in related solutions where it is difficult to guarantee global optimality during PID controller parameter tuning in speed control systems for motors such as permanent magnet synchronous motors (PMSMs), thus affecting the accuracy of motor speed control. This invention achieves the effect of improving the accuracy of motor speed control by optimizing PID control parameters in motor speed PID control based on a set swarm optimization algorithm (such as the rime algorithm) and employing a fitness function that combines following error, control energy, and response smoothness. This motor controller relates to the manufacture of industrial automatic control system devices.

[0007] This invention provides a method for controlling the speed of a motor, applied to tuning the PID control parameters of a PID controller in the speed loop of the motor's control system; the method includes: employing a PID controller in the speed loop of the motor's control system, performing closed-loop simulation control with set PID control parameters within a set simulation time domain T; and performing closed-loop simulation control according to a set sampling period T. s Obtain the setpoint speed of the motor. Obtain the speed feedback of the motor. And obtain the control quantity of the PID controller. Based on the speed setpoint of the motor The speed feedback of the motor and the control quantity of the PID controller The set fitness function B(k) and the set population optimization algorithm are used to optimize the set PID control parameters to determine the optimal PID control parameters; the speed of the motor is controlled by PID according to the optimal PID control parameters.

[0008] In some implementations, the setpoint is based on the motor's rotational speed. The speed feedback of the motor and the control quantity of the PID controller The set fitness function B(k) and the set population optimization algorithm are used to optimize the set PID control parameters to determine the optimal PID control parameters, including: based on the speed setpoint of the motor. The speed feedback of the motor and the control quantity of the PID controller The performance of the PID controller under the set PID control parameters is evaluated using a set fitness function B(k), and the evaluation result is obtained. Based on the evaluation result, the set swarm optimization algorithm is used to optimize the set PID control parameters to obtain optimized PID control parameters. The set PID control parameters and the optimized PID control parameters are stored in the historical PID control parameters. Then, the simulation is returned, and closed-loop simulation control is performed with the optimized PID control parameters within the set simulation time domain T. This process is iterated until the set maximum number of iterations is reached. Finally, the optimal PID control parameters are determined from the historical PID control parameters.

[0009] In some implementations, the setpoint is based on the motor's rotational speed. The speed feedback of the motor and the control quantity of the PID controller The performance index of the PID controller under the set PID control parameters is evaluated using a set fitness function B(k), and the evaluation result is obtained, including: within the set simulation time domain T, based on the speed setpoint of the motor. The speed feedback of the motor and the control quantity of the PID controller Determine the instantaneous performance index at step k. The motor speed feedback amount in step k. The speed feedback amount of the motor in step k-1. The difference is denoted as the smoothness penalty term S(k) at step k; based on the instantaneous performance index at step k... The expression of the fitness function B(k) at step k is determined by the smoothness penalty term S(k) at step k. The expression of the fitness function B(k) at step k is used to calculate the performance index of the PID controller under the set PID control parameters.

[0010] In some implementations, based on the instantaneous performance index of the k-th step Given the smoothness penalty term S(k) at step k, determine the expression of the set fitness function B(k) at step k, including: determining whether the smoothness penalty term S(k) at step k is greater than or equal to 0; if it is determined that the smoothness penalty term S(k) at step k is greater than or equal to 0, then based on the speed setpoint of the motor... The speed feedback of the motor and the control quantity of the PID controller The fitness function B(k) is determined to be the first expression at step k; if the smoothness penalty term S(k) at step k is determined to be less than 0, then the speed setpoint of the motor is used. The speed feedback of the motor The control quantity of the PID controller And the smoothness penalty term S(k) in step k, determine that the expression of the fitness function B(k) in step k is the second expression.

[0011] In some implementations, wherein,

[0012] The first expression is as follows:

[0013] ;

[0014] ;

[0015] The second expression is as follows:

[0016] ;

[0017] in, This represents the evaluation result calculated at step k based on the set fitness function B(k). This represents the evaluation result calculated at step k-1 based on the set fitness function B(k). This represents the instantaneous performance index at step k-1. Indicates the weighted calculation coefficients and <1, This represents the setpoint speed of the motor at step k-1. The speed feedback amount of the motor in step k-1. The error, This represents the control quantity of the PID controller at step k-1; Indicates the penalty coefficient;

[0018] ;

[0019] K p K i K d The parameters are, in order, the proportional parameter, integral parameter, and derivative parameter in the PID control parameters of the PID controller.

[0020] In some implementations, the set group optimization algorithm includes: a rime algorithm; based on the evaluation results, the set group optimization algorithm is used to optimize the set PID control parameters to obtain optimized PID control parameters, including: based on the evaluation results, the rime algorithm is used to optimize the set PID control parameters to obtain optimized PID control parameters.

[0021] And / or, wherein the fitness function B(k) is set based on the motor speed given within the set simulation time domain T. Speed ​​feedback of the motor The optimization objective is to minimize the cumulative value of the error e(k); among the historical PID control parameters, the optimal PID control parameters are determined, including: among the historical PID control parameters, the motor speed setpoint within the set simulation time domain T. Speed ​​feedback of the motor The PID control parameters that minimize the cumulative value of the error e(k) are determined as the optimal PID control parameters.

[0022] And / or, when the PID controller employs a positional discrete PID controller, the control quantity u(k) of the positional discrete PID controller is subjected to amplitude limiting.

[0023] In conjunction with the above method, another aspect of the present invention provides a motor speed control device, comprising: a control unit configured to employ a PID controller in the speed loop of the motor control system, and to perform closed-loop simulation control with set PID control parameters within a set simulation time domain T; and an acquisition unit configured to perform sampling according to a set sampling period T. s Obtain the setpoint speed of the motor. Obtain the speed feedback of the motor. And obtain the control quantity of the PID controller. The control unit is further configured to base its input speed on a setpoint given by the motor. The speed feedback of the motor and the control quantity of the PID controller The set fitness function B(k) and set population optimization algorithm are used to optimize the set PID control parameters to determine the optimal PID control parameters; the control unit is also configured to perform PID control on the speed of the motor according to the optimal PID control parameters.

[0024] In conjunction with the above-described device, the present invention further provides a motor controller, comprising: the motor speed control device described above.

[0025] In conjunction with the above-described device, the present invention further provides a motor, comprising: the motor controller described above.

[0026] In conjunction with the above method, the present invention further provides a storage medium comprising a stored program, wherein, when the program is executed, the device on which the storage medium is located executes the steps of the above-described motor speed control method.

[0027] In conjunction with the above method, the present invention further provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described motor speed control method.

[0028] The present invention addresses the tuning problem of PID controller parameters in the speed control system of a motor, such as a permanent magnet synchronous servo motor. A PID controller is employed in the speed loop of the motor's control system. Closed-loop simulation control is performed within a set simulation time domain T using set PID control parameters. Based on the motor's speed setpoint r(k), within the set simulation time domain T, a set sampling period T is used. sObtain the setpoint speed of the motor. Obtain the speed feedback of the motor. And obtain the control quantity of the PID controller. Based on the speed setpoint of the motor The speed feedback of the motor and the control quantity of the PID controller The set fitness function B(k) and a set swarm optimization algorithm are used to optimize the set PID control parameters to determine the optimal PID control parameters. A PID controller is then used in the speed loop of the motor control system to perform PID control on the motor speed according to the optimal PID control parameters. Thus, in the motor speed PID control, based on a set swarm optimization algorithm (such as the rime algorithm), a fitness function combining the following error e(k), control energy u(k), and response smoothness S(k) is employed. This motor controller optimizes PID control parameters to improve the accuracy of motor speed control. It is relevant to the manufacturing of industrial automatic control system devices.

[0029] Specifically, in the solution of this invention, regarding the tuning problem of PID controller parameters in the speed control system of a motor such as a permanent magnet synchronous servo motor, in the motor speed closed-loop system, a position-type discrete PID controller is used in the speed loop with the set PID control parameters (K). p K i K d Closed-loop simulation control is performed within the set simulation time domain T, according to the set sampling period T. s Obtain the motor speed setpoint as instructed. The motor speed feedback quantity is as follows: In a motor control system, the control quantity of a speed PID controller, such as a position-type discrete PID controller, is... The setpoint is based on the motor speed. Motor speed feedback Control quantity of the speed PID controller The motor speed is given by a setpoint within the simulated time domain T. Motor speed feedback The optimization objective is to minimize the cumulative error e(k). The fitness function B(k) is used to evaluate the speed PID controller under the set PID control parameters (K). p K i K d Control quantity under ) The performance indicators, based on the evaluation results of the fitness function B(k), are used to evaluate the speed PID controller under the set PID control parameters (K). The Rime algorithm (i.e., the rime algorithm) is employed. p K i K d ) to perform optimization and determine the optimal PID control parameters (K) p K i K d Based on the optimal PID control parameters (K) p K i K d This device controls the motor speed; therefore, by using a fitness function that combines following error, control energy, and response smoothness in the PID control of the motor speed based on the frost algorithm, the accuracy of motor speed control is improved by optimizing the PID control parameters. This motor controller relates to the manufacturing of industrial automatic control system devices.

[0030] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention.

[0031] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0032] Figure 1 This is a schematic flowchart of an embodiment of the motor speed control method of the present invention;

[0033] Figure 2 This is a flowchart illustrating an embodiment of the method of the present invention, which uses a set fitness function B(k) and a set population optimization algorithm to optimize set PID control parameters.

[0034] Figure 3 This is a flowchart illustrating an embodiment of the method of the present invention, which uses a set fitness function B(k) to evaluate the performance index of the PID controller under set PID control parameters.

[0035] Figure 4 In the method of this invention, the instantaneous performance index at step k is used as a reference. A flowchart illustrating an embodiment of determining the expression of the fitness function B(k) in step k, using the smoothness penalty term S(k) in step k;

[0036] Figure 5 This is a schematic diagram of a structure of an embodiment of the motor speed control device of the present invention;

[0037] Figure 6This is a flowchart illustrating an embodiment of a servo motor PID speed controller parameter optimization method based on an improved rime ice algorithm;

[0038] Figure 7 This is a schematic diagram of the step output curve when the PID controller controls the output quantity. It can display the curve diagram of the PID control output quantity versus the number of control feedbacks.

[0039] Figure 8 A schematic diagram showing the relationship between the optimal fitness of the step output and the number of iterations when the output is controlled by a PID controller.

[0040] Figure 9 This is a schematic diagram of the sinusoidal output curve when the PID controller controls the output quantity. It can display the curve diagram of the PID control output quantity versus the number of control feedback cycles.

[0041] Figure 10 This is a schematic diagram showing the relationship between the optimal fitness of the sinusoidal output and the number of iterations when the output is controlled by a PID controller.

[0042] Referring to the accompanying drawings, the reference numerals in the embodiments of the present invention are as follows:

[0043] 102 - Acquisition unit; 104 - Control unit. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0045] Considering that it is difficult to guarantee global optimization when tuning the PID controller parameters in the speed control system of a motor such as a permanent magnet synchronous motor (PMSM), thus affecting the accuracy of motor speed control, the relevant schemes mainly employ the following methods for PID controller parameter tuning in the speed control system of a motor such as a permanent magnet synchronous motor (PMSM): empirical trial and error method, Ziegler-Nichols tuning method, and model-based design method.

[0046] Among these methods, the empirical trial-and-error method relies on engineers' practical experience, repeatedly adjusting parameters through trial and error, which is time-consuming and labor-intensive, and it is difficult to guarantee global optimization. The Ziegler-Nichols tuning method (ZN method) calculates parameters based on critical gain and critical period; this method is simple but only applicable to specific systems and often leads to large overshoot. Model-based design methods, such as pole placement and internal model control, require accurate mathematical models, but real-world industrial systems often exhibit nonlinearity, time-varying characteristics, and uncertainties, making it difficult to establish accurate models.

[0047] With the development of intelligent optimization algorithms, swarm intelligence optimization algorithms (such as particle swarm optimization, genetic algorithms, and gray wolf algorithms) have been introduced into the field of PID controller parameter tuning. These swarm intelligence optimization algorithms, by simulating the behavior of biological groups in nature, search for the optimal combination of PID controller parameters within the search space, effectively overcoming the limitations of PID controller parameter tuning methods in related schemes.

[0048] Although swarm intelligence optimization algorithms (such as particle swarm optimization, genetic algorithm, gray wolf algorithm, etc.) have achieved certain results in PID controller parameter tuning, some problems still exist.

[0049] For example, it is difficult to balance convergence speed and global search capability: Particle Swarm Optimization (PSO) is prone to getting stuck in local optima, leading to convergence stagnation in the later stages; while Genetic Algorithm (GA) has strong global search capability, its convergence speed is slow and its computational cost is high, making it difficult to meet the needs of rapid tuning in engineering applications.

[0050] Furthermore, the fitness function design is not perfect: the fitness function in related schemes often only focuses on the accumulation of tracking error, while ignoring practical engineering problems such as oscillation and control overshoot in the motor control system. Although the optimized PID controller parameters perform well in simulation, they may cause problems such as severe oscillation and actuator saturation when deployed to a real system.

[0051] Therefore, the present invention proposes a motor speed control method, specifically a servo motor PID speed controller parameter optimization method based on an improved frost algorithm. Based on a proposed fitness function that considers multiple objectives, it is introduced into the frost algorithm to achieve global optimization, which can reduce the speed tracking error of the motor and effectively suppress the oscillation of the motor control system, resulting in higher output accuracy of motor speed control.

[0052] According to an embodiment of the present invention, a method for controlling the speed of a motor is provided, such as... Figure 1The diagram shows a flowchart of an embodiment of the method of the present invention. This motor speed control method is applied to tuning the PID control parameters of a PID controller in the speed loop of the motor control system; specifically, when a PID controller is used for control in the speed loop of the motor control system, the PID control parameters of the PID controller are tuned, i.e., the optimal PID control parameters of the PID controller are determined through an optimization process. The control quantity of the PID controller in the speed loop of the motor control system, such as a positional discrete PID controller, is... In the solution of the present invention, such as Figure 1 As shown, the motor speed control method includes steps S110 to S140.

[0053] In step S110, a PID controller is used in the speed loop of the motor control system. Closed-loop simulation control is performed with set PID control parameters within a set simulation time domain T. The set simulation time domain T is the entire simulation time domain T.

[0054] In step S120, within the set simulation time domain T, the sampling period T is set. s Obtain the setpoint speed of the motor. Obtain the speed feedback of the motor. And obtain the control quantity of the PID controller. Wherein, the motor speed is a given value, such as an instruction. ; Obtain the speed feedback value of the motor, such as feedback And obtain the control input of the PID controller, such as the control input of a positional discrete PID controller. .

[0055] In step S130, a setpoint is given based on the motor's rotational speed. The speed feedback of the motor and the control quantity of the PID controller The set fitness function B(k) and the set population optimization algorithm are used to optimize the set PID control parameters in order to determine the optimal PID control parameters.

[0056] In step S140, a PID controller is used in the speed loop of the motor control system to perform PID control on the motor speed according to the optimal PID control parameters.

[0057] In the solution of this invention, a PID controller is used in the speed loop of the motor control system. Closed-loop simulation control is performed within a set simulation time domain T using set PID control parameters. Based on the motor's speed setpoint r(k), within the set simulation time domain T, a set sampling period T is used. s Obtain the setpoint speed of the motor. Obtain the speed feedback of the motor. And obtain the control quantity of the PID controller. Based on the speed setpoint of the motor The speed feedback of the motor and the control quantity of the PID controller The set fitness function B(k) and a set swarm optimization algorithm are used to optimize the set PID control parameters to determine the optimal PID control parameters. A PID controller is then used in the speed loop of the motor control system to perform PID control on the motor speed according to the optimal PID control parameters. Thus, in the motor speed PID control, based on a set swarm optimization algorithm (such as the rime algorithm), a fitness function combining the following error e(k), control energy u(k), and response smoothness S(k) is employed. Optimize PID control parameters to improve the accuracy of motor speed control.

[0058] In some implementations, in step S130, a setpoint is given based on the motor's rotational speed. The speed feedback of the motor and the control quantity of the PID controller The specific process of optimizing the set PID control parameters using the set fitness function B(k) and the set population optimization algorithm to determine the optimal PID control parameters is illustrated in the following exemplary description.

[0059] The following is combined with Figure 2 The flowchart shown is a schematic diagram of an embodiment of the method of the present invention, which uses a set fitness function B(k) and a set population optimization algorithm to optimize the set PID control parameters. The flowchart further illustrates the specific process of optimizing the set PID control parameters using the set fitness function B(k) and the set population optimization algorithm in step S130, including steps S210 to S240.

[0060] Step S210, based on the motor speed setpoint The speed feedback of the motor and the control quantity of the PID controller The performance index of the PID controller under the set PID control parameters is evaluated using the set fitness function B(k), and the evaluation result is obtained.

[0061] Step S220: Based on the evaluation results, the set PID control parameters are optimized using a set group optimization algorithm to obtain optimized PID control parameters; both the set PID control parameters and the optimized PID control parameters are stored in the historical PID control parameters.

[0062] Step S230, then return, and within the set simulation time domain T, perform closed-loop simulation control with the optimized PID control parameters.

[0063] Step S240: Iterate in this way until the set maximum number of iterations is reached, and then determine the optimal PID control parameters from the historical PID control parameters.

[0064] Figure 6 This is a flowchart illustrating an embodiment of a servo motor PID speed controller parameter optimization method based on an improved rime ice algorithm, showing the overall framework of the algorithm. Figure 6 As shown, the overall process of a servo motor PID speed controller parameter optimization method based on an improved rime ice algorithm includes:

[0065] Step 1: Parameter setting and system initialization, then proceed to Step 2.

[0066] Step 1 involves parameter setting and system initialization, including: PID control system parameters (i.e., servo motor PID speed controller parameters), Rime population size, maximum number of iterations, PID boundaries, and input command initialization. Among these, the PID boundaries include, for example, the given upper boundary U... b The value is 5, and the lower boundary is L. b Set to 0. Initialization: This refers to initializing the speed command, as shown in Mode 1 and Mode 2 below.

[0067] In other words, in step 1, parameter initialization is performed first, including PID control system parameters, Rime population size, maximum number of iterations, PID boundaries, and input command initialization.

[0068] Step 2: System closed-loop control, then proceed to step 3.

[0069] In steps 1 and 2, the solution of this invention addresses the PID controller parameter tuning problem in the speed control system of a motor such as a permanent magnet synchronous servo motor (PMSM). The controlled object is a permanent magnet synchronous motor with a rated power of 750W and a rated speed of 3000rpm, and the sampling period is T. s=0.001s, the motor speed setting modes are two (i.e., Mode 1 and Mode 2). Mode 1: Unit step mode, the motor speed jumps from 0 rpm to 1500 rpm (normalized to 1 for later comparison); Mode 2: The motor speed follows sin(2πt), and the motor speed change amplitude is 750 rpm (normalized to 0.5 for later comparison). T s =0.001s, where 's' represents time in seconds.

[0070] Let the continuous transfer function G(s) of the motor speed loop be:

[0071] (1).

[0072] Where a, b, and c are all calculation coefficients, and preferably a, b, and c take values ​​of 0.125, 7, and 50, respectively. s in formula (1) represents the Laplace operator, i.e., the operator variable in the Laplace transform. The motor speed closed-loop system is approximated as a second-order system, such as the continuous transfer function, i.e., formula (1). Here, the second-order transfer function is initialized.

[0073] With sampling period T s Discretizing the continuous transfer function G(s) of the motor speed closed-loop system at 0.001s (e.g., using the zero-order hold method) yields the discrete transfer function G(z) after Z-transformation:

[0074] (2).

[0075] Where n2, n3, d2, and d3 represent the calculated coefficients, and z represents the Z-transform operator. The calculated coefficients n2, n3, d2, and d3 are the coefficients in the discretized transfer function obtained by the Z-transform.

[0076] In the motor speed closed-loop system, a positional discrete PID controller is used. The control law and state variables of the positional discrete PID controller are set as follows:

[0077] (3).

[0078] Where e(k) is the error between the instruction and the feedback. Here, yout(k) is the control command for the motor speed loop, yout(k) is the system feedback output, and u(k) is the output of the PID controller, i.e., the control quantity. p K i K dHere are the PID control parameters; n2, n3, d2, and d3 all represent calculation coefficients, u(k-1) is the control quantity at step k-1, u(k-2) is the control quantity at step k-2, youout(k-1) is the feedback at step k-1, and youout(k-2) is the feedback at step k-2. In formula (3), the calculation coefficients n2, n3, d2, and d3 from formula (2) are introduced into youout(k) for feedback output calculation.

[0079] To prevent actuator saturation in the positional discrete PID controller, the control quantity u(k) of the positional discrete PID controller is limited:

[0080] (4).

[0081] Step 3: Fitness assessment, followed by step 4.

[0082] In step 3, the fitness assessment module is used to perform fitness assessment.

[0083] In the fitness evaluation module, the fitness function B(k) is an evaluation index function for algorithm optimization. The smaller its value, the better the control performance of the PID controller parameters of that group. The fitness function B(k) designed in the present invention integrates following error, control energy, and response smoothness, and is a multi-objective fusion weighted index.

[0084] Step 4: Use the Rime algorithm (i.e., the rime algorithm) to find the optimal solution, and then proceed to step 5.

[0085] Step 5: Determine if the maximum number of iterations has been reached. If yes, output the optimal servo motor PID speed controller parameters and output the response curve, i.e., the speed feedback of the motor. The curve, such as Figure 7 and Figure 9 The curve shown; otherwise, return to step 2 to continue optimizing the servo motor PID speed controller parameters.

[0086] In the iterative optimization of steps 2 to 5, the operations include simulation evaluation, algorithm update, and loop determination.

[0087] Among them, simulation evaluation refers to: in the PID controller parameters (i.e., proportional coefficient K) p Integral coefficient K i and differential coefficient K dWithin the feasible solution space of ), a set of "frost particle" positions are randomly generated. Each particle (i.e., each set of "frost particle" positions) represents a set of PID controller parameters. These (i.e., each set of PID controller parameters) are substituted into the controlled object (such as a motor) for digital closed-loop simulation (such as a motor speed control system). The performance (i.e., fitness value) of these (i.e., each set of PID controller parameters) is calculated based on the fitness function.

[0088] Algorithm update refers to the Rime algorithm guiding the particle swarm to move towards a region with a better fitness value, based on the Rime algorithm's unique "soft frost search" and "hard frost puncture" mechanisms.

[0089] The iterative decision refers to repeating steps 2 to 5 until the maximum number of iterations is reached or the accuracy requirement is met; finally, the historical best PID controller parameters and response curve are output.

[0090] This invention proposes a parameter optimization scheme for a servo motor PID speed controller based on an improved frost algorithm. A closed-loop system control model is built based on initialization parameters and a position-based PID controller. A proposed fitness function considering multiple objectives is introduced into the frost algorithm to achieve global optimization. Since the fitness function integrates following error, control energy, and response smoothness, it is a weighted index that fuses multiple objectives, resulting in higher control output accuracy and stronger robustness.

[0091] In some implementations, in step S210, a setpoint is given based on the motor's rotational speed. The speed feedback of the motor and the control quantity of the PID controller The specific process of evaluating the performance of the PID controller under the set PID control parameters using the set fitness function B(k) and obtaining the evaluation results is illustrated in the following exemplary description.

[0092] The following is combined with Figure 3 The flowchart shown is a schematic diagram of an embodiment of the method of the present invention, which uses a set fitness function B(k) to evaluate the performance index of the PID controller under set PID control parameters. The specific process of using the set fitness function B(k) to evaluate the performance index of the PID controller under set PID control parameters in step S210 is further explained, including steps S310 to S340.

[0093] Step S310: Within the set simulation time domain T, based on the given speed of the motor... The speed feedback of the motor and the control quantity of the PID controller Determine the instantaneous performance index at step k. .

[0094] Step S320: Within the set simulation time domain T, the motor speed feedback quantity from step k is... The speed feedback amount of the motor in step k-1. The difference is denoted as the smoothness penalty term S(k) at step k.

[0095] Step S330: Within the set simulation time domain T, based on the instantaneous performance index of step k... The smoothness penalty term S(k) at step k is used to determine the expression of the fitness function B(k) at step k.

[0096] Step S340: The fitness function B(k) is calculated using the expression in step k, and the calculated result is used as the evaluation result to evaluate the performance index of the PID controller under the set PID control parameters.

[0097] In the solution of this invention, a set group optimization algorithm (such as the rime algorithm) is combined, and an output reverse change penalty term is introduced into the fitness function. When the output of the motor speed control system changes in reverse (i.e., callback or oscillation after overshoot), an additional penalty value is applied to achieve global optimization, which can reduce the speed tracking error of the motor and effectively suppress the oscillation of the motor control system, so as to make the output accuracy of motor speed control higher.

[0098] In some implementations, in step S330, based on the instantaneous performance index of step k... The specific process of determining the expression of the fitness function B(k) in step k, along with the smoothness penalty term S(k) in step k, is illustrated in the following exemplary description.

[0099] The following is combined with Figure 4 The method of the present invention shown is based on the instantaneous performance index of the k-th step. A schematic diagram illustrating an embodiment of determining the expression of the set fitness function B(k) in step k, based on the smoothness penalty term S(k) in step k, further illustrates step S330 based on the instantaneous performance index in step k. The specific process of determining the expression of the fitness function B(k) in step k, along with the smoothness penalty term S(k) in step k, includes steps S410 to S430.

[0100] Step S410: Determine whether the smoothness penalty term S(k) in step k is greater than or equal to 0.

[0101] Step S420: If it is determined that the smoothness penalty term S(k) in step k is greater than or equal to 0, then the speed setpoint of the motor is... The speed feedback of the motor and the control quantity of the PID controller The fitness function B(k) is determined to be the first expression at step k.

[0102] Step S430: If it is determined that the smoothness penalty term S(k) in step k is less than 0, then the speed setpoint of the motor is... The speed feedback of the motor The control quantity of the PID controller And the smoothness penalty term S(k) in step k, determine that the expression of the fitness function B(k) in step k is the second expression.

[0103] In this invention, a pre-defined swarm optimization algorithm (such as the rime algorithm) is used, and a penalty term for output reversal is introduced into the fitness function. When the output of the motor speed control system exhibits a reversal (i.e., a callback or oscillation after overshoot), an additional penalty value is applied. This design ensures that the optimized PID controller parameters not only reduce the motor's speed tracking error but also effectively suppress oscillations in the motor control system, improving its stability and engineering practicality. Thus, under various desired input signals, the control objective of small overshoot, short settling time, low steady-state error, and accurate tracking of the motor control system is achieved. This solves the problems of slow convergence, premature convergence, and balance exploration encountered when using swarm intelligent optimization algorithms to optimize PID controller parameters.

[0104] In some implementations, in step S420, the first expression is as follows:

[0105] ;

[0106] .

[0107] In step S430, the second expression is as follows:

[0108] .

[0109] in, This represents the evaluation result calculated at step k based on the set fitness function B(k). This represents the evaluation result calculated at step k-1 based on the set fitness function B(k). This represents the instantaneous performance index at step k-1. Indicates the weighted calculation coefficients and <1, This represents the setpoint speed of the motor at step k-1. The speed feedback amount of the motor in step k-1. The error, This represents the control quantity of the PID controller at step k-1; Indicates the penalty coefficient;

[0110] ;

[0111] K p K i K d The parameters are, in order, the proportional parameter, integral parameter, and derivative parameter in the PID control parameters of the PID controller.

[0112] like Figure 6 As shown, the overall process of a servo motor PID speed controller parameter optimization method based on an improved rime ice algorithm also includes:

[0113] In step 3, within the fitness evaluation module, for example, the simulation duration is 2 seconds, the sampling period is 0.001 seconds (i.e., 2000 steps), and the sampling duration for the k-th step is k * 0.001 seconds. Here, the instantaneous performance index f(k) for the k-th step is defined as:

[0114] (5).

[0115] The optimization objective of the fitness function B(k) is to minimize the cumulative error over the entire simulation time domain.

[0116] When S(k) = yout(k) - yout(k-1) ≥ 0, the fitness function B(k) is defined as:

[0117] (6).

[0118] When S(k) = yout(k) - yout(k-1) < 0, the fitness function B(k) becomes:

[0119] (7).

[0120] In formulas (5), (6) and (7), f(k-1) is the instantaneous performance index of the (k-1)th step, e(k-1) is the error between the instruction and feedback of the (k-1)th step, and u(k-1) is the control quantity of the (k-1)th step. The weighted value is preferably 0.999. The value of the optimization objective obtained from the fitness function B(k) at step k-1 is... Let S(k) be the fitness value at step k-1. S(k) is the smoothness penalty term, and P... eHere, P is the penalty coefficient, and T is the simulation step size, which is 2000 steps in this case. e The penalty coefficient is set to 100. It needs to be evaluated based on the results of S(k) and the response of yout(k). If the system still has a slight overshoot, the penalty coefficient can be increased appropriately; if the system response is found to be too slow, the value should be decreased. A penalty is applied when the output (i.e., the control quantity) experiences an undesirable sharp drop. It can effectively reduce overshoot (no overshoot or low overshoot) and oscillation. By integrating multiple performance constraints, such as the following error e(k), control energy u(k) and response smoothness term S(k), the optimized controller can simultaneously possess good dynamic response and robustness.

[0121] In the scheme of this invention, a set population optimization algorithm (such as the rime algorithm) is combined, and an output reverse change penalty term is introduced into the fitness function. When the output of the motor speed control system shows a reverse change (i.e., a callback or oscillation after overshoot), an additional penalty value is applied, which has strong robustness. By designing a fitness function with multi-objective fusion, the optimized PID controller can not only track the unit step signal well, but also show excellent tracking accuracy and stability for continuously changing signals such as sine waves, demonstrating good robustness.

[0122] In some implementations, the set population optimization algorithm includes: the rime algorithm.

[0123] In step S220, based on the evaluation results, a set group optimization algorithm is used to optimize the set PID control parameters to obtain optimized PID control parameters, including:

[0124] Based on the evaluation results, the rime ice algorithm is used to optimize the set PID control parameters, resulting in optimized PID control parameters.

[0125] like Figure 6 As shown, the overall process of a servo motor PID speed controller parameter optimization method based on an improved rime ice algorithm also includes:

[0126] In step 4, the Rime optimization module is used to perform Rime algorithm (i.e., rime algorithm) optimization.

[0127] In the Rime optimization module, parameter optimization is mainly carried out through the soft frost search strategy (i.e., global exploration, simulating the random motion of soft frost particles to enhance the global exploration capability of the algorithm) and the hard frost puncture mechanism (i.e., local development, accelerating convergence by exchanging information through dimensional cross-exchange between the optimal solution and the current solution).

[0128] First, the population is initialized by setting up i individuals (i is a positive integer), with each individual representing a set of PID controller parameters x.i =[K p K i K d The initial population is randomly generated within the search space.

[0129] (8).

[0130] Among them, U b and L b These represent the upper and lower limits of the PID controller parameter values, respectively. Here, X is defined as... i =[x i1 x i2, x i3··· x ij ], where i is the i-th hoarfrost individual and j is the j-th PID dimension (3≥j≥1).

[0131] Introducing rime ice growth factor R to control the search step size:

[0132] (9).

[0133] Where h represents the calculated coefficient, and h is a uniformly distributed random number between 0 and 1; t is the current iteration number; T max To determine the maximum number of iterations, W is set to 5 as the parameter for soft frost. () represents the floor function.

[0134] The adhesion coefficient E is defined as:

[0135] (10).

[0136] Soft frost position update strategy: If h < E, then:

[0137] (11).

[0138] Where x best,j It represents the j-th dimension component of the current global optimal solution. The new positions of the population are updated using the frost algorithm.

[0139] After normalizing the fitness values, we obtain B(X). i B(X) i ) represents the fitness value of the i-th individual.

[0140] Hard frost puncture strategy: If h < B(Xi), then:

[0141] (12).

[0142] For the updated out-of-bounds individuals, a boundary absorption strategy is adopted:

[0143] (13).

[0144] Greedy selection mechanism strategy: For each individual, if the new position has better fitness, it is replaced to ensure that the population quality always evolves towards a better direction and finds the optimal solution.

[0145] (14).

[0146] Where, x best,j For the best historical PID, x new,i,,j The optimal PID is obtained by comparing the individuals after the rime algorithm update using the fitness function.

[0147] In the present invention, to compensate for the poor local search capability of the rime algorithm due to randomness, the present invention uses the rime algorithm to globally optimize the PID controller parameters of the second-order motor speed control system, and introduces a penalty term for output reversal in the fitness function. When the output of the motor control system shows a reversal (i.e., callback or oscillation after overshoot), an additional penalty is applied, which solves the problem in related schemes that the fitness function only focuses on error accumulation and ignores system oscillation, so that the optimized PID controller parameters have both high accuracy and high stability.

[0148] In some implementations, the fitness function B(k) is set based on the motor speed given within a set simulation time domain T. Speed ​​feedback of the motor The goal of optimization is to minimize the cumulative value of the error e(k).

[0149] In step S240, the optimal PID control parameters are determined from the historical PID control parameters, including:

[0150] In the historical PID control parameters, the motor speed setpoint will be within the set simulation time domain T. Speed ​​feedback of the motor The PID control parameters that minimize the cumulative value of the error e(k) are determined as the optimal PID control parameters.

[0151] Preferably, when the PID controller is a positional discrete PID controller, the control quantity u(k) of the positional discrete PID controller is subjected to amplitude limiting processing, such as limiting the amplitude of the control quantity u(k) of the positional discrete PID controller to within a set amplitude A, where the set amplitude A can be selected as 10 in formula (4).

[0152] Figure 7This is a schematic diagram of the step output curve when the PID controller controls the output quantity. It can display the curve diagram of the PID control output quantity versus the number of control feedbacks. Figure 8 This is a schematic diagram showing the relationship between the optimal fitness of the step output and the number of iterations when the output is controlled by a PID controller. Figure 9 This is a schematic diagram of the sinusoidal output curve when the PID controller controls the output quantity. It can display the curve diagram of the PID control output quantity versus the number of control feedback cycles. Figure 10 This is a schematic diagram showing the relationship between the optimal fitness of the sinusoidal output and the number of iterations when the PID controller controls the output.

[0153] from Figure 7 , Figure 8 , Figure 9 and Figure 10 As can be seen, when tracking a step signal, the optimized PID controller parameters did not overshoot after being processed by closed-loop control, and reached the optimal fitness value after only 8 iterations. When tracking a continuously changing sine wave signal, the phase lag was small, the tracking accuracy was high, and the robustness was strong; the optimal fitness value was reached after only 6 iterations. Thanks to the unique soft-hard frost balancing mechanism of the Rime algorithm, the solution of this invention exhibits faster convergence speed and stronger ability to escape local optima in motor control PID controller parameter optimization, demonstrating good robustness.

[0154] In the scheme of this invention, a set swarm optimization algorithm (such as the frost algorithm) is combined, and an output reverse change penalty term is introduced into the fitness function. When the output of the motor speed control system shows a reverse change (i.e., a callback or oscillation after overshoot), an additional penalty value is applied, which has superior performance. Thanks to the unique soft and hard frost balancing mechanism of the frost algorithm, the scheme of this invention shows a faster convergence speed and a stronger ability to escape local optima in PID controller parameter optimization. Compared with the swarm intelligent optimization algorithms (such as PSO and GA) in related schemes, it can obtain a PID controller with better performance.

[0155] In this invention, the fitness objective function is proposed as a combination of following error, control energy, and response smoothness. While related schemes only consider following error in their fitness objective functions, the fitness function designed in this invention integrates following error, control energy, and response smoothness, making it a weighted index that considers multi-objective fusion. This multi-objective fitness function proposed in this invention is not only applicable to the Rime algorithm but also widely applicable to other control optimization algorithms.

[0156] The technical solution of this embodiment addresses the tuning problem of PID controller parameters in the speed control system of a motor, such as a permanent magnet synchronous servo motor. A PID controller is used in the speed loop of the motor's control system. Closed-loop simulation control is performed within a set simulation time domain T using set PID control parameters. Based on the motor's speed setpoint r(k), within the set simulation time domain T, a set sampling period T is used. s Obtain the setpoint speed of the motor. Obtain the speed feedback of the motor. And obtain the control quantity of the PID controller. Based on the speed setpoint of the motor The speed feedback of the motor and the control quantity of the PID controller The set fitness function B(k) and a set swarm optimization algorithm are used to optimize the set PID control parameters to determine the optimal PID control parameters. A PID controller is then used in the speed loop of the motor control system to perform PID control on the motor speed according to the optimal PID control parameters. Thus, in the motor speed PID control, based on a set swarm optimization algorithm (such as the rime algorithm), a fitness function combining the following error e(k), control energy u(k), and response smoothness S(k) is employed. This motor controller optimizes PID control parameters to improve the accuracy of motor speed control. It is relevant to the manufacturing of industrial automatic control system devices.

[0157] Specifically, in the solution of this invention, by addressing the tuning problem of PID controller parameters in the speed control system of a motor such as a permanent magnet synchronous servo motor, a position-type discrete PID controller is used in the speed loop of the motor speed closed-loop system with the set PID control parameters (K). p K i K d Closed-loop simulation control is performed within the set simulation time domain T, according to the set sampling period T. s Obtain the motor speed setpoint as instructed. The motor speed feedback quantity is as follows: In a motor control system, the control quantity of a speed PID controller, such as a position-type discrete PID controller, is... The setpoint is based on the motor speed. Motor speed feedback Control quantity of the speed PID controller The motor speed is given by a setpoint within the simulated time domain T. Motor speed feedback The optimization objective is to minimize the cumulative error e(k). The fitness function B(k) is used to evaluate the speed PID controller under the set PID control parameters (K). p K i K d Control quantity under ) The performance indicators, based on the evaluation results of the fitness function B(k), are used to evaluate the speed PID controller under the set PID control parameters (K). The Rime algorithm (i.e., the rime algorithm) is employed. p K i K d ) to perform optimization and determine the optimal PID control parameters (K) p K i K d Based on the optimal PID control parameters (K) p K i K d This device controls the motor speed; therefore, by using a fitness function that combines following error, control energy, and response smoothness in the PID control of the motor speed based on the frost algorithm, the accuracy of motor speed control is improved by optimizing the PID control parameters. This motor controller relates to the manufacturing of industrial automatic control system devices.

[0158] According to an embodiment of the present invention, a motor speed control device corresponding to a motor speed control method is also provided. See also Figure 5 The diagram shows a structural schematic of an embodiment of the device of the present invention. This motor controller relates to the manufacture of industrial automatic control system devices. The motor speed control device may include: an acquisition unit 102 and a control unit 104.

[0159] The control unit 104 is configured to employ a PID controller in the speed loop of the motor control system, performing closed-loop simulation control with set PID control parameters within a set simulation time domain T; the set simulation time domain T includes the entire simulation time domain T. The specific functions and processing of the control unit 104 are described in step S110.

[0160] The acquisition unit 102 is configured to perform sampling at a set sampling period T within a set simulation time domain T. s Obtain the setpoint speed of the motor. Obtain the speed feedback of the motor. And obtain the control quantity of the PID controller. Wherein, the motor speed is a given value, such as an instruction. ; Obtain the speed feedback value of the motor, such as feedback And obtain the control input of the PID controller, such as the control input of a positional discrete PID controller. The specific functions and processing of the acquisition unit 102 are described in step S120.

[0161] The control unit 104 is also configured to base its input speed on the speed setpoint of the motor. The speed feedback of the motor and the control quantity of the PID controller The set fitness function B(k) and the set population optimization algorithm are used to optimize the set PID control parameters to determine the optimal PID control parameters. The specific functions and processing of this control unit 104 are further described in step S130.

[0162] The control unit 104 is further configured to employ a PID controller in the speed loop of the motor control system to perform PID control on the motor speed according to the optimal PID control parameters. The specific functions and processing of the control unit 104 are further described in step S140.

[0163] In the solution of this invention, a PID controller is used in the speed loop of the motor control system. Closed-loop simulation control is performed within a set simulation time domain T using set PID control parameters. Based on the motor's speed setpoint r(k), within the set simulation time domain T, a set sampling period T is used. s Obtain the setpoint speed of the motor. Obtain the speed feedback of the motor. And obtain the control quantity of the PID controller. Based on the speed setpoint of the motor The speed feedback of the motor and the control quantity of the PID controller The set fitness function B(k) and a set swarm optimization algorithm are used to optimize the set PID control parameters to determine the optimal PID control parameters. A PID controller is then used in the speed loop of the motor control system to perform PID control on the motor speed according to the optimal PID control parameters. Thus, in the motor speed PID control, based on a set swarm optimization algorithm (such as the rime algorithm), a fitness function combining the following error e(k), control energy u(k), and response smoothness S(k) is employed. Optimize PID control parameters to improve the accuracy of motor speed control.

[0164] Since the processing and functions implemented by the device in this embodiment are basically the same as the embodiments, principles and examples of the aforementioned methods, any details not covered in the description of this embodiment can be found in the relevant descriptions in the aforementioned embodiments, and will not be repeated here.

[0165] According to an embodiment of the present invention, a motor controller corresponding to a motor speed control device is also provided. This motor controller may include the motor speed control device described above. This motor controller relates to the manufacture of industrial automatic control system devices.

[0166] Since the processing and functions implemented by the motor controller in this embodiment are basically the same as those in the embodiments, principles and examples of the aforementioned device, any details not covered in this embodiment can be found in the relevant descriptions in the aforementioned embodiments, and will not be repeated here.

[0167] According to an embodiment of the present invention, a motor corresponding to a motor speed control device is also provided. This motor may include: the motor speed control device described above, or the motor controller described above. This motor controller relates to the manufacture of industrial automatic control system devices.

[0168] Since the processing and functions implemented by the motor in this embodiment are basically the same as the embodiments, principles and examples of the aforementioned device, any details not covered in this embodiment can be found in the relevant descriptions in the aforementioned embodiments, and will not be repeated here.

[0169] According to an embodiment of the present invention, a computer program product corresponding to a motor speed control method is also provided, comprising a computer program that, when executed by a processor, implements the steps of the motor speed control method described above.

[0170] Since the processing and functions implemented by the product in this embodiment are basically the same as the embodiments, principles and examples of the aforementioned methods, any details not covered in the description of this embodiment can be found in the relevant descriptions in the aforementioned embodiments, and will not be repeated here.

[0171] According to an embodiment of the present invention, a storage medium corresponding to a motor speed control method is also provided, the storage medium including a stored program, wherein, when the program is executed, the device where the storage medium is located executes the steps of the motor speed control method described above.

[0172] Since the processing and functions implemented by the storage medium in this embodiment are basically the same as the embodiments, principles and examples of the aforementioned methods, any details not covered in this embodiment can be found in the relevant descriptions in the aforementioned embodiments, and will not be repeated here.

[0173] In summary, it is readily understood by those skilled in the art that, without conflict, the aforementioned advantageous methods can be freely combined and superimposed.

[0174] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of the claims of the present invention.

Claims

1. A method for controlling the speed of an electric motor, characterized in that, The method for controlling the speed of a motor includes: tuning the PID control parameters of a PID controller in the speed loop of the motor control system; and the motor speed control method includes: A PID controller is used in the speed loop of the motor control system. Closed-loop simulation control is performed with set PID control parameters within the set simulation time domain T. According to the set sampling period T s Obtain the setpoint speed of the motor. Obtain the speed feedback of the motor. And obtain the control quantity of the PID controller. ; Based on the speed setpoint of the motor The speed feedback of the motor and the control quantity of the PID controller The set fitness function B(k) and the set population optimization algorithm are used to optimize the set PID control parameters in order to determine the optimal PID control parameters. The motor speed is controlled by PID according to the optimal PID control parameters.

2. The motor speed control method according to claim 1, characterized in that, Based on the speed setpoint of the motor The speed feedback of the motor and the control quantity of the PID controller The set fitness function B(k) and the set population optimization algorithm are used to optimize the set PID control parameters to determine the optimal PID control parameters, including: Based on the speed setpoint of the motor The speed feedback of the motor and the control quantity of the PID controller The performance index of the PID controller under the set PID control parameters is evaluated by using the set fitness function B(k), and the evaluation result is obtained. Based on the evaluation results, the set PID control parameters are optimized using a set group optimization algorithm to obtain optimized PID control parameters; both the set PID control parameters and the optimized PID control parameters are stored in the historical PID control parameters. Then return and perform closed-loop simulation control with the optimized PID control parameters within the set simulation time domain T; This process is repeated until the maximum number of iterations is reached. Then, the optimal PID control parameters are determined from the historical PID control parameters.

3. The motor speed control method according to claim 2, characterized in that, Based on the speed setpoint of the motor The speed feedback of the motor and the control quantity of the PID controller The performance of the PID controller under the set PID control parameters is evaluated using a set fitness function B(k), and the evaluation results are obtained, including: Within the set simulation time domain T, based on the given speed of the motor... The speed feedback of the motor and the control quantity of the PID controller Determine the instantaneous performance index at step k. ; The motor speed feedback amount in step k. The speed feedback amount of the motor in step k-1. The difference is denoted as the smoothness penalty term S(k) at step k. Based on the instantaneous performance index at step k The smoothness penalty term S(k) at step k is used to determine the expression of the fitness function B(k) at step k. The fitness function B(k) is calculated using the expression of the set fitness function at step k, and the calculated result is used as the evaluation result to evaluate the performance index of the PID controller under the set PID control parameters.

4. The motor speed control method according to claim 3, characterized in that, Based on the instantaneous performance index at step k Given the smoothness penalty term S(k) at step k, determine the expression for the fitness function B(k) at step k, including: Determine whether the smoothness penalty term S(k) in step k is greater than or equal to 0; If it is determined that the smoothness penalty term S(k) at step k is greater than or equal to 0, then the speed setpoint of the motor is used. The speed feedback of the motor and the control quantity of the PID controller The fitness function B(k) is determined to be the first expression at step k. If it is determined that the smoothness penalty term S(k) at step k is less than 0, then the speed setpoint of the motor is used. The speed feedback of the motor The control quantity of the PID controller And the smoothness penalty term S(k) in step k, determine that the expression of the fitness function B(k) in step k is the second expression.

5. The motor speed control method according to claim 4, characterized in that, in, The first expression is as follows: ; ; The second expression is as follows: ; in, This represents the evaluation result calculated at step k based on the set fitness function B(k). This represents the evaluation result calculated at step k-1 based on the set fitness function B(k). This represents the instantaneous performance index at step k-1. Indicates the weighted calculation coefficients and <1, This represents the setpoint speed of the motor at step k-1. The speed feedback amount of the motor in step k-1. The error, This represents the control quantity of the PID controller at step k-1; Indicates the penalty coefficient; ; K p K i K d The parameters are, in order, the proportional parameter, integral parameter, and derivative parameter in the PID control parameters of the PID controller.

6. The method for controlling the speed of a motor according to any one of claims 2 to 5, characterized in that, in, The established population optimization algorithms include: the rime algorithm; Based on the evaluation results, the set swarm optimization algorithm is used to optimize the set PID control parameters, resulting in optimized PID control parameters, including: Based on the evaluation results, the rime ice algorithm is used to optimize the set PID control parameters to obtain the optimized PID control parameters. And / or, The fitness function B(k) is set based on the motor speed given within the set simulation time domain T. Speed ​​feedback of the motor The optimization objective is to minimize the cumulative value of the error e(k). From the historical PID control parameters, the optimal PID control parameters are determined, including: In the historical PID control parameters, the motor speed setpoint will be within the set simulation time domain T. Speed ​​feedback of the motor The PID control parameters that minimize the cumulative value of the error e(k) are determined as the optimal PID control parameters. And / or, When the PID controller is a positional discrete PID controller, the control quantity u(k) of the positional discrete PID controller is subjected to amplitude limiting.

7. A speed control device for an electric motor, characterized in that, include: The control unit is configured to use a PID controller in the speed loop of the motor's control system to perform closed-loop simulation control with set PID control parameters within a set simulation time domain T. The acquisition unit is configured to operate at a set sampling period T. s Obtain the setpoint speed of the motor. Obtain the speed feedback of the motor. And obtain the control quantity of the PID controller. ; The control unit is also configured to base its input speed on the motor speed setpoint. The speed feedback of the motor and the control quantity of the PID controller The set fitness function B(k) and the set population optimization algorithm are used to optimize the set PID control parameters in order to determine the optimal PID control parameters. The control unit is also configured to perform PID control on the motor speed according to the optimal PID control parameters.

8. A motor controller, characterized in that, include: The motor speed control device as described in claim 7.

9. An electric motor, characterized in that, include: The motor speed control device as described in claim 7, or the motor controller as described in claim 8.

10. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, the device containing the storage medium is controlled to perform the motor speed control method according to any one of claims 1 to 6.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the motor speed control method according to any one of claims 1 to 6.