Permanent magnet synchronous motor parameter optimization method based on improved moth flame particle swarm optimization
By improving the Moth Flame Particle Swarm Optimization (MFPSO) algorithm to optimize fuzzy PID parameters, the problems of difficult parameter tuning of traditional controllers and weak global search capability of intelligent algorithms in PMSM control are solved, realizing efficient, fast response and anti-interference control of permanent magnet synchronous motors under multiple operating conditions.
Patent Information
- Application Number
- CN202511582658.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2025-12-23
AI Technical Summary
In existing technologies, traditional fuzzy PID controllers are difficult to tune and cannot adapt to complex working conditions. Furthermore, existing intelligent algorithms such as particle swarm optimization and genetic algorithms have problems such as weak global search capabilities, easy getting trapped in local optima, and slow convergence speed in PMSM control, which cannot meet the real-time requirements of permanent magnet synchronous motors under multiple working conditions.
An improved Moth Flame Particle Swarm Optimization (MFPSO) algorithm is adopted, incorporating adaptive inertia weights, Gaussian mutation strategy, and group evolution mechanism to optimize fuzzy PID parameters. The algorithm's global dynamic optimization capability and fitness are improved through nonlinear acceleration coefficients and group evolution mechanism, and an adaptive control strategy for permanent magnet synchronous motors is designed.
It achieves position and speed control of permanent magnet synchronous motors with no overshoot, fast response, small error, and strong anti-interference capability, improving the control performance and adaptability of the motor under different operating conditions.
Smart Images

Figure CN121193174A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent control and optimization technology, specifically to a method for optimizing parameters of a permanent magnet synchronous motor based on an improved moth flame particle swarm algorithm. Background Technology
[0002] Traditional PID controllers are widely used in industrial control, but their parameter tuning is difficult, making them ill-suited for complex operating conditions. Fuzzy PID controllers combine fuzzy logic and PID control, allowing for the development of fuzzy rules based on operational experience to adaptively adjust PID parameters. However, in traditional fuzzy PID controller design, the optimization of fuzzy rules and parameters often relies on manual experience, lacking a systematic optimization method, resulting in limited control performance. Traditional PID controller parameter tuning, dependent on experience, is prone to slow response and large overshoot under various operating conditions of PMSM (Motor Motor Module) from low speed and light load to high speed and heavy load, and cannot adapt to the time-varying nature of motor parameters. The fuzzy rules and membership functions of existing fuzzy PID controllers are mostly manually set, lacking deep integration with intelligent algorithms, and unable to achieve dynamic matching of parameters, rules, and operating conditions. Therefore, with the development of intelligent algorithms, it is necessary to combine PID parameter optimization with algorithm models.
[0003] However, algorithms such as Particle Swarm Optimization (PSO) and Genetic Algorithm (GSO) suffer from weak global search capabilities, susceptibility to local optima, slow convergence, and low optimization efficiency in the later stages of Motion Optimization (MFO). Furthermore, they lack optimization strategies specifically designed for the collaborative requirements of three-loop control in Motion Module Synchronous Motors (PMSMs), resulting in low adaptability to real-time requirements under different operating conditions. Therefore, there is an urgent need to design an intelligent algorithm adapted to fuzzy PID parameter optimization, capable of rapid response while possessing global dynamic optimization and high adaptability, thus enabling its application in various permanent magnet synchronous motor control strategies across different scenarios. Summary of the Invention
[0004] Purpose of the invention: To address the problems mentioned in the background art, this invention discloses a method for optimizing parameters of a permanent magnet synchronous motor (PMSM) based on an improved Moth Flame Particle Swarm Optimization (MFPSO) algorithm. By improving the MFPSO algorithm, introducing adaptive inertial weights, Gaussian mutation strategy, and elite retention method, the method designs and optimizes fuzzy PID parameters to achieve position and speed control of the PMSM with no overshoot, fast response, small error, and strong anti-interference capability.
[0005] Technical solution:
[0006] This invention discloses a method for optimizing parameters of a permanent magnet synchronous motor based on an improved moth flame particle swarm optimization algorithm. The method includes the following steps:
[0007] S1: Construct the Moth Flame Particle Swarm Optimization Algorithm MFPSO, which integrates the particle swarm optimization algorithm and the moth flame optimization algorithm. The MFPSO algorithm introduces adaptive inertia weights.
[0008] S2: The MFPSO algorithm introduces a Gaussian mutation strategy to output optimal parameters. Combining the algorithm's characteristics with the introduction of a nonlinear acceleration coefficient and a group evolution mechanism, an improved MFPSO algorithm is formed.
[0009] S3: Design a fuzzy PID controller with the control performance of permanent magnet synchronous motor as the target. Use the fuzzy rules, membership function and PID parameters in the fuzzy PID controller as optimization variables to improve the MFPSO algorithm. Construct a fitness function that includes motor speed error, overshoot, settling time and anti-interference capability.
[0010] S4: By improving the MFPSO algorithm, the optimization variables are optimized, the optimal parameter configuration is output and loaded into the fuzzy PID controller, and the fuzzy PID controller with the optimal parameters is applied to the control of permanent magnet synchronous motor.
[0011] Furthermore, the MFPSO algorithm described in S1 introduces adaptive inertia weights as follows:
[0012] The introduction is carried out through three main steps: parameter definition, real-time calculation, and dynamic application. First, the initial parameters are defined. and finally Inertia weight is calculated using the dynamic inertia weight calculation formula. Then it is applied to the speed update calculation formula, using Replace fixed Finally, the location is updated to obtain optimized parameters for dynamic adaptation of PMSM;
[0013]
[0014] in, It is 0.9; It is 0.4; This represents the current iteration number; This represents the maximum number of iterations. The adjustment coefficient for the iterative process is ; Let be the variance sensitivity coefficient; For the first Variance of fitness in generations of populations; The initial generation population fitness variance is represented by .
[0015] Furthermore, after population initialization, the velocity formula is updated using the particle swarm optimization algorithm, the position is updated using the MFPSO algorithm, the position boundary is processed, and then the Gaussian mutation strategy is introduced to perturb the position, perform secondary boundary processing, and evaluate the fitness.
[0016] Furthermore, the optimization parameters are obtained as follows:
[0017] Define minimum and maximum mutation probabilities, apply the minimum mutation probability in the early stages of iteration, and apply the maximum mutation probability in the later stages of iteration; generate perturbation terms using the improved mutation strategy formula. The parameters are finely adjusted by leveraging the characteristic of low probability of large perturbations and high probability of small perturbations; a mutation operation is performed to update the particle positions according to probability; finally, to ensure that the mutated parameters possess physical properties, a secondary boundary treatment is performed to output the optimal parameters.
[0018]
[0019] in: The parameters of the MFPSO algorithm are obtained through a hybrid PSO / MFO mechanism. Uniform random numbers; Mutation probability (dynamically adjusted); : No. Gaussian perturbation of individual particles; Gaussian disturbance term, with mean 0 and variance . It follows a normal distribution.
[0020] Furthermore, the nonlinear acceleration coefficient introduced in S2 is as follows:
[0021] Define individual and global learning factors, and refine them to the initial values of individual learning factors. and the final value of individual learning factors and the initial value of the global learning factor The final value of the global learning factor The factor sizes in the early and late stages of iteration are dynamically adjusted using dynamic calculation formulas for individual and global learning factors, thereby accelerating the real-time calculation of nonlinear coefficients. , Substitute this value into the speed update formula of the MFPSO algorithm, replacing the traditional fixed value, and directly apply it to parameter adjustment and optimization.
[0022] Furthermore, the nonlinear acceleration coefficient , The calculation is as follows:
[0023]
[0024] in, The maximum number of iterations, This represents the current iteration number; This represents the initial value of the individual learning factor; This represents the final value of the individual learning factor. This is the initial value for the global learning factor; This represents the final value of the global learning factor.
[0025] Furthermore, the group evolution mechanism is implemented as follows:
[0026] Perform population initialization and grouping preparation, and determine the groups. The MFPSO algorithm population is divided into 2-5 independent groups based on fitness, with each group employing a different local search strategy. Intra-group independent evolution focuses on searching local parameter regions, and velocity and position updates are performed within each group. Elite individuals are retained and screened within each group to ensure no high-quality solutions are lost and to maintain an elite ratio of 30% per group. Finally, cross-group information exchange is implemented to achieve global collaboration and diversity enhancement. Every 5-10 iterations, groups exchange information on the best individuals, and 10%-20% of individuals within each group are randomly selected for cross-group migration to enrich population diversity and prevent the algorithm from getting trapped in local optima. After population reorganization, the set of individuals with the best parameters is selected to form a new generation population. .
[0027] Furthermore, the fitness function described in S3 is constructed as follows:
[0028]
[0029] in, For multi-objective fitness functions; , , , These are the weighting coefficients, and their sum is 1. This is the steady-state error; This represents the maximum speed deviation. The overshoot is calculated; the position and speed control of the permanent magnet synchronous motor are achieved by optimizing the PID parameters through an improved MFPSO algorithm.
[0030] Furthermore, the optimized carrier of the method includes a magnetic synchronous motor body, a current sensor, a speed sensor, a fuzzy PID controller, and a drive module; the current sensor and the speed sensor respectively collect the stator current and actual speed of the motor and feed them back to the fuzzy PID controller; the fuzzy PID controller loads the parameters optimized by the MFPSO algorithm and outputs a PWM control signal to the drive module; the drive module adjusts the motor power supply voltage and frequency according to the PWM signal to achieve precise motor control.
[0031] Beneficial effects:
[0032] 1. This invention uses the Moth Flame Particle Swarm Optimization (MFPSO) algorithm as the algorithm carrier to optimize fuzzy PID parameters. Compared with the existing MFO and PSO single-algorithm control strategies, it solves the problems of local optimum traps and insufficient parameter coupling optimization. The fusion algorithm MFPSO utilizes the fast traversal characteristics of PSO in the early stage of iteration and adopts MFO to focus on local fine optimization in the later stage of iteration, which further improves the convergence speed of parameter optimization and adaptability to the real-time requirements of different working conditions.
[0033] 2. This invention introduces adaptive inertial weights based on the Moth Flame Particle Swarm Optimization (MFPSO) algorithm through three major steps: parameter definition, real-time calculation, and dynamic action. This improves the original algorithm's poor adaptability to the time-varying nature of PMSM parameters and multiple operating conditions, further enhancing global optimization capabilities and strengthening the adaptability of PMSM application scenarios.
[0034] 3. This invention introduces a Gaussian mutation strategy into MFPSO, which introduces random perturbations into the particle position, enabling the improved algorithm to explore more different parameter combinations, adapt to the optimal PMSM parameters under various operating conditions, and improve the control performance of the motor under different operating conditions.
[0035] 4. This invention introduces a nonlinear acceleration coefficient into the MFPSO, enabling the system to find the optimal parameters more quickly and reducing the speed step response rise time; at the same time, it reduces the overshoot of speed control and has stronger anti-interference capability.
[0036] 5. This invention designs a group evolution mechanism in MFPSO, dividing the population into 2-5 independent groups, each evolving independently; each group ensures that 30% of elite individuals are retained, ensuring that high-quality solutions are not lost, further avoiding the algorithm from getting stuck in local optima during parameter optimization, and further improving the convergence speed. Attached Figure Description
[0037] Figure 1 This is a flowchart of the overall process of the present invention;
[0038] Figure 2 This is a simulation model structure diagram of the fuzzy PID controller based on the improved MFPSO algorithm of this invention;
[0039] Figure 3 The iterative curve diagram of the improved MFPSO algorithm of this invention;
[0040] Figure 4 This is a comparison chart of the speed response of the embodiment of the present invention with that of traditional PID and fuzzy PID optimized PMSM;
[0041] Figure 5This is a comparison chart of the dynamic torque of the PMSM under load mutation in the embodiment of the present invention with that of traditional PID and fuzzy PID. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.
[0043] like Figure 1 As shown, this invention discloses a method for optimizing parameters of a permanent magnet synchronous motor based on an improved moth flame particle swarm algorithm. The method steps are as follows:
[0044] S1: Construct the Moth Flame Particle Swarm Optimization Algorithm MFPSO, which integrates the particle swarm optimization algorithm and the moth flame optimization algorithm. The MFPSO algorithm introduces adaptive inertia weights.
[0045] The introduction is carried out through three main steps: parameter definition, real-time calculation, and dynamic application. First, the initial parameters are defined. and finally Inertia weight is calculated using the dynamic inertia weight calculation formula. Then it is applied to the speed update calculation formula, using Replace fixed Finally, the location is updated to obtain optimized parameters for dynamic adaptation of PMSM;
[0046] ;
[0047] in, It is 0.9; It is 0.4; This represents the current iteration number; This represents the maximum number of iterations. This is the adjustment coefficient for the iterative process, ranging from 1.2 to 1.5. This is the variance sensitivity coefficient, which ranges from 0.8 to 1.0. For the first Variance of fitness in generations of populations; For the initial generation Population fitness variance;
[0048] Introducing adaptive inertial weights can better solve the problem of weak global optimization ability, improve the ability to avoid getting trapped in local optima, and accelerate the convergence speed. It also enhances the adaptability of PMSM application scenarios, adapts to the time-varying requirements of PMSM parameters, and meets the needs of PMSM in multiple operating conditions.
[0049] S2: The MFPSO algorithm introduces a Gaussian mutation strategy to output optimal parameters. Combining the algorithm's characteristics with the introduction of a nonlinear acceleration coefficient and a group evolution mechanism, an improved MFPSO algorithm is formed.
[0050] The specific steps for implementing the Gaussian mutation strategy are as follows:
[0051] After population initialization, the velocity formula is updated using the particle swarm optimization algorithm, followed by the position update using the MFPSO algorithm. After position boundary processing, a Gaussian mutation strategy is introduced to perturb the position. Then, a second boundary processing is performed, and finally, fitness is evaluated.
[0052] First, define the minimum and maximum mutation probabilities. Apply the minimum mutation probability in the early stages of iteration and the maximum mutation probability in the later stages. Then, generate the perturbation term using the improved mutation strategy formula. The parameters are finely adjusted by taking advantage of the characteristics of small probability of large perturbation and large probability of small perturbation; a mutation operation is performed to update the particle position according to the probability; finally, in order to ensure that the mutated parameters have physical properties, a secondary boundary process is performed to output the optimal parameters.
[0053] ;
[0054] in: The parameters of the MFPSO algorithm are obtained through a hybrid PSO / MFO mechanism; Uniform random numbers; Mutation probability (dynamically adjusted); : No. Gaussian perturbation of individual particles; Gaussian disturbance term, with mean 0 and variance . The normal distribution;
[0055] Introducing a Gaussian mutation strategy can more effectively prevent the algorithm from getting trapped in local optima. The Gaussian mutation strategy introduces a random perturbation term that follows a normal distribution. This allows particles to escape their current local optimum. Because The particles are randomly generated and follow a normal distribution, meaning they have a certain probability of moving away from their current position, thus increasing the likelihood of finding the global optimum. Simultaneously, the Gaussian mutation strategy introduces random perturbations into the particle positions, causing them to change and increasing the diversity of particle positions within the population. Different particles, subjected to varying degrees of Gaussian perturbation, will be distributed across different locations in the search space, maintaining population diversity and enabling the algorithm to continuously explore new regions. This also allows the algorithm to explore more diverse parameter combinations, thereby adapting to the optimal PMSM parameters under various operating conditions and improving the motor's control performance under different conditions.
[0056] The specific steps for introducing a nonlinear acceleration factor are as follows:
[0057] The improvement is achieved through four steps: parameter definition, dynamic calculation, embedded speed update, and adaptation to motor control requirements, as detailed below:
[0058] First, define the individual and global learning factors, and then refine them to the initial values of the individual learning factors. and the final value of individual learning factors and the initial value of the global learning factor The final value of the global learning factor The factor sizes are dynamically adjusted in the early and late stages of the iteration using dynamic calculation formulas for individual and global learning factors. The early stage of the iteration mainly involves... big Small, later stages of iteration Small Large; then calculate in real time , The speed update formula of the MFPSO algorithm is substituted into the traditional fixed value and directly applied to parameter adjustment and optimization to meet the motor control requirements.
[0059] The nonlinear acceleration factor changes with the number of iterations, and the individual learning factor... and global learning factor There will be different changes to adapt the algorithm in the early stages. Emphasizing individual exploration, later stages It also focuses on global convergence, and its mathematical expression is as follows:
[0060] ;
[0061] in, The maximum number of iterations, This represents the current iteration number; This represents the initial value of the individual learning factor; This represents the final value of the individual learning factor. This is the initial value for the global learning factor; This represents the final value of the global learning factor.
[0062] The group evolution mechanism is implemented as follows:
[0063] The closed-loop process of "population division, intra-group evolution, preservation of elite individuals, cross-group information exchange, and population recombination" is used to solve the problems of insufficient population diversity and easy getting trapped in local optima in traditional algorithms. The specific operation steps are as follows:
[0064] First, population initialization and grouping preparation are performed, and grouping is determined. The process involves setting group sizes, sorting and dividing the MFPSO algorithm population into 2-5 independent groups based on fitness, with each group employing a different local search strategy. Intra-group independent evolution focuses on searching local parameter regions, with updates to velocity and position performed within each group. Elite individuals are retained and screened within groups to ensure no high-quality solutions are lost and to maintain an elite ratio of 30% per group. Finally, cross-group information exchange is implemented to achieve global collaboration and diversity enhancement. Every 5-10 iterations, groups exchange information on the best individuals, and 10%-20% of individuals within a group are randomly selected for cross-group migration to enrich population diversity and prevent the algorithm from getting trapped in local optima. After population reorganization, a new generation population is generated using a new generation population formula. .
[0065] ;
[0066] in, This refers to the new generation of populations generated after group evolution; Total number of groups; For the merging operation, multiple groups are combined into one whole; For the first The elite individuals in the group; For the first The optimal individual is shared among all groups;
[0067] The introduction of the group evolution mechanism divides the population into 2-5 independent groups, each evolving independently; each group ensures that 30% of elite individuals are retained to ensure that high-quality solutions are not lost; PSO / MFO hybrid updates are performed within each group to enhance the diversity of the population; ideally, the population is reorganized after each group evolves to ultimately achieve information sharing.
[0068] In summary, the grouped evolutionary mechanism enhances the control of motor speed and position; the introduction of nonlinear acceleration coefficients enables the system to find optimal parameters more quickly, reducing the rise time of speed step response; it also reduces speed control overshoot and provides stronger anti-interference capabilities. Overall, it significantly improves the algorithm's performance. Through these improvements, the algorithm can find better PID parameter combinations in motor control, balancing fast response and control accuracy; it also enhances system stability and anti-interference capabilities, making it particularly suitable for the control requirements of high-performance motor drive systems.
[0069] S3: Design a fuzzy PID controller with the control performance of permanent magnet synchronous motor as the target. Use the fuzzy rules, membership function and PID parameters in the fuzzy PID controller as optimization variables to improve the MFPSO algorithm. Construct a fitness function that includes motor speed error, overshoot, settling time and anti-interference capability.
[0070] like Figure 2 As shown, the fuzzy PID controller design is as follows:
[0071] Hierarchical design of fuzzy PID controller
[0072] The core requirements of the position loop are high-precision positioning and no overshoot. The position loop PID parameters are indirectly corrected through fuzzy logic by optimizing parameter K3 in the improved MFPSO algorithm. Its key feature is that…
[0073] Its positional error is characterized by,
[0074] ;
[0075] in, For the target location; This refers to the actual location;
[0076] The target speed output by its PID controller is characterized by,
[0077] ;
[0078] in: , , For the position ring proportional, integral, and differential coefficients; This refers to the positional error;
[0079] The target formula for PID parameter adjustment of a permanent magnet synchronous motor (PMSM) is characterized by the overshoot and settling time in the dynamic performance indicators.
[0080] ;
[0081] in, This is an overshoot indicator; This is the maximum speed; The target speed is determined by the smaller the overshoot; the system is basically stable within (-5, +5) during the settling time.
[0082] By improving the MFPSO algorithm and optimizing parameter K3 to adjust the weight of the fuzzy increment, the position loop parameters are dynamically balanced between fast response and accurate positioning, so as to achieve the purpose of accurately adjusting the motor position loop.
[0083] The speed loop is the core of the three-loop control, requiring a balance between fast dynamic response and low speed fluctuation. It achieves this by improving the parameters K1, K2, Ke, and Kec in the MFPSO algorithm, optimizing both fuzzy logic accuracy and PID parameter correction. Its key feature is...
[0084] Its speed error is characterized by,
[0085] ;
[0086] in, The target rotational speed; This refers to the actual rotational speed;
[0087] Its PID controller output Axis commands, it is worth noting that they are generally used Control strategy, so we try to adjust it. Shaft, characterized in that,
[0088] ;
[0089] in: , , For the proportional, integral, and differential coefficients of the velocity loop;
[0090] The steady-state error of its static stability performance index is characterized by,
[0091] ;
[0092] in, This is the steady-state error; For speed error;
[0093] The characteristic of the anti-interference index is that the maximum speed deviation under load disturbance is:
[0094] ;
[0095] in, This represents the maximum speed deviation. This refers to the actual rotational speed; The target rotational speed;
[0096] The optimization logic lies in adjusting the PID parameters K1 and K2 through the optimization algorithm, Ke and Kec improve the fuzzy accuracy, and take into account both dynamic response and anti-interference ability; improve the dynamic response of the motor, enhance the load anti-interference ability, and eliminate steady-state error after the motor speed tends to stabilize.
[0097] The core requirements of current loop control are fast tracking of command current and noiseless amplification, which are typically achieved using PI control. The characteristic of shaft current error is that,
[0098] ;
[0099] in, for Shaft target current; for Actual shaft current; for Shaft target current; for Actual shaft current;
[0100] Its current loop PI controller outputs a voltage command. To avoid amplifying noise, the current loop is typically not differentiated during adjustment. Its characteristic is that...
[0101] ;
[0102] in, , For current loop Axis ratio, integral coefficient; for Shaft current error; , For current loop Axis ratio, integral coefficient; for Shaft current error;
[0103] The improvement of the five parameters of the MFPSO algorithm optimization is not simply a replacement of the fixed coefficients of the three-loop PID. Instead, it solves the problem that the fixed parameters of traditional PID are difficult to adapt to all operating conditions through fuzzy logic and dynamic correction. The algorithm optimizes fuzzy rules to correct the PID parameters. In addition, the logic control of the three-loop coordinated execution makes the control performance of the PMSM more adaptable to the dynamic industrial operating conditions and has significant engineering application value.
[0104] Multi-objective optimization process for PMSM parameters:
[0105] 1) Optimization variable definition: The optimization variables for MFPSO are defined as the five core parameters of fuzzy PID: : 0-1.1, : 0-1.1, : 0-8 : 0.1-0.8 : 0.1-0.5, covering both fuzzification accuracy and PID parameter correction dimensions;
[0106] 2) Fitness function construction: Taking PMSM control performance as the objective, a weighted multi-objective fitness function formula is constructed as described in claim 4: in: Overshoot The smaller the weight, the better. =0.3 adjustment time The smaller the weight, the better. =0.2 steady-state error The smaller the weight, the better. Maximum speed deviation due to load disturbance The smaller the weight, the better; the weight can be dynamically adjusted according to the working conditions.
[0107] S4: By improving the MFPSO algorithm, the optimization variables are optimized, the optimal parameter configuration is output and loaded into the fuzzy PID controller, and the fuzzy PID controller with the optimal parameters is applied to the control of permanent magnet synchronous motor.
[0108] The optimization process of the MFPSO algorithm includes:
[0109] S41: Initialize the population, set the population size to 50-100, the particle position corresponds to the optimization variable of the fuzzy PID controller, and the position boundary is set according to the parameter range of the permanent magnet synchronous motor and the design requirements of the fuzzy controller;
[0110] S42: Calculate the fitness value of each particle to determine the individual optimal position and the global optimal position;
[0111] S43: Update particle velocity based on adaptive inertia weight and nonlinear acceleration coefficient, and update particle position based on group evolution mechanism;
[0112] S44: Determine if the maximum number of iterations (50-200) has been reached or if the fitness value is less than the preset threshold (0.01-0.1). If yes, output the globally optimal parameters; otherwise, return to S42 to continue iteration. The iteration curve is shown below. Figure 3 As shown.
[0113] The optimized carrier of the method of the present invention includes a magnetic synchronous motor body, a current sensor, a speed sensor, a fuzzy PID controller, and a drive module; the current sensor and the speed sensor respectively collect the stator current and the actual speed of the motor and feed them back to the fuzzy PID controller; the fuzzy PID controller loads the parameters optimized by the MFPSO algorithm and outputs a PWM control signal to the drive module; the drive module adjusts the motor power supply voltage and frequency according to the PWM signal to achieve precise motor control.
[0114] The following is a simulation experiment of the method of the present invention, the specific contents of which are as follows:
[0115] 1. Experimental environment and PMSM model parameters
[0116] Simulation software: Matlab R2024a / Simulink, CEC2020 Test Function Toolbox;
[0117] PMSM unit parameters: Rated power: 1.5kW; Rated speed: 1500rpm; Rated voltage: 380V (three-phase); Stator resistance Rs=1.2 d-axis inductance Ld = 4.2 mH; q-axis inductance Lq = 8.5 mH; permanent magnet flux linkage f = 0.18Wb; number of pole pairs p = 4; moment of inertia J = 0.005 kg·m The coefficient of viscous friction, B, is 0.002 N·m·s / rad.
[0118] Control strategy: id=0 vector control current loop sampling frequency 10kHz, speed loop sampling frequency 1kHz, position loop sampling frequency 100Hz.
[0119] 2. MFPSO Algorithm Parameter Settings and Testing
[0120] Algorithm parameter settings: Population size Maximum number of iterations Adaptive inertia weight parameters: , , , Nonlinear acceleration coefficient: , , , Group evolution: Divided into 2 groups, each with 15 particles, elite individuals are exchanged every 8 iterations; Mutation strategy: Initially 0.05, The value rose to 0.3, and the standard deviation of Gaussian variation was [value missing]. =0.1.
[0121] The algorithm tests were compared across three core dimensions: convergence speed, convergence accuracy, and stability.
[0122] Convergence speed: The fewer iterations required for the curve to descend from its initial high value to a stable low value, the faster the convergence speed.
[0123] Convergence accuracy: The smaller the value of the ordinate of the curve when it finally stabilizes, the higher the accuracy.
[0124] Stability: The less oscillation and the smoother the curve is during its descent, the better the stability and the less it is affected by local optima.
[0125] By changing the dimensions and specific test functions, the algorithm can be comprehensively evaluated:
[0126] Adaptability: Whether it can work stably on problems with different dimensions and characteristics;
[0127] Robustness: Whether a better solution can still be found when facing complex scenarios such as high dimensionality and multiple peaks;
[0128] Generality: Whether it is applicable to multiple types of optimization problems.
[0129] In this invention, when designing dimensions and selecting specific test functions, high-dimensional and multi-peak test functions are chosen to test the algorithm's optimization ability in complex spaces and whether the algorithm can escape local optima when there are multiple local optima, that is, to test the algorithm's global search ability.
[0130] 3. Comparative Experimental Design
[0131] Three sets of comparison algorithms were set up to verify the superiority of MFPSO:
[0132] Group 1: Traditional PID ( , , , );
[0133] Group 2: Fuzzy PID ( Correction amount: 5 Correction amount: 0.5 Correction amount: 0.02).
[0134] Group 3: This invention's MFPSO optimizes fuzzy PID ( , , Correction amount: 5 Correction amount: 0.5 Correction amount: 0.01).
[0135] 4. Experimental Results and Analysis (e.g.) Figure 4 and Figure 5 (As shown)
[0136] 1) By comparing the convergence performance of each algorithm and analyzing their convergence curves, we can obtain the following:
[0137] Curve characteristics: The MFPSO curve drops very rapidly in the early stage, from 3200 to about 2850 in about 50 iterations, and then becomes completely stable; the traditional PSO curve drops more slowly, and it takes about 350 iterations to converge to 2870; the standard MFO curve drops even more slowly, and it converges to 2865 in about 420 iterations.
[0138] Analysis: MFPSO combines the local convergence speed of PSO with the global search capability of MFO. The adaptive inertia weight enables rapid traversal of the parameter space in the early stage, and group evolution and elite preservation avoid getting trapped in local optima. Therefore, the convergence speed is 40% faster than PSO and 50% faster than MFO. The final fitness is also the lowest, indicating the highest optimization accuracy.
[0139] 2) Comparative analysis of static control performance:
[0140] Curve characteristics: After MFPSO optimization, when the PMSM speed increases from 0 to 1000 rpm, the overshoot is... Only 4.2%, adjustment time s, steady-state error Traditional PID overshoot is 18%. s, Standard PSO overshoot 10.2%, s.
[0141] Analysis: The fuzzy PID parameters optimized by MFPSO enhance the characteristics of fast response when the error is large and accurate convergence when the error is small through nonlinear acceleration coefficients. At the same time, the fuzzy rules dynamically adjust the PID parameters, which not only ensures the response speed but also suppresses overshoot. The steady-state accuracy is also greatly improved due to the dynamic integral adjustment.
[0142] 3) Comparative analysis of dynamic anti-interference performance:
[0143] Curve characteristics: When the load suddenly increases from 1 N·m to 3 N·m, the speed fluctuation under MFPSO control rpm, stabilized within 0.2s; traditional fuzzy PID fluctuations rpm, 0.6s recovery; standard PID fluctuation rpm, recovers in 0.4s.
[0144] Analysis: MFPSO's dynamic Gaussian variation and group information sharing enable the algorithm to quickly correct fuzzy PID parameters under load disturbances and increase the derivative gain to suppress speed fluctuations. Therefore, its anti-interference capability is far superior to other algorithms, demonstrating the dynamic adaptability of the algorithm, controller, and motor.
[0145] 5. Experimental Conclusions
[0146] The MFPSO algorithm of this invention can efficiently optimize fuzzy PID parameters and significantly improve PMSM control performance through four major improvement mechanisms, which can meet the industrial requirements for high precision and high stability control.
[0147] Algorithm performance advantages: MFPSO combines the local convergence speed of PSO with the global search capability of MFO. Adaptive inertia weights enable global exploration in the early stage and local convergence in the later stage. Group evolution avoids population homogeneity, making the algorithm convergence speed 40% faster than traditional PSO and 50% faster than standard MFO, while improving optimization accuracy by 5%-8%.
[0148] Improved control performance: The optimized fuzzy PID reduces PMSM speed overshoot from 18% of traditional PID to 4.2%, shortens settling time by 56%, and eliminates steady-state error to below 0.1%; speed fluctuations under load disturbances are reduced by 70%, and recovery time is shortened by 67%, comprehensively outperforming traditional PID, standard PSO, and standard MFO;
[0149] Engineering value: Combining the advantages of intelligent algorithms, fully automatic optimization of PMSM parameters can be achieved, greatly shortening the debugging cycle. It can be directly applied to scenarios such as new energy vehicle drive and industrial robot servo control, and has the advantages of high precision, fast response and strong robustness.
[0150] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent transformations or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for optimizing parameters of a permanent magnet synchronous motor based on an improved moth-flame particle swarm optimization algorithm, characterized in that, The method includes the following steps: S1: Construct the Moth Flame Particle Swarm Optimization Algorithm MFPSO, which integrates the particle swarm optimization algorithm and the moth flame optimization algorithm. The MFPSO algorithm introduces adaptive inertia weights. S2: The MFPSO algorithm introduces a Gaussian mutation strategy to output the optimal parameters, and combines the algorithm characteristics to introduce a nonlinear acceleration coefficient and a group evolution mechanism to form an improved MFPSO algorithm. S3: Design a fuzzy PID controller with the control performance of permanent magnet synchronous motor as the target. Use the fuzzy rules, membership function and PID parameters in the fuzzy PID controller as optimization variables to improve the MFPSO algorithm. Construct a fitness function that includes motor speed error, overshoot, settling time and anti-interference capability. S4: By improving the MFPSO algorithm, the optimization variables are optimized, the optimal parameter configuration is output and loaded into the fuzzy PID controller, and the fuzzy PID controller with the optimal parameters is applied to the control of permanent magnet synchronous motor.
2. The method for optimizing parameters of a permanent magnet synchronous motor based on an improved moth-flame particle swarm optimization algorithm according to claim 1, characterized in that, The MFPSO algorithm described in S1 introduces adaptive inertia weights as follows: The introduction is carried out through three main steps: parameter definition, real-time calculation, and dynamic application. First, the initial parameters are defined. and finally Inertia weight is calculated using the dynamic inertia weight calculation formula. Then it is applied to the speed update calculation formula, using Replace fixed Finally, the location is updated to obtain optimized parameters for dynamic adaptation of PMSM; ; in, It is 0.9; It is 0.4; This represents the current iteration number; This represents the maximum number of iterations. The adjustment coefficient for the iterative process is ; Let be the variance sensitivity coefficient; For the first Variance of fitness in generations of populations; The initial generation population fitness variance is represented by .
3. The method for optimizing parameters of a permanent magnet synchronous motor based on an improved moth-flame particle swarm optimization algorithm according to claim 1, characterized in that, After population initialization, the velocity formula is updated using the particle swarm optimization algorithm, the position is updated using the MFPSO algorithm, the position boundary is processed, and then the Gaussian mutation strategy is introduced to perturb the position. After secondary boundary processing, fitness is evaluated.
4. The method for optimizing parameters of a permanent magnet synchronous motor based on an improved moth-flame particle swarm optimization algorithm according to claim 3, characterized in that, The optimization parameters are obtained as follows: Define minimum and maximum mutation probabilities, apply the minimum mutation probability in the early stages of iteration, and apply the maximum mutation probability in the later stages of iteration; generate perturbation terms using the improved mutation strategy formula. The parameters are finely adjusted by leveraging the characteristic of low probability of large perturbations and high probability of small perturbations; a mutation operation is performed to update the particle positions according to probability; finally, to ensure that the mutated parameters possess physical properties, a secondary boundary treatment is performed to output the optimal parameters. ; in: The parameters of the MFPSO algorithm are obtained through a hybrid PSO / MFO mechanism; Uniform random numbers; Mutation probability (dynamically adjusted); : No. Gaussian perturbation of individual particles; Gaussian disturbance term, with mean 0 and variance . It follows a normal distribution.
5. The method for optimizing parameters of a permanent magnet synchronous motor based on an improved moth-flame particle swarm optimization algorithm according to claim 1, characterized in that, The nonlinear acceleration coefficient introduced in S2 is as follows: Define individual and global learning factors, and refine them to the initial values of individual learning factors. and the final value of individual learning factors and the initial value of the global learning factor The final value of the global learning factor The factor sizes in the early and late stages of iteration are dynamically adjusted using dynamic calculation formulas for individual and global learning factors, thereby accelerating the real-time calculation of nonlinear coefficients. , Substitute this value into the speed update formula of the MFPSO algorithm, replacing the traditional fixed value, and directly apply it to parameter adjustment and optimization.
6. The method for optimizing parameters of a permanent magnet synchronous motor based on an improved moth-flame particle swarm optimization algorithm according to claim 5, characterized in that, The nonlinear acceleration coefficient , The calculation is as follows: ; ; in, The maximum number of iterations, This represents the current iteration number; This represents the initial value of the individual learning factor; This represents the final value of the individual learning factor. This is the initial value for the global learning factor; This represents the final value of the global learning factor.
7. The method for optimizing parameters of a permanent magnet synchronous motor based on an improved moth-flame particle swarm optimization algorithm according to claim 1, characterized in that, The specific implementation of the group evolution mechanism is as follows: Perform population initialization and grouping preparation, and determine the groups. Set the group size; sort and divide the population of the MFPSO algorithm into 2-5 independent groups according to fitness, and use different local search strategies in each group; Intra-group independent evolution focuses on searching local parameter regions, with velocity and position updates performed within each group. Elite individuals are retained and screened within the group to ensure no high-quality solutions are lost and to maintain an elite ratio of 30% per group. Finally, cross-group information exchange is implemented to achieve global collaboration and diversity enhancement. Every 5-10 iterations, optimal individual information is exchanged between groups, and 10%-20% of individuals within each group are randomly selected for cross-group migration to enrich population diversity and prevent the algorithm from getting trapped in local optima. After population reorganization, the set of individuals with the best parameters is selected to form a new generation population. .
8. The method for optimizing parameters of a permanent magnet synchronous motor based on an improved moth-flame particle swarm optimization algorithm according to claim 1, characterized in that, The fitness function described in S3 is constructed as follows: ; in, For multi-objective fitness functions; , , , These are the weighting coefficients, and their sum is 1. This is the steady-state error; This represents the maximum speed deviation. This is to determine the speed overshoot; by improving the MFPSO algorithm and optimizing the PID parameters, position and speed control of the permanent magnet synchronous motor is achieved.
9. The method for optimizing parameters of a permanent magnet synchronous motor based on an improved moth-flame particle swarm optimization algorithm according to any one of claims 1-8, characterized in that... The optimized carrier of the method includes a magnetic synchronous motor body, a current sensor, a speed sensor, a fuzzy PID controller, and a drive module; the current sensor and the speed sensor respectively collect the stator current and the actual speed of the motor and feed them back to the fuzzy PID controller; the fuzzy PID controller loads the parameters optimized by the MFPSO algorithm and outputs a PWM control signal to the drive module; The drive module adjusts the motor power supply voltage and frequency according to the PWM signal to achieve precise motor control.
Citation Information
Cited By
New energy automobile permanent magnet synchronous motor optimization method based on improved elk swarm algorithm
CN121543447A
Network intrusion detection method and device based on artificial intelligence, and storage medium
CN121585463A
