Anti-jitter motor control algorithm and device based on improved PSO algorithm
Through the improved PSO algorithm and speed curve planning, combined with the motor acceleration and deceleration algorithm, the motor stability and noise interference problems are solved, and the motor is efficient and jitter-free motion control is achieved, and the control accuracy and stability are improved.
Patent Information
- Application Number
- CN202310744746.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-21
- Publication Date
- 2024-12-24
AI Technical Summary
The existing motor stability algorithm has a high dependence on parameters, requires complex parameter adjustment, and the control effect decreases under external noise and interference, resulting in system instability.
The improved particle swarm algorithm (PSO) is used in combination with the motor acceleration and deceleration algorithm, and the stability and robustness of motor movement are improved by updating the acceleration stop time and deceleration start time, segmented planning of the speed curve, and adaptive optimization control.
It realizes the efficient and jitter-free movement of the motor, improves the control accuracy and system stability, is suitable for a variety of scenarios, and reduces the complexity of parameter adjustment.
Smart Images

Figure CN119182326A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor control technology, and in particular to an anti-shake motor control algorithm and device based on an improved PSO algorithm. Background Art
[0002] The development of modern motor control algorithms enables motors to achieve more efficient and accurate motion control, thus playing a vital role in industrial production. Motor stability control can improve the performance of motors. In the control system, the closed-loop control method can eliminate the dynamic error and steady-state error of mechanical equipment, thereby improving the response speed and accuracy of the motor. This control method can ensure that the motor can still maintain an efficient and stable working state under load changes and unstable working conditions, reduce the vibration and noise of the motor, and improve the life and reliability of the motor. In order to ensure smooth movement during motor control, common motor acceleration and deceleration control algorithms mainly include trapezoidal acceleration and deceleration algorithm, exponential acceleration and deceleration algorithm, traditional seven-segment S-type acceleration and deceleration algorithm, and cosine acceleration and deceleration algorithm.
[0003] In order to meet the demand of jitter-free control of the robotic arm, the existing technology usually uses an optimized S-type acceleration and deceleration algorithm, which divides the whole process into three stages: acceleration, uniform speed and deceleration, calculates the movement time of each stage, and brings the current interpolation period into the function of the cosine acceleration and deceleration algorithm during interpolation control. After calculating the running time and distance of each stage, the displacement of each stage is calculated using time as the independent variable, and the derivative and quadratic derivative are performed to obtain the speed and acceleration of each stage respectively.
[0004] However, the existing motor stabilization algorithm is highly dependent on parameters and requires complex parameter adjustments to achieve better control effects, which also limits the actual scope of application. It can also have adverse effects under the influence of external noise and interference, resulting in reduced control effects or even system instability. Summary of the invention
[0005] In order to solve the problem that the existing motor stabilization algorithm is highly dependent on parameters, complex parameter adjustments are required to achieve better control effects, which also limits the actual application scope, and there will be adverse effects under the influence of external noise and interference, resulting in reduced control effect or even system instability. This application provides an anti-shake motor control algorithm based on an improved PSO algorithm, introduces a particle swarm algorithm, and combines it with a motor acceleration and deceleration algorithm for design, thereby achieving efficient and jitter-free movement of the motor.
[0006] The embodiment of the present application is implemented as follows:
[0007] In a first aspect, the present application provides an anti-shake motor control method based on an improved PSO algorithm, comprising:
[0008] Determine the starting position and target position, and determine the direction and distance of movement. At the same time, use the particle swarm algorithm to update the acceleration stop time and deceleration start time of each motor.
[0009] Calculate the maximum speed and acceleration;
[0010] Segment-wise planning of speed curve;
[0011] Calculate the position and speed of the motor at each moment, and calculate the position and speed of the system at each moment based on the speed curve and time;
[0012] Control the movement of the motor, use the position, speed and motor deflection angle as control signals to control the movement of the motor or robot system.
[0013] In a possible implementation, after controlling the movement of the motor, the method further includes:
[0014] The fitness value is calculated based on four reference indicators, including the maximum acceleration of the x, y, z axis and the rotation axis, using the information returned by the sensor;
[0015] Update the particle's individual optimum, global optimum, adaptive inertia weight and adaptive acceleration parameters, and repeat the above steps again until the preset number of iterations is reached.
[0016] In a possible implementation, the calculating the maximum speed and acceleration further includes:
[0017] Calculate the maximum velocity and acceleration based on the system's physical characteristics and motion constraints;
[0018] According to the starting point and the end point of each motion path, the rotation angle of each motor, i.e. the angular displacement, is calculated;
[0019] The maximum angular velocity is calculated according to the acceleration stop time and the deceleration start time.
[0020] In a possible implementation, the segmented planning speed curve further includes:
[0021] The whole motion process is divided into three stages: acceleration stage, uniform speed stage and deceleration stage;
[0022] During the acceleration and deceleration phases, the speed increases or decreases linearly with time;
[0023] In the uniform speed stage, the speed remains constant. These stages are combined to form a smooth speed curve.
[0024] In a possible implementation, the particle swarm algorithm includes:
[0025] Particle initialization;
[0026] The fitness function is calculated according to the needs of the problem. Each time a particle updates its position and velocity, the fitness function determines the fitness of the particle based on its movement.
[0027] Update the individual optimal solution of each particle;
[0028] According to the individual optimal solution, a global optimal solution is updated, where the global optimal solution is the optimal solution among all particles;
[0029] Update the speed and position of each particle according to the current speed, personal optimal solution and global optimal solution.
[0030] In a possible implementation, the particle swarm algorithm further includes:
[0031] Establish the termination condition of the program, and set different termination conditions for different problems. Reach the set number of iterations; the difference between generations meets the minimum limit.
[0032] In a possible implementation, the particle initialization includes:
[0033] Assign a random number to the position and speed of each particle, the particle being a motor;
[0034] Set the maximum number of iterations of the algorithm, the number of independent variables of the objective function, and the maximum speed range of the particles.
[0035] In a possible implementation, updating the individual optimal solution of each particle further includes:
[0036] Record the individual optimal solution of each particle, and determine whether it is a new individual optimal solution according to the formula. If the value is 1, it indicates that the individual optimal solution needs to be updated, otherwise it does not need to be changed. The formula is:
[0037]
[0038] In a possible implementation, updating the global optimal solution according to the individual optimal solution further includes:
[0039] After learning each generation of particles, compare the optimal solutions of all individual particles to obtain a global optimal solution;
[0040] The current global optimal solution is compared with the historical global optimal solution, and if it is better than the global optimal solution, the global optimal solution is updated.
[0041] In a second aspect, the present application provides an anti-shake motor control device based on an improved PSO algorithm, comprising:
[0042] The initial positioning module is used to determine the starting position and target position, and determine the direction and distance of movement. At the same time, the acceleration stop time and deceleration start time of each motor are updated through the particle swarm algorithm;
[0043] A first calculation module, used for calculating the maximum speed and acceleration;
[0044] Speed planning module, used to plan speed curve in sections;
[0045] The second calculation module is used to calculate the position and speed of the motor at each moment, and calculate the position and speed of the system at each moment according to the speed curve and time;
[0046] The motor control module is used to control the movement of the motor. It uses the position, speed and motor deflection angle as control signals to control the movement of the motor or robot system.
[0047] The technical solution provided by this application can at least achieve the following beneficial effects:
[0048] The anti-shake motor control method and device based on the improved PSO algorithm provided in the present application are designed and improved by referring to the idea of the PSO algorithm and combining it with the actual situation of motor control, and an optimization algorithm suitable for the control update and design of the motor is proposed. In addition, a new anti-shake control algorithm is proposed by combining the improved PSO algorithm with the speed curve planning algorithm, which can adaptively face various scenarios. At the same time, the angular velocity variable is added on the basis of the S-shaped speed planning to improve the control accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0050] Figure 1 is a flowchart of an anti-shake motor control method based on an improved PSO algorithm shown in an exemplary embodiment of the present application;
[0051] Figure 2 is a flowchart of an improved PSO algorithm shown in an exemplary embodiment of the present application;
[0052] Figure 3 It is a structural schematic diagram of an anti-shake motor control device based on an improved PSO algorithm shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, implementation mode and advantages of the present application clearer, the exemplary implementation mode of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, not all of the embodiments. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.
[0054] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0055] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0056] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0057] Before explaining the anti-shake motor control algorithm based on the improved PSO algorithm provided in the embodiment of the present application, the application scenario and implementation environment of the embodiment of the present application are first introduced.
[0058] The development of modern motor control algorithms enables motors to achieve more efficient and accurate motion control, thus playing a vital role in industrial production. Motor stability control can improve the performance of motors. In the control system, the closed-loop control method can eliminate the dynamic error and steady-state error of mechanical equipment, thereby improving the response speed and accuracy of the motor. This control method can ensure that the motor can still maintain an efficient and stable working state under load changes and unstable working conditions, reduce the vibration and noise of the motor, and improve the life and reliability of the motor. In order to ensure smooth movement during motor control, common motor acceleration and deceleration control algorithms mainly include trapezoidal acceleration and deceleration algorithm, exponential acceleration and deceleration algorithm, traditional seven-segment S-type acceleration and deceleration algorithm, and cosine acceleration and deceleration algorithm.
[0059] In order to achieve the demand of jitter-free control of the robot arm, an optimized S-type acceleration and deceleration algorithm has been proposed recently. The algorithm divides the whole process into three stages: acceleration, uniform speed and deceleration, calculates the movement time of each stage, and brings the current interpolation cycle into the function of the cosine acceleration and deceleration algorithm during interpolation control. The fitting formula is as follows:
[0060]
[0061] Among them, t 1 ,t 2 and t 3 Respectively represent the motion time of acceleration, uniform speed and deceleration stages; v s is the initial velocity; v c is the speed in the uniform phase; v e is the end speed; a is the acceleration in the acceleration phase; d is the deceleration in the deceleration phase; S 1 , S 2 and S 2 are the displacements in the acceleration, uniform speed and deceleration stages respectively.
[0062] After calculating the running time and distance of each stage, the displacement of each stage is calculated using time as the independent variable, and the derivative and quadratic derivative are performed to obtain the speed and acceleration of each stage respectively.
[0063] However, at present, there are still some problems with the motor stability control algorithm.
[0064] First, some traditional motor stability control algorithms have the problem of parameter dependence. These algorithms require complex parameter adjustments to achieve the best control effect, which not only increases the difficulty of system design, but also limits the practical application scope of the algorithm.
[0065] Secondly, some existing motor stability control algorithms are sensitive to noise and interference. These noise and interference will have adverse effects on the motor control system, resulting in reduced control effect and even system instability. The robustness of current motor control algorithms to noise and interference needs to be improved.
[0066] In addition, some existing motor control algorithms have the problem of large amount of calculation and high computational complexity. These algorithms require a lot of computing resources, which is unacceptable in some embedded application scenarios.
[0067] In response to the above problems, the present invention proposes an anti-shake control algorithm with high stability and low computational complexity. Based on this, the present application provides an anti-shake motor control method and device based on the improved PSO algorithm, introduces the particle swarm algorithm (PSO), and combines it with the motor acceleration and deceleration algorithm for design, thereby achieving efficient and jitter-free movement of the motor.
[0068] Next, the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems will be described in detail through embodiments and in combination with the accompanying drawings. The embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. Obviously, the described embodiments are part of the embodiments of the present application, not all of them.
[0069] Figure 1 It is a flowchart of an anti-shake motor control method based on an improved PSO algorithm shown in an exemplary embodiment of the present application.
[0070] In an exemplary embodiment, Figure 1 As shown, a method for controlling an anti-shake motor based on an improved PSO algorithm is provided. In this embodiment, the method may include the following steps:
[0071] Step 10: Determine the starting and target positions.
[0072] Among them, it is necessary to first determine the starting position and target position of the system, as well as the direction and distance of movement, and then apply the improved PSO algorithm to update the acceleration stop time and deceleration start time of each motor.
[0073] Step 20: Calculate the maximum velocity and acceleration.
[0074] Among them, the maximum speed and acceleration are calculated according to the physical characteristics and motion constraints of the system, the rotation angle of each motor, i.e., the angular displacement, is calculated according to the starting and ending points of each motion path, and the maximum angular speed is calculated according to the end time point of acceleration and the start time point of deceleration.
[0075] Step 30: Plan the speed curve in sections.
[0076] The entire motion process is divided into three stages: acceleration stage, uniform speed stage and deceleration stage. In the acceleration and deceleration stages, the speed increases or decreases linearly with time. In the uniform speed stage, the speed remains unchanged. These stages are combined to form a smooth speed curve.
[0077] Step 40: Calculate the position and velocity at each moment.
[0078] Among them, the position and speed of the system at each moment are calculated based on the speed curve and time.
[0079] Step 50: Control the movement of the motor or robotic system.
[0080] Among them, the position, speed and motor deflection angle are used as control signals to control the movement of the motor or robot system.
[0081] Step 60: Calculate the fitness value using the sensor return information according to four reference indicators, including the maximum acceleration of the x-axis, y-axis, z-axis and the rotation axis.
[0082] Step 70: Update the individual optimum, global optimum, adaptive inertia weight and adaptive acceleration parameters of the particle. Repeat the above steps until the preset number of iterations is reached.
[0083] It can be seen that in the above anti-shake motor control algorithm based on the improved PSO algorithm, the control signal changes with time, and the control motor or robot system achieves smooth and efficient movement.
[0084] In the above method, an improved PSO algorithm needs to be used to update the acceleration stop time and deceleration start time of the motor.
[0085] Figure 2 It is a flowchart of an improved PSO algorithm shown in an exemplary embodiment of the present application.
[0086] like Figure 2 As shown, the operation process of the improved PSO algorithm includes the following steps:
[0087] Step 100: Particle initialization.
[0088] Among them, at this stage, some parameters need to be set, a random number needs to be assigned to the position and speed of each particle, the maximum number of iterations of the algorithm, the number of independent variables of the objective function and the maximum speed range of the particles need to be set, etc. In some embodiments of the present application, the particles refer to motors.
[0089] Step 200: Calculate the fitness function according to the needs of the problem.
[0090] Each time a particle updates its position and velocity, the fitness function determines the particle's fitness based on the particle's motion.
[0091] Step 300: Update the individual optimal solution of each particle.
[0092] The individual optimal solution of each particle is recorded, and formula (1) is used to determine whether to update the individual optimal solution. If the value is 1, it indicates that the individual optimal solution needs to be updated, otherwise it does not need to be changed.
[0093]
[0094] Among them, i is the number of particles and t is the current iteration number.
[0095] Step 400: Update the global optimal solution, where the global optimal solution refers to the optimal solution among all particles.
[0096] Among them, after learning each generation of particles, the individual optimal solutions of all particles are compared to obtain a global optimal solution, which is compared with the historical global optimal solution. If it is better than the global optimal solution, the global optimal solution will be updated.
[0097] Step 500: Update the velocity and position of each particle.
[0098] The speed is affected by the current speed, the personal optimal solution and the global optimal solution, and the calculation formula is shown in formula (1). The position of the particle at the next time point is determined by the current position plus the particle speed, and the calculation formula is shown in formula (2).
[0099] V(t+1)=w a (t)×V(t)+c 1 ×rand 1 ×(pbest-X(t))
[0100] +c 2 ×rand 2 ×(gbest-X(t))(2)
[0101] X(t+1)=X(t)+V(t+1)(3)
[0102] Wherein, w is the inertia factor, which is a non-negative number. When the inertia factor is large, the global optimization ability is strong and the local optimization ability is weak. When the inertia factor is small, the global optimization ability is weak and the local optimization ability is strong. Adjusting w can achieve the adjustment of global optimization performance and local optimization performance; c 1 、c 2 is the acceleration parameter, c 1 is the individual learning factor of each particle, c 2 is the global learning factor of each particle. These three parameters are constant during PSO learning; rand1 and rand2 are random numbers between 0 and 1; pbest is the individual optimal solution, representing the best position of the particle; gbest is the global optimal solution, derived from the best positions of all particles; V(t) is the current velocity of the particle; V(t+1) is the velocity of the particle at the next time point; X(t) is the position of the particle at time t; X(t+1) is the position of the particle at time t+1.
[0103] w in formula (2) a (t) is derived from the following formula:
[0104]
[0105] w a (t)=(w max -w min ) s (t)+wmin (5)
[0106] Among them, P s (t) is the ratio of the total individual optimal solution of the current particle to the total number of particles; n is the total number of particles. Formula (5) gives the updating principle of the inertia weight, where w max and w mi n are the custom minimum and maximum values of the weight, ranging between 0 and 1.
[0107] Step 600: Establish program termination conditions.
[0108] Different termination conditions are set for different problems. The set number of iterations is reached; the difference between the generations meets the minimum limit.
[0109] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the instructions, these steps are not necessarily executed in sequence according to the order of the instructions. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the above-mentioned embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0110] Corresponding to the aforementioned embodiment of the anti-shake motor control method based on the improved PSO algorithm, the present application also provides an embodiment of an anti-shake motor control device based on the improved PSO algorithm, using the same technical concept.
[0111] Figure 3 It is a structural schematic diagram of an anti-shake motor control device based on an improved PSO algorithm shown in an exemplary embodiment of the present application.
[0112] In an exemplary embodiment, Figure 3 As shown, the anti-shake motor control device based on the improved PSO algorithm includes:
[0113] Initial positioning module 1 is used to determine the starting position and target position, and determine the direction and distance of movement. At the same time, the acceleration stop time and deceleration start time of each motor are updated through the particle swarm algorithm;
[0114] A first calculation module 2 is used to calculate the maximum speed and acceleration;
[0115] Speed planning module 3, used for segmented speed planning;
[0116] The second calculation module 4 is used to calculate the position and speed of the motor at each moment, and calculate the position and speed of the system at each moment according to the speed curve and time;
[0117] The motor control module 5 is used to control the movement of the motor, and uses the position, speed and motor deflection angle as control signals to control the movement of the motor or the robot system.
[0118] For the specific limitations of the anti-shake motor control device based on the improved PSO algorithm, please refer to the limitations of the anti-shake motor control algorithm based on the improved PSO algorithm in the above text, which will not be repeated here. Each module in the above-mentioned anti-shake motor control device based on the improved PSO algorithm can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0119] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0120] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0121] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. An anti-shake motor control algorithm based on an improved PSO algorithm, characterized in that: include: Determine the starting position and target position, and determine the direction and distance of movement. At the same time, use the particle swarm algorithm to update the acceleration stop time and deceleration start time of each motor. Calculate the maximum speed and acceleration; Segment-wise planning of speed curve; Calculate the position and speed of the motor at each moment, and calculate the position and speed of the system at each moment based on the speed curve and time; Control the movement of the motor, use the position, speed and motor deflection angle as control signals to control the movement of the motor or robot system.
2. The anti-shake motor control algorithm based on the improved PSO algorithm as claimed in claim 1, characterized in that: After the control of the movement of the motor, further comprising: The fitness value is calculated based on four reference indicators, including the maximum acceleration of the x, y, z axis and the rotation axis, using the information returned by the sensor; Update the particle's individual optimum, global optimum, adaptive inertia weight and adaptive acceleration parameters, and repeat the above steps again until the preset number of iterations is reached.
3. The anti-shake motor control algorithm based on the improved PSO algorithm as claimed in claim 1, characterized in that: The calculation to obtain the maximum speed and acceleration also includes: Calculate the maximum velocity and acceleration based on the system's physical characteristics and motion constraints; According to the starting point and the end point of each motion path, the rotation angle of each motor, i.e. the angular displacement, is calculated; The maximum angular velocity is calculated according to the acceleration stop time and the deceleration start time.
4. The anti-shake motor control algorithm based on the improved PSO algorithm as claimed in claim 1, characterized in that: The segmented planning speed curve also includes: The whole motion process is divided into three stages: acceleration stage, uniform speed stage and deceleration stage; During the acceleration and deceleration phases, the speed increases or decreases linearly with time; In the uniform speed stage, the speed remains constant. These stages are combined to form a smooth speed curve.
5. The anti-shake motor control algorithm based on the improved PSO algorithm as claimed in claim 1, characterized in that: The particle swarm algorithm comprises: Particle initialization; The fitness function is calculated according to the needs of the problem. Each time a particle updates its position and velocity, the fitness function determines the fitness of the particle based on its movement. Update the individual optimal solution of each particle; According to the individual optimal solution, a global optimal solution is updated, where the global optimal solution is the optimal solution among all particles; Update the speed and position of each particle according to the current speed, personal optimal solution and global optimal solution.
6. The anti-shake motor control algorithm based on the improved PSO algorithm as claimed in claim 3, characterized in that: The particle swarm algorithm further includes: Establish the termination condition of the program, and set different termination conditions for different problems. Reach the set number of iterations; the difference between generations meets the minimum limit.
7. The anti-shake motor control algorithm based on the improved PSO algorithm as claimed in claim 1, characterized in that: The particle initialization includes: Assign a random number to the position and speed of each particle, the particle being a motor; Set the maximum number of iterations of the algorithm, the number of independent variables of the objective function, and the maximum speed range of the particles.
8. The anti-shake motor control algorithm based on the improved PSO algorithm as claimed in claim 1, characterized in that: The updating of the individual optimal solution of each particle further includes: Record the individual optimal solution of each particle, and determine whether it is a new individual optimal solution according to the formula. If the value is 1, it indicates that the individual optimal solution needs to be updated, otherwise it does not need to be changed. The formula is:
9. The anti-shake motor control algorithm based on the improved PSO algorithm as claimed in claim 1, characterized in that: The updating of the global optimal solution according to the individual optimal solution further includes: After learning each generation of particles, compare the optimal solutions of all individual particles to obtain a global optimal solution; The current global optimal solution is compared with the historical global optimal solution, and if it is better than the global optimal solution, the global optimal solution is updated.
10. An anti-shake motor control device based on an improved PSO algorithm, characterized in that: include: The initial positioning module is used to determine the starting position and target position, and determine the direction and distance of movement. At the same time, the acceleration stop time and deceleration start time of each motor are updated through the particle swarm algorithm; A first calculation module, used for calculating the maximum speed and acceleration; Speed planning module, used to plan speed curve in sections; The second calculation module is used to calculate the position and speed of the motor at each moment, and calculate the position and speed of the system at each moment according to the speed curve and time; The motor control module is used to control the movement of the motor. It uses the position, speed and motor deflection angle as control signals to control the movement of the motor or robot system.
