Permanent magnet synchronous motor control method based on improved small sample generative adversarial network
By improving the small sample generation adversarial network and spider bee optimization algorithm, the control problem of permanent magnet synchronous motors under nonlinear and uncertain conditions is solved, and a more stable and robust intelligent control effect is achieved.
Patent Information
- Application Number
- CN202510326216.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-06-27
AI Technical Summary
When facing factors such as load changes, temperature fluctuations and voltage disturbances, the changes in model parameters make it difficult for traditional control methods to provide stable and efficient control effects within a wide range of working conditions.
The control method based on the improved small sample generation adversarial network is adopted, and data enhancement is performed through RBF generation adversarial network, and combined with the spider bee optimization algorithm to optimize the loss function weight, high-quality sample data is generated, and the control model of permanent magnet synchronous motor is constructed to realize intelligent control of the motor.
It significantly improves the reliability and generalization of the generation of adversarial network data, enhances the stability and robustness of the permanent magnet synchronous motor control system, and provides more reliable and efficient intelligent control means.
Smart Images

Figure CN120222882A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of motor control, and particularly relates to a permanent magnet synchronous motor control method based on an improved small-sample generative adversarial network. Background Technique
[0002] Due to its advantages such as high power density, high efficiency, and compact structure, the permanent magnet synchronous motor (PMSM) has been widely used in modern industrial and transportation fields. Especially in scenarios that require high-performance drives such as electric vehicles, industrial robots, automated production lines, and aerospace, the PMSM has become the preferred motor due to its superior dynamic performance and low maintenance cost. However, the PMSM has strong nonlinear characteristics, and its operating characteristics are easily affected by factors such as load changes, temperature fluctuations, and voltage disturbances, resulting in changes in the parameters of the motor model. This nonlinearity and uncertainty pose significant challenges to the design of control systems, and traditional control methods are difficult to provide stable and efficient control effects within a wide range of operating conditions.
[0003] The composite control method based on the PID and sliding mode controllers, as a strategy that combines classical control and modern nonlinear control theories, demonstrates good practicability and robustness. The PID controller realizes the stable control of the system by adjusting the control input in real time according to the error and its change trend, while the sliding mode controller effectively enhances the robustness of the system under uncertain and external disturbance conditions by designing a sliding mode surface, thus ensuring that the system can still maintain a high control accuracy under complex operating conditions. In the control of permanent magnet synchronous motors, this composite control method is widely used in the precise regulation of speed and position, and its robust performance in dealing with load fluctuations and external disturbances is particularly prominent. However, this method also has certain limitations, mainly reflected in the fact that parameter tuning depends on experience and is relatively complex. In addition, under non-ideal operating conditions, the sliding mode control may introduce the "chattering" phenomenon, which has a negative impact on the dynamic performance of the system.
[0004] To overcome the deficiencies of the above methods in the tuning of control parameters, an adaptive PID-sliding mode control parameter identification method based on neural networks is proposed. This method constructs a nonlinear mapping relationship between the motor operating state and the controller parameters through offline training of the neural network, thereby realizing the real-time adaptive adjustment of the PID controller gains and the sliding mode control parameters. By adjusting the PID and sliding mode control parameters in real time, this method achieves adaptive control, not only effectively reducing the complexity of parameter tuning, but also significantly enhancing the robustness and flexibility of the control system in complex working conditions and environments with high uncertainties. Although this method exhibits excellent performance, its application still faces certain challenges. First, the training effect of the neural network highly depends on the quality and diversity of the dataset. In the case of insufficient data samples or failure to cover various working conditions, the generalization ability of the model may be limited, making it difficult to maintain an ideal control effect in unseen working conditions.
[0005] The emergence of the small sample problem mainly stems from the difficulty of data acquisition and the limitations of data distribution. Due to factors such as the difficulty of data collection and the difficulty of collecting key states of dynamic systems, the obtained data is often limited. This insufficient data situation poses higher requirements for system modeling and control, and there is an urgent need to develop more adaptable algorithms and technologies to address it. Generative adversarial networks (GANs) are an efficient data augmentation technique that generates virtual data approximating real samples by learning the distribution characteristics of existing samples, so as to expand the scale and diversity of the training dataset. Their significant advantage is that they can generate high-quality and diverse samples without relying on a large amount of real data, thus alleviating the sample insufficiency problem to a certain extent. In the field of motor control, the application of GANs is becoming increasingly widespread, including the generation and supplementation of working condition data, the prediction of control parameters, etc., significantly enhancing the generalization ability and robustness of neural network models under complex working conditions, and providing an effective technical path for solving the data scarcity problem. However, the quality of the data generated by generative adversarial networks (GANs) is affected by the design of the loss function. The differences in the loss functions and their weight allocations adopted by the generator and the discriminator have a significant impact on the feature distribution and generation effect of the generated data. The choice of the loss function and the reasonable configuration of its weights are directly related to the adversarial equilibrium between the generator and the discriminator, thus determining the authenticity and diversity of the generated data. Therefore, to improve the stability and diversity of sample generation, it is usually necessary to optimize the design of the GAN loss function to enhance the robustness and performance of the model. Summary of the Invention
[0006] In view of the above problems existing in the prior art, the present invention is proposed, with reasonable design, which solves the deficiencies of the prior art and has good effects.
[0007] A permanent magnet synchronous motor control method based on an improved small sample generative adversarial network, comprising the following steps:
[0008] Step 1: Through the off-line operation test of the permanent magnet synchronous motor from no-load to full-load, collect the operation data of the motor under different load conditions;
[0009] Step 2: Perform data augmentation based on the RBF-based generative adversarial network;
[0010] Step 3: For the augmented data generated in Step 2, conduct an off-line operation test of the permanent magnet synchronous motor. If the test results show that the generated data fails to meet the quality requirements, optimize the generative adversarial network according to the information feedback from the off-line test;
[0011] Step 4: Optimize the generative adversarial network using the improved spider wasp optimization algorithm, and perform data augmentation using the optimized generative adversarial network;
[0012] Step 5: Construct a control model of the permanent magnet synchronous motor based on the RBF neural network, and train it using the augmented data generated in Step 4 to obtain the trained control model;
[0013] Step 6: Incorporate the trained control model into the on-line control system of the permanent magnet synchronous motor to achieve intelligent control of the motor.
[0014] Furthermore, Step 1 is specifically as follows: A total of 1000 groups of sample data are collected. Each group of sample data includes load condition data, control parameter data, and adjustment effect data; the load condition data includes rotational speed n, voltage u, current I d 、I q and temperature T, the control parameter data includes PID controller parameters K p 、K i 、K d and the parameters K s 、λ s of the sliding mode controller, and the adjustment effect data includes error e and error change rate
[0015] Furthermore, in Step 4, the generator takes the RBF neural network as the core, the input is 12-dimensional real data, the output is 12-dimensional generated samples, and the radial basis function of the hidden layer selects the Gaussian kernel function, and its mathematical expression is:
[0016]
[0017] where φ(x) is the Gaussian kernel function, x is the feature vector of the input sample, c is the kernel center, and σ is the kernel bandwidth parameter; through the non-linear mapping of the Gaussian kernel function, the generator can capture the complex distribution characteristics of the data and generate samples close to the real data distribution;
[0018] The discriminator is also based on the RBF neural network. The input is 12-dimensional sample data, and the output is a 1-dimensional probability. By distinguishing between the generated samples and the real samples, the discriminator provides a reverse gradient signal for the generator to guide the generator to improve the distribution of the generated samples.
[0019] For the standard cross-entropy loss function, a weight factor α is introduced, and the improved spider wasp optimization algorithm is used to dynamically adjust the weight factor α. The loss function L is defined as:
[0020] L = -α·E x~pdata [logD(x)] - (1 - α)·E z~pz [log(1 - D(G(z)))] (2);
[0021] where D(x) represents the discrimination probability of the discriminator for real data, and E x~pdata is the expected function of real data, D(G(z)) represents the discrimination probability of the discriminator for the generated sample g(z), and E z~pz is the expected function of generated data.
[0022] Furthermore, the improved spider wasp optimization algorithm is specifically as follows:
[0023] First, a population containing N female spider wasp individuals is generated and initialized.
[0024] The initialization of the female spider wasp individual is expressed as:
[0025]
[0026] where is the position vector of the i-th female spider wasp individual before iteration, s is a D-dimensional random vector between [0, 1], and X max and X min are the upper and lower limits of the loss function weights respectively.
[0027] Secondly, according to the behavior switching probability η, randomly select the switching between the hunting behavior and the mating behavior, generate a random number ρ6. If ρ6 < η, then perform the mating behavior, otherwise perform the hunting behavior. The hunting behavior is divided into three stages, namely the search stage, the tracking and escape stage, and the nest building stage.
[0028] Finally, there is population size reduction and memory preservation. After the spider wasp individual builds a nest, it stops working, and let other individuals continue to search to accelerate the convergence speed. The expression is:
[0029] M = M min +(M - M min )×k (4);
[0030] where M is the population size, k is the population reduction factor, and Mmin is the minimum population size to avoid falling into local minima.
[0031] Furthermore, for the behavior switching probability η, a dynamic feedback regulation mechanism based on the fitness change rate is proposed. By establishing a time-varying functional relationship of the probability parameter, the stage adaptive optimization of the algorithm search strategy is realized. The improved formula is as follows:
[0032]
[0033] where η t is the behavior switching probability corresponding to the t-th iteration, is the basic probability term, and Δη t is the fitness feedback correction term;
[0034] The expression is:
[0035]
[0036] where η max is the maximum value of the behavior switching probability, τ is the attenuation rate factor, tmax is the maximum number of iterations;
[0037] Δη t The expression is:
[0038]
[0039] where γ is the sensitivity adjustment factor, γ > 0, Δf(t) is the fitness change rate, and Δf ref is the reference change rate. The expression is:
[0040]
[0041] where f(t) is the fitness at the t-th iteration, and ε is a small value to prevent division by zero.
[0042] Furthermore, in the search stage, a fixed-step size position update formula or a variable-step size position update formula will be adopted. The fixed-step size position update is as follows:
[0043]
[0044] λ1 = |z| * ρ1 (10);
[0045] where is the position of the next-generation female spider wasp individual, is the position of the current female spider wasp individual, λ1 is the coefficient, is the position of the female spider wasp individual with index a at the t-th iteration, $x_{b}^{t}$ is the position of the female spider wasp individual with index $b$ at the $t$-th iteration, $z$ is a random number from a normal distribution, and $\rho_1$ is a random number within $[0, 1]$;
[0046] The formula for updating the position with variable step size is as follows:
[0047]
[0048] where, $x_{c}^{t}$ is the position of the female spider wasp individual with index $c$ at the $t$-th iteration, where $i \neq c$, $\lambda_2$ is a coefficient, the value range of $l$ is $[-1, 1]$, and $\rho_2$ is a random number between $[0, 1]$;
[0049] The switching mechanism between fixed step size and variable step size for position update is:
[0050]
[0051] where, Eq.(4) is formula (4), Eq.(6) is formula (6), and $\rho_3$, $\rho_4$ are random numbers between $[0, 1]$;
[0052] The formula for updating the position in the tracking stage is as follows:
[0053]
[0054] where, $P$ determines whether the prey is successfully captured, $a$, $b$ are the indices of two random spider wasps, and $\rho_5$, $\rho_6$ are random numbers between $[0, 1]$; If the prey capture fails, the following position update formula is used to re-explore:
[0055]
[0056] where, $w$ is a random number from a normal distribution between $[-k, k]$;
[0057] The switching mechanism between the tracking and escape stages is:
[0058]
[0059] where, Eq.(9) is formula (9), Eq.(11) is formula (11);
[0060] The switching mechanism between the search stage and the tracking and escape stages is:
[0061]
[0062] where, Eq.(8) is formula (8), Eq.(13) is formula (13), and $p$ is a random number between $[0, 1]$;
[0063] There are two strategies in the nesting stage. One is to drag the prey to a suitable location for nesting, and the other is to randomly select the location of a spider wasp for nesting. The position update when dragging the prey for nesting is as follows:
[0064]
[0065] Among them, X * is the current optimal solution;
[0066] The position update for randomly selecting the location of a spider wasp for nesting is as follows:
[0067]
[0068] Among them, ρ3 is a random number between [0,1], σ is a value generated by the Levy model, and U is a random vector of 0 or 1;
[0069] The switching mechanism between dragging the prey for nesting and randomly selecting the location of a spider wasp for nesting is:
[0070]
[0071] The switching mechanism between tracking, escaping, and nesting is:
[0072]
[0073] Furthermore, the mating behavior is carried out according to the following formula:
[0074]
[0075] Among them, Crossover is the uniform crossover operator, is the position of the male spider wasp individual, and κ is the crossover rate;
[0076] The generation of male spider wasps is as follows:
[0077]
[0078] Among them, is the position of the male spider wasp in the next generation of the mating behavior. The value range of l is [-1,1]. v1 is the position difference vector between the i-th female spider wasp and the a-th female spider wasp, v2 is the position difference vector between the b-th female spider wasp and the c-th female spider wasp, β0 and β1 are random numbers conforming to the normal distribution, and a, b, and c are three different individual index numbers.
[0079] Further, in step 4, in each iteration, according to the updated α, the generator and the discriminator are trained respectively, and the quality of the generated samples is evaluated; the particle fitness is determined by the difference between the generated samples and the real sample distribution, and is quantified using the evaluation index FID. If the fitness reaches the set convergence condition, the algorithm terminates and outputs the global optimal weight factor α * = X * ;
[0080] Finally, the optimized weight factor α * is applied to the cross-entropy loss function to guide the joint training of the generator G and the discriminator D, making the distribution of the generated samples closer to the real data distribution, thereby significantly improving the generation quality and distribution consistency of the generative adversarial network.
[0081] The beneficial technical effects brought by the present invention:
[0082] In order to improve the data reliability of the generative adversarial network, the present invention proposes a method based on the spider wasp optimization of the loss function weight. The optimized generative adversarial network significantly enhances the generalization of the training data set, enhances the stability and robustness of the permanent magnet synchronous motor control system, and provides a more reliable and efficient technical means for the intelligent control of the permanent magnet synchronous motor. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] Figure 1 is the flow chart of the permanent magnet synchronous motor control method in the present invention;
[0084] Figure 2 is the flow chart of the spider wasp algorithm optimization in the present invention;
[0085] Figure 3 is the comparison chart of the speed response curves in the present invention;
[0086] Among them, (a) is the speed response curve diagram based on the traditional speed-current double closed-loop proportional integral differential control strategy; (b) is the speed response curve diagram based on the improved control strategy in the present invention; DETAILED DESCRIPTION OF THE INVENTION
[0087] The following further describes the specific embodiments of the present invention with reference to specific embodiments:
[0088] A permanent magnet synchronous motor control method based on an improved small-sample generative adversarial network, as Figure 1 and Figure 2 shown, includes the following steps:
[0089] Step 1: Through the off-line operation test of the permanent magnet synchronous motor from no-load to full-load, the operation data of the motor under different load conditions are collected;
[0090] Step 2: Perform data augmentation based on the RBF-based generative adversarial network;
[0091] Step 3: Conduct offline operation tests on the permanent magnet synchronous motor for the augmented data generated in Step 2. If the test results show that the generated data fails to meet the quality requirements, optimize the generative adversarial network based on the information feedback from the offline tests;
[0092] Step 4: Optimize the generative adversarial network using the improved spider wasp optimization algorithm, and perform data augmentation using the optimized generative adversarial network;
[0093] Step 5: Construct a control model for the permanent magnet synchronous motor based on the RBF neural network, and train it using the augmented data generated in Step 4 to obtain a trained control model;
[0094] Step 6: Incorporate the trained control model into the online control system of the permanent magnet synchronous motor to achieve intelligent control of the motor.
[0095] Specifically, Step 1 is as follows: A total of 1000 groups of sample data are collected. Each group of sample data includes load condition data, control parameter data, and adjustment effect data. The load condition data includes key operating parameters such as rotational speed n, voltage u, current I d 、I q and temperature T, etc., which are used to comprehensively characterize the dynamic performance of the motor under different operating conditions. The control parameter data includes PID controller parameters K p 、K i 、K d and the parameters K s 、λ s of the sliding mode controller, which are used to describe the adjustment ability of the motor control system under various operating states. The adjustment effect data includes indicators such as error e and error change rate etc., which quantify the response performance and adjustment effect of the control system. This dataset covers the full operating range of the motor from no-load to full-load, and has high representativeness and reliability, laying a solid foundation for the subsequent training and optimization of the model.
[0096] In Step 4, a generative adversarial network (GAN) based on the radial basis function (RBF) is used to achieve data augmentation, and the cross-entropy loss function optimized by the spider wasp is combined to improve the quality of the generated samples. The generator takes the RBF neural network as the core, with the input being 12-dimensional real data and the output being 12-dimensional generated samples. The radial basis function of the hidden layer selects the Gaussian kernel function, and its mathematical expression is:
[0097]
[0098] Among them, φ(x) is the Gaussian kernel function, x is the feature vector of the input sample, c is the kernel center, and σ is the bandwidth parameter of the kernel; through the non-linear mapping of the Gaussian kernel function, the generator can capture the complex distribution characteristics of the data and generate samples close to the real data distribution;
[0099] The discriminator is also based on the RBF neural network. The input is 12-dimensional sample data, and the output is a 1-dimensional probability; by distinguishing between the generated samples and the real samples, the discriminator provides a reverse gradient signal for the generator to guide the generator to improve the distribution of the generated samples;
[0100] For the standard cross-entropy loss function, a weight factor α is introduced, and the improved spider wasp optimization algorithm is used to dynamically adjust the weight factor α, where the loss function L is defined as:
[0101] L = -α·E x~pdata [logD(x)] - (1 - α)·E z~pz [log(1 - D(G(z)))](2);
[0102] Among them, D(x) represents the determination probability of the discriminator for the real data, and E x~pdata is the expected function of the real data, D(G(z)) represents the determination probability of the discriminator for the generated sample G(z), and E z~pz is the expected function of the generated data.
[0103] The spider wasp optimization algorithm is an intelligent optimization algorithm inspired by the predation behavior of spider wasps in nature. Its core principle is to simulate the cooperation and competition behaviors of spider wasps during hunting, nest building, and mating. The algorithm process is mainly divided into three stages: in the hunting and nest building behaviors, spider wasps conduct global exploration through random differential perturbation and Levy flight, and at the same time combine contraction search and cosine perturbation to achieve local exploitation; in the mating behavior, the local search ability is enhanced through the male generation rule and gene crossover strategy; the dynamic population reduction mechanism balances the convergence efficiency and computational cost by linearly reducing the population size. The algorithm achieves a dynamic balance between exploration and exploitation through a hierarchical update strategy (dividing the population into an exploration group, an exploitation group, and an elite group). The global search ability is enhanced through Levy flight and random differential strategies to avoid premature convergence; the local exploitation accuracy is improved by using cosine perturbation and contraction operations; a dynamic population reduction mechanism is introduced to optimize the allocation of computational resources. Finally, the globally optimal loss function weight α is found.
[0104] The improved spider wasp optimization algorithm is specifically as follows:
[0105] First, a population containing N female spider wasp individuals is generated and initialized;
[0106] The initialization of the female spider wasp individual is expressed as:
[0107]
[0108] Among them, is the position vector of the i-th female spider wasp individual before iteration, s is a D-dimensional random vector between [0, 1], and X max and X min are the upper and lower limits of the loss function weight respectively;
[0109] Secondly, according to the behavior switching probability η, randomly select the switching between hunting behavior and mating behavior to generate a random number ρ6. If ρ6 < η, then perform mating behavior, otherwise perform hunting behavior; Hunting behavior is divided into three stages, namely the search stage, the tracking and escape stage, and the nest building stage;
[0110] In the original spider wasp optimization algorithm, the behavior switching probability η is set as a static constant parameter. This fixed parameter mechanism has theoretical defects that it cannot effectively respond to the dynamic characteristics of the solution space during the optimization process and lacks the ability to adaptively regulate the exploration-exploitation trade-off. To solve this problem, a dynamic feedback regulation mechanism based on the fitness change rate is proposed for the behavior switching probability η. By establishing a time-varying functional relationship of the probability parameter, the stage adaptive optimization of the algorithm search strategy is realized, and the improved formula is as follows:
[0111]
[0112] Among them, η t is the behavior switching probability corresponding to the t-th iteration, is the basic probability term, and Δη t is the fitness feedback correction term;
[0113] The expression is:
[0114]
[0115] Among them, η max is the maximum value of the behavior switching probability, τ is the attenuation rate factor, tmax is the maximum number of iterations;
[0116] Δη t The expression is:
[0117]
[0118] Among them, γ is the sensitivity adjustment factor, γ > 0, Δf(t) is the fitness change rate, and Δf ref is the reference change rate, and the expression is:
[0119]
[0120] Among them, f(t) is the fitness of the t-th iteration, and ε is a small value to prevent division by zero.
[0121] In the search stage, a fixed-step size position update formula or a variable-step size position update formula will be adopted. The fixed-step size position update is as follows:
[0122]
[0123] λ1 = |z| * ρ1 (9);
[0124] Among them, is the fixed-step size position of the next-generation female spider wasp individual, is the position of the current female spider wasp individual, λ1 is a coefficient, is the position of the female spider wasp individual with index a at the t-th iteration, is the position of the female spider wasp individual with index b at the t-th iteration, z is a random number from a normal distribution, and ρ1 is a random number within [0, 1];
[0125] The variable-step size position update formula is as follows:
[0126]
[0127] Among them, is the female spider wasp individual with index c at the t-th iteration, where i ≠ c, λ2 is a coefficient, the value range of l is [-1, 1], and ρ2 is a random number between [0, 1].
[0128] The switching mechanism for fixed-step size and variable-step size position updates is:
[0129]
[0130] Among them, Eq.(4) is formula (4), Eq.(6) is formula (6), and ρ3, ρ4 are random numbers between [0, 1];
[0131] The position update formula in the tracking stage is as follows:
[0132]
[0133] Among them, P determines whether the prey is successfully captured, a and b are the indices of two random spider wasps, and ρ5, ρ6 are random numbers between [0, 1]; if the prey capture fails, the following position update formula is used to re-explore:
[0134]
[0135] Among them, For the position of the next-generation female spider wasp after failing to capture prey, w is a random number with a normal distribution between [-k, k];
[0136] The switching mechanism between the tracking and escaping phases is as follows:
[0137]
[0138] The switching mechanism between the searching phase and the tracking and escaping phase is as follows:
[0139]
[0140] Among them, Eq. (8) is formula (8), Eq. (13) is formula (13), and p is a random number between [0, 1];
[0141] There are two strategies in the nest-building phase. One is to drag the prey to a suitable location for nest building, and the other is to randomly select a location where a spider wasp is located for nest building. The position update when dragging the prey for nest building is as follows:
[0142]
[0143] Among them, is the position of the next-generation female spider wasp when dragging the prey for nest building, and X * is the current optimal solution;
[0144] The position update when randomly selecting a location where a spider wasp is located for nest building is as follows:
[0145]
[0146] Among them, ρ3 is a random number between [0, 1], σ is a value generated by the Levy model, and U is a random vector of 0 or 1;
[0147] The switching mechanism between dragging the prey for nest building and randomly selecting a location where a spider wasp is located for nest building is as follows:
[0148]
[0149] The switching mechanism between tracking, escaping, and nest building is as follows:
[0150]
[0151] The mating behavior is carried out according to the following formula:
[0152]
[0153] Among them, Crossover is the uniform crossover operator, is the position of the male spider wasp individual, and κ is the crossover rate;
[0154] The generation of male spider wasps is as follows:
[0155]
[0156]
[0157] Among them, is the position of the next-generation male spider wasp in the mating behavior, the value range of l is [-1, 1], v1 is the position difference vector between the i-th female spider wasp and the a-th female spider wasp, v2 is the position difference vector between the b-th female spider wasp and the c-th female spider wasp, β0 and β1 are random numbers conforming to the normal distribution, and a, b, and c are three different individual index numbers.
[0158] Finally, there is population reduction and memory preservation. After the spider wasp individuals build nests, they stop working and let other individuals continue to search to accelerate the convergence speed. The expression is:
[0159] M = M min +(M - M min ) × k(28);
[0160] Among them, M is the population size, k is the population reduction factor, and M min is the minimum population quantity to avoid falling into local minima.
[0161] In each iteration, according to the updated α, the generator and the discriminator are trained respectively, and the quality of the generated samples is evaluated. The particle fitness is determined by the difference between the distribution of the generated samples and the real samples, and is quantified using the evaluation index FID. If the fitness reaches the set convergence condition, the algorithm terminates and outputs the global optimal weight factor α * = X * ;
[0162] Finally, the optimized weight factor α * is applied to the cross-entropy loss function to guide the joint training of the generator G and the discriminator D, making the distribution of the generated samples closer to the real data distribution, thereby significantly improving the generation quality and distribution consistency of the generative adversarial network. The optimized generative adversarial network is used to generate data again, and the quality of the generated data is evaluated through offline testing. If the requirements are not met, optimization is carried out again until the quality of the generated data reaches the expected standard.
[0163] In step 5, based on the high-quality enhanced data generated in the previous steps, a control model of the permanent magnet synchronous motor is constructed and trained. The radial basis function (RBF) neural network is used as the core framework, and its excellent non-linear mapping ability is utilized to model the relationship between the complex operating state of the motor and the controller parameters.
[0164] The input of the control model consists of the operating state parameters of the permanent magnet synchronous motor, including load conditions (such as speed, voltage, current, temperature, etc.) and regulation effects (such as error and error change rate), so as to comprehensively characterize the dynamic operating characteristics of the motor. The output of the model is the key parameters of the controller, including the proportional-integral-differential (PID) controller parameters {K p , K i , K d} and the sliding mode controller parameters {K s , λ s}, in order to achieve efficient regulation of the motor operating state.
[0165] In step 6, the trained and optimized control model in step 5 is marginalized into the online control system of the permanent magnet synchronous motor to achieve intelligent control of the motor.
[0166] The experimental results show that, as Figure 3 shown: under step input conditions, when using the traditional speed-current double closed-loop proportional integral differential (PID) control strategy (corresponding to curve a), the system dynamic response shows an overshoot of 4.8%, and the adjustment time reaches 0.109 s; while the improved control strategy (corresponding to curve b) significantly suppresses the overshoot phenomenon while maintaining the dynamic response speed, with its overshoot only being 0.02%, and at the same time shortens the adjustment time to 0.105 s by optimizing the control algorithm. The improved control strategy successfully reduces the overshoot by 99.58% on the premise of maintaining the system response speed (the adjustment time is reduced by 3.67%), demonstrating better dynamic performance and steady-state accuracy.
[0167] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by those skilled in the art within the essence of the present invention should also fall within the protection scope of the present invention.
Claims
1. A permanent magnet synchronous motor control method based on an improved small sample generative adversarial network, characterized in that: The following steps are involved: Step 1: Collect the operation data of the permanent magnet synchronous motor under different load conditions by performing an offline operation test from no-load to full-load on the permanent magnet synchronous motor; Step 2: Data enhancement based on RBF generative adversarial network; Step 3: Perform an offline operation test of the permanent magnet synchronous motor for the enhanced data generated in step 2. If the test result shows that the generated data fails to meet the quality requirements, the generative adversarial network is optimized based on the feedback information of the offline test. Step 4: Use the improved spider bee optimization algorithm to optimize the generative adversarial network, and use the optimized generative adversarial network for data enhancement; Step 5: Build a control model of the permanent magnet synchronous motor based on the RBF neural network, and use the enhanced data generated in step 4 for training to obtain a trained control model; Step 6: Edge-map the trained control model to the online control system of the permanent magnet synchronous motor to achieve intelligent control of the electrodes.
2. According to claim 1, a permanent magnet synchronous motor control method based on an improved small sample generative adversarial network is characterized in that: The step 1 is specifically as follows: a total of 1000 sets of sample data are collected, each set of sample data includes load condition data, control parameter data and adjustment effect data; the load condition data includes speed n, voltage u, current I d ,I q and temperature T, the control parameter data includes PID controller parameter K p , K i , K d and the parameter K of the sliding mode controller s , s The adjustment effect data includes the error e and the error change rate 3. A permanent magnet synchronous motor control method based on an improved small sample generative adversarial network according to claim 2, characterized in that: In step 4, the generator uses the RBF neural network as the core, the input is 12-dimensional real data, the output is 12-dimensional generated samples, and the radial basis function of the hidden layer uses the Gaussian kernel function, and its mathematical expression is: Among them, φ(x) is the Gaussian kernel function, x is the feature vector of the input sample, c is the kernel center, and σ is the kernel bandwidth parameter. Through the nonlinear mapping of the Gaussian kernel function, the generator can capture the complex distribution characteristics of the data and generate samples that are close to the real data distribution. The discriminator is also based on the RBF neural network, with 12-dimensional sample data as input and 1-dimensional probability as output. By distinguishing the generated samples from the real samples, the discriminator provides the generator with a reverse gradient signal to guide the generator to improve the distribution of the generated samples. For the standard cross entropy loss function, a weight factor α is introduced, and the improved spider bee optimization algorithm is used to dynamically adjust the weight factor α, where the loss function L is defined as: L=-α·E x~pdata [logD(x)]-(1-α)·E z~pz [log(1-D(G(z)))](2); Among them, D(x) represents the probability of the discriminator's judgment on the real data, E x~pdata is the expected function of the real data, D(G(z)) represents the probability of the discriminator to generate the sample G(z), and E z~pz is the expected function for generating data.
4. A permanent magnet synchronous motor control method based on an improved small sample generative adversarial network according to claim 3, characterized in that: The improved spider bee optimization algorithm is as follows: First, a population of N female spider bees is generated and initialized; The individual initialization of female spider bees is represented as: in, is the position vector of the ith female spider bee before iteration, s is a D-dimensional random vector between [0,1], X max , X min They are the upper and lower limits of the loss function weight respectively; Secondly, the switching between hunting behavior and mating behavior is randomly selected according to the behavior switching probability η, and a random number ρ6 is generated. If ρ6 < η, mating behavior is performed, otherwise hunting behavior is performed; hunting behavior is divided into three stages, namely, the search stage, the tracking and escape stage, and the nesting stage; Finally, there is population size reduction and memory preservation. After the spider bee individual builds a nest, it stops working and allows other individuals to continue searching to speed up the convergence speed. The expression is: M=M min +(M-M min )×k(4); Among them, M is the population size, k is the population reduction factor, and M min is the minimum population size to avoid falling into the local minimum.
5. A permanent magnet synchronous motor control method based on an improved small sample generative adversarial network according to claim 4, characterized in that: For the behavior switching probability η, a dynamic feedback adjustment mechanism based on the fitness change rate is proposed. By establishing a time-varying function relationship of the probability parameters, the stage adaptive optimization of the algorithm search strategy is realized. The improved formula is as follows: Among them, η t is the behavior switching probability corresponding to the tth iteration, is the basic probability term, Δη t is the fitness feedback correction term; The expression is: Among them, η max is the maximum probability of behavior switching, τ is the decay rate factor, tmax is the maximum number of iterations; Δη t The expression is: Among them, γ is the sensitivity adjustment factor, γ>0, Δf(t) is the fitness change rate, Δf ref is the reference change rate, and the expression is: Among them, f(t) is the fitness of the tth iteration, and ε is a small value to prevent division by zero.
6. A permanent magnet synchronous motor control method based on an improved small sample generative adversarial network according to claim 5, characterized in that: In the search phase, a fixed-step position update formula or a variable-step position update formula is used. The fixed-step position update is as follows: λ1=|z|*ρ1 (10); in, The location of the next generation of female spider bees, is the current position of the female spider peak individual, λ1 is the coefficient, is the position of the female spider bee individual with individual index a in the tth iteration, is the position of the female spider bee with individual index b in the tth iteration, z is a random number from normal distribution, and ρ1 is a random number in [0,1]; The variable step position update formula is as follows: in, is the individual position of the female spider bee with individual index c in the t-th iteration, where i≠c, λ2 is the coefficient, l ranges from [-1,1], and ρ2 is a random number between [0,1]; The switching mechanism between fixed step size and variable step size position update is: Wherein, Eq.(4) is formula (4), Eq.(6) is formula (6), ρ3, ρ4 are random numbers between [0,1]; The position update formula in the tracking phase is as follows: Among them, P determines whether the prey is successfully captured, a and b are the indexes of two random spider bees, and ρ5 and ρ6 are random numbers between [0,1]. If the prey is not captured, the following position update formula is used to re-explore: Where w is a normally distributed random number between [-k, k]; The switching mechanism between the tracking and escaping phases is: Wherein, Eq. (9) is formula (9), Eq. (11) is formula (11); The switching mechanism between the search phase and the tracking escape phase is: Wherein, Eq. (8) is formula (8), Eq. (13) is formula (13), and p is a random number between [0, 1]; There are two strategies in the nesting phase. One is to drag the prey to a suitable location to build a nest, and the other is to randomly select a spider bee location to build a nest. The position update when dragging the prey to build a nest is as follows: Among them, X * is the current optimal solution; The locations of randomly selected spider bees' nests are updated as follows: Among them, ρ3 is a random number between [0,1], σ is the value generated by the Levy model, and U is a random vector 0 or 1; The switching mechanism between dragging prey to build a nest and randomly selecting the location of the spider bee to build a nest is: The switching mechanism between tracking, escaping and nesting is:
7. A permanent magnet synchronous motor control method based on an improved small sample generative adversarial network according to claim 6, characterized in that: The mating behavior is performed according to the following formula: Among them, Crossover is a uniform crossover operator. is the position of the male spider bee individual, κ is the crossover rate; A male Spider Bee is spawned like this: in, is the position of the next generation of male spider bees after mating behavior, l ranges from [-1,1], v1 is the position difference vector between the ith female spider bee and the ath female spider bee, v2 is the position difference vector between the bth female spider bee and the cth female spider bee, β0 and β1 are random numbers that conform to the normal distribution, and a, b, and c are three different individual index numbers.
8. The permanent magnet synchronous motor control method based on improved small sample generative adversarial network according to claim 7 is characterized in that: In step 4, in each iteration, the generator and the discriminator are trained respectively according to the updated α, and the quality of the generated samples is evaluated; the particle fitness is determined by the difference between the generated samples and the real samples, and is quantified using the evaluation index FID. If the fitness reaches the set convergence condition, the algorithm terminates and outputs the global optimal weight factor α * =X * ; Finally, the optimized weight factor α * Applied to the cross entropy loss function, it guides the joint training of the generator G and the discriminator D, making the distribution of generated samples closer to the real data distribution, thereby significantly improving the generation quality and distribution consistency of the generative adversarial network.