Permanent magnet synchronous motor pi parameter optimization setting method and device, equipment and medium

By optimizing the PI parameters of the permanent magnet synchronous motor using the boundary prior and coordinate fine-tuning snake optimization algorithm (BC-SOA), the problems of speed overshoot and electromagnetic torque pulsation caused by unreasonable parameter settings are solved, thereby improving the dynamic response performance and torque stability of the system.

CN123184537APending Publication Date: 2026-11-27HUAQIAO UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611673808.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-28
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing PI parameter tuning methods for permanent magnet synchronous motors suffer from problems such as increased speed overshoot, prolonged settling time, increased steady-state error, and aggravated electromagnetic torque pulsation due to unreasonable parameter settings. Furthermore, swarm intelligence optimization algorithms suffer from insufficient initial population coverage and inadequate local search capabilities under finite population conditions.

Method used

The Boundary Prior and Coordinate Refinement Improvement Snake Optimization Algorithm (BC-SOA) is adopted. The population is constructed through Tent chaotic mapping and Latin hypercube sampling. The comprehensive fitness function is constructed by combining boundary prior and high-parameter region prior. A dimension-by-dimensional refinement mechanism is introduced to optimize the PI parameters of the velocity loop, d-axis current loop and q-axis current loop.

Benefits of technology

It improves the efficiency of PI parameter search, enhances the ability of local fine search, optimizes the dynamic performance of speed, steady-state accuracy and torque stability, reduces the risk of fluctuations in multiple runs and getting trapped in local optima, and improves the dynamic response performance and torque stability of the control system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123184537A_ABST
    Figure CN123184537A_ABST
Patent Text Reader

Abstract

The application discloses a permanent magnet synchronous motor PI parameter optimization setting method, device, equipment and medium, belongs to the permanent magnet synchronous motor control and intelligent optimization technical field, aiming at the low efficiency of the multi-loop PI parameter setting and the insufficient optimization precision in the prior art, the permanent magnet synchronous motor PI parameter optimization setting method introduces boundary priori and high parameter region priori through hierarchical initialization, improves the high-quality PI parameter region coverage capability, constructs a comprehensive fitness function considering the speed dynamic tracking error, steady-state error, overshoot and electromagnetic torque ripple, and introduces the dimension-by-dimension coordinate refinement and adaptive direction and step length adjustment in the snake optimization algorithm, and enhances the local optimization capability in the later period. The method realizes the joint automatic setting of six PI parameters of the speed loop, the d-axis current loop and the q-axis current loop, reduces the dependence on manual debugging, and has the advantages of fast convergence, good stability, low torque ripple and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of permanent magnet synchronous motor control and intelligent optimization technology, and in particular to a method, apparatus, equipment and medium for optimizing and tuning the PI parameters of a permanent magnet synchronous motor. Background Technology

[0002] Permanent magnet synchronous motors (PMSMs) have advantages such as high power density, high operating efficiency, and fast dynamic response, and are widely used in traction drives for new energy vehicles, industrial servo systems, and other electric drive systems. Field-oriented control can decompose the stator current into d-axis and q-axis current components, achieving decoupled control of flux linkage and torque, and is a commonly used control method for PMSMs.

[0003] A field-oriented control system for a permanent magnet synchronous motor typically includes a speed loop, a d-axis current loop, and a q-axis current loop, with each loop generally employing a proportional-integral (PI) controller. Therefore, the system requires simultaneous tuning of six PI parameters for the speed, d-axis, and q-axis current loops. These control loops influence each other; improper parameter settings can lead to increased speed overshoot, prolonged settling time, increased steady-state error, and exacerbated electromagnetic torque pulsation.

[0004] Existing PI parameter tuning methods include manual trial and error, analytical tuning, and swarm optimization. Manual trial and error relies on debugging experience and is inefficient; analytical tuning relies on a relatively accurate motor model and has limited adaptability to changes in operating conditions. Although swarm optimization algorithms such as particle swarm optimization, gray wolf optimization, and snake optimization can automatically search for PI parameters, they may still suffer from insufficient initial population coverage, weak local search capabilities in later stages, and large fluctuations in results after multiple runs when the population size and fitness evaluation times are limited.

[0005] The standard snake optimization algorithm switches between exploration, thermal environment, fighting, and mating updates based on food quantity and ambient temperature. However, when directly applied to the multi-loop PI parameter tuning of permanent magnet synchronous motors, it is difficult to perform fine-grained searches for different parameter dimensions. Summary of the Invention

[0006] In view of this, the purpose of this invention is to provide a method for optimizing the tuning of PI parameters of a permanent magnet synchronous motor, including: S1. Initial determination of parameter vector: Establish a model of the field orientation control system of permanent magnet synchronous motor, determine the six PI parameters to be tuned in the speed loop, d-axis current loop and q-axis current loop, form the PI parameter vector, and set the lower bound vector and upper bound vector of the search as the search range; S2. Population Construction: Within the defined search range, a hierarchical initialization strategy is adopted, introducing boundary priors and high-parameter region priors to construct a population based on the PI parameter vector. S3. Global Optimal Individual Selection: Based on the speed tracking error, steady-state speed error, speed overshoot, and electromagnetic torque pulsation, a comprehensive fitness function is established, and the fitness of the PI parameter vectors in the population is evaluated. The individual with the best fitness is selected as the current global optimal individual. S4. Global Optimal Individual Update: Snake optimization candidate individuals are generated iteratively using the snake optimization algorithm position update mechanism. In the snake optimization algorithm, a dimensional refinement candidate is generated centered on the global optimal individual, and a boundary projection candidate is generated and out-of-bounds processing is performed. Fitness evaluation and greedy selection are performed on the snake optimization candidate individuals, the dimensional refinement candidate and the boundary projection candidate to update the population and the global optimal individual. S5. Parameter Vector Output: When the preset number of iterations or fitness convergence is reached, the PI parameter vector corresponding to the globally optimal individual is output and written into the PI controllers of the speed loop, d-axis current loop and q-axis current loop respectively to drive the permanent magnet synchronous motor.

[0007] As a further improvement of the present invention, the PI parameter vector is:

[0008] in, These are the proportional and integral parameters of the speed loop PI controller, respectively. These are the proportional and integral parameters of the d-axis current loop PI controller, respectively. These are the proportional and integral parameters of the q-axis current loop PI controller, respectively. The lower bound vector and the upper bound vector for the search are respectively:

[0009] For the i-th candidate individual Its parameter dimensions satisfy: .

[0010] As a further improvement of the present invention, in S2, the population construction is specifically carried out as follows: an initial individual is generated by combining Tent chaotic mapping with Latin hypercube sampling, and the i-th normalized hierarchical individual is obtained. The normalized hierarchical individuals are mapped to the PI parameter search space according to the following formula to obtain the hierarchical initialized individuals:

[0011] Where ⊙ represents the multiplication of the corresponding parameter dimensions; Set each PI parameter to its corresponding upper bound to form boundary prior individuals:

[0012] Construct prior individuals for high-parameter regions between the lower and upper bounds of the search according to a preset high-parameter ratio:

[0013] The hierarchical initial individuals, boundary prior individuals, and high-parameter region prior individuals are combined to form the initial population.

[0014] As a further improvement of the present invention, in S3, the comprehensive fitness function is:

[0015] in, For the dynamic tracking error term of rotational speed, For steady-state speed error term, For speed overshoot evaluation items, This is an evaluation item for electromagnetic torque ripple. All are weighting coefficients that are greater than zero; The value is determined based on the time-weighted error between the given rotational speed and the actual rotational speed. The speed error is determined based on the preset steady-state evaluation time period. The degree of overshoot is determined based on the actual rotational speed relative to the given rotational speed. The value is determined by normalization calculation based on the difference between the maximum and minimum electromagnetic torque values ​​during the steady-state time period.

[0016] As a further improvement of the present invention, in S4, the specific method for generating the dimension-by-dimensional refinement candidate is as follows: Normalize the current global best individual to obtain the current global best normalized individual. Normalize the parameter vector to be optimized. Taking the current global best normalized individual as the center, calculate the dimension-by-dimensional refinement candidate corresponding to the j-th parameter dimension. When generating the dimension-by-dimensional refinement candidate, only change the j-th parameter dimension, and keep the other parameter dimensions unchanged. Finally, reverse normalize the dimension-by-dimensional refinement candidate. The fitness value of the dimension-wise refined candidate corresponding to the j-th parameter dimension is calculated using the denormalized dimension-wise refined candidate; the fitness value of the dimension-wise refined candidate is compared with the current global optimal fitness value to obtain the fitness improvement result; wherein, the current global optimal fitness value is the fitness value corresponding to the current global optimal individual; When the fitness value of the dimension-by-dimensional refinement candidate is less than the current global optimal fitness value, it is determined to be fitness improvement. The search direction of the next generation in the j-th parameter dimension is equal to the search direction of the current generation. The search step size of the next generation in the j-th parameter dimension is equal to the smaller value between the preset maximum search step size and "step size increase factor multiplied by the current generation search step size", wherein the step size increase factor is greater than one. When the fitness value of the dimension-by-dimensional refinement candidate is not less than the current global optimal fitness value, it is determined that the fitness has not been improved. The search direction of the next generation in the j-th parameter dimension is equal to the opposite direction of the current generation search direction. The search step size of the next generation in the j-th parameter dimension is equal to the larger of the preset minimum search step size and "step size reduction factor multiplied by the current generation search step size", wherein the step size reduction factor is greater than zero and less than one. The preset minimum search step size and the preset maximum search step size are the lower limit and upper limit of the current generation search step size, respectively.

[0017] As a further improvement of the present invention, in S4, the generation of the dimension-by-dimensional refinement candidate is performed sequentially according to each parameter dimension in the parameter vector to be optimized; For the j-th parameter dimension, the candidate PI parameters after inverse normalization are written into the permanent magnet synchronous motor field orientation control system model, the model is run and the candidate fitness value corresponding to the j-th parameter dimension is calculated. When the candidate fitness value is less than the current global optimal fitness value, the current global optimal individual is updated to the dimension-by-dimensional refinement candidate; otherwise, the current global optimal individual remains unchanged. After completing the coordinate refinement of all parameter dimensions, the current global optimal normalized individual is denormalized to obtain the current global optimal PI parameter vector; the current global optimal PI parameter vector is equal to the dimension-wise product of the current global optimal normalized individual and the difference between the upper bound vector and the lower bound vector, plus the lower bound vector. The output is the globally optimal combination of PI parameter vectors when the preset termination condition is met.

[0018] As a further improvement of the present invention, S4 also includes: generating boundary projection candidates based on the relative positions of the current globally optimal individual within the search intervals of each PI parameter; performing boundary constraint processing on the snake optimization candidate individuals, boundary projection candidates, and dimension-by-dimensional refinement candidates to keep each parameter dimension within a preset search range; and performing the following boundary processing on the j-th parameter dimension of the i-th snake optimization candidate individual:

[0019] in, The j-th candidate parameter is used for the i-th snake optimization candidate individual before boundary processing. These are the corresponding parameters after boundary processing. and These are the lower and upper bounds for the search of the j-th PI parameter, respectively. The fitness of the snake optimization candidate individuals after boundary processing is evaluated, and the current individual is updated according to the following greedy selection rule: when the fitness value of the i-th snake optimization candidate individual in generation t+1 is less than the fitness value of the i-th individual in generation t, the position of the i-th individual in generation t+1 is equal to the position of the i-th snake optimization candidate individual in generation t+1. When the fitness value of the i-th snake optimization candidate individual in generation t+1 is not less than the fitness value of the i-th individual in generation t, the position of the i-th individual in generation t+1 is equal to the position of the i-th individual in generation t. After the candidate individuals complete the fitness evaluation and greedy selection, the current population and the global optimal individual are updated.

[0020] The present invention also provides a device for optimizing and tuning the PI parameters of a permanent magnet synchronous motor, comprising: The parameter vector initialization unit is used to establish the field orientation control system model of the permanent magnet synchronous motor, determine the six PI parameters to be tuned in the speed loop, d-axis current loop and q-axis current loop, form the PI parameter vector, and set the lower search bound vector and upper search bound vector as the search range; Population construction unit is used to construct a population based on the PI parameter vector by adopting a hierarchical initialization strategy within a set search range, introducing boundary priors and high parameter region priors; The global optimal individual selection unit is used to establish a comprehensive fitness function based on speed tracking error, steady-state speed error, speed overshoot and electromagnetic torque pulsation, and to evaluate the fitness of the PI parameter vectors in the population, and select the one with the best fitness as the current global optimal individual. The global optimal individual update unit is used to generate snake optimization candidate individuals through an iterative method using the snake optimization algorithm position update mechanism. In the snake optimization algorithm, a dimensional refinement candidate is generated centered on the global optimal individual, and a boundary projection candidate is generated and out-of-bounds processing is performed. Fitness evaluation and greedy selection are performed on the snake optimization candidate individuals, the dimensional refinement candidate individuals, and the boundary projection candidate individuals to update the population and the global optimal individual. The parameter vector output unit is used to output the PI parameter vector corresponding to the globally optimal individual when the preset number of iterations or fitness convergence is reached, and write it into the PI controller of the speed loop, d-axis current loop and q-axis current loop respectively to drive the permanent magnet synchronous motor.

[0021] The present invention also provides an optimization tuning device for PI parameters of a permanent magnet synchronous motor, including a memory and a processor. The memory stores a computer program, which can be executed by the processor to implement the optimization tuning method described above.

[0022] The present invention also provides a computer-readable storage medium storing a computer program that can be executed by a processor of the device in which the computer-readable storage medium is located, to implement the optimization tuning method described above.

[0023] Compared with the prior art, the present invention has at least the following advantages: First, a hierarchical initialization strategy combining Tent chaotic mapping and Latin hypercube sampling is adopted, and boundary prior individuals and high-parameter region prior individuals are introduced to improve the coverage of potential high-quality PI parameter regions under finite population conditions, avoiding the problems of low search efficiency and poor initial population quality in traditional random initialization.

[0024] Secondly, a comprehensive fitness function is constructed that simultaneously considers dynamic speed tracking error, steady-state speed error, speed overshoot, and electromagnetic torque pulsation, so that the tuning results take into account dynamic speed performance, steady-state accuracy, and torque stability, avoiding control performance imbalance caused by optimization of a single index.

[0025] Third, a dimension-wise coordinate refinement mechanism is introduced into the snake optimization algorithm framework, and the search direction and search step size are adaptively adjusted according to the improvement results of the fitness of candidate individuals. This enhances the algorithm's ability to perform fine local search in the later stages, balances global exploration and local development, improves convergence speed and optimization accuracy, and reduces the risk of large fluctuations and getting trapped in local optima after multiple runs. Attached Figure Description

[0026] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a schematic diagram of the overall process of the present invention; Figure 2 This is a schematic diagram of the structure of the permanent magnet synchronous motor field orientation control system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the overall flow of the algorithm of the present invention in the embodiment; Figure 4 The graph shows the average fitness convergence curves of five independent runs of the standard snake optimization algorithm, particle swarm optimization algorithm, gray wolf optimization algorithm, and the algorithm of this invention. Figure 5 The graph shows the optimal first-order fitness convergence curves of the standard snake optimization algorithm, particle swarm optimization algorithm, gray wolf optimization algorithm, and the algorithm of this invention. Figure 6The graph shows the speed tracking response curve of the permanent magnet synchronous motor when the optimal PI parameters are obtained using the algorithm of this invention. Figure 7 The electromagnetic torque response curve of the permanent magnet synchronous motor is shown when the optimal PI parameters are obtained using the algorithm of this invention. Detailed Implementation

[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] Example S1. Initial determination of parameter vector.

[0030] A model of the field-oriented control system for a permanent magnet synchronous motor is established. Six PI parameters to be tuned in the speed loop, d-axis current loop, and q-axis current loop are determined, forming a PI parameter vector. A lower and upper bound vector for the search are set as the search range. Figure 1 As shown, this embodiment provides an optimization method for PI parameters of a permanent magnet synchronous motor (PMSM), based on the Boundary-Prior and Coordinate-Refinement Snake Optimization Algorithm (BC-SOA) for multi-loop PI parameter tuning. This method establishes a vector control model for the PMSM, using the parameters of the speed loop PI controller, the d-axis current loop PI controller, and the q-axis current loop PI controller as optimization objects. The BC-SOA algorithm is then used to jointly optimize multiple PI parameters, thereby improving the dynamic response performance of the PMSM control system.

[0031] like Figure 2 As shown, this embodiment employs a permanent magnet synchronous motor control structure based on field-oriented control. The control system includes a speed outer loop, a current inner loop, a maximum torque-to-current ratio (MTPA) control module, a coordinate transformation module, a space vector pulse width modulation (SVPWM) module, a three-phase inverter, and a permanent magnet synchronous motor.

[0032] Among them, the speed given signal Feedback signal of actual motor speed The error signal obtained from the comparison is input to the speed loop PI regulator. The output of the speed loop PI regulator is used as the input of the MTPA module. The MTPA module calculates the d-axis current reference value and q-axis current reference value based on the permanent magnet synchronous motor parameters.

[0033] The d-axis current collected during the actual operation of the motor and q-axis current The error signals are compared with the reference values ​​respectively, and then input to the d-axis current PI regulator and the q-axis current PI regulator to obtain the voltage control quantity. and The voltage signal in the stationary coordinate system is obtained after inverse Park transformation. , Then, after SVPWM modulation, an inverter switching signal is generated to drive the permanent magnet synchronous motor.

[0034] In the above control process, the speed loop PI parameters and current loop PI parameters directly affect the system's dynamic performance. Therefore, this embodiment uses the BC-SOA algorithm to jointly optimize the six PI parameters, and the optimization variables are expressed as follows:

[0035] in, , These are the proportional and integral parameters of the velocity loop, respectively. , These are the proportional and integral parameters of the d-axis current loop, respectively. , These are the proportional and integral parameters of the q-axis current loop, respectively.

[0036] The lower bound vector and the upper bound vector for the search are respectively:

[0037] For the i-th candidate individual Its parameter dimensions satisfy: .

[0038] S2, Population Structure.

[0039] Within the defined search range, a hierarchical initialization strategy is adopted, introducing boundary priors and high-parameter region priors to construct a population based on the PI parameter vector.

[0040] The population construction method is as follows: an initial individual is generated by combining Tent chaotic mapping and Latin hypercubic sampling, and the i-th normalized hierarchical individual is obtained. The normalized hierarchical individuals are mapped to the PI parameter search space according to the following formula to obtain the hierarchical initialized individuals:

[0041] Where ⊙ represents the multiplication of the corresponding parameter dimensions; Set each PI parameter to its corresponding upper bound to form boundary prior individuals:

[0042] Construct prior individuals for high-parameter regions between the lower and upper bounds of the search according to a preset high-parameter ratio:

[0043] The hierarchical initial individuals, boundary prior individuals, and high-parameter region prior individuals are combined to form the initial population.

[0044] Among them, the boundary prior initialization mechanism utilizes the PI parameter search range information to construct prior individuals with parameter boundary information outside the basic initial population, thereby improving the coverage of the effective search area by the initial population; the coordinate refinement mechanism takes the current global best individual as the center, generates candidate solutions for different parameter dimensions in the normalized parameter space, and dynamically adjusts the search direction and search step size according to the fitness change results, thereby enhancing the local fine search capability of the algorithm in the later stage.

[0045] Because different parameter regions have varying impacts on the system's dynamic performance during the optimization of PI parameters for permanent magnet synchronous motors, parameter combinations that meet the requirements of rapid response and stable operation may be distributed within specific regions of the search space. Therefore, this embodiment utilizes PI parameter search range information to construct initial individuals with prior knowledge, improving the coverage of potentially effective parameter regions by the initial population.

[0046] To ensure that the optimization process meets the PI parameter constraints, constraints are applied to individuals that are outside the search range:

[0047] in, and These represent the lower and upper bounds of the search for the j-th PI parameter, respectively.

[0048] By implementing the boundary constraint processing described above, the candidate individuals generated during the algorithm iteration process are always kept within the search range of the preset PI parameters, thereby reducing invalid fitness evaluations caused by out-of-bounds candidate solutions.

[0049] S3, global optimal individual selection.

[0050] In this embodiment, the dynamic response performance of the permanent magnet synchronous motor control system is used as the evaluation criterion for the algorithm, and a comprehensive fitness function is established:

[0051] in, For the dynamic tracking error term of rotational speed, For steady-state speed error term, For speed overshoot evaluation items, This is an evaluation item for electromagnetic torque ripple. , , and Weighting coefficients that are greater than zero; Among them, dynamic error:

[0052] Steady-state error:

[0053] Overshoot:

[0054] Torque:

[0055] in, For rotational speed, For the desired rotational speed, This refers to the current actual rotational speed. For maximum speed, As the starting point of steady-state time, The total observation time, These represent the maximum, minimum, and average electromagnetic torque, respectively.

[0056] The smaller the fitness function value, the smaller the speed tracking error of the control system, the lower the electromagnetic torque fluctuation, and the better the performance of the corresponding PI parameters.

[0057] like Figure 3 The diagram illustrates the flowchart of the boundary prior-coordinate refinement snake optimization algorithm provided in this embodiment of the invention. First, a basic initial population is constructed using Tent chaotic mapping and hierarchical sampling, and boundary prior individuals and high-parameter region prior individuals are introduced. Then, population search is performed according to the basic position update mechanism of the snake optimization algorithm. Based on this, dimensional coordinate refinement is performed on the current globally optimal individual, and the search direction and search step size of each parameter dimension are adaptively adjusted according to the candidate fitness improvement results. Finally, boundary constraints, fitness evaluation, and greedy selection are performed on candidate individuals, and the current population and the globally optimal individual are updated until a preset termination condition is met.

[0058] S4, Global Optimal Individual Update.

[0059] The BC-SOA algorithm is an improved swarm intelligence optimization algorithm built upon the Snake Optimization Algorithm (SOA). The Snake Optimization Algorithm simulates the foraging behavior of snakes in their natural environment, utilizing information interaction among individuals to achieve global search and local development. It primarily iterates candidate solutions through mechanisms such as exploration updates, thermal environment updates, and inter-individual interaction updates.

[0060] In the process of tuning multi-loop PI parameters of permanent magnet synchronous motor, the number of parameters to be optimized is small, but there are coupling relationships between the parameters. When the traditional snake optimization algorithm is directly applied, it still has the following shortcomings: On the one hand, the random initialization method leads to insufficient coverage of the potential high-quality parameter area by the initial population, which affects the search efficiency; on the other hand, in the later stage of iteration, after the population gradually concentrates, the individual update mainly relies on random perturbation, which makes it difficult to perform fine search for the current optimal parameter combination, thus limiting the optimization accuracy.

[0061] Therefore, this embodiment, while retaining the basic search framework of the snake optimization algorithm, introduces a boundary prior initialization mechanism and a coordinate refinement mechanism to form the Boundary-Prior and Coordinate-Refinement Snake Optimization Algorithm (BC-SOA).

[0062] The snake optimization algorithm's position update mechanism includes: The current population is divided into male subpopulations and female subpopulations, and the food quantity parameter Qt and temperature parameter Tt are determined based on the current iteration number. When the food quantity parameter Qt is lower than the first preset threshold, exploration and update are performed on the male individual subpopulation and the female individual subpopulation respectively; When the food quantity parameter Qt is not lower than the first preset threshold and the temperature parameter Tt is higher than the second preset threshold, the population individuals move to the current food location and perform thermal environment update. When the temperature parameter Tt is not higher than the second preset threshold, the struggle update or mating update between the male individual subpopulation and the female individual subpopulation is performed; When the preset spawning conditions are met, individuals in the population with poor fitness are re-initialized.

[0063] After the snake optimization algorithm completes the population position update, it performs a dimensional coordinate refinement centered on the current globally optimal individual. First, the parameters to be optimized are normalized to the [0,1] interval: Generate dimension-wise refinement candidates for the j-th parameter dimension:

[0064] in, For the search direction in the j-th parameter dimension, To correspond to the search step size, Let be the unit vector of the j-th parameter dimension. When generating candidate individuals, only the current parameter dimension is changed, while the dimensions of the other parameters remain unchanged. The dimension-by-dimensional refined candidate is denormalized as follows:

[0065] And perform fitness evaluation; if the candidate fitness is better than the current global best fitness, that is:

[0066] hour:

[0067]

[0068] And maintain the search direction and increase the search step size:

[0069]

[0070] When the dimension-by-dimensional refinement of the candidate fails to improve the current optimal fitness, i.e.:

[0071] If the current search direction has not yielded effective optimization, then reverse the search direction and reduce the search step size:

[0072]

[0073] Complete the coordinate refinement of the six PI parameter dimensions in the above manner, and update the current global best individual based on the fitness improvement results. Then, denormalize the current global best normalized individual as follows: .

[0074] Through the aforementioned boundary constraints and coordinate refinement mechanisms, the BC-SOA algorithm combines global search capabilities with local optimization capabilities, thereby improving the search accuracy in complex nonlinear control parameter optimization problems.

[0075] Based on the relative position of the current globally optimal individual within the search interval of each PI parameter, boundary projection candidates are generated; boundary constraints are applied to the snake optimization candidate individuals, boundary projection candidates, and dimension-by-dimensional refinement candidates to keep each parameter dimension within the preset search range; the following boundary processing is applied to the j-th parameter dimension of the i-th candidate individual:

[0076] in, Let j be the candidate parameter of the i-th candidate individual before boundary processing. These are the corresponding parameters after boundary processing. and Let $\begin{pmatrix} \ ...

[0077]

[0078] The current population and the global best individual are updated after the candidate individuals complete the fitness evaluation and greedy selection.

[0079] S5, Parameter Vector Output.

[0080] After completing BC-SOA optimization, the obtained globally optimal PI parameter combination is passed to the speed loop PI regulator, d-axis current loop PI regulator, and q-axis current loop PI regulator, respectively, to achieve automatic tuning of the permanent magnet synchronous motor control parameters. The globally optimal PI parameter combination is:

[0081] To verify the effectiveness of the method of this invention, a MATLAB / Simulink simulation model for permanent magnet synchronous motor control was established. During the experiment, the motor speed setpoint was set to a step change condition, and load torque disturbances were introduced during operation to verify the stability of the control system under dynamic changing conditions.

[0082] Meanwhile, the BC-SOA algorithm proposed in this embodiment is compared with the standard snake optimization algorithm (SOA), particle swarm optimization algorithm (PSO), and gray wolf optimization algorithm (GWO).

[0083] All algorithms use the same population size, number of iterations, and PI parameter search range to ensure consistent experimental conditions.

[0084] like Figure 4 The figure shows the average fitness convergence curves of the four algorithms after five independent runs. As can be seen from the figure, the BC-SOA algorithm can rapidly reduce the fitness function value in the early stages of iteration and maintain stable convergence in the later stages, demonstrating better convergence speed and optimization capabilities compared to traditional SOA, PSO, and GWO algorithms.

[0085] like Figure 5The figure shows the fitness convergence curves of the optimal single-run results of the four algorithms. As can be seen from the figure, the BC-SOA algorithm achieves a lower final fitness value, indicating that after improvements in boundary priors and coordinate refinement mechanisms, the algorithm can more accurately search for high-quality PI parameter combinations.

[0086] Furthermore, statistical analysis was performed on the results of five independent runs of the four algorithms, including the optimal fitness value, the average fitness value, and the standard deviation.

[0087] Experimental results show that the optimal fitness value obtained by the BC-SOA algorithm is lower than that of the SOA, PSO and GWO algorithms, while the average fitness is lower and the standard deviation is smaller. This indicates that the method of the present invention not only has better optimization effect, but also has higher stability and repeatability.

[0088] Finally, the optimal PI parameters obtained by the BC-SOA algorithm were applied to the permanent magnet synchronous motor control system for verification.

[0089] like Figure 6 The figure shows the speed tracking response curve of the permanent magnet synchronous motor after optimizing the PI parameters using BC-SOA. As can be seen from the figure, during a step change in speed, the system can quickly track the given speed with a small steady-state error, demonstrating good dynamic response performance.

[0090] like Figure 7 The figure shows the electromagnetic torque response curve after optimizing the PI parameters using BC-SOA. As can be seen from the figure, under load disturbance, the electromagnetic torque can respond quickly and tend to stabilize, with small torque fluctuations in the steady-state phase. This indicates that the system has good torque response performance after using the PI parameters tuned by BC-SOA.

[0091] In summary, the multi-loop PI parameter tuning method for permanent magnet synchronous motors proposed in this embodiment, based on boundary prior and coordinate fine-tuning progressive snake optimization algorithm, effectively improves the speed response performance and torque stability of the permanent magnet synchronous motor control system by constructing a multi-parameter joint optimization model and enhancing the search capability using the BC-SOA algorithm, and has good engineering application value.

[0092] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for optimizing the tuning of PI parameters of a permanent magnet synchronous motor, characterized in that, include: S1. Initial determination of parameter vector: Establish a model of the field orientation control system of permanent magnet synchronous motor, determine the six PI parameters to be tuned in the speed loop, d-axis current loop and q-axis current loop, form the PI parameter vector, and set the lower bound vector and upper bound vector of the search as the search range; S2. Population Construction: Within the defined search range, a hierarchical initialization strategy is adopted, introducing boundary priors and high-parameter region priors to construct a population based on the PI parameter vector. S3. Global Optimal Individual Selection: Based on the speed tracking error, steady-state speed error, speed overshoot, and electromagnetic torque pulsation, a comprehensive fitness function is established, and the fitness of the PI parameter vectors in the population is evaluated. The individual with the best fitness is selected as the current global optimal individual. S4. Global Optimal Individual Update: Snake optimization candidate individuals are generated through an iterative approach using the snake optimization algorithm position update mechanism. In the snake optimization algorithm, the global optimal individual is used as the center to generate dimensional refinement candidates, and boundary projection candidates are generated and out-of-bounds processing is performed. Fitness evaluation and greedy selection are performed on the snake optimization candidate individuals, the dimension-by-dimensional refinement candidate individuals, and the boundary projection candidate individuals to update the population and the globally optimal individual; S5. Parameter Vector Output: When the preset number of iterations or fitness convergence is reached, the PI parameter vector corresponding to the globally optimal individual is output and written into the PI controllers of the speed loop, d-axis current loop and q-axis current loop respectively to drive the permanent magnet synchronous motor.

2. The method according to claim 1, characterized in that, The PI parameter vector is: in, These are the proportional and integral parameters of the speed loop PI controller, respectively. These are the proportional and integral parameters of the d-axis current loop PI controller, respectively. These are the proportional and integral parameters of the q-axis current loop PI controller, respectively. The lower bound vector and the upper bound vector for the search are respectively: For the i-th candidate individual Its parameter dimensions satisfy: 。 3. The method according to claim 2, characterized in that, In S2, the population construction is specifically carried out as follows: an initial individual is generated by combining Tent chaotic mapping with Latin hypercube sampling, and the i-th normalized hierarchical individual is obtained. The normalized hierarchical individuals are mapped to the PI parameter search space according to the following formula to obtain the hierarchical initialized individuals: Where ⊙ represents the multiplication of the corresponding parameter dimensions; Set each PI parameter to its corresponding upper bound to form the boundary prior individuals: Construct prior individuals for high-parameter regions between the lower and upper bounds of the search according to a preset high-parameter ratio: The hierarchical initial individuals, boundary prior individuals, and high-parameter region prior individuals are combined to form the initial population.

4. The method according to claim 1, characterized in that, In S3, the comprehensive fitness function is: in, For the dynamic tracking error term of rotational speed, For steady-state speed error term, For speed overshoot evaluation items, This is an evaluation item for electromagnetic torque ripple. All are weighting coefficients greater than zero; the aforementioned The value is determined based on the time-weighted error between the given rotational speed and the actual rotational speed. The speed error is determined based on the preset steady-state evaluation time period. The degree of overshoot is determined based on the actual rotational speed relative to the given rotational speed. The value is determined by normalization calculation based on the difference between the maximum and minimum electromagnetic torque values ​​during the steady-state time period.

5. The method according to claim 2, characterized in that, In S4, the specific method for generating the dimension-by-dimensional refinement candidate is as follows: Normalize the current global best individual to obtain the current global best normalized individual. Normalize the parameter vector to be optimized. Taking the current global best normalized individual as the center, calculate the dimension-by-dimensional refinement candidate corresponding to the j-th parameter dimension. When generating the dimension-by-dimensional refinement candidate, only change the j-th parameter dimension, and keep the other parameter dimensions unchanged. Finally, reverse normalize the dimension-by-dimensional refinement candidate. The fitness value of the dimension-wise refined candidate corresponding to the j-th parameter dimension is calculated using the inverse normalized dimension-wise refined candidate. The fitness values ​​of the dimension-by-dimensional refinement candidates are compared with the current global optimal fitness value to obtain the fitness improvement result; wherein, the current global optimal fitness value is the fitness value corresponding to the current global optimal individual; When the fitness value of the dimension-by-dimensional refinement candidate is less than the current global optimal fitness value, it is determined to be fitness improvement. The search direction of the next generation in the j-th parameter dimension is equal to the search direction of the current generation. The search step size of the next generation in the j-th parameter dimension is equal to the smaller value between the preset maximum search step size and "step size increase factor multiplied by the current generation search step size", wherein the step size increase factor is greater than one. When the fitness value of the dimension-by-dimensional refinement candidate is not less than the current global optimal fitness value, it is determined that the fitness has not been improved. The search direction of the next generation in the j-th parameter dimension is equal to the opposite direction of the current generation search direction. The search step size of the next generation in the j-th parameter dimension is equal to the larger of the preset minimum search step size and "step size reduction factor multiplied by the current generation search step size", wherein the step size reduction factor is greater than zero and less than one. The preset minimum search step size and the preset maximum search step size are the lower limit and upper limit of the current generation search step size, respectively.

6. The method according to claim 5, characterized in that, In S4, the generation of the dimension-by-dimensional refinement candidate is performed sequentially according to each parameter dimension in the parameter vector to be optimized; For the j-th parameter dimension, the candidate PI parameters after inverse normalization are written into the permanent magnet synchronous motor field orientation control system model, the model is run and the candidate fitness value corresponding to the j-th parameter dimension is calculated. When the candidate fitness value is less than the current global optimal fitness value, the current global optimal individual is updated to the dimension-by-dimensional refinement candidate; Otherwise, the current globally optimal individual remains unchanged; After completing the coordinate refinement of all parameter dimensions, the current global optimal normalized individual is denormalized to obtain the current global optimal PI parameter vector; the current global optimal PI parameter vector is equal to the dimension-wise product of the current global optimal normalized individual and the difference between the "search upper bound vector and the search lower bound vector", plus the search lower bound vector. When the preset termination condition is met, the globally optimal combination of PI parameter vectors is output.

7. The method according to claim 1, characterized in that, S4 further includes: generating boundary projection candidates based on the relative positions of the current globally optimal individual within the search intervals of each PI parameter; performing boundary constraint processing on the snake optimization candidate individuals, boundary projection candidates, and dimension-by-dimensional refinement candidates to keep each parameter dimension within a preset search range; and performing the following boundary processing on the j-th parameter dimension of the i-th snake optimization candidate individual: in, For the j-th candidate parameter of the i-th snake optimization candidate individual before boundary processing, These are the corresponding parameters after boundary processing. and These are the lower and upper bounds for the search of the j-th PI parameter, respectively. The fitness of the snake optimization candidate individuals after boundary processing is evaluated, and the current individual is updated according to the following greedy selection rule: when the fitness value of the i-th snake optimization candidate individual in generation t+1 is less than the fitness value of the i-th individual in generation t, the position of the i-th individual in generation t+1 is equal to the position of the i-th snake optimization candidate individual in generation t+1. When the fitness value of the i-th snake optimization candidate individual in generation t+1 is not less than the fitness value of the i-th individual in generation t, the position of the i-th individual in generation t+1 is equal to the position of the i-th individual in generation t. After the candidate individuals complete the fitness evaluation and greedy selection, the current population and the global optimal individual are updated.

8. A device for optimizing and tuning PI parameters of a permanent magnet synchronous motor, characterized in that, include: The parameter vector initialization unit is used to establish the field orientation control system model of the permanent magnet synchronous motor, determine the six PI parameters to be tuned in the speed loop, d-axis current loop and q-axis current loop, form the PI parameter vector, and set the lower search bound vector and upper search bound vector as the search range; The population construction unit is used to construct a population based on the PI parameter vector by adopting a hierarchical initialization strategy within a set search range, introducing boundary priors and high-parameter region priors. The global optimal individual selection unit is used to establish a comprehensive fitness function based on speed tracking error, steady-state speed error, speed overshoot and electromagnetic torque pulsation, and to evaluate the fitness of the PI parameter vectors in the population, and select the one with the best fitness as the current global optimal individual. The global optimal individual update unit is used to generate snake optimization candidate individuals through an iterative method using the snake optimization algorithm position update mechanism. In the snake optimization algorithm, the global optimal individual is used as the center to generate dimensional refinement candidates, and boundary projection candidates are generated and out-of-bounds processing is performed. Fitness evaluation and greedy selection are performed on the snake optimization candidate individuals, the dimensional refinement candidates and the boundary projection candidates to update the population and the global optimal individual. The parameter vector output unit is used to output the PI parameter vector corresponding to the globally optimal individual when the preset number of iterations or fitness convergence is reached, and write it into the PI controller of the speed loop, d-axis current loop and q-axis current loop respectively to drive the permanent magnet synchronous motor.

9. A device for optimizing and tuning PI parameters of a permanent magnet synchronous motor, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that can be executed by the processor to implement the optimization tuning method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The device contains a computer program that can be executed by a processor of the device in which the computer-readable storage medium is located to implement the optimization tuning method as described in any one of claims 1 to 7.