Motor parameter identification method and device and storage medium
By initializing the parrot algorithm using preset sequence functions in motor parameter identification, parrot populations are generated, and position is updated through individual fitness, the problems of low accuracy of motor parameter identification and complex process are solved, and more efficient and accurate motor parameter identification is achieved.
Patent Information
- Application Number
- CN202411990526.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In the prior art, the accuracy of motor parameter identification is low and the identification process is complicated.
The parameters of the parrot algorithm are initialized through the preset sequence function, and the corresponding parrot population is generated based on the initialized parrot algorithm, the individual fitness of the parrot is determined, the position of the parrot is updated, and the motor parameters are determined until the performance indicators meet the preset conditions.
It improves the recognition efficiency and accuracy of motor parameters, and solves the complexity of the motor parameter identification process.
Smart Images

Figure CN119853523A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor parameter identification, and in particular to a motor parameter identification method, device and storage medium. Background Art
[0002] In existing motor control systems, the quality of motor output efficiency, the arrangement of the motor's internal system circuits, and the setting of the motor's major controller parameters all depend to a large extent on accurate motor parameters. Considering that motors are electronic devices that are extremely susceptible to environmental interference, temperature changes, air humidity, etc., the above weather changes will inevitably cause changes in motor parameters.
[0003] At present, the commonly used motor parameter identification strategies include: 1) Recursive least squares method, which is applied to motor parameter identification. This method needs to continuously learn old information during identification, which is prone to data saturation. 2) Combining the model reference adaptive method with motor parameter identification, but this method has the defects of complex adjustable model establishment and dependence of the selection of adaptive rate on subjective experience. 3) Applying the Kalman filter algorithm to motor parameter identification. This method estimates the state at the next moment based on the estimated value and covariance at the current moment, but the relevant parameters of the Kalman gain matrix of the algorithm are difficult to select, and a large number of matrix operations are involved in the solution, which is not conducive to engineering use. It can be seen that the accuracy of motor parameter identification in related technologies is low and the identification process is complicated.
[0004] There is currently no effective solution to the above-mentioned technical problems in the relevant technologies. Summary of the invention
[0005] The present application provides a method, device and storage medium for identifying motor parameters to solve the problems of low accuracy and complex identification process of motor parameters in related technologies.
[0006] In a first aspect, the present application provides a method for identifying motor parameters, comprising:
[0007] S11, initializing the parameters of the parrot algorithm through a preset sequence function, and generating a corresponding parrot population based on the initialized parrot algorithm; wherein the parrot population includes a plurality of parrots, the parrots are position vectors of motor parameters to be identified, the dimension of the position vector represents the number of motor parameters to be identified, and the motor parameters to be identified are motor parameters in a double closed-loop model of the motor;
[0008] S12, determining the individual fitness of each parrot in the parrot population, wherein the individual fitness represents the distance of the parrot from the target location;
[0009] S13, determining a target parrot at the optimal position in the parrot population according to the individual fitness, and updating the position of the parrot according to the target behavior of the parrot, wherein the target behavior represents the behavior of the parrot moving closer to the target parrot;
[0010] S14, repeating S12 and S13 until the performance index meets the preset conditions to determine the motor parameters corresponding to the position vector, wherein the performance index refers to the performance index of the motor double closed-loop model determined based on the parrot after the updated position.
[0011] Optionally, initializing the parameters of the Parrot algorithm by a preset sequence includes: initializing the parameters of the Parrot algorithm by a Halton sequence;
[0012] The Halton sequence is H(n) is the initial position of the nth parrot, n is the ordinal number of the Halton sequence; p is the cardinality of the Halton sequence; and is called the root inverse of the parrot initial position n with respect to the cardinality p1, and p i (1≤i≤s), where s is the number of parameters to be identified, a i is a constant variable.
[0013] Optionally, in the case where the target behavior is a foraging behavior, updating the position of the parrot according to the target behavior of the parrot includes: determining the flight strategy of the parrot by a first formula, and updating the position of the parrot during the foraging process according to a second formula under the flight strategy;
[0014] The first formula is:
[0015]
[0016] in, is the position vector of the t+1th generation parrot, σ represents the flight distance of the parrot; tan(θ) is the direction of the parrot’s flight;
[0017] The second formula is:
[0018]
[0019] in, is the mean position of the parrot population in the tth generation, max is the farthest distance from the target position in the parrot population in this round of iteration; Levy (d) is a function that characterizes the flight status of the parrot; x best is the position of the leading parrot, and rand represents the value range Any number in .
[0020] Optionally, when the target behavior is a stay behavior, updating the position of the parrot according to the target behavior of the parrot includes: determining the flight strategy of the parrot by a first formula, and updating the position of the parrot during the stay process according to a third formula under the flight strategy;
[0021] The first formula is:
[0022]
[0023] in, is the position vector of the t+1th generation parrot, σ represents the flight distance of the parrot; tan(θ) is the direction of the parrot’s flight;
[0024] The third formula is:
[0025]
[0026] Among them, ones(1,d) represents a vector composed of 1 and with dimension d, x best is the current position of the leading parrot, and Levy(d) is a function that characterizes the parrot's flight status.
[0027] Optionally, in the case where the target behavior is a communication behavior, updating the position of the parrot according to the target behavior of the parrot includes: updating the position of the parrot in the communication behavior by the fourth formula;
[0028] Wherein, the fourth formula is:
[0029]
[0030] Among them, p is the probability control variable.
[0031] Optionally, when the target behavior is fear behavior, updating the position of the parrot according to the target behavior of the parrot includes:
[0032] The position of the frightened parrot is updated by the fifth formula;
[0033]
[0034] Optionally, repeatedly executing S2 and S3 until the performance index meets a preset condition, and determining the motor parameters corresponding to the position vector includes:
[0035] S21, dividing the parrots after executing S12 and S13 once to obtain the updated positions into parrots of a first preset ratio and parrots of a second preset ratio, wherein the sum of the first preset ratio and the second preset ratio is 1, and the first preset ratio is smaller than the second preset ratio;
[0036] S22, updating the positions of the parrots in the first preset proportion by using a sixth formula;
[0037] Wherein, the sixth formula is:
[0038] x s (t+1)=x s (t)+S(r1x best -r2x s (t))
[0039] x s represents the position of the t+1th generation parrot of the sth parrot; x best is the parrot closest to the target position in the parrot group; r is a random number (0-1); S is the flip factor;
[0040] S=Ks+ε*ΔK s
[0041] K s is the uncorrected flip factor, ε represents the proportional factor, ΔK s Represents the flip factor gain after fuzzy control correction;
[0042] S23, updating the individual fitness of the parrots of the first preset ratio and the parrots of the second preset ratio after the position update, and executing S12 again according to the updated individual fitness to re-determine the target parrot;
[0043] S24, executing S13 again to update the position of the parrot according to the target behavior of the parrot, and determining the motor parameters corresponding to the position vector when the performance index meets the preset conditions.
[0044] Optionally, the performance index is determined by: determining the integral of the absolute value of the product of time t and the speed loop error in the motor double closed-loop model; and taking the sum of the integral and the absolute value of the product of time and the current regulation loop error as the performance index.
[0045] In a second aspect, the present application provides a device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to execute the motor parameter identification method described in the first aspect of the present application.
[0046] In a third aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the motor parameter identification method described in the first aspect of the present application.
[0047] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: in the method provided by the embodiment of the present application, the parameters of the parrot algorithm are initialized by a preset sequence function, and a corresponding parrot population is generated based on the initialized parrot algorithm, that is, the motor parameters to be identified in the motor double closed-loop model are mapped to parrots, and then the individual fitness of the parrots is determined, that is, the distance between the parrots and the target position, and then the target parrot at the optimal position in the parrot population is determined by the individual fitness, and the position of the parrot is updated according to the target behavior of the parrot. The updating process is a continuous iterative process. Through this iterative process, the position of the parrot can be continuously updated, which not only improves the recognition efficiency of the motor parameters, but also improves the recognition accuracy of the motor parameters, thereby solving the problems of low accuracy and complex identification process of motor parameter identification in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0050] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0051] Figure 1 A flow chart of a method for identifying motor parameters provided in an embodiment of the present application;
[0052] Figure 2 A schematic diagram of a double closed-loop model of a motor provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of a double closed-loop model of a motor with performance indicators provided in an embodiment of the present application;
[0054] Figure 4A flow chart of a method for identifying motor parameters using the Parrot algorithm provided in an embodiment of the present application;
[0055] Figure 5 A schematic diagram of a fuzzy surface of ΔKs provided in an embodiment of the present application;
[0056] Figure 6 A schematic diagram of the structure of the device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0058] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0059] In order to solve the problem of low accuracy and complicated identification process of motor parameters in related technologies, the present application provides a method for identifying motor parameters, such as Figure 1 As shown, the steps of the method include:
[0060] S11, initializing the parameters of the parrot algorithm through a preset sequence function, and generating a corresponding parrot population based on the initialized parrot algorithm; wherein the parrot population includes multiple parrots, the parrots are position vectors of motor parameters to be identified, the dimension of the position vector represents the number of motor parameters to be identified, and the motor parameters to be identified are motor parameters in a double closed-loop model of the motor;
[0061] S12, determining the individual fitness of each parrot in the parrot population, wherein the individual fitness represents the distance of the parrot from the target location;
[0062] S13, determining the target parrot at the optimal position in the parrot population according to the individual fitness, and updating the position of the parrot according to the target behavior of the parrot, wherein the target behavior represents the behavior of the parrot moving closer to the target parrot;
[0063] S14, repeatedly executing S12 and S13 until the performance index meets the preset conditions to determine the motor parameters corresponding to the position vector, wherein the performance index refers to the performance index of the motor double closed-loop model determined based on the parrot after the updated position.
[0064] Through the above steps S11 to S14, the parameters of the parrot algorithm are initialized by a preset sequence function, and a corresponding parrot population is generated based on the initialized parrot algorithm, that is, the motor parameters to be identified in the motor double closed-loop model are mapped to parrots, and then the individual fitness of the parrot is determined, that is, the distance between the parrot and the target position, and then the target parrot in the optimal position in the parrot population is determined by the individual fitness, and the position of the parrot is updated according to the target behavior of the parrot. The updating process is a continuous iterative process. Through this iterative process, the position of the parrot can be continuously updated, which not only improves the recognition efficiency of the motor parameters, but also improves the recognition accuracy of the motor parameters, thereby solving the problem of low accuracy and complex identification process of motor parameter identification in related technologies.
[0065] In the embodiment of the present application, the method of repeatedly executing S2 and S3 involved in the above step 14 until the performance index satisfies the preset condition to determine the motor parameter corresponding to the position vector may further include:
[0066] S21, dividing the parrots after executing S12 and S13 once to obtain the updated positions into parrots of a first preset ratio and parrots of a second preset ratio, wherein the sum of the first preset ratio and the second preset ratio is 1, and the first preset ratio is smaller than the second preset ratio;
[0067] S22, updating the positions of the parrots of the first preset proportion by using the sixth formula;
[0068] Among them, the sixth formula is:
[0069] x s (t+1)=x s (t)+S(r1x best -r2x s (t))
[0070] x s represents the position of the t+1th generation parrot of the sth parrot; x best is the parrot closest to the target position in the parrot group; r is a random number (0-1); S is the flip factor;
[0071] S=Ks+ε*ΔK s
[0072] K s is the uncorrected flip factor, ε represents the proportional factor, ΔK sRepresents the flip factor gain after fuzzy control correction;
[0073] S23, updating the individual fitness of the parrots of the first preset ratio and the parrots of the second preset ratio after the position update, and executing S12 again according to the updated individual fitness to re-determine the target parrot;
[0074] S24, executing S13 again to update the position of the parrot according to the target behavior of the parrot, and determining the motor parameters corresponding to the position vector when the performance index meets the preset conditions.
[0075] In this regard, in a specific example, the first preset ratio may be 0.1, and the second preset ratio may be 0.9. The above is only an example, and corresponding settings may be made according to the requirements in the actual application scenario.
[0076] Through the above steps S21 and S24, the individual fitness of the parrot can be continuously updated and iterated. Since each behavior of the parrot will cause its distance from the target position to change, the optimal position needs to be reselected after each update iteration, that is, the parrot closest to the target. The iteration is repeated until the motor parameters identified by the iterative parrot are substituted into the motor double closed-loop model and its performance indicators can meet the preset conditions, thereby terminating the iteration.
[0077] In the embodiment of the present application, the method of initializing the parameters of the parrot algorithm by the preset sequence involved in the above step S11 may be: initializing the parameters of the parrot algorithm by the Halton sequence;
[0078] The Halton sequence is H(n) is the initial position of the nth parrot, n is the ordinal number of the Halton sequence; p is the cardinality of the Halton sequence; and is called the root inverse of the parrot initial position n with respect to the cardinality p1, and p i (1≤i≤s), where s is the number of parameters to be identified, a i is a constant variable.
[0079] The existing parrot population initialization method relies on the rand function to generate a random sequence. The use of this function has the advantage of a simple population initialization process, but the generation of the rand random sequence is prone to uneven distribution of the parrot population, which will lead to blank spaces in the search space and reduce the efficiency of the parrot search. In the embodiment of the present application, considering that the Halton sequence is a small difference sequence, it is constructed by a deterministic method with prime numbers as the base, that is, the Halton sequence is used in the embodiment of the present application to replace the existing rand sequence, so that the parrot population is densely distributed in the search space, thereby improving the optimization efficiency of the parrot algorithm.
[0080] In the embodiment of the present application, parrots in the parrot population have various behaviors, such as foraging behavior, staying behavior, communication behavior and fear behavior. The following will explain the method of updating the position of the parrots in combination with each specific behavior. In the case where the target behavior is foraging behavior, the method of updating the position of the parrot according to the target behavior of the parrot involved in the above step 13 can further include:
[0081] Step 31, determining the parrot's flight strategy through the first formula, and updating the parrot's position during the foraging process according to the second formula under the flight strategy;
[0082] The first formula is:
[0083]
[0084] in, is the position vector of the t+1th generation parrot, σ represents the flight distance of the parrot; tan(θ) is the direction of the parrot’s flight;
[0085] The second formula is:
[0086]
[0087] in, is the mean position of the parrot population in the tth generation, max is the farthest distance from the target position in the parrot population in this round of iteration; Levy (d) is a function that characterizes the flight status of the parrot; x best is the position of the leading parrot, that is, the position of the best parrot in this round of iteration, and rand represents the value range in Any number in .
[0088] In the embodiment of the present application, when the target behavior is a stay behavior, the method of updating the position of the parrot according to the target behavior of the parrot involved in the above step 13 may further include:
[0089] Step 41, determining the flight strategy of the parrot by the first formula, and updating the position of the parrot during the stay process according to the third formula under the flight strategy;
[0090] The first formula is:
[0091]
[0092] in, is the position vector of the t+1th generation parrot, σ represents the flight distance of the parrot; tan(θ) is the direction of the parrot’s flight;
[0093] The third formula is:
[0094]
[0095] Among them, ones(1,d) represents a vector composed of 1 and with dimension d, x best is the current position of the leading parrot, and Levy(d) is a function that characterizes the parrot's flight status.
[0096] In the embodiment of the present application, when the target behavior is a communication behavior, the method of updating the position of the parrot according to the target behavior of the parrot involved in the above step 13 may further include:
[0097] Step 51, updating the position of the parrot in the communication behavior by the fourth formula;
[0098] Among them, the fourth formula is:
[0099]
[0100] Among them, p is the probability control variable.
[0101] In the embodiment of the present application, when the target behavior is fear behavior, the method of updating the position of the parrot according to the target behavior of the parrot involved in the above step 13 may further include:
[0102] Step 61, updating the position of the frightened parrot by the fifth formula;
[0103]
[0104] In an embodiment of the present application, the performance index is determined in the following manner: first, the integral of the absolute value of the product of time t and the speed loop error in the motor double closed-loop model is determined, and then the sum of the integral and the absolute value of the product of time and the current regulation loop error is used as the performance index.
[0105] In a specific example, the integral of the absolute value of the product of time t and the permanent magnet synchronous motor system speed loop error E(t) and the absolute value of the product of t and the current regulation loop error e(t) can be taken as the performance index. The role of this performance index is to quantify the quality of the performance index returned by the motor parameters solved by the Parrot algorithm after calling the motor system model. The mathematical expression of the performance index J is as follows:
[0106]
[0107] In the embodiment of the present application, the dual closed-loop system of the synchronous motor continuously generates a speed loop error E(t) and a current loop error e(t). When the motor system is running, the changes of E(t) and e(t) are detected at all times, thereby adaptively generating a series of J of different sizes. The smaller the value, the smaller the deviation of the speed loop and the current loop of the motor system, that is, the system reaches a steady state at this time, and the identified motor parameters are more accurate.
[0108] The present application is explained below in conjunction with the specific implementation of the embodiment of the present application. The specific implementation provides a method for identifying parameters of a permanent magnet synchronous motor based on an improved parrot algorithm. The existing dual-loop control model of a permanent magnet synchronous motor, such as Figure 2 As shown in Figure 2, after the Parrot algorithm is deployed, it is necessary to add performance indicator functions based on the dual-loop control model of the permanent magnet synchronous motor, such as Figure 3 As shown in the dashed box.
[0109] The following will introduce them separately. Figure 2 In the specific implementation, a dual closed-loop motor control system is adopted, and the given d-axis current is manually set to zero as the control scheme of the whole system. Specifically, the given speed is subtracted from the speed feedback to obtain E(t), and E(t) is passed through the speed regulation loop to obtain the given q-axis input current. At this time, the current deviation e(t) formed by the difference between the given current of the d and q axes and the corresponding feedback current is controlled, and it is used as the input of the current regulation loop, thereby generating the input voltage given by the q and d axes respectively, and then through the 2 / 2 transformation, the voltage of the d and q axis coordinate system is converted into the voltage corresponding to the α and β coordinate system. The voltage generates the switch signal of the IGBT through the action of the SVPWM module, and realizes the three-phase power I required for the motor to work. a ,I b ,I c , combined with the electrical angle θ of the motor's output signal, the output current and electrical angle of the above motor are converted through 3 / 2 and 2 / 2 coordinate systems to generate d and q axis current feedback. The feedback is subtracted from the d and q axis given current to generate E(t), thereby realizing closed-loop control.
[0110] The motor double closed-loop model after adding performance indicators is as follows Figure 3As shown in the dashed box in the embodiment, the dashed box is specifically presented by formula (10). The input of the dashed box is the deviation E(t) between the given speed and the feedback speed. After multiplication with time and then integration, it is finally summed with the d-axis current deviation e(t), and the value obtained by multiplying it with time and integrating it, and finally the "output" of the performance index part is obtained, which corresponds to Figure 4 The "Calculate and return performance indicators" step in the dashed box on the right. Figure 4 It can be seen that the method of identifying motor parameters by the parrot algorithm in the embodiment of the present application includes:
[0111] Step 401, parameter initialization;
[0112] Existing parrot population initialization function:
[0113] x i =rand(ub-lb)+lb
[0114] Wherein, ub is the upper bound of the range that includes the set of motor parameters to be identified; lb is the lower bound of the range that includes the set of motor parameters to be identified; rand represents any number in the range [0, 1]; x i is the initial position of the i-th parrot in foraging.
[0115] However, the existing parrot population initialization method relies too much on the rand function to generate a random sequence. The use of this function has the advantage of a simple population initialization process, but the generation of the rand random sequence is prone to uneven distribution of the parrot population, which in turn leads to blank spaces in the search space, reducing the efficiency of the parrot search. In the embodiment of the present application, the Halton sequence is used. This sequence is a small difference sequence and is constructed using a deterministic method with prime numbers as the base. That is, in the embodiment of the present application, it is proposed to use the Halton sequence to replace the existing rand sequence, so that the parrot population is densely distributed in the search space, thereby improving the optimization efficiency of the parrot algorithm. The mathematical description of the sequence is:
[0116]
[0117] Among them, H(n) is the initial position of the nth parrot, n is the ordinal number of the Halton sequence; p is the cardinality of the Halton sequence, is called the root inverse of the parrot initial position n with respect to the cardinality p1, and p i (1≤i≤s), where s is the number of parameters to be identified, a i is a constant variable.
[0118] Step 402, generating a flock of parrots;
[0119] Step 403, calculating individual fitness and marking the position of the best parrot;
[0120] Step 404, foraging behavior, updating the own position according to formula (1) and flight strategy formula (2);
[0121] The iteration of the parrot's position during foraging is determined by the following formula:
[0122]
[0123] Where: is the parrot position vector of the t+1th generation, which indicates how the parrot position is updated; is the mean position of the parrot population in the tth generation; Levy(d) is the function that characterizes the flight status of the parrot; x best The current position of the leading parrot.
[0124] The basic parrot algorithm uses the Levy flight strategy to calculate the step length during the foraging and staying stages. The large step length and short interval generated by Levy flight will make the early search of the iteration insufficient and the search at the end of the generation too cumbersome, resulting in the disadvantage of lack of precision. At the same time, considering that the length of the step length has a great influence on the accuracy of the algorithm, that is, a large step length is conducive to exploration, and a small step length is conducive to development. Based on this, a tangent flight strategy is adopted in the embodiment of the present application, using the tangent to play a smooth role in the transition, running through the whole situation, and helping the parrot algorithm escape from the local optimal solution. Specifically, the tangent flight strategy is as shown in formula (2).
[0125]
[0126] Among them, σ represents the flight distance of the parrot; tan(θ) is the direction of the parrot's flight.
[0127] Step 405, stay behavior, update the own position according to formula (3) and flight strategy formula (2);
[0128] Steps of staying behavior:
[0129]
[0130] Among them, ones(1,d) represents a vector composed of 1s with a dimension of d.
[0131] Step 406, communication behavior, update the position according to formula (4);
[0132] The communication behavior includes flying to the flock and not flying to the flock. In the parrot algorithm, by introducing the probability control variable p, according to the size of p, and using the mean of the current parrot population position to symbolize the center of the group. The mathematical description of this process is:
[0133]
[0134] Step 407, fear behavior, update the position according to formula (5);
[0135] Fear behavior: This means that the t+1 generation of parrots do not trust the group's methods and take the initiative to find a safe environment again. The mathematical description formula for this step is:
[0136]
[0137] Step 408, the individual parrot flies toward the direction of the best parrot in the group;
[0138] Step 409, determine whether P is less than 0.1, if yes, go to step 410, if no, go to step 411;
[0139] Step 410, implementing the somersault foraging strategy according to formula (6) and formula (7);
[0140] Considering that at the end of the settlement period of the parrot algorithm, the parrot will fly towards the position of the best parrot in the current group. In order to avoid the reduction of the diversity of the parrot's flying mode caused by this and to avoid the parrot algorithm from falling into a local extreme value, a fuzzy control-based somersault action method is used in the embodiment of the present application to update the parrot's position. The process is described in mathematical language as follows:
[0141] x s (t+1)=x s (t)+S(r1x best -r2x s (t)) (6)
[0142] Among them, x s represents the position of the t+1th generation parrot of the sth parrot; x best is the optimal position in the parrot group; r is a random number (0-1); S is the flip factor, the value of which is determined by the following formula.
[0143] S=Ks+ε*ΔK s (7)
[0144] Ks is the uncorrected flip factor, ε represents the proportional factor, ΔK s Represents the flip factor gain after fuzzy control correction.
[0145] By introducing fuzzy control, the value of the flip factor can be adaptively changed. That is, in the embodiment of the present application, the deviation E of the motor speed loop and its change rate E' are used as the input of the fuzzy controller. By designing fuzzy rules, the fuzzy controller of the flip factor is adaptively processed logically, and finally outputs the correction value ΔK of the flip factor.s The fuzzy subsets we selected are {LB, LM, LS, ZE, HS, HM, HB}, which represent a very small, small, small, zero, large, large, and very large simulation parameter standard. In the embodiment of the present application, the determination principle of the fuzzy rules is: at the initial stage of the motor parameter identification control system, ΔK s Take a larger value. From formula (7), it can be seen that the larger the flip factor, the closer the parrot is to the optimal individual, thus ensuring that the parrots quickly move towards the optimal individual in the early stage. At the end of the system operation, the distance between the parrots is close enough and the position only needs to be fine-tuned. At this time, ΔK s A smaller value should be taken. In the medium term, ΔK s It can be adjusted according to the actual needs based on the response of the system. Finally, the fuzzy rules in the embodiment of this application are shown in Table 1 below:
[0146]
[0147] Table 1
[0148] After setting as above, the fuzzy surface generated by the fuzzy rules is as follows Figure 5 As shown, the input variables of the fuzzy surface are the deviation E of the motor speed loop and its rate of change E'. Through the fuzzy surface, it is possible to intuitively check whether the fuzzy rules are set incorrectly. After the fuzzy rules are set, the generated fuzzy surface should be consistent with that presented in the embodiment of the present application.
[0149] Step 411, updating the individual fitness of the parrot and recording the optimal position at this time; wherein the individual fitness with the smallest value is the optimal position;
[0150] Step 412, iteration ends;
[0151] Step 413, output the optimal parrot position.
[0152] It can be seen that in the embodiment of the present application, Figure 4 The dotted line frame on the left shows the design of the parrot algorithm process. When the algorithm is entered in Matlab according to the above parrot algorithm logic, the parrot algorithm-related parameters are initialized first, followed by the parrot population generation step. It should be noted that each parrot is a vector containing the dimension corresponding to the number of motor parameters to be identified. After rounds of iterations of the parrot population, the individual parrots are guided by performance indicators and eventually iterate towards the direction of the optimal motor identification parameter results. After initializing the parrot population, the algorithm will initialize the individual fitness value of the parrot. The individual fitness value is defined as the distance of the individual parrot from the optimal position. After traversing all the parrot populations, the position of the best parrot in the population is marked according to the principle of the smallest fitness value.
[0153] Then the four major behaviors of the parrot algorithm are carried out: 1) Foraging behavior updates the parrot's position according to formula (1) and the improved flight strategy (2); 2) Staying behavior updates the parrot's position according to formula (3) and the improved flight strategy (2); 3) Communication behavior updates the parrot's position according to the principle determined by formula (4); 4) Fear behavior updates the parrot's position according to the principle determined by formula (5). Among them, the individual parrots move towards the direction of the optimal parrot position in the population, that is, the range of solutions corresponding to the parrots to be identified parameters is contracted.
[0154] In addition, by introducing the random variable p, the parrot is controlled to maintain a probability of 0.1 to update its position according to the somersault strategy based on fuzzy control proposed in this application, thereby avoiding a reduction in the diversity of the parrot's flight methods at the end of the iteration, and at the same time to avoid the parrot algorithm from falling into a local extreme value; in addition, the individual parrot maintains a probability of 0.9 to calculate the position of the optimal parrot, thereby updating the size of the individual fitness, so that the position of the optimal parrot during this round of iteration can be recorded.
[0155] Further, in the embodiment of the present application, after the Parrot interactive motor algorithm process reaches this step, it is necessary to determine whether the Parrot algorithm meets the iteration end condition. In the embodiment of the present application, the performance index in the form of data of formula (8) is used to determine whether the iteration condition is met by evaluating the numerical value of the performance index. Specifically, the integral of the absolute value of the product of time t and the permanent magnet synchronous motor system speed loop error E(t) and the absolute value of the product of t and the current regulation loop error e(t) are taken as the performance index. The role of this performance index is to quantify the quality of the performance index returned by the motor parameters solved by the Parrot algorithm after calling the motor system model. The mathematical expression of the performance index J is as follows:
[0156]
[0157] In the embodiment of the present application, the dual closed-loop system of the permanent magnet synchronous motor will continuously generate the speed loop error E(t) and the current loop error e(t). When the motor system is running, the changes of E(t) and e(t) are constantly detected, thereby adaptively generating a series of J of different sizes. The smaller the value, the smaller the deviation of the speed loop and the current loop of the motor system, that is, the system reaches a steady state at this time, and the identified motor parameters are more accurate. If the end condition of the parrot algorithm iteration is not met, a new round of iteration of the parrot individual is continued until the optimal performance index of the system output is reached. At this time, the optimal parrot position vector is the optimal solution set containing the motor parameters to be identified.
[0158] In the embodiment of the present application, a permanent magnet motor control parameter identification strategy is adopted, which adopts the Parrot algorithm with a simple framework, clear structure and strong algorithm performance as the underlying algorithm, and improves the existing Parrot algorithm to improve its performance; and by setting performance indicators, a motor parameter identification strategy is used as a way for motor parameter identification to interact with the Parrot algorithm, so that the motor parameters finally identified are more accurate.
[0159] Corresponding to the above Figure 1 In an embodiment of the present application, a device for identifying motor parameters is provided, and the device is used to perform the following steps:
[0160] S11, initializing the parameters of the parrot algorithm through a preset sequence function, and generating a corresponding parrot population based on the initialized parrot algorithm; wherein the parrot population includes a plurality of parrots, the parrots are position vectors of motor parameters to be identified, the dimension of the position vector represents the number of motor parameters to be identified, and the motor parameters to be identified are motor parameters in a double closed-loop model of the motor;
[0161] S12, determining the individual fitness of each parrot in the parrot population, wherein the individual fitness represents the distance of the parrot from the target location;
[0162] S13, determining a target parrot at the optimal position in the parrot population according to the individual fitness, and updating the position of the parrot according to the target behavior of the parrot, wherein the target behavior represents the behavior of the parrot moving closer to the target parrot;
[0163] S14, repeating S12 and S13 until the performance index meets the preset conditions to determine the motor parameters corresponding to the position vector, wherein the performance index refers to the performance index of the motor double closed-loop model determined based on the parrot after the updated position.
[0164] Based on the device of the embodiment of the present application, the parameters of the parrot algorithm are initialized by a preset sequence function, and the corresponding parrot population is generated based on the initialized parrot algorithm, that is, the motor parameters to be identified in the motor double closed-loop model are mapped to parrots, and then the individual fitness of the parrot is determined, that is, the distance between the parrot and the target position, and then the target parrot in the optimal position in the parrot population is determined by the individual fitness, and the position of the parrot is updated according to the target behavior of the parrot. The updating process is a continuous iterative process. Through this iterative process, the position of the parrot can be continuously updated, which not only improves the recognition efficiency of the motor parameters, but also improves the recognition accuracy of the motor parameters, thereby solving the problems of low accuracy and complex identification process of motor parameter identification in related technologies.
[0165] like Figure 6As shown, an embodiment of the present application provides a device, including a processor 611, a communication interface 612, a memory 613 and a communication bus 614, wherein the processor 611, the communication interface 612, and the memory 613 communicate with each other through the communication bus 614.
[0166] Memory 613, used for storing computer programs;
[0167] In one embodiment of the present application, the processor 611 is used to execute the program stored in the memory 613 to implement the motor parameter identification method provided by any of the aforementioned method embodiments, and its role is similar and will not be repeated here.
[0168] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the motor parameter identification method provided in any of the aforementioned method embodiments are implemented.
[0169] The device embodiments described above are merely illustrative, wherein 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0170] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0171] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0172] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for identifying motor parameters, characterized in that: include: S11, initializing the parameters of the parrot algorithm through a preset sequence function, and generating a corresponding parrot population based on the initialized parrot algorithm; wherein the parrot population includes a plurality of parrots, the parrots are position vectors of motor parameters to be identified, the dimension of the position vector represents the number of motor parameters to be identified, and the motor parameters to be identified are motor parameters in a double closed-loop model of the motor; S12, determining the individual fitness of each parrot in the parrot population, wherein the individual fitness represents the distance of the parrot from the target location; S13, determining a target parrot at the optimal position in the parrot population according to the individual fitness, and updating the position of the parrot according to the target behavior of the parrot, wherein the target behavior represents the behavior of the parrot moving closer to the target parrot; S14, repeating S12 and S13 until the performance index meets the preset conditions to determine the motor parameters corresponding to the position vector, wherein the performance index refers to the performance index of the motor double closed-loop model determined based on the parrot after the updated position.
2. The method according to claim 1, characterized in that Initialize the parameters of the Parrot algorithm through a preset sequence, including: Initialize the parameters of the Parrot algorithm through the Halton sequence; Wherein, the Halton sequence is H(n) is the initial position of the nth parrot, n is the ordinal number of the Halton sequence; p is the cardinality of the Halton sequence; and is called the root inverse of the parrot initial position n with respect to the cardinality p1, and p i (1≤i≤s), where s is the number of parameters to be identified, a i is a constant variable.
3. The method according to claim 1, characterized in that When the target behavior is a foraging behavior, updating the position of the parrot according to the target behavior of the parrot includes: Determine the flight strategy of the parrot by a first formula, and update the position of the parrot during the foraging process according to a second formula under the flight strategy; The first formula is: in, is the position vector of the t+1th generation parrot, σ represents the flight distance of the parrot; tan(θ) is the direction of the parrot’s flight; The second formula is: in, is the mean position of the parrot population in the tth generation, max is the farthest distance from the target position in the parrot population in this round of iteration; Levy (d) is a function that characterizes the flight status of the parrot; x best is the position of the leading parrot, and rand represents the value range Any number in .
4. The method according to claim 1, characterized in that: When the target behavior is a stay behavior, updating the position of the parrot according to the target behavior of the parrot includes: Determine the flight strategy of the parrot by the first formula, and update the position of the parrot during the stay according to the third formula under the flight strategy; The first formula is: in, is the position vector of the t+1th generation parrot, σ represents the flight distance of the parrot; tan(θ) is the direction of the parrot’s flight; The third formula is: Among them, ones(1,d) represents a vector composed of 1 and with dimension d, x best is the current position of the leading parrot, and Levy(d) is a function that characterizes the parrot's flight status.
5. The method according to claim 1, characterized in that: When the target behavior is a communication behavior, updating the position of the parrot according to the target behavior of the parrot includes: The position of the parrot in the communication behavior is updated by the fourth formula; Wherein, the fourth formula is: Among them, p is the probability control variable.
6. The method according to claim 1, characterized in that When the target behavior is fear behavior, updating the position of the parrot according to the target behavior of the parrot includes: The position of the frightened parrot is updated by the fifth formula; 7. The method according to claim 1, characterized in that S2 and S3 are repeatedly executed until the performance index meets the preset conditions, and the motor parameters corresponding to the position vector are determined to include: S21, dividing the parrots after executing S12 and S13 once to obtain the updated positions into parrots of a first preset ratio and parrots of a second preset ratio, wherein the sum of the first preset ratio and the second preset ratio is 1, and the first preset ratio is smaller than the second preset ratio; S22, updating the positions of the parrots in the first preset proportion by using a sixth formula; Wherein, the sixth formula is: x s (t+1)=x s (t)+S(r1x best -r2x s (t)) Among them, x s represents the parrot's position in the t+1th generation; x best is the parrot closest to the target position in the parrot group; r is a random number (0-1); S is the flip factor; S=Ks+ε*ΔK s K s is the uncorrected flip factor, ε represents the proportional factor, ΔK s Represents the flip factor gain after fuzzy control correction; S23, updating the individual fitness of the parrots of the first preset ratio and the parrots of the second preset ratio after the position update, and executing S12 again according to the updated individual fitness to re-determine the target parrot; S24, executing S13 again to update the position of the parrot according to the target behavior of the parrot, and determining the motor parameters corresponding to the position vector when the performance index meets the preset conditions.
8. The method according to claim 1, characterized in that The performance indicators are determined by: Determine the integral of the absolute value of the product of time t and the speed loop error in the motor double closed loop model; The sum of the absolute values of the product of the integral, time, and the current regulation loop error is used as the performance indicator.
9. A device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein the processor is configured to execute the motor parameter identification method according to any one of claims 1 to 8.
10. A computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the motor parameter identification method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Construction and application of permanent magnet synchronous motor parameter identification model based on improved raccoon optimization algorithm
CN117914193A
Parrot optimization method
CN118690777A
Unmanned aerial vehicle task allocation method based on Levy flight parrot optimization algorithm
CN119225407A