A motor parameter identification method and system based on improved particle swarm
By improving the particle swarm algorithm and merging with the similarity between particles, the problem of slow particle swarm convergence speed in the prior art is solved, and rapid convergence and efficient identification of motor parameter identification are achieved.
Patent Information
- Application Number
- CN202411576492.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, when particle swarm is used to identify motor parameters, the slow convergence speed leads to a long identification time, which affects the accuracy of motor control.
By randomly generating particle swarms, the speed difference between the estimated speed and the measured speed of the particles is calculated based on the motor model, and the particles are sorted and merged according to the magnitude of the speed difference to form a new particle swarm until the combined particles meet the set requirements.
It improves the convergence speed of the particle swarm, reduces the identification time, and improves the efficiency and control accuracy of motor parameter identification.
Smart Images

Figure CN119766048A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a motor parameter identification method and system based on improved particle swarm, belonging to the technical field of motor control. Background Art
[0002] In the field of modern motor control, accurate knowledge of the electrical and mechanical parameters of the motor is essential for efficient and precise control. As an important means of measuring motor parameters, motor parameter identification can monitor and update key parameters in real time during motor operation, providing reliable support for precise motor control. The motor parameters that need to be identified generally include stator resistance, stator inductance, and moment of inertia.
[0003] At present, the commonly used parameter identification methods mainly include theoretical analysis method, numerical calculation method and intelligent optimization algorithm: The theoretical analysis method is based on the operation mechanism of the motor system, corresponds the electrochemical process with the circuit elements in the equivalent model, and determines the unknown parameters in the motor model by performing differential and derivative operations on the VI characteristic curve of the model; however, as the system structure becomes more and more complex, the accuracy of parameter identification of the theoretical analysis method is decreasing. The essence of the numerical calculation method is to make the simulation curve output by the model as close as possible to the measured curve through iteration, and then obtain the optimal solution of the model parameters; however, the performance of the numerical method depends on the objective function and the initial value setting of the parameters, the human factor is large, and this scheme is not suitable for parameter identification of complex nonlinear models. The intelligent optimization algorithm is an optimization algorithm that simulates the laws of natural phenomena and the social behavior of biological groups. This scheme identifies the optimal solution of the model parameters through a step-by-step optimization strategy, such as the particle swarm algorithm, but this method is affected by the size of the particle swarm and the distribution of particles, the algorithm converges slowly, and the identification time is long, which affects the subsequent control accuracy of the motor. Summary of the invention
[0004] The purpose of the present invention is to provide a motor parameter identification method and system based on improved particle swarm, so as to solve the problem of long identification time caused by slow convergence speed when using particle swarm for motor parameter identification.
[0005] In order to solve the above technical problems, the present invention provides a motor parameter identification method based on improved particle swarm, which comprises:
[0006] 1) Randomly generate a particle swarm containing N particles, each particle represents a motor parameter;
[0007] 2) based on the motor model, the particles in the particle swarm are converted to the corresponding estimated speeds, the absolute value of the speed difference between each estimated speed and the actual speed of the motor is calculated, and the corresponding particles are sorted according to the size of the absolute value, and two adjacent particles are merged into one particle by averaging according to the sorting result;
[0008] 3) If the merged particles meet the set requirements, the mean of the merged particles is used as the identified motor parameter; if the merged particles do not meet the set requirements, some particles are selected from the particle group before the merger and the merged particles to form a new particle group, and the number of particles in the new particle group is N;
[0009] 4) Repeat steps 2) and 3) for the new particle swarm to iteratively update until each merged particle meets the set requirements or the number of iterations reaches the set number.
[0010] Furthermore, the motor parameters are motor moment of inertia, stator resistance or stator inductance.
[0011] Furthermore, the method of calculating the average value in step 2) is a logarithmic average value, and the calculation formula of the logarithmic average value is:
[0012] Combine(a,b)=10 [lg(a)+lg(b)] / 2
[0013] Where a and b are two adjacent particles, and Combine(a,b) is the combined particle.
[0014] Furthermore, if the number N of particles in the particle group is an even number, starting from the first particle in the sorting result, two adjacent particles are merged into one particle according to the sorting result, and the number of the merged particles is N / 2.
[0015] Furthermore, if the number of particles N in the particle group is an odd number, one particle is randomly selected from the sorting result and does not participate in the merging operation, and the remaining particles merge two adjacent particles into one particle according to the sorting result, and the number of particles after merging is (N-1) / 2.
[0016] Furthermore, there are N actually measured rotational speeds of the motor, and the N actually measured rotational speeds of the motor are obtained by repeated or continuous measurements within a set time.
[0017] Furthermore, the part of particles selected from the particle group before merging in step 3) are randomly selected.
[0018] Furthermore, the setting requirement is that the variance of the merged particles is less than a set threshold.
[0019] Furthermore, when the number of iterations reaches a set number and the merged particles do not meet the set requirements, a particle group containing N particles is randomly generated again.
[0020] The present invention also provides a motor parameter identification system based on improved particle swarm, comprising a processor, wherein the processor is used to execute computer program instructions to implement the motor parameter identification method based on improved particle swarm of the present invention.
[0021] The invention has the beneficial effects as follows: as an improved invention, when the present invention utilizes a particle swarm to identify the moment of inertia, the particle in the particle swarm is converted to the corresponding estimated speed, the absolute value of the speed difference between each estimated speed and the actual measured speed of the motor is calculated, and the corresponding particles are merged according to the size of the absolute value, so as to form the update of the particle swarm. It can be seen that the present invention utilizes the similarity between particles to merge, thereby reducing the redundant information in the particle swarm, making the entire particle swarm more compact and efficient, and at the same time, the merged particles can inherit the advantages of their previous generation particles. The present invention does not need to perform complex calculations, and the update process of the entire population can be quickly updated in the direction of the optimal solution, which improves the convergence speed and ensures the identification efficiency of the motor parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flow chart of the motor parameter identification method based on improved particle swarm of the present invention. DETAILED DESCRIPTION
[0023] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.
[0024] Embodiment of motor parameter identification method based on improved particle swarm
[0025] The present invention converts the particles in the particle group into the corresponding estimated speed through the motor model, calculates the absolute value of the speed difference between each estimated speed and the actual speed of the motor, and sorts the corresponding particles according to the size of the absolute value. Based on the sorting result, two adjacent particles are merged into one particle. When the merged particles meet the set requirements, the average value of the merged particles is used as the identified motor parameter; if the merged particles do not meet the set requirements, some particles are selected from the particle group before the merger and the merged particles to form a new particle group, and the new particle group is used to re-iterate the judgment. The specific implementation process of the present invention is described in detail below using the moment of inertia J as an example. The implementation process of this method is as follows: Figure 1 shown.
[0026] 1. Randomly generate N motor parameters and use them as particles in the particle swarm to form an initial particle swarm.
[0027] The motor parameter in this embodiment is the moment of inertia, so N moments of inertia are randomly generated, and each moment of inertia is a particle, that is, N particles are randomly generated, and these N particles constitute the initial particle group. Assume that there are 100 particles generated in this embodiment, and the particles are numbered 1 to 100, and the value of each particle is a random number within 1000, and these random numbers are the estimated moments of inertia.
[0028] 2. Convert the particles in the particle group to the corresponding estimated speeds, and calculate the absolute value of the speed difference between each estimated speed and the actual speed of the motor.
[0029] The motor measurement platform controls the motor rotation according to the step current, so the motor will be in a state of continuous acceleration and deceleration. According to the motor model, the relationship between the moment of inertia J and the speed is:
[0030] J*dw / dt=KI
[0031] Where I is the torque current of the motor, K is determined by the motor parameters and is a fixed value, and w is the speed of the motor (here the speed is the angular velocity). Using the above relationship, the randomly generated moment of inertia can be converted into the corresponding estimated speed. The N motor moments of inertia J1, J2, ... J in this embodiment are N Convert to the corresponding estimated speed n 1* 、n 2* 、…n N* , so N estimated speeds can be obtained.
[0032] The actual speed of the motor is measured, and the estimated speed is subtracted from the actual speed. Since there are N estimated speeds in this embodiment, in order to ensure the accuracy of the calculation, the motor speed is repeatedly measured N times or continuously measured N times within a set time. For example, N actual speed values n1, n2, ...n are measured at 10.1s, 10.2s, 10.3s, etc. N , calculate the estimated speed n 1* 、n 2* 、…n N* Compared with the measured speed values n1, n2, ...n N The absolute value of the difference between d1, d2, ...d N , for the first particle, the corresponding absolute value of the difference is:
[0033] d1=ABS(n1-n 1* )
[0034] ABS stands for absolute value. The larger d is, the greater the difference between the estimated rotational speed based on the moment of inertia and the actual rotational speed is, that is, the less credible the moment of inertia represented by the particle is; the smaller d is, the more credible the moment of inertia represented by the particle is.
[0035] 3. Sort the corresponding particles according to the absolute value of the difference, and merge two adjacent particles into one particle according to the sorting result.
[0036] The difference results obtained in this embodiment are d1, d2, ...d N , sort them in ascending order, and sort the N particles in this order, and merge two adjacent particles into one particle based on the sorting result. For example, for this embodiment, the number of particles N is 100, which is an even number. After the 100 particles are sorted according to the above results, the first particle is merged with the second particle, the third particle is merged with the fourth particle, and so on. The ninety-ninth particle is merged with the hundredth particle, and 50 particles are obtained after the merger. When the number of particles is an odd number, for example, N is 99, when merging, any one of the particles can be selected not to participate in the merger. For example, the 10th particle and the remaining 98 particles merge the two adjacent particles according to the sorting results, so that 49 merged particles can be obtained.
[0037] When merging two adjacent particles, the present invention can use the average value of the two particles as the size of the merged particle. The average value here can be an arithmetic mean, a weighted mean, a logarithmic mean, etc. The arithmetic mean is to add up all the values and divide by the number of values, which is relatively simple and intuitive; the weighted mean is to give different weights to different values and then average them. For example, when some particles are more reliable than other particles, they can be given higher weights; the logarithmic mean is to first take the logarithm of the value, then calculate the arithmetic mean, and finally take the exponent. The logarithmic mean is more advantageous in nonlinear problems because it can make the value of the merged particle change nonlinearly, further improving the convergence speed. In order to make the merged particles change nonlinearly, make the process of particle merging more complicated, and further improve the convergence speed, the average value in this embodiment adopts the logarithmic mean, and the specific calculation formula used is:
[0038] Combine(a,b)=10 [lg(a)+lg(b)] / 2
[0039] Where a and b are two adjacent particles, and Combine(a,b) is the combined particle.
[0040] 4. Determine whether the merged particles meet the set requirements. If they do not meet the set requirements, select some particles from the particle group before the merger and form a new particle group with the merged particles. If they meet the requirements, identify the motor parameters according to the merged particles.
[0041] The setting requirement adopted by the present invention is that the variance of each particle after merging is less than the set threshold value e, and the threshold value can be determined according to the actual situation. When the variance of each particle after merging is less than the set threshold value e, it means that the values of each particle after merging are relatively close and the difference is relatively small. At this time, the mean value of these particles after merging is used as the final moment of inertia. When each particle after merging does not meet the above requirements, it is necessary to select some particles from the particle group before merging and form a new particle group with the particles after merging. In the process of forming a new ion group, this embodiment randomly selects some particles from the particle group before merging, and the sum of the number of selected particles and the number of particles after merging is N, that is, the size of the ion group remains unchanged. When N is an even number, since there are N / 2 particles after merging, it is necessary to randomly select N / 2 particles from the particle group before merging; when N is an odd number, since there are (N-1) / 2 particles after merging, it is necessary to randomly select (N+1) / 2 particles from the particle group before merging.
[0042] Convert the particles in the newly formed particle swarm to the corresponding estimated speed, calculate the absolute value of the speed difference between each estimated speed and the actual speed of the motor, sort the corresponding particles according to the absolute value, merge two adjacent particles into one particle according to the sorting result, and judge the newly merged particles again. Repeat this process until the variance of each merged particle is less than the set threshold e. When the process is repeated for the set number of times and the variance of each merged particle still does not meet the requirements, terminate the process and return to step 1 to randomly generate a new particle swarm, and perform iterative calculation according to the randomly generated new particle swarm. The set number of times can also be determined according to the actual situation, such as 500.
[0043] Through the above process, it can be seen that the present invention does not need to perform complex calculations. When using a particle swarm to identify the moment of inertia, the particles in the particle swarm are converted to the corresponding estimated speed, the absolute value of the speed difference between each estimated speed and the actual speed of the motor is calculated, and the particles corresponding to the similar absolute values are merged to form an update of the particle swarm. The update process of the entire population is faster, and it can be updated in the direction of the optimal solution, which improves the convergence speed.
[0044] As another implementation mode, in addition to being able to identify the motor's rotational inertia, the present invention can also identify the stator resistance and stator inductance. The identification process is basically the same as that of the present embodiment, and only the stator inductance and stator resistance need to be converted into the corresponding estimated rotation speed.
[0045] From the motor model, we can know that the relationship between stator resistance, stator inductance and motor speed can be converted by the following formula:
[0046] V=I*R s +L s *dI / dt+E
[0047] E=K e *ω
[0048] ω=2πn / 60
[0049] In summary, the conversion relationship between motor speed and stator resistance and stator inductance is:
[0050] V=I*R s +L s *dI / dt+K e *2πn / 60
[0051] Where V is the stator voltage, I is the stator current, R s is the stator resistance, L s is the stator inductance, E is the back electromotive force, K e is the back electromotive force constant, ω is the angular velocity of the motor, and n is the speed of the motor. Through the above process, the estimated speed corresponding to the stator inductance and stator resistance conversion layer can be obtained.
[0052] The present invention can use the similarity between particles to merge, thereby reducing the redundant information in the particle group, making the entire particle group more compact and efficient. At the same time, the merged particles can inherit the advantages of their predecessors. On this basis, the present invention adopts a specific merging calculation formula Combine(a,b)=10 [lg(a)+lg(b)] / 2 , this formula makes the merged particles change nonlinearly, further improving the convergence speed. If the merged particles do not meet the set requirements, some particles are selected from the particle group before the merger to form a new particle group with the merged particles, and the next round of iteration is performed. This ensures that the algorithm can continue to search when the optimal solution cannot be found until the set requirements are met or the upper limit of the number of iterations is reached. Therefore. The present invention achieves rapid convergence when using particle groups for motor parameter identification by sorting and merging particles, using particle similarity to reduce redundant information, and adopting a specific merging calculation formula.
[0053] Embodiment of motor parameter identification system based on improved particle swarm
[0054] A motor parameter identification system based on an improved particle swarm of the present invention can be used to execute computer program instructions to implement the motor parameter identification method based on an improved particle swarm in the above method embodiment. The specific implementation process of the method has been described in detail in the motor parameter identification method embodiment based on an improved particle swarm, and will not be repeated here. The motor parameter identification system based on an improved particle swarm of this embodiment can be used as an algorithm platform, which together with the current motor measurement platform realizes the control of the motor.
Claims
1. A motor parameter identification method based on improved particle swarm, characterized in that: The method includes: 1) Randomly generate a particle swarm containing N particles, each particle represents a motor parameter; 2) based on the motor model, the particles in the particle swarm are converted to the corresponding estimated speeds, the absolute value of the speed difference between each estimated speed and the actual speed of the motor is calculated, and the corresponding particles are sorted according to the size of the absolute value, and two adjacent particles are merged into one particle by averaging according to the sorting result; 3) If the merged particles meet the set requirements, the mean of the merged particles is used as the identified motor parameter; if the merged particles do not meet the set requirements, some particles are selected from the particle group before the merger and the merged particles to form a new particle group, and the number of particles in the new particle group is N; 4) Repeat steps 2) and 3) for the new particle swarm to iteratively update until each merged particle meets the set requirements or the number of iterations reaches the set number.
2. The motor parameter identification method based on improved particle swarm according to claim 1 is characterized in that: The motor parameters are motor moment of inertia, stator resistance or stator inductance.
3. The motor parameter identification method based on improved particle swarm according to claim 1, characterized in that: The method of calculating the average value in step 2) is the logarithmic average value, and the calculation formula of the logarithmic average value is: Combine(a,b)=10 [lg(a)+lg(b)] / 2 Where a and b are two adjacent particles, and Combine(a,b) is the combined particle.
4. The motor parameter identification method based on improved particle swarm according to claim 1, characterized in that: If the number N of particles in the particle group is an even number, starting from the first particle in the sorting result, two adjacent particles are merged into one particle according to the sorting result, and the number of the merged particles is N / 2.
5. The motor parameter identification method based on improved particle swarm according to claim 1, characterized in that: If the number of particles N in the particle group is an odd number, one particle is selected from the sorting result and does not participate in the merging operation. The remaining particles merge two adjacent particles into one particle according to the sorting result. The number of particles after merging is (N-1) / 2.
6. The motor parameter identification method based on improved particle swarm according to claim 1, characterized in that: The number of actually measured rotational speeds of the motor is N, and the N actually measured rotational speeds of the motor are obtained by repeated or continuous measurements within a set time.
7. The motor parameter identification method based on improved particle swarm according to claim 1, characterized in that: The part of particles selected from the particle group before merging in step 3) are randomly selected.
8. The motor parameter identification method based on improved particle swarm according to claim 1, characterized in that: The setting requirement is that the variance of the merged particles is less than the set threshold.
9. The motor parameter identification method based on improved particle swarm according to claim 1, characterized in that: When the number of iterations reaches the set number and the merged particles do not meet the set requirements, a particle swarm containing N particles is randomly generated again.
10. A motor parameter identification system based on improved particle swarm, comprising a processor, characterized in that: The processor is used to execute computer program instructions to implement the motor parameter identification method based on improved particle swarm as described in any one of claims 1-9.