Motor speed control method, device, terminal equipment and storage medium
By improving the Arctic Puffin optimization algorithm, the PID parameters are optimized using speed error and rate of change, the problem of reduced accuracy of the PID controller is solved, and more efficient motor speed control is achieved.
Patent Information
- Application Number
- CN202411854612.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-12-17
AI Technical Summary
After the introduction of the optimization algorithm, the PID controller's control accuracy of the motor speed is reduced, and it is unable to effectively adapt to system parameter changes and external interference.
The Arctic Puffin optimization algorithm is improved, and the PID parameters are optimized and solved by using the speed error and the speed error change rate as the fitness function, and then the control amount is calculated to adjust the motor speed.
It improves the accuracy of the PID controller to control the motor speed, enhances the ability to adapt to system parameter changes and external interference, and improves the stability and response speed of the system.
Smart Images

Figure CN119324648B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent control technology, and in particular to a motor speed control method, device, terminal equipment and storage medium. Background Art
[0002] At present, most commercial motor drive systems use a proportional integral differential controller (PID) to achieve speed control. PID control is simple and easy to implement, and can provide good control effects in many cases. However, PID control also has some limitations:
[0003] (1) PID control relies on real-time measurement and adjustment of system errors. When faced with complex motor systems with multiple variables, nonlinearity, and strong coupling, PID control cannot provide sufficient control accuracy and response speed.
[0004] (2) PID control has poor adaptability to changes in system parameters and external disturbances, resulting in a decrease in the performance of the control system when system parameters change or are subject to external disturbances;
[0005] (3) The speed regulation system based on PID control has problems such as slow speed response, insufficient anti-interference ability and system instability.
[0006] These problems limit the application of PID control in high-performance motor speed control systems. In order to meet the high performance requirements of motor speed control systems, more advanced control strategies need to be proposed. At present, in the process of PID control, optimization algorithms are introduced to make up for the above shortcomings, such as the introduction of the Arctic Puffin optimization algorithm. However, the inventors found that the introduction of the optimization algorithm has brought new problems to the PID control strategy, reducing the accuracy of the PID controller when controlling the motor speed. Summary of the invention
[0007] The embodiments of the present invention provide a motor speed control method, apparatus, terminal device and storage medium to solve the problem that the control accuracy of the motor speed by the PID controller is reduced after the optimization algorithm is introduced.
[0008] In a first aspect, an embodiment of the present invention provides a motor speed control method, comprising:
[0009] Collect the current speed and target speed of the target motor;
[0010] Determine the speed error according to the current speed and the target speed;
[0011] Input the speed error into the PID controller to obtain the control quantity;
[0012] Based on the control quantity, the speed of the target motor is controlled;
[0013] Among them, in the PID controller, the PID parameters are optimized and solved based on the improved Arctic Puffin optimization algorithm, so as to calculate the control quantity based on the solved PID parameters; the fitness function of the improved Arctic Puffin optimization algorithm is determined based on the speed error and the speed error change rate.
[0014] In one possible implementation, the fitness function of the improved Arctic Puffin optimization algorithm is:
[0015]
[0016] in, , is the weight; is the speed error; is the speed error change rate.
[0017] In a possible implementation, in the improved Arctic Puffin optimization algorithm, population initialization is performed based on the improved Tent chaotic map;
[0018] Among them, random variables are introduced into the improved Tent chaotic map;
[0019] The process of population initialization based on the improved Tent chaotic map is:
[0020]
[0021]
[0022] In the formula, represents a chaotic sequence, Indicates i The Arctic Puffin t The position of the iteration process, c is a constant parameter between 0 and 1, ub and lb Represent the upper and lower bounds of the search space respectively, N is the number of individuals in the population, T is the maximum number of iterations.
[0023] In one possible implementation, the optimization steps of the improved Arctic Puffin Optimization Algorithm are as follows:
[0024] Based on the fitness function, determine the fitness values of individuals in each population, and rearrange the population in order from small to large fitness values;
[0025] Select multiple candidate population individuals from the population to form a candidate population, and use a weighted average optimization algorithm to calculate the weighted average position of the candidate population;
[0026] Based on the positions of the optimal population individuals and the weighted average positions of the candidate populations, the search space is updated to generate a new population.
[0027] In one possible implementation, the weighted average position of the candidate population is calculated by the following formula:
[0028]
[0029]
[0030]
[0031] in, is the weighted average position; is the number of individuals in the candidate population; For the i The location of each candidate population individual; is the sum of the fitness values of the selected candidates; For the i The fitness value of each candidate population individual.
[0032] In one possible implementation, the new population is generated by the following formula:
[0033]
[0034] in, is the position of the optimal population individual.
[0035] In one possible implementation, in a PID controller, the control variable is calculated by the following formula:
[0036]
[0037] in, K P is the proportionality coefficient; K I is the integration coefficient; K D is the differential coefficient.
[0038] In a second aspect, an embodiment of the present invention provides a motor speed control device, comprising:
[0039] The speed acquisition module is used to acquire the current speed and target speed of the target motor;
[0040] An error calculation module, used to determine a speed error according to a current speed and a target speed;
[0041] The optimization solution module is used to input the speed error into the PID controller to obtain the control quantity;
[0042] A speed control module is used to control the speed of the target motor based on the control amount;
[0043] Among them, in the PID controller, the PID parameters are optimized and solved based on the improved Arctic Puffin optimization algorithm, so as to calculate the control quantity based on the solved PID parameters; the fitness function of the improved Arctic Puffin optimization algorithm is determined based on the speed error and the speed error change rate.
[0044] In a third aspect, an embodiment of the present invention provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method described in the first aspect or any possible implementation of the first aspect are implemented.
[0045] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect or any possible implementation of the first aspect are implemented.
[0046] The embodiment of the present invention provides a motor speed control method, device, terminal device and storage medium. In a traditional PID controller based on an Arctic puffin optimization algorithm, since the traditional Arctic puffin optimization algorithm uses a single speed error as a fitness function, the fitness value calculated in this way cannot accurately reflect the dynamic performance of the motor rotation process. Based on this, in this embodiment, the Arctic puffin optimization algorithm is improved by taking the speed error and the speed error change rate as the fitness function, so as to solve the PID parameters based on the improved Arctic puffin optimization algorithm, and then calculate the control amount according to the solved PID parameters and the speed error, so as to adjust the current speed of the motor to the target speed through the control amount. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0048] Figure 1 is a flow chart of an implementation method of a motor speed control method provided by an embodiment of the present invention;
[0049] Figure 2is a flow chart of a motor speed control method provided by an embodiment of the present invention;
[0050] Figure 3 is a schematic structural diagram of a motor speed control device provided by an embodiment of the present invention;
[0051] Figure 4 It is a schematic diagram of a terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0053] In order to make the purpose, technical solutions and advantages of the present invention more clear, specific embodiments will be described below in conjunction with the accompanying drawings.
[0054] Figure 1 FIG. 1 is a flow chart of the motor speed control method provided by an embodiment of the present invention. Figure 1 As shown, the method may include:
[0055] Step 110: Collect the current speed and target speed of the target motor.
[0056] Step 120: Determine the speed error according to the current speed and the target speed.
[0057] In this embodiment, the speed error=target speed-current speed.
[0058] Step 130: Input the speed error into the PID controller to obtain the control variable.
[0059] In this embodiment, there are certain limitations in the process of solving the PID parameters based on the traditional optimization algorithm, which not only affects the solution speed in the solution process, increases the amount of calculation in the solution process, but also makes the solution result inaccurate.
[0060] Therefore, in the example of the present invention, an improved Arctic Puffin optimization algorithm is introduced into the PID controller, and the PID parameters are optimized and solved by the algorithm, so as to determine the control quantity according to the PID parameters obtained by the optimized solution.
[0061] The following is an explanation of the improved Arctic Puffin optimization algorithm using S10-S30:
[0062] In this embodiment, in the traditional Arctic Puffin optimization algorithm, the improved Arctic Puffin optimization algorithm is obtained by improving the population initialization method, the fitness function and the method of generating a new population.
[0063] S10, the embodiment of the present invention takes into account that in the traditional Arctic Puffin optimization algorithm, the population initialization strategy cannot traverse the search space, and the uncertainty of random distribution will have an adverse effect on the convergence of the algorithm. In order to solve this problem, in the current research, the Tent chaotic mapping will be added to the population initialization strategy of the traditional Arctic Puffin optimization algorithm, and the random variables will be replaced by chaotic variables to make the population more evenly distributed in the search space, increase the population diversity and improve the convergence speed of the algorithm.
[0064] However, the introduction of Tent chaotic mapping will cause new problems. The introduction of chaotic variables will make the population initialization process easily fall into cycles and fixed points in some cases. To address this problem, this embodiment improves the Tent chaotic mapping and performs population initialization based on the improved Tent chaotic mapping.
[0065] In this embodiment, the improved Tent chaotic map is obtained by introducing random variables into the traditional Tent chaotic map, wherein the random variables can be expressed as:
[0066]
[0067] in, N is the number of individuals in the population.
[0068] Based on the improved Tent chaotic map, the population initialization process in the improved Arctic Puffin optimization algorithm can be expressed as:
[0069]
[0070]
[0071] In the formula, represents a chaotic sequence, Indicates i The Arctic Puffin t The position of the iteration process, c is a constant parameter between 0 and 1, ub and lb Represent the upper and lower bounds of the search space respectively, N is the number of individuals in the population, T is the maximum number of iterations.
[0072] S20, considering that in the traditional Arctic Puffin optimization algorithm, the fitness function is determined by a single parameter of the speed error, and then the fitness value is obtained, which cannot accurately reflect the dynamic performance of the motor speed control system. This embodiment introduces the speed error change rate on the basis of the original speed error, and determines the fitness value by the speed error and the speed error change rate.
[0073] Among them, the fitness function of the improved Arctic Puffin optimization algorithm can be expressed as:
[0074]
[0075] In the formula, , is the weight; is the speed error; is the speed error change rate.
[0076] S30, the traditional Arctic puffin optimization algorithm does not take into account the differences between individuals in the population, and ignores the impact of individuals in the population on the weighted average position and the optimal individual position, which is not conducive to the algorithm's rapid convergence to the global optimal solution. At the same time, the method of simply updating the population distribution based on the maximum value of the fitness function cannot reflect the advantages of population diversity.
[0077] Based on this problem, this embodiment improves the method of generating a new population by improving the individual positions of the candidate population.
[0078] The following optional embodiment is used to illustrate how the improved Arctic Puffin optimization algorithm generates a new population, or in other words, the optimization steps of the improved Arctic Puffin optimization algorithm are described:
[0079] Based on the fitness function, the fitness values of individuals in each population are determined, and the population is rearranged in order from small to large fitness values.
[0080] A plurality of candidate population individuals are selected from the population to form a candidate population, and a weighted average optimization algorithm is used to calculate the weighted average position of the candidate population.
[0081] Based on the positions of the optimal population individuals and the weighted average positions of the candidate populations, the search space is updated to generate a new population.
[0082] In this embodiment, the fitness values of each population individual are calculated according to the improved fitness function, and the population is rearranged in order of fitness value from small to large, and the population individual with the smallest fitness value is taken as the optimal population individual in the population.
[0083] Through calculation, multiple candidate population individuals are selected from the reordered population, and multiple candidate population individuals are recombined to form a candidate population. The weighted average position of the candidate population is calculated by the following formula:
[0084]
[0085]
[0086]
[0087] in, is the weighted average position; is the number of individuals in the candidate population; For the i The locations of the candidate population individuals; is the sum of the fitness values of the selected candidates; For the i The fitness value of each candidate population individual.
[0088] Using the weighted average position of the candidate population and the position of the optimal population individual, the search space is updated to generate a new population. Accordingly, the new population is generated by the following formula:
[0089]
[0090] in, is the position of the optimal population individual.
[0091] The contents described in S10-S30 are related descriptions of improving the Arctic Puffin optimization algorithm provided in this embodiment. The following describes the process of optimizing and solving the PID parameters based on the improved Arctic Puffin optimization algorithm through steps 131-135.
[0092] Step 131: Collect the current speed and target speed of the target motor. According to the current speed and target speed, determine the speed error initialization. Modified initialization parameters of the improved Arctic Puffin optimization algorithm, including the upper bound of the search space. ub and lower bound lb , the number of individuals in the population N , maximum number of iterations T , and the initial population is generated by improving the Tent chaotic mapping strategy.
[0093] Step 132: Calculate the fitness values of individuals in the initial population according to the improved fitness function.
[0094] Step 133: rearrange the population in order of fitness value from small to large, and select multiple candidate population individuals from the population through calculation to form a candidate population, and then calculate the weighted average position of the candidate population based on the position of each candidate population individual.
[0095] Step 134: Update the search space using the weighted average position and the position of the optimal population individual to generate a new population distribution.
[0096] Step 135: Update the position of the Arctic puffin population, calculate the fitness value of each new individual, and step 132, until the number of iterations reaches the maximum number of iterations, convert the position of the optimal population individual in the population into the PID parameters of the PID controller, and output the obtained PID parameters.
[0097] In an optional embodiment, step 135 may be implemented by the following steps:
[0098] Step 10, calculate the transition coefficient B and compare it with the specific constant coefficient C. If B>C, enter the air flight stage, otherwise enter the underwater foraging stage;
[0099] Among them, the excess coefficient B can be calculated by the following formula:
[0100]
[0101] Step 20, when B>C, it enters the aerial flight stage, and the Arctic puffins use two behavioral strategies, aerial search and swooping predation, to enhance the search process according to different situations. The search process under these different behavioral strategies can be expressed as:
[0102] The position update process of the air search strategy is:
[0103]
[0104]
[0105]
[0106] In the formula, For the updated position in the air search strategy; Indicates the current population i The location of individuals in a population; represents the position of a randomly selected individual in the current population; It is a random number generated by Levy flight function; D is the dimension constant; R is [1, N -1]; is a random number that conforms to the normal distribution.
[0107] The flight strategy in this phase enhances the global search capability of the algorithm, enabling it to better explore the problem space and increase the chances of discovering the global optimal solution.
[0108] The position update process of the diving predation strategy is:
[0109]
[0110]
[0111] In the formula, Updated position for diving predation strategy; S is the speed coefficient, which is used to adjust the displacement of the Arctic puffin during the dive, increase the randomness and diversity of the algorithm, and enhance the exploration ability of the Arctic puffin.
[0112] In this embodiment, in order to better calculate and screen the optimal solution, the position update formulas under the two behavior strategies are merged and updated to obtain new solutions, these solutions are sorted according to fitness, and the top solutions are selected. N Individuals from a population form a new population.
[0113]
[0114]
[0115]
[0116] in, is the updated position based on the two behavioral strategies; sort (·) indicates that the new population is sorted from small to large according to its fitness value.
[0117] Step 30, when B≤C, the underwater foraging phase begins. The Arctic puffins adopt three behavioral strategies according to different situations, namely, gathering foraging, intensifying search, and avoiding predators. The following is an explanation of these three behavioral strategies in the underwater foraging phase.
[0118] The position update process of the cluster foraging strategy is:
[0119]
[0120] In the formula, F stands for cooperation factor, and its main function is to regulate the predation behavior of Arctic puffins; , represents the position of a randomly selected individual in the population; , Is in the range [1, N-1] and is not equal to i A random number.
[0121] The location update process of the enhanced search strategy is:
[0122]
[0123]
[0124] In the formula, T Represents the total number of iterations; t Represents the current iteration number; rand Represents a random number.
[0125] The position update process of the predator avoidance strategy is:
[0126]
[0127] in, is a random number between [0,1].
[0128] In this embodiment, in order to ensure that the optimal population and optimal solution of these three stages do not conflict or error, the following formula is used to merge to determine the updated position of the underwater foraging stage:
[0129]
[0130]
[0131]
[0132] in, sort (·) indicates that the new population is sorted from small to large according to its fitness value.
[0133] Step 40, taking the updated individual fitness values of each population as the fitness values of the PID parameters, to calculate the fitness values of the PID parameters in each group of PID controllers in the population after the position update, and selecting a group of PID parameters with the smallest fitness value under the current number of iterations, and comparing it with a group of PID parameters with the smallest fitness value in the previous number of iterations, and taking a group of PID parameters with a smaller fitness value as the current optimal PID parameters. And restarting step 132, until the set number of iterations is reached, the corresponding current optimal PID parameters are output.
[0134] After determining the optimal PID parameters, calculate the control amount according to the following formula:
[0135]
[0136] in, K P is the proportionality coefficient; KI is the integration coefficient; K D is the differential coefficient.
[0137] Step 140: Based on the control amount, the speed of the target motor is controlled.
[0138] In this embodiment, after adjusting the rotation speed of the target motor based on the control amount, a new current rotation speed is obtained, and then a new control amount is determined according to the new current rotation speed and the target rotation speed until the target motor stops running.
[0139] It can be seen that this embodiment can overcome the limitations of the traditional method for solving PID parameters based on the Arctic Puffin algorithm and improve the control accuracy of the PID controller by improving the population initialization method, fitness function and method for generating a new population in the Arctic Puffin algorithm.
[0140] Figure 2 is a flow chart of the motor speed control method provided by an embodiment of the present invention, such as Figure 2 As shown, the method provided in this embodiment can be applied to a motor speed control system, and the system may include: a speed measurement module, an error calculation module, a PID controller module, an improved Arctic puffin optimization algorithm module and a motor drive module.
[0141] The motor driving module is used to drive the target motor to make the target motor start working.
[0142] After the target motor starts to work, the speed measurement module performs speed measurement to determine the current speed of the target motor, and sends the measured current speed to the error calculation module.
[0143] The error calculation module is based on the current speed and the target speed. r(t) , calculate the speed error and the speed error change rate, and use the calculated speed error and speed error change rate to solve the PID parameters of the PID controller through the improved Arctic Puffin optimization algorithm module.
[0144] The PID controller calculates the control quantity based on the solved PID parameters, speed error, and speed error change rate, and inputs the control quantity into the motor drive module to output a signal to adjust the speed of the target motor.
[0145] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0146] The following is an embodiment of the device of the present invention. For details not described in detail, reference may be made to the corresponding method embodiments described above.
[0147] Figure 3 The structure diagram of the motor speed control device provided by the embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:
[0148] like Figure 3 As shown, the motor speed control device 3 includes:
[0149] The speed acquisition module 31 is used to acquire the current speed and target speed of the target motor;
[0150] The error calculation module 32 is used to determine the speed error according to the current speed and the target speed;
[0151] The optimization solution module 33 is used to input the speed error into the PID controller to obtain the control quantity;
[0152] A speed control module 34, used to control the speed of the target motor based on the control amount;
[0153] Among them, in the PID controller, the PID parameters are optimized and solved based on the improved Arctic Puffin optimization algorithm, so as to calculate the control quantity based on the solved PID parameters; the fitness function of the improved Arctic Puffin optimization algorithm is determined based on the speed error and the speed error change rate.
[0154] In one possible implementation, the fitness function of the improved Arctic Puffin optimization algorithm is:
[0155]
[0156] in, , is the weight; is the speed error; is the speed error change rate.
[0157] In a possible implementation, in the improved Arctic Puffin optimization algorithm, population initialization is performed based on the improved Tent chaotic map;
[0158] Among them, random variables are introduced into the improved Tent chaotic map;
[0159] The process of population initialization based on the improved Tent chaotic map is:
[0160]
[0161]
[0162] In the formula, represents a chaotic sequence, Indicates i The Arctic Puffin t The position of the iteration process, c is a constant parameter between 0 and 1, ub and lb Represent the upper and lower bounds of the search space respectively, N is the number of individuals in the population, T is the maximum number of iterations.
[0163] In one possible implementation, the optimization steps of the improved Arctic Puffin Optimization Algorithm are as follows:
[0164] Based on the fitness function, determine the fitness values of individuals in each population, and rearrange the population in order from small to large fitness values;
[0165] Select multiple candidate population individuals from the population to form a candidate population, and use a weighted average optimization algorithm to calculate the weighted average position of the candidate population;
[0166] Based on the positions of the optimal population individuals and the weighted average positions of the candidate populations, the search space is updated to generate a new population.
[0167] In one possible implementation, the weighted average position of the candidate population is calculated by the following formula:
[0168]
[0169]
[0170]
[0171] in, is the weighted average position; is the number of individuals in the candidate population; For the i The locations of the candidate population individuals; is the sum of the fitness values of the selected candidates; For the i The fitness value of each candidate population individual.
[0172] In one possible implementation, the new population is generated by the following formula:
[0173]
[0174] in, is the position of the optimal population individual.
[0175] In one possible implementation, in a PID controller, the control variable is calculated by the following formula:
[0176]
[0177] in, K P is the proportionality coefficient; K I is the integration coefficient; K D is the differential coefficient.
[0178] See also Figure 4 , Figure 4 A schematic block diagram of a terminal device provided in an embodiment of the present invention. Figure 4 The terminal 400 in the embodiment shown may include: one or more processors 401, one or more input devices 402, one or more output devices 403 and one or more memories 404. The processors 401, input devices 402, output devices 403 and memories 404 communicate with each other via a communication bus 405. The memory 404 is used to store computer programs, which include program instructions. The processor 401 is used to execute the program instructions stored in the memory 404. The processor 401 is configured to call the program instructions to perform the following operations to perform the functions of the modules / units in the above-mentioned device embodiments, such as Figure 3 The functions of the modules 31 to 34 are shown.
[0179] It should be understood that in the embodiment of the present invention, the processor 401 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0180] The input device 402 may include a touch panel, a fingerprint sensor (for collecting fingerprint information of the user and fingerprint direction information), a microphone, etc. The output device 403 may include a display (LCD, etc.), a speaker, etc.
[0181] The memory 404 may include a read-only memory and a random access memory, and provide instructions and data to the processor 401. A portion of the memory 404 may also include a non-volatile random access memory. For example, the memory 404 may also store information about the device type.
[0182] In a specific implementation, the processor 401, input device 402, and output device 403 described in the embodiment of the present invention can execute the implementation method described in the motor speed control method provided in the embodiment of the present invention, and can also execute the implementation method of the terminal described in the embodiment of the present invention, which will not be repeated here.
[0183] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0184] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0185] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0186] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0187] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0188] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0189] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned motor speed control method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium.
[0190] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A motor speed control method, characterized in that: include: Collect the current speed and target speed of the target motor; Determining a speed error according to the current speed and the target speed; The speed error is input into a PID controller to obtain a control variable; Based on the control amount, controlling the speed of the target motor; Wherein, in the PID controller, the PID parameters are optimized and solved based on the improved Arctic Puffin optimization algorithm, so as to calculate the control quantity based on the solved PID parameters; the fitness function of the improved Arctic Puffin optimization algorithm is determined based on the speed error and the speed error change rate; The optimization steps of the improved Arctic Puffin optimization algorithm are as follows: Based on the fitness function, determine the fitness values of individuals in each population, and rearrange the population in order from small to large fitness values; Select multiple candidate population individuals from the population to form a candidate population, and use a weighted average optimization algorithm to calculate the weighted average position of the candidate population; Based on the position of the optimal population individuals and the weighted average position of the candidate populations, the search space is updated to generate a new population; The weighted average position of the candidate population is calculated by the following formula: in, N is the number of individuals in the population; T is the maximum number of iterations; is the weighted average position; is the number of individuals in the candidate population; For the i The locations of the candidate population individuals; is the sum of the fitness values of the selected candidates; For the i The fitness value of each candidate population individual.
2. The motor speed control method according to claim 1, characterized in that: The fitness function of the improved Arctic Puffin optimization algorithm is: in, , is the weight; is the speed error; is the speed error change rate.
3. The motor speed control method according to claim 1, characterized in that: In the improved Arctic Puffin optimization algorithm, population initialization is performed based on the improved Tent chaotic map; Wherein, random variables are introduced into the improved Tent chaotic map; The process of population initialization based on the improved Tent chaotic map is: In the formula, represents a chaotic sequence, Indicates i The Arctic Puffin t The position of the iteration process, c is a constant parameter between 0 and 1, ub and lb Represent the upper and lower bounds of the search space respectively, N is the number of individuals in the population, T is the maximum number of iterations.
4. The motor speed control method according to claim 1, characterized in that: The new population is generated by the following formula: in, For new populations; , is the weight; is the weighted average position; is the position of the optimal population individual.
5. The motor speed control method according to claim 1, characterized in that: In the PID controller, the control quantity is calculated by the following formula: in, To control the amount; is the speed error; K P is the proportionality coefficient; K I is the integration coefficient; K D is the differential coefficient.
6. A motor speed control device, characterized in that: include: The speed acquisition module is used to acquire the current speed and target speed of the target motor; An error calculation module, used to determine a speed error according to the current speed and the target speed; An optimization solution module is used to input the speed error into a PID controller to obtain a control variable; A speed control module, used for controlling the speed of the target motor based on the control amount; Wherein, in the PID controller, the PID parameters are optimized and solved based on the improved Arctic Puffin optimization algorithm, so as to calculate the control quantity based on the solved PID parameters; the fitness function of the improved Arctic Puffin optimization algorithm is determined based on the speed error and the speed error change rate; The optimization steps of the improved Arctic Puffin optimization algorithm are as follows: Based on the fitness function, determine the fitness values of individuals in each population, and rearrange the population in order from small to large fitness values; Select multiple candidate population individuals from the population to form a candidate population, and use a weighted average optimization algorithm to calculate the weighted average position of the candidate population; Based on the position of the optimal population individuals and the weighted average position of the candidate populations, the search space is updated to generate a new population; The weighted average position of the candidate population is calculated by the following formula: in, N is the number of individuals in the population; T is the maximum number of iterations; is the weighted average position; is the number of individuals in the candidate population; For the i The location of each candidate population individual; is the sum of the fitness values of the selected candidates; For the i The fitness value of each candidate population individual.
7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Design method of fractional order PID controller
CN115097719A
Feed-forward type self-adaptive PID (Proportion Integration Differentiation) control optimization method
CN118859686A