Motor parameter optimization method and device, electronic equipment and storage medium
The position vector of motor parameters is constructed through the whale optimization algorithm and combined with the motor evaluation model, the problem of premature maturity in motor parameter optimization is solved, and the efficiency and accuracy of optimization are improved.
Patent Information
- Application Number
- CN202411990536.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The prior art is prone to premature maturity when optimizing motor parameters, and the results are inaccurate, resulting in large control errors and reducing the working efficiency of the motor.
Using whale optimization algorithm, the position vector of each whale individual is constructed and combined with a pre-constructed motor evaluation model is used to determine the fitness of each whale individual, and the best whale individual is selected to determine the optimal motor parameters.
It improves the efficiency and accuracy of motor parameter optimization, avoids premature maturity, and ensures the effectiveness of motor parameter optimization.
Smart Images

Figure CN119891848A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of motor parameter adjustment, and in particular to a motor parameter optimization method, device, electronic device and storage medium. Background Art
[0002] In the existing motor control system for permanent magnet synchronous motors, the dynamic parameters of the motor are easily affected by environmental factors such as high temperature and high humidity, so there is uncertainty in the dynamic parameters of the motor, and the motor control algorithm is very dependent on the real-time parameters of the motor. At this time, if constant parameters are still used as the control input of the algorithm, it will cause large control errors. Therefore, it is particularly important to optimize the motor parameters.
[0003] In the related art, a particle swarm algorithm is generally used to optimize motor parameters. However, this method is prone to premature failure and inaccurate results, which can easily lead to large deviations when optimizing motor parameters and reduce the working efficiency of the motor. Summary of the invention
[0004] The present application provides a method, device, electronic device and storage medium for optimizing motor parameters to solve the technical problem in the prior art that the motor parameters are easily optimized prematurely and the results are inaccurate, thereby easily resulting in large deviations when optimizing the motor parameters and reducing the working efficiency of the motor.
[0005] In a first aspect, the present application provides a method for optimizing motor parameters, the method comprising:
[0006] Acquire multiple groups of parameter values corresponding to multiple different motor parameters to be optimized, and for any individual whale in a preset whale population, acquire a group of parameter values from the multiple groups of parameter values to construct a position vector of the individual whale; wherein each group of the parameter values includes a parameter value corresponding to each of the motor parameters;
[0007] For any individual whale, the position vector of the individual whale is input into a pre-constructed motor evaluation model to obtain the fitness of the individual whale;
[0008] When the fitness is less than a preset threshold, determining the best whale individual from the whale population according to the fitness of each of the whale individuals;
[0009] The optimal motor parameters are determined according to the position vector of the best individual whale.
[0010] In a second aspect, the present application provides a device for optimizing motor parameters, the device comprising:
[0011] An acquisition module, used to acquire multiple groups of parameter values corresponding to multiple different motor parameters to be optimized, and for any individual whale in a preset whale population, acquire a group of parameter values from the multiple groups of parameter values to construct a position vector of the individual whale; wherein each group of the parameter values includes a parameter value corresponding to each of the motor parameters;
[0012] A first determination module is used for inputting the position vector of any individual whale into a pre-constructed motor evaluation model to obtain the fitness of the individual whale;
[0013] A second determination module is used to determine the best whale individual from the whale population according to the fitness of each of the whale individuals when the fitness is less than a preset threshold;
[0014] The third determination module is used to determine the optimal motor parameters according to the position vector of the best whale individual.
[0015] In a third aspect, the present application provides an electronic device comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; the memory is used to store a computer program; and the processor is used to implement the motor parameter optimization method described in any one of the first aspects when executing the computer program.
[0016] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for optimizing motor parameters described in any one of the first aspects.
[0017] The above-mentioned technical scheme provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by constructing the position vector of each whale individual by including parameter values corresponding to multiple different motor parameters, and determining the fitness of each whale individual in combination with a pre-constructed evaluation model, can determine the best whale individual according to the fitness, and determine an optimal motor parameter according to the best position vector. Since one whale individual integrates multiple motor parameters, the efficiency of motor parameter optimization can be improved. The whale optimization algorithm has few adjustable parameters, a clear structure, and includes a whale random search process, which avoids premature phenomenon, improves the accuracy of motor parameter optimization, and ensures the effectiveness of motor parameter optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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.
[0019] 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.
[0020] 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.
[0021] Figure 1 A flow chart of an embodiment of a method for optimizing motor parameters provided in an embodiment of the present application;
[0022] Figure 2 A flowchart of another method for optimizing motor parameters provided in an embodiment of the present application;
[0023] Figure 3 A schematic diagram of the structure of a motor vector control sub-model provided in an embodiment of the present application;
[0024] Figure 4 A schematic diagram of the structure of a motor evaluation model provided in an embodiment of the present application;
[0025] Figure 5 A flowchart of another method for optimizing motor parameters provided in an embodiment of the present application;
[0026] Figure 6 A flow chart of another method for optimizing motor parameters provided in an embodiment of the present application;
[0027] Figure 7 A flow chart of an embodiment of a method for optimizing motor parameters is provided for the embodiment of the present application;
[0028] Figure 8 A schematic diagram of a fitness change curve provided in an embodiment of the present application;
[0029] Fig. 9 A schematic diagram of a fitness change curve in the prior art provided in an embodiment of the present application;
[0030] Fig.10 A comparison diagram of an optimized curve of electronic resistance provided in an embodiment of the present application;
[0031] Fig.11 A block diagram of an embodiment of a motor parameter optimization device provided in an embodiment of the present application;
[0032] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] 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.
[0034] 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.
[0035] In order to solve the technical problem in the prior art that the motor parameters are easily premature and the results are inaccurate, thereby easily resulting in large deviations when optimizing the motor parameters and reducing the working efficiency of the motor, the present application provides a motor parameter optimization method, which can realize the construction of a position vector of each whale individual by including parameter values corresponding to multiple different motor parameters, and determine the fitness of each whale individual in combination with a pre-built evaluation model, and can determine the best whale individual according to the fitness, and determine an optimal motor parameter according to the best position vector. Since a whale individual integrates multiple motor parameters, the efficiency of motor parameter optimization can be improved, and the whale optimization algorithm has few adjustable parameters, a clear structure, and includes a whale random search process, which avoids premature phenomenon, improves the accuracy of motor parameter optimization, and ensures the effectiveness of motor parameter optimization.
[0036] The motor parameter optimization method provided in the present application is further explained below with reference to specific embodiments in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present application.
[0037] See also Figure 1 , is a flow chart of an embodiment of a method for optimizing motor parameters provided in an embodiment of the present application. Figure 1 As shown, the process may include the following steps:
[0038] Step 101, obtain multiple groups of parameter values corresponding to multiple different motor parameters to be optimized, and for any individual whale in a preset whale group, obtain a group of parameter values from the multiple groups of parameter values to construct a position vector of the individual whale, wherein each group of parameter values includes a parameter value corresponding to each motor parameter.
[0039] The above motor parameters are parameters related to the operation of the motor. The motor may be a permanent magnet synchronous motor or other motors, which are not limited in the present embodiment. The above motor parameters may include but are not limited to: stator resistance, flux linkage, quadrature axis inductance, direct axis inductance, and rotor moment of inertia.
[0040] The above-mentioned multiple groups of parameter values refer to different combinations of parameter values corresponding to different motor parameters, that is, each motor parameter may correspond to multiple parameter values, and each group of parameter values includes a parameter value corresponding to each motor parameter. For example, there are 5 different motor parameters, and each motor parameter corresponds to three parameter values, then there are 3*3*3*3*3=243 groups of parameter values.
[0041] The above-mentioned whale population is a pre-set population containing a preset number of whales. The number of whales in the whale population can be 55, 60, or other values, and the embodiment of the present application does not limit this.
[0042] The above-mentioned position vector refers to a vector that represents the individual position of the whale. Since it is constructed through each group of parameter values, and each group of parameter values includes parameter values corresponding to multiple motor parameters, the position vector is a multi-dimensional vector, and each dimensional vector can correspond to a motor parameter.
[0043] In the embodiment of the present application, the execution subject of the embodiment of the present application can obtain multiple groups of parameters corresponding to multiple different motor parameters to be optimized. Afterwards, for any individual whale in the preset whale population, a group of parameter values can be obtained from the multiple groups of parameter values to construct the position vector of the individual whale according to the group of parameter values.
[0044] Step 102: for any individual whale, input the position vector of the individual whale into a pre-built motor evaluation model to obtain the fitness of the individual whale.
[0045] Step 103: When the fitness is less than a preset threshold, the best whale individual is determined from the whale population according to the fitness of each whale individual.
[0046] Step 104: Determine optimal motor parameters according to the position vector of the best individual whale.
[0047] The following is a unified description of steps 102 to 104:
[0048] The above fitness is used to evaluate the quality of individual whales. In the embodiment of the present application, the smaller the fitness, the closer the individual whale is to the optimal motor parameters.
[0049] The above-mentioned motor evaluation model refers to a pre-built model used to determine the current fitness of individual whales.
[0050] The above-mentioned best whale individual refers to the best whale individual in the current whale population. The motor parameters represented by the corresponding position vector of the best whale individual are the best in the current whale population, that is, the efficiency achieved by the motor operating under the motor parameters is higher than that achieved under the motor parameters represented by the position vectors of other whale individuals.
[0051] In an embodiment of the present application, after constructing each individual whale in a preset whale population, the execution subject of the embodiment of the present application can input the position vector of each individual whale into a pre-constructed motor evaluation model for each individual whale to obtain the fitness of the individual whale.
[0052] As for how to obtain the fitness of the individual whale, we can find it in the following Figure 2 The process shown is explained and will not be described in detail here.
[0053] Afterwards, it may be determined whether the fitness is less than a preset threshold.
[0054] Optionally, when it is determined that the fitness is less than a preset threshold, it means that the best whale individual can be determined based on the currently constructed whale population. Therefore, the best whale individual can be determined from the whale population based on the fitness of each whale individual.
[0055] As an optional implementation method, the whale individual with the smallest fitness in the whale population can be determined as the best whale individual in the whale population, and the best whale individual can represent the optimal solution of the motor parameters.
[0056] Afterwards, since the position vector of the individual whale is constructed based on the parameter values of multiple motor parameters, the optimal motor parameters can be determined based on the position vector of the best individual whale.
[0057] As an optional implementation method, the position vector of the best whale individual can be analyzed to obtain the motor parameters corresponding to the position vector, and the motor parameters are determined as the optimal motor parameters.
[0058] The technical solution provided by the embodiment of the present application obtains multiple groups of parameter values corresponding to multiple different motor parameters to be optimized, and for any individual whale in a preset whale group, obtains a group of parameter values from the multiple groups of parameter values to construct a position vector of the individual whale, wherein each group of parameter values includes a parameter value corresponding to each motor parameter, and for any individual whale, the position vector of the individual whale is input into a pre-constructed motor evaluation model to obtain the fitness of the individual whale, and when the above fitness is less than a preset threshold, the best individual whale is determined from the above whale population according to the fitness of each individual whale, and the optimal motor parameters are determined according to the position vector of the best individual whale. This technical solution constructs the position vector of each whale individual by including parameter values corresponding to multiple different motor parameters, and determines the fitness of each whale individual in combination with a pre-built evaluation model. The best whale individual can be determined based on the fitness, and an optimal motor parameter can be determined based on the best position vector. Since a whale individual integrates multiple motor parameters, the efficiency of motor parameter optimization can be improved. The whale optimization algorithm has few adjustable parameters, a clear structure, and includes a whale random search process, which avoids premature optimization, improves the accuracy of motor parameter optimization, and ensures the effectiveness of motor parameter optimization.
[0059] See also Figure 2 , which is a flow chart of an embodiment of another method for optimizing motor parameters provided in an embodiment of the present application. Figure 2 The process shown in Figure 1 Based on the process shown, it is described how the motor evaluation model determines the fitness of the individual whale after the position vector of the individual whale is input into the motor evaluation model, based on the motor evaluation model including the motor vector control sub-model and the evaluation function sub-model, wherein, Figure 2 The process shown can be applied to the motor evaluation model. Figure 2 As shown, the process may include the following steps:
[0060] Step 201: according to the position vector of the individual whale, set the motor parameters of the motor module in the motor vector control sub-model.
[0061] Step 202: Input the preset expected speed into the updated motor vector control sub-model to obtain the speed difference output by the motor vector control sub-model within the operating time period.
[0062] The following is a unified description of step 201 and step 202:
[0063] The above-mentioned motor vector control sub-model refers to a pre-built motor vector control model, such as a simulation model built in Simulink (simulation system), and the motor vector control sub-model can be used to perform vector control on the motor.
[0064] For example, see Figure 3 , is a schematic diagram of the structure of a motor vector control sub-model provided in an embodiment of the present application. Figure 3 As shown, the structure may include a speed regulation loop, a current regulation loop, a dq-αβ conversion module, a SVPWM (Space Vector Pulse Width Modulation) vector modulation module, an IGBT (Insulated gate bipolar transistor) switch module, a permanent magnet synchronous motor, an abc-αβ conversion module, and an αβ-dq conversion module.
[0065] Should Figure 3 The model shown can control the motor system by limiting the expected d-axis current to zero. The specific control action is: select the deviation e(t) between the expected speed and the speed feedback, and use it as the input of the current regulation loop. By limiting the expected d-axis current to zero and adjusting the q-axis current, the expected q-axis voltage is controlled. The d-axis expected voltage is combined for a 2 / 2 transformation, and the SVPWM vector modulation is used to generate a switching signal to control the IGBT, thereby generating a three-phase current abc acting on the permanent magnet synchronous motor, and the motor end outputs an electrical angle θ. The three-phase current and the electrical angle θ undergo a 3 / 2 change and a 2 / 2 change to form a q-axis current feedback and a d-axis current feedback, respectively, which are subtracted from the corresponding expected current values to form a closed-loop feedback, and the entire motor vector control model is realized.
[0066] The above-mentioned expected speed refers to the preset speed value that the motor module is expected to reach.
[0067] In one embodiment, after receiving the position vector of the individual whale sent by the execution subject of the above embodiment, the motor model can set the motor parameters of the motor module in the motor vector control sub-model according to the position vector of the individual whale, so that the motor module operates based on the motor parameters corresponding to the individual whale. The above motor module can be a motor included in the motor vector control sub-model, for example Figure 3 The permanent magnet synchronous motor shown.
[0068] Afterwards, the preset expected speed can be input into the updated motor vector control sub-model to obtain the speed difference output by the motor vector control sub-model during the operation period. The speed difference here refers to the difference between the expected speed and the actual speed fed back by the motor module.
[0069] As an optional implementation method, after receiving the expected speed, the updated motor vector control sub-model can run the updated motor module based on the expected speed to obtain the actual speed output by the motor module. Thereafter, the speed difference can be obtained by subtracting the actual speed from the expected speed.
[0070] As an exemplary embodiment, the speed difference can be determined through iterative steps until the feedback direct-axis current fed back by the motor vector control sub-model and the preset expected direct-axis current meet preset conditions, wherein the preset condition can be that the feedback direct-axis current reaches the expected direct-axis current, or that the difference between the feedback direct-axis current and the expected direct-axis current is less than a preset difference threshold.
[0071] The iterative steps are as follows:
[0072] First, the expected speed is subtracted from the actual speed obtained in the previous round to obtain the speed deviation. When the current round is the first round, the actual speed can be a preset value, that is, during the first round of iterations, the motor module in the motor vector control submodel has not yet fed back the actual speed. Therefore, a preset value can be added as the actual speed of the first round. The preset value can be determined according to the expected speed, for example, it can be the expected speed multiplied by a preset percentage, or it can be a value determined according to historical records. The embodiment of the present application does not limit this. The above-mentioned actual speed refers to the motor module in the motor vector control submodel (for example Figure 3 The actual speed of the permanent magnet synchronous motor (shown) actually fed back in the previous round.
[0073] Then, the above speed deviation and the preset desired quadrature axis current (for example Figure 3 The desired q-axis current shown in FIG. 1 ), and the preset desired direct-axis current (eg Figure 3 The desired d-axis current shown in the figure is input into a preset current regulation module to obtain the desired quadrature-axis voltage output by the current regulation module. The above-mentioned current regulation module can be used to regulate the current in the motor vector control sub-model, for example Figure 3 In the current regulation loop shown, the above-mentioned expected direct-axis current can be 0. In this method, the expected direct-axis current can be limited to zero (it can also be other values greater than zero, and the embodiments of the present application do not limit this) and the expected quadrature-axis voltage can be controlled by adjusting the quadrature-axis current.
[0074] After that, the three-phase current acting on the motor module can be determined based on the expected quadrature-axis voltage and the preset expected direct-axis voltage. As an optional implementation method, the above-mentioned expected quadrature-axis voltage and the expected direct-axis voltage can be transformed 2 / 2, and the switching signal for controlling the IGBT is generated through SVPWM vector modulation, thereby generating the three-phase current abc acting on the permanent magnet synchronous motor.
[0075] Thereafter, the three-phase current can be input into the motor module to obtain the electrical angle and actual rotation speed fed back by the motor module.
[0076] Finally, the feedback direct-axis current corresponding to the desired direct-axis current can be determined according to the three-phase current and the electrical angle. In addition, the feedback quadrature-axis current corresponding to the desired quadrature-axis current can also be obtained.
[0077] As an optional implementation, the three-phase current and electrical angle may be transformed by 3 / 2 and 2 / 2 to form feedback quadrature-axis current and feedback direct-axis current respectively, and their corresponding expected current values are subtracted to form closed-loop feedback.
[0078] At this point, the above iteration steps are completed, wherein each round of iteration can obtain a feedback direct-axis current and an actual rotation speed. After the feedback direct-axis current is obtained, it can be determined whether the feedback direct-axis current and the above expected direct-axis current meet the preset conditions.
[0079] Optionally, if the condition is satisfied, the iteration can be terminated to obtain the actual rotation speed of the final wheel, and the rotation speed deviation can be obtained by subtracting the actual rotation speed from the expected rotation speed.
[0080] Optionally, if not satisfied, the next round of iteration can be continued.
[0081] Step 203: input the rotation speed difference into the evaluation function sub-model to obtain the fitness of the individual whale output by the evaluation function sub-model.
[0082] The above-mentioned evaluation function sub-model refers to a model used to determine the fitness of individual whales.
[0083] In the embodiment of the present application, by inputting the rotation speed difference obtained in the above steps into a preset evaluation function sub-model, the fitness of the individual whale output by the evaluation function sub-model can be obtained.
[0084] As an optional implementation method, the above speed difference can be input into the evaluation function formula shown in the following formula (1) to obtain the fitness of the individual whale corresponding to the speed difference:
[0085]
[0086] Among them, the above J is the fitness of the individual whale, the above t is the total duration corresponding to the operation time period of the motor module in the corresponding motor parameters of the individual whale, and the above e(t) is the above speed difference.
[0087] As another optional implementation, the above evaluation function sub-model may include: Figure 4 The model structure shown. Figure 4, is a schematic diagram of a motor evaluation model provided in an embodiment of the present application. Figure 4 As shown, the motor evaluation model may include an evaluation function sub-model and Figure 3 The motor vector control submodel is shown in Figure 1. Figure 4 As shown, the evaluation function sub-model may include a multiplier, an integrator, and an output module.
[0088] Based on this, the absolute value of the speed difference obtained and the total duration corresponding to the operation time period of the motor module in the operation of the motor parameters of the individual whale can be input into the multiplier to obtain the product of the absolute value and the total duration. Afterwards, the product can be input into the integrator to integrate the product according to the total duration, and the integration result is output through the output module to obtain the fitness of the individual whale.
[0089] The technical solution provided by the embodiment of the present application sets the motor parameters of the motor module in the motor vector control submodel according to the position vector of the individual whale, inputs the preset expected speed into the updated motor vector control submodel, obtains the speed difference output by the motor vector control submodel during the operation time period, inputs the speed difference into the above-mentioned evaluation function submodel, and obtains the fitness of the individual whale output by the evaluation function submodel. This technical solution determines the fitness of each individual whale through the motor evaluation model, and the motor evaluation module includes a motor vector control submodel and an evaluation function submodel, wherein the motor vector control submodel can simulate the speed deviation of the motor under the motor parameters corresponding to the individual whale, and the evaluation function submodel can determine the fitness of the individual whale according to the speed deviation. The above two submodels can be combined to simulate the fitness of the motor under the motor parameters corresponding to the individual whale, and the obtained fitness is more in line with the actual situation and more accurate, so as to achieve more efficient and accurate determination of the fitness of the individual whale.
[0090] See also Figure 5 , which is a flow chart of an embodiment of another method for optimizing motor parameters provided in an embodiment of the present application. Figure 5 The process shown in Figure 1 Based on the process shown in FIG. 1 , it describes how to determine the optimal motor parameters when the fitness of the individual whale is greater than or equal to the preset threshold. Figure 5 As shown, the process may include the following steps:
[0091] Step 501: When the fitness of a whale individual is greater than or equal to a preset threshold, for any whale individual, the current position vector of the whale individual is adjusted according to the position vector of the best whale individual to obtain a first position vector.
[0092] The best whale individuals mentioned above refer to those Figure 1The best individual whales in the current whale population as determined by the process shown.
[0093] In the embodiment of the present application, when it is determined that the fitness of a whale individual is greater than or equal to a preset threshold, it means that there is at least one whale individual to be optimized in the whale population at this time, so Figure 1 The best individual whale position vector determined by the process shown is used to adjust the current individual whale position vector to obtain a first position vector.
[0094] As for how to adjust the current position vector of the whale individual according to the position vector of the best whale individual to obtain the first position vector, please refer to the following Figure 6 The process shown here will not be described in detail. Figure 6 The process shown in the figure describes how to adjust the position vector of the current round of the whale individual according to the position vector of the best whale individual in the current round to obtain the second position vector. Based on this, in this embodiment, Figure 1 The best whale individual determined by the process shown is used as the best whale individual in the current round, and the current position vector of the whale individual is used as the position vector of the current round of the whale individual, and according to Figure 6 The process shown uses the obtained second position vector as the above-mentioned first position vector.
[0095] Step 502: Use the first position vector as the position vector of the first round of iteration. For any individual whale, input the position vector of the current wheel of the individual whale into a pre-built motor evaluation model to obtain the fitness of the individual whale.
[0096] Step 503: According to the fitness of the individual whales, the best individual whale in the current round is determined from the above whale population.
[0097] Step 504: For any individual whale, the position vector of the current round of the individual whale is adjusted according to the position vector of the best individual whale in the current round to obtain a second position vector.
[0098] The following is a unified description of steps 502 to 504:
[0099] The above motor evaluation model can be a model for evaluating motor parameters corresponding to individual whales, for example Figure 1 The motor evaluation model in the process shown.
[0100] The above fitness is used to evaluate the quality of individual whales. In the embodiment of the present application, the smaller the fitness, the closer the individual whale is to the optimal motor parameters.
[0101] In the embodiment of the present application, when determining Figure 1When the fitness of each whale individual determined by the process shown is greater than or equal to a preset threshold, the current position vector of the whale individual can be adjusted to a first position vector based on the position vector of the best whale individual, and the first position vector can be used as the position vector of the whale individual in the first round of iteration to iterate the whale individuals in the whale population.
[0102] In one embodiment, for any individual whale, the position vector of the current wheel of the individual whale may be input into a pre-built motor evaluation model to obtain the fitness of the individual whale.
[0103] As an optional implementation, the process of determining the fitness of individual whales through the motor evaluation model can be found in Figure 2 The process shown will not be described in detail here.
[0104] Afterwards, the best whale individual for the current round can be determined from the whale population based on the fitness of each whale individual.
[0105] As an optional implementation method, the whale individual with the smallest fitness can be determined as the best whale individual in the current round in the whale population.
[0106] In one embodiment, during this round of iterations, after determining the best whale individual for the current wheel, in order to further optimize the motor parameters corresponding to the position vector of the whale individual, the executive body of the embodiment of the present application may adjust the position vector of the current wheel of the whale individual according to the position vector of the best whale individual for the current wheel to obtain an adjusted second position vector.
[0107] As for how to adjust the position vector of the current round of the whale individual according to the position vector of the best whale individual in the current round to obtain the adjusted second position vector, it can be described below by Figure 6 The process shown is explained and will not be described in detail here.
[0108] Step 505: determine whether the current number of iterations reaches a preset number threshold, or the fitness of any individual whale is less than the preset threshold. If it is determined that the number of iterations does not reach the number threshold, and the fitness of any individual whale is greater than or equal to the preset threshold, the second position vector is used as the position vector of the next round, and return to step 502; if so, execute step 506.
[0109] Step 506: After the iteration is completed, the optimal motor parameters are determined according to the position vector of the best individual whale obtained in the last round.
[0110] The following is a unified description of step 505 and step 506:
[0111] In the embodiment of the present application, after completing each iteration, the execution subject of the embodiment of the present application can determine whether the preset iteration end condition is currently met.
[0112] As an optional implementation method, it can be determined whether the current number of iterations reaches a preset number threshold. If the number of iterations reaches the number threshold, it can be determined that the iteration end condition is currently met; if the number of iterations does not reach the above number threshold, it can be determined that the iteration end condition is not currently met.
[0113] As another optional implementation, the execution subject of the embodiment of the present application may determine whether the fitness of any whale individual is less than a preset threshold. If it is determined that the fitness of any whale individual is less than the preset threshold, it can be determined that the iteration end condition is currently met; if it is determined that the fitness of at least one whale individual is greater than or equal to the preset threshold, it can be determined that the iteration end condition is not currently met.
[0114] As another optional implementation, the execution subject of the embodiment of the present application may determine whether the current number of iterations reaches a preset number threshold, and determine whether the fitness of any individual whale is less than a preset threshold.
[0115] Optionally, when it is determined that the current number of iterations reaches a preset number threshold, or the fitness of any individual whale is less than a preset threshold, it can be determined that the preset iteration end condition is currently met.
[0116] Optionally, when it is determined that the current number of iterations does not reach the above number threshold, and there is at least one whale individual whose fitness is greater than or equal to a preset threshold, it can be determined that the preset iteration end condition is not met at present.
[0117] In one embodiment, after determining that the preset iteration end condition is currently met, the optimal motor parameters can be determined based on the position vector of the best whale individual obtained in the last round.
[0118] As an optional implementation method, the motor parameters represented by the position vector of the best individual whale obtained in the last round can be determined, and the motor parameters can be determined as the optimal motor parameters.
[0119] The technical solution provided by the embodiment of the present application is that when the fitness of the whale individual is greater than or equal to a preset threshold, for any whale individual, according to the position vector of the best whale individual, the current position vector of the whale individual is adjusted to obtain a first position vector, and the first position vector is used as the position vector of the first round of iteration. For any whale individual, the position vector of the current round of the above-mentioned whale individual is input into a pre-constructed motor evaluation model to obtain the fitness of the whale individual, and according to the fitness of the whale individual, the best whale individual of the current round is determined from the above-mentioned whale population. For any whale individual, according to the position vector of the best whale individual of the current round, the position vector of the current round of the whale individual is adjusted to obtain a second position vector, and it is determined whether the current number of iterations reaches a preset number threshold, or the fitness of any whale individual is less than the preset threshold. If it is determined that the number of iterations does not reach the number threshold, and the fitness of any whale individual is greater than or equal to the preset threshold, the second position vector is used as the position vector of the next round, and the iteration step is returned; if not, after the iteration is completed, the optimal motor parameters are determined according to the position vector of the best whale individual obtained in the last round. This technical solution uses the whale optimization algorithm to iteratively optimize the motor parameters to be optimized. It can achieve one-time operation and simultaneously optimize multiple parameters of the motor. The whale optimization algorithm has few adjustable parameters and the existence of the whale random search process effectively avoids the algorithm from falling into premature phenomenon, thereby improving the accuracy of the motor parameters and ensuring the effectiveness of the optimization results.
[0120] See also Figure 6 , which is a flow chart of an embodiment of another method for optimizing motor parameters provided in an embodiment of the present application. Figure 6 The process shown in Figure 5 Based on the process shown in FIG. 1 , it is described how to adjust the position vector of the current round of the whale individual according to the position vector of the best whale individual in the current round to obtain the second position vector. Figure 6 As shown, the process may include the following steps:
[0121] Step 601: Determine the current shrinkage and enveloping coefficient.
[0122] The above-mentioned shrinkage coefficient refers to the degree of shrinkage of the current whale population.
[0123] In one embodiment, when determining the current shrinkage and enveloping coefficient, the execution subject of the embodiment of the present application may first obtain the current linear weight value, and input the linear weight value into the following formula (II) to obtain the shrinkage and enveloping coefficient, wherein the linear weight value may be inversely proportional to the number of iterations:
[0124]
[0125] Among them, the above Represents the shrinkage factor. represents the above linear weight value, and the above rand represents a random positive number not exceeding 1.
[0126] Step 602: perform a first adjustment on the position vector of the current round of the whale individual according to the prey encirclement sub-algorithm in the preset whale optimization algorithm, the best whale individual in the current round, and the shrinkage encirclement coefficient.
[0127] The above-mentioned prey encirclement sub-algorithm refers to the step used to encircle prey in the whale optimization algorithm, which aims to take the best whale individual in the current round as the prey, and other whale individuals approach the prey, so as to achieve the purpose of optimizing the position vector of the whale individual.
[0128] In the embodiment of the present application, when the execution subject of the embodiment of the present application performs a first adjustment on the position vector of the current round of the whale individual according to the surrounding prey sub-algorithm, the best whale individual of the current round, and the shrinking surrounding coefficient, the position vector of the current round of the above-mentioned whale individual, the position vector of the best whale individual of the current round, and the shrinking surrounding system can be input into the following formula (III) to obtain the first adjusted whale individual:
[0129]
[0130] Among them, the above is the position vector of the first adjusted whale individual. is the position vector of the best whale individual in the current round. is the shrinkage factor, the above is a random positive number not exceeding the preset value. is the position vector of the current round of the whale individual. It can be a preset multiple of the random integer rand in formula (2), for example, 2 times.
[0131] Step 603: Generate a random number and determine whether the random number is greater than or equal to a first preset threshold. If so, execute step 604; if not, execute step 605.
[0132] Step 604: According to the bubble net attack sub-algorithm in the whale optimization algorithm and the best whale individual in the current round, a second adjustment is made to the position vector of the current round of the whale individual to obtain a second position vector.
[0133] Step 605: Perform a second adjustment on the position vector of the current wheel of the individual whale based on the shrinkage envelopment coefficient to obtain a second position vector.
[0134] The following is a unified description of steps 603 to 605:
[0135] In the embodiment of the present application, in order to make the individual whale closer to the best individual whale, the execution subject of the embodiment of the present application can generate a random number and make a second adjustment to the position vector of the individual whale according to the generated random number.
[0136] As an optional implementation method, it can be determined whether the random number is greater than or equal to a first preset threshold. The above-mentioned first preset threshold is a pre-set threshold, which can be 0.5 or other values. The embodiment of the present application does not limit this.
[0137] As an exemplary implementation, when it is determined that the random number is greater than or equal to the above-mentioned first preset threshold, the position vector of the current round of the whale individual can be adjusted for the second time according to the bubble net attack sub-algorithm in the above-mentioned whale optimization algorithm and the best whale individual in the current round to obtain a second position vector.
[0138] As an implementation method, the position vector of the current round of the whale individual and the position vector of the current best whale individual can be input into the following formula (IV) to obtain the second position vector of the second adjusted whale individual:
[0139]
[0140] Among them, the above is the second position vector of the individual whale is the position vector of the best whale individual in the current round. is the position vector of the current wheel of the whale individual, the above b is the first preset parameter, and the above l is the second preset parameter.
[0141] As another exemplary embodiment, when it is determined that the random number is less than the first preset threshold, a second adjustment may be made to the position vector of the current round of the individual whale based on the shrinkage and envelopment coefficient to obtain a second position vector.
[0142] As an implementation method, it can be determined whether the absolute value of the shrinkage envelopment coefficient is less than a second preset threshold. The second preset threshold can be a preset value representing that the current shrinkage range of the whale population is in a smaller range, such as 1.
[0143] Optionally, when it is determined that the absolute value of the shrinkage and encirclement coefficient is less than a second preset threshold, it means that the shrinkage range of the whale population is small at this time. Therefore, the position vector of the current round of the whale individual can be adjusted for the second time according to the surrounding prey sub-algorithm, the best whale individual in the current round, and the shrinkage and encirclement coefficient to obtain the second position vector.
[0144] As an exemplary implementation, the bubble net attack sub-algorithm shown in the above formula (IV) can be used to perform a second adjustment on the position vector of the current round of the whale individual to obtain a second position vector.
[0145] Optionally, when it is determined that the absolute value of the shrinkage envelopment coefficient is greater than or equal to a second preset threshold, it means that the shrinkage range of the whale population is larger at this time. Therefore, according to the random search sub-algorithm in the whale optimization algorithm, the position vector of the current round of the individual whale can be adjusted for the second time to obtain the second position vector.
[0146] As an exemplary implementation, the position vector of the current wheel of any random whale individual can be obtained, and the position vector of the current wheel of the above whale individual and the position vector of the current wheel of the random whale individual are input into the following formula (V) to obtain the second position vector of the second adjusted whale individual:
[0147]
[0148] Among them, the above is the second position vector of the individual whale. is the position vector of the current round of the random whale individual mentioned above is the above shrinkage coefficient, is a random positive number not exceeding the preset value. is the position vector of the current round of the individual whale.
[0149] The technical solution provided by the embodiment of the present application is to make a first adjustment to the position vector of the current round of the whale individual according to the prey encirclement sub-algorithm in the preset whale optimization algorithm, the best whale individual in the current round, and the shrinkage encirclement coefficient, generate a random number, and determine whether the random number is greater than or equal to the first preset threshold value. If so, the position vector of the current round of the whale individual is adjusted for the second time according to the bubble net attack sub-algorithm in the whale optimization algorithm and the best whale individual in the current round to obtain a second position vector; if not, the position vector of the current round of the whale individual is adjusted for the second time based on the shrinkage encirclement coefficient to obtain a second position vector. This technical solution uses the whale optimization algorithm to adjust the position vector of the whale individual in the whale population twice to make the whale individual closer to the best whale individual, so that the best whale individual in the last round can be obtained through multiple iterations, and the whale individual is adjusted by the random search sub-algorithm, which effectively avoids the algorithm from falling into premature phenomenon, and improves the accuracy of the motor parameters while ensuring the effectiveness of the optimization results.
[0150] See also Figure 7 , provides a flow chart of another embodiment of a method for optimizing motor parameters for the present application. Figure 7 As shown, the process may include the following steps:
[0151] 1. Whale algorithm deployment settings:
[0152] (1) First, build a permanent magnet synchronous motor dynamics model in Simulink, such as Figure 4 As shown;
[0153] (2) At the same time, complete the writing of the whale algorithm in Matlab.
[0154] (3) The whale algorithm originated from the simulation of the foraging phenomenon of humpback whales in the ocean. The three steps implemented by the whale algorithm are: random search for prey, encirclement and prey hunting, and bubble prey hunting.
[0155] (4) The core advantage of the whale algorithm is that compared with other group optimization algorithms, it has a clear structure and will not fall into the local optimum due to the existence of the random search step. The present invention takes into account the requirements of the motor parameter identification system design, such as the need for a small number of adjustable system parameters, reliable identification results, and no local optimum, and thus selects the whale algorithm as the best algorithm for parameter identification.
[0156] (5) The whale position vector designed in this application is five-dimensional, and each dimension represents the five identified parameters, namely, stator resistance, flux linkage, AC and DC axis inductance, and rotor moment of inertia. Figure 3 After the update iteration shown, the optimal whale position vector generated represents the optimal value of the parameter to be identified.
[0157] (6) This application uses appropriate functions as evaluation indicators for the accuracy of motor system identification results, which will be introduced one by one below.
[0158] 2. Introduction to the three major steps of the whale algorithm:
[0159] (1) The encirclement step is the first action taken by a whale after discovering its prey. This step can be described by the following function:
[0160]
[0161] Where: Represents the intermediate vector of the whale algorithm; Represents the optimal position whale vector in the current iteration; represents the distance the next generation of whales will swim; represents the position vector of the whale of generation t+1; represents the position vector of the whale of the tth generation; rand represents a random positive number not exceeding 1; Represents a vector that decreases from 2 to 0.
[0162] (2) The bubble net attack step simulates the predation process. There are two different hunting methods in this step, which can be expressed by the following function:
[0163]
[0164] Where: p is a random positive number not exceeding 1; Represents the intermediate vector of the whale algorithm; Represents the optimal position whale vector in the current iteration; represents the distance the next generation of whales will swim; represents the position vector of the whale of generation t+1; represents the position vector of the whale of the tth generation; rand represents a random positive number not exceeding 1; represents a vector decreasing from 2 to 0; l and b are the parameters that determine the whale's ascending spiral.
[0165] (3) The random search step is the key to the algorithm's superiority over other algorithms. The existence of whale random search avoids the algorithm from falling into the defect of premature search.
[0166]
[0167] In the formula, represents random whale positions; A vector representing the distance of a random whale from other whale groups; Represents the intermediate vector of the whale algorithm; represents the position vector of the whale of generation t+1; Represents the position vector of the whale of generation t.
[0168] The specific steps of using the whale algorithm to identify motor parameters are as follows:
[0169] 1. As Figure 7 As shown in the dashed box on the left side of the flowchart, it is the design step of the whale algorithm deployment module in this application. The first is the initialization of the number of whales. The number of whales is equivalent to the set of solutions containing the motor parameters to be identified. Through each round of whale iteration, the algorithm will control the whale to iterate in the direction of the minimum evaluation function. This value is selected according to the actual task complexity. In the field of motor identification, the present invention sets the number of whales to 55.
[0170] 2. After the whale individuals are generated, each whale individual is essentially a five-dimensional vector containing the parameters to be identified. In the first round of iteration, the fitness of the whale individuals will be randomly generated according to the evaluation function we set. The best fitness among these 55 whale individuals is marked as the optimal whale position, i.e.
[0171]
[0172] 3. Update relevant parameters according to the formula (VI) of the whale algorithm.
[0173] 4. By introducing a random variable p and comparing it with the value of 0.5, the comparison result is used to determine whether the whale chooses to adaptively switch between the two postures determined by formula (VII) to prey.
[0174] 5. By judgment The relationship between the size of 1 and this determines whether the whale performs a random search process formula (eight), that is, when When it is greater than 1, the whale is randomly searched by formula (VIII). The existence of the random search process ensures that the result of the motor parameter identification jumps out of the local optimum.
[0175] 6. After the algorithm program proposed in this application is carried out to this point, it is necessary to determine whether the whale algorithm meets the iteration end conditions. The present invention sets a motor parameter identification evaluation function index in the form of a structure such as formula (IX) to determine whether the algorithm meets the iteration end index.
[0176] 7. Take the integral of the absolute value of the product of time t and the permanent magnet synchronous motor system speed loop error e(t) as the motor parameter identification evaluation function index J. The expression of the evaluation function index J is as follows:
[0177]
[0178] Among them, the above J is the fitness of the individual whale, the above t is the total duration corresponding to the operation time period of the motor module in the corresponding motor parameters of the individual whale, and the above e(t) is the above speed difference.
[0179] Among them, for the above evaluation function, since the motor parameter identification system designed in this application will continuously obtain the parameters of the motor speed loop error e(t) as the motor system runs, and each round of iteration, the evaluation index shown in the above formula (IX) will generate a fitness value accordingly. The smaller the value, the smaller the deviation of the speed loop of the motor system, that is, the system reaches a steady state at this time, and the identified motor parameters are more accurate. After completing each round of whale iteration, if the optimal fitness has not been reached at this time, the system will trigger the second set of algorithm logic end conditions, that is, to determine whether the preset number of iterations has been reached. If the conditions are not met, the program will return to the second step, reassign the whale individual, and start a new round of iteration until the optimal motor fitness value is output.
[0180] The technical solution provided in the embodiment of the present application can realize one-time operation and simultaneous multi-parameter identification of the motor by integrating the whale algorithm into the method of motor parameter optimization. The algorithm takes into account the fact that the whale algorithm has few adjustable parameters and the existence of the whale random search process, which effectively avoids the algorithm from falling into the premature phenomenon, thereby advantageously ensuring the validity of the identification results.
[0181] In addition, in order to further illustrate the motor parameter optimization method provided by the present application, an example is given below:
[0182] Assume that the initial motor parameters of the motor are as shown in Table 1 below:
[0183] Table 1
[0184] Based on this, the motor parameter optimization method provided in this application can be obtained as follows: Figure 8 The fitness change curve shown in Figure 8 , which is a schematic diagram of a fitness change curve provided in an embodiment of the present application.
[0185] Continuing with the assumption, based on Table 1, the motor parameters are optimized using the particle swarm algorithm in the prior art, and the following can be obtained: Fig. 9 The fitness change curve shown in Fig. 9 , which is a schematic diagram of a fitness change curve in the prior art provided in an embodiment of the present application.
[0186] By Figure 8 and Fig. 9 By comparison, it can be seen that the optimal fitness value of the motor parameters of the permanent magnet synchronous motor based on the particle swarm algorithm tends to be stable after 24 iterations, and the final fitness value is stable at about 4.10; in contrast, the optimal fitness value of the motor parameter optimization method based on the present application does not change after the 12th iteration, and at this time reaches the optimal fitness value of 3.543. It can be seen from the form of fitness expression (IX) that the size of the fitness depends on the first-order definite integral of the product of the absolute value of the motor running time t and the motor speed loop deviation e(t). Therefore, the lower the fitness, the more stable the motor system is, and the identified motor parameters are also the best at this time.
[0187] It can be seen that the motor parameter optimization method provided in the present application not only takes a shorter time, but also achieves better performance release compared to the motor parameter identification system based on particle swarm.
[0188] Finally, after the motor parameter identification system completes the iteration, after the motor parameter optimization method provided in this application is used for optimization, the final motor parameter can be obtained as follows: Rs = 2.931Ω, Ld=0.00851H,Lq=0.00851H,Jm=0.001043Kg·m2,The final motor parameters obtained by the particle swarm algorithm identification strategy are: Rs=3.028Ω, Ld = 0.00961H, Lq = 0.00961H, Jm = 0.001833Kg·m2, the detailed identification parameters of the motor parameter optimization method provided by the present application are shown in Table 2, and the identification parameters based on the particle swarm algorithm are shown in Table 3. In this process, the motor parameter optimization curves of the two algorithms are respectively taken as an example here for the stator resistance parameter optimization. The curve is as follows Fig.10 As shown, see Fig.10 , is a comparison diagram of an optimized curve of electronic resistance provided in an embodiment of the present application. Fig.10 As shown, the optimization curve of electronic resistance obtained by the particle swarm algorithm and the optimization curve of electronic resistance obtained by the motor parameter optimization method provided in this application are included. Among them, the parameters such as flux linkage and quadrature axis inductance can be obtained in the same way.
[0189] Table 2
[0190] Parameter name unit True value Identification value Error rate Identify time Stator resistance Ω 2.875 2.931 1.95% 0.01s Magnet Link Wb 0.175 0.1736 0.80% 0.004s Direct axis inductor H 0.0085 0.00851 0.12% 8e-4s Quadrature-axis inductance H 0.0085 0.00851 0.12% 8e-4s Moment of Inertia Kg·m2 0.001 0.001043 4.3% 0.01s
[0191] Table 3
[0192] Parameter name unit True value Identification value Error rate Identify time Stator resistance Ω 2.875 3.028 5.32% 0.16s Magnet Link Wb 0.175 0.2239 27.9% 0.04s Direct axis inductor H 0.0085 0.00961 13.06% 0.01s Quadrature-axis inductance H 0.0085 0.00961 13.06% 0.01s Moment of Inertia Kg·m2 0.001 0.001833 83.3% 0.16s
[0193] According to the above analysis results, the motor parameter optimization method provided by the present application has an optimization error of no more than 4.3% for the motor parameters, and the identification time is very fast; in comparison, the parameter error based on particle swarm identification is very large, because: on the one hand, the motor parameters themselves are very small numbers, and even a very small parameter perturbation will cause a large parameter error, which also reflects the importance of accurate parameter identification of the motor. On the other hand, from the fitness optimization curves of the two, it can also be seen that the data convergence time of the motor parameter optimization algorithm provided by the present application is shorter, and its value is more accurate.
[0194] In summary, the permanent magnet motor control parameter identification strategy proposed in the present invention adopts the whale algorithm with low structural complexity and strong algorithm efficiency as the underlying algorithm, and provides a control strategy for automatically identifying and optimizing motor parameters by setting evaluation function indicators, and gives its specific implementation. A simulation experiment is carried out by building a permanent magnet synchronous motor parameter identification model, and a motor parameter identification experiment based on a particle swarm algorithm is designed for comparison. The experimental results prove that the motor parameter identification based on the whale algorithm proposed in the present invention has fast search in the field of multi-parameter identification, and the effect of the identification results converging to the true value is more credible, and it has good applicability.
[0195] See also Fig.11 , is a block diagram of an embodiment of a motor parameter optimization device provided in an embodiment of the present application. Fig.11 As shown, the device may include:
[0196] The acquisition module 111 is used to acquire multiple groups of parameter values corresponding to multiple different motor parameters to be optimized, and for any individual whale in a preset whale population, acquire a group of parameter values from the multiple groups of parameter values to construct a position vector of the individual whale; wherein each group of the parameter values includes a parameter value corresponding to each of the motor parameters;
[0197] A first determination module 112 is used for inputting the position vector of any individual whale into a pre-built motor evaluation model to obtain the fitness of the individual whale;
[0198] A second determination module 113 is used to determine the best whale individual from the whale population according to the fitness of each of the whale individuals when the fitness is less than a preset threshold;
[0199] The third determination module 114 is used to determine the optimal motor parameters according to the position vector of the best individual whale.
[0200] like Fig.12 As shown, it is a structural schematic diagram of an electronic device provided in an embodiment of the present application, including a processor 1201, a communication interface 1202, a memory 1203 and a communication bus 1204, wherein the processor 1201, the communication interface 1202, and the memory 1203 communicate with each other through the communication bus 1204.
[0201] Memory 1203, used for storing computer programs;
[0202] In one embodiment of the present application, the processor 1201 is used to implement the motor parameter optimization method provided by any one of the above method embodiments when executing the program stored in the memory 1203, including:
[0203] Acquire multiple groups of parameter values corresponding to multiple different motor parameters to be optimized, and for any individual whale in a preset whale population, acquire a group of parameter values from the multiple groups of parameter values to construct a position vector of the individual whale; wherein each group of the parameter values includes a parameter value corresponding to each of the motor parameters;
[0204] For any individual whale, the position vector of the individual whale is input into a pre-constructed motor evaluation model to obtain the fitness of the individual whale;
[0205] When the fitness is less than a preset threshold, determining the best whale individual from the whale population according to the fitness of each of the whale individuals;
[0206] The optimal motor parameters are determined according to the position vector of the best individual whale.
[0207] 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 optimization method provided in any one of the aforementioned method embodiments are implemented.
[0208] 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.
[0209] 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.
[0210] 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.
[0211] 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 optimizing motor parameters, characterized in that: The method comprises: Acquire multiple groups of parameter values corresponding to multiple different motor parameters to be optimized, and for any individual whale in a preset whale population, acquire a group of parameter values from the multiple groups of parameter values to construct a position vector of the individual whale; wherein each group of the parameter values includes a parameter value corresponding to each of the motor parameters; For any individual whale, the position vector of the individual whale is input into a pre-constructed motor evaluation model to obtain the fitness of the individual whale; When the fitness is less than a preset threshold, determining the best whale individual from the whale population according to the fitness of each of the whale individuals; The optimal motor parameters are determined according to the position vector of the best individual whale.
2. The method according to claim 1, characterized in that The method further comprises: When the fitness is greater than or equal to a preset threshold, for any of the whale individuals, according to the position vector of the best whale individual, the current position vector of the whale individual is adjusted to obtain a first position vector; Iteratively perform the following steps until the number of iterations reaches a preset number threshold, or the fitness of any of the individual whales is less than a preset threshold; For any of the individual whales, the position vector of the current wheel of the individual whale is input into a pre-constructed motor evaluation model to obtain the fitness of the individual whale; Determine the best whale individual of the current round from the whale population according to the fitness of the whale individual; For any of the whale individuals, according to the position vector of the best whale individual in the current round, the position vector of the whale individual in the current round is adjusted to obtain a second position vector; The position vector of the first round is the first position vector, and the second position vector is the position vector of the next round; After the iteration, the optimal motor parameters are determined based on the position vector of the best individual whale obtained in the last round.
3. The method according to claim 1, characterized in that The motor evaluation model includes a motor vector control sub-model and an evaluation function sub-model, and the motor vector control sub-model includes a motor module; The step of inputting the position vector of the individual whale into a pre-built motor evaluation model to obtain the fitness of the individual whale comprises: The position vector of the individual whale is input into the motor evaluation model, so that the motor evaluation model obtains the fitness of the individual whale in the following manner: According to the position vector of the individual whale, setting the motor parameters of the motor module in the motor vector control sub-model; Inputting a preset expected speed into the updated motor vector control sub-model to obtain a speed difference output by the motor vector control sub-model within a running time period; The rotation speed difference is input into the evaluation function sub-model to obtain the fitness of the individual whale output by the evaluation function sub-model.
4. The method according to claim 3, characterized in that After receiving the expected speed, the updated motor vector control sub-model determines the speed difference in the following manner: Running the updated motor module based on the expected speed to obtain an actual speed output by the updated motor module; The speed difference is obtained by subtracting the actual speed from the expected speed.
5. The method according to claim 3, characterized in that: The step of inputting the rotation speed difference into the evaluation function sub-model to obtain the fitness of the individual whale output by the evaluation function sub-model includes: The speed difference is input into the following evaluation function formula to obtain the fitness of the individual whale: Wherein, J is the fitness of the individual whale, t is the total duration corresponding to the running time period, and e(t) is the rotation speed difference.
6. The method according to claim 1, characterized in that Determining the best whale individual from the whale population according to the fitness of each of the whale individuals comprises: The whale individual with the smallest fitness is determined as the best whale individual in the whale population.
7. The method according to claim 2, characterized in that The adjusting the position vector of the current round of the whale individual according to the position vector of the best whale individual in the current round to obtain a second position vector includes: Determine the current shrinkage factor; According to the prey encirclement sub-algorithm in the preset whale optimization algorithm, the best whale individual in the current round, and the shrinkage encirclement coefficient, a first adjustment is made to the position vector of the current round of the whale individual; Generate a random number, and determine whether the random number is greater than or equal to a first preset threshold; When it is determined that the random number is greater than or equal to the first preset threshold, a second adjustment is made to the position vector of the current round of the whale individual according to the bubble net attack sub-algorithm in the whale optimization algorithm and the best whale individual of the current round to obtain a second position vector; When it is determined that the random number is less than the first preset threshold, a second adjustment is performed on the position vector of the current round of the whale individual based on the shrinkage and envelopment coefficient to obtain a second position vector.
8. A motor parameter optimization device, characterized in that: The device comprises: An acquisition module, used to acquire multiple groups of parameter values corresponding to multiple different motor parameters to be optimized, and for any individual whale in a preset whale population, acquire a group of parameter values from the multiple groups of parameter values to construct a position vector of the individual whale; wherein each group of the parameter values includes a parameter value corresponding to each of the motor parameters; A first determination module is used for inputting the position vector of any individual whale into a pre-constructed motor evaluation model to obtain the fitness of the individual whale; A second determination module is used to determine the best whale individual from the whale population according to the fitness of each of the whale individuals when the fitness is less than a preset threshold; The third determination module is used to determine the optimal motor parameters according to the position vector of the best whale individual.
9. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store a computer program; the processor is used to implement the motor parameter optimization method according to any one of claims 1 to 7 when executing the computer program.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for optimizing the motor parameters described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Permanent magnet synchronous motor multi-parameter identification method and system based on improved whale algorithm
CN115765560A
Multi-node path planning method for electric tractor
CN116149334A
Servo system parameter self-tuning method based on improved whale optimization algorithm
CN116974190A
Permanent magnet synchronous motor speed control method based on chaos adaptive optimization whale algorithm
CN117013896A
Cited By
Motor and control method and device thereof, compressor, air conditioner, medium and product
CN120377724A