A machine learning-based five-phase permanent magnet synchronous motor harmonic suppression control method
By constructing a dual-plane control system based on deep neural networks in a five-phase permanent magnet synchronous motor, and combining motor physical information and hybrid optimization strategies, the problems of overshoot and insufficient robustness of traditional control methods under complex operating conditions are solved, and more efficient motor control performance is achieved.
Patent Information
- Application Number
- CN202511655089.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-06-09
- Estimated Expiration
- 2045-11-12
AI Technical Summary
Existing control methods for five-phase permanent magnet synchronous motors (PMSMs) suffer from problems such as control variable overshoot, steady-state error, and insufficient robustness under complex operating conditions. Traditional PI/PID controllers increase computational complexity and are difficult to handle parameter perturbations and load disturbances.
A deep neural network-based control method is adopted, which combines prior physical information of the motor and trains the neural network through a hybrid optimization strategy to construct a dual-plane high-efficiency control system for a five-phase permanent magnet synchronous motor. The PINN architecture and L-BFGS optimizer are used to enhance the generalization ability and robustness of the model.
It significantly improves the control performance of the five-phase permanent magnet synchronous motor under complex working conditions, reduces the deviation between predicted voltage and actual voltage, and improves the stability and anti-interference capability of the system.
Smart Images

Figure CN121216972B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of five-phase permanent magnet synchronous motor (PMSM) technology, specifically to a harmonic suppression control method for five-phase permanent magnet synchronous motors based on machine learning. Background Technology
[0002] In recent years, with the rapid development of the electric vehicle industry, the application of permanent magnet synchronous motors (PMSMs) in vehicle drive systems has become a research hotspot. Compared with three-phase PMSMs, five-phase PMSMs have significant advantages, including lower torque ripple, stronger fault tolerance, and higher control flexibility, making them more promising for high-performance drive applications. As a core technology for improving the control performance of five-phase PMSMs, the research on dual-plane space vector pulse width modulation (SVPWM) algorithms is particularly crucial. Its essence lies in achieving coordinated control between the fundamental subspace and the third harmonic subspace, thereby achieving control objectives such as high torque density, low harmonic distortion rate, and high operating efficiency. However, with the expansion of the control dimension, multiple additional PI controllers are required. This not only increases the computational complexity and execution time of the control algorithm, but also leads to problems such as control variable overshoot and unavoidable steady-state errors in complex operating conditions or scenarios requiring rapid motor response, significantly reducing control performance and weakening the robustness of the drive system. There is an urgent need to explore alternatives to traditional PI / PID controllers to address this technical challenge.
[0003] In the field of permanent magnet synchronous motor (PMSM) drive control, machine learning (ML)-based intelligent control strategies are gradually replacing traditional control methods and demonstrating significant technological advantages. The core advantage of reinforcement learning (RL) lies in its interactive learning mechanism between the agent and the environment, enabling it to autonomously optimize system control strategies and effectively reduce reliance on precise system models. While RL-based PMSM drive control can serve as a superior alternative to traditional data-driven methods (such as model-free predictive control, MFPC), the deployment capabilities and limited scalability of static control strategies may lead to insufficient robustness—a deficiency particularly pronounced under uncertainties such as parameter perturbations and load disturbances, which are common problems in PMSM drive systems.
[0004] Supervised learning, as a core branch of machine learning, achieves prediction or decision-making functions by training models with labeled data. In the field of PMSM drive control, supervised learning has provided innovative solutions to many technical challenges, with applications covering key aspects such as adaptive PI parameter tuning (e.g., PID online self-tuning based on radial basis function neural networks), parameter estimation, fault diagnosis, and speed / current / torque control. Significant progress has been made in multiple dimensions. Existing technologies have proposed vector controllers based on neural networks, achieving optimal control through approximate dynamic programming training, surpassing traditional methods in adaptability and accuracy. Existing technologies have also explored the application of machine learning techniques such as linear regression, support vector machines, and neural networks in PMSM vector control, constructing machine learning surrogate models to replace PI controllers in field-oriented control (FOC) systems. Experiments have demonstrated superior performance in compensating for nonlinear characteristics and suppressing external disturbances. Furthermore, the existing technology innovatively uses two deep neural networks (DNNs) to replace the traditional speed and current controllers in vector control; at the same time, the existing technology proposes a hybrid machine learning strategy that integrates current and speed regulation into a single DNN controller, which simplifies the complex architecture that requires multiple independent controllers and improves the system's adaptability under different operating conditions. Experiments have verified that this strategy has excellent generalization performance and can maintain stable and superior control performance under complex operating conditions.
[0005] After discussing various neural network alternatives to PI controllers, existing technologies analyze the application of motor physical information in neural networks. A data-driven Gaussian process regression (GPR) method is employed for prediction, and an overshoot-inspired motor physics embedded GPR method (OR-MPE-GPR) is proposed, combining the advantages of GPR with the physical characteristics of permanent magnet synchronous motors. However, this method addresses relatively limited problems. A motor physics-inspired neural network is proposed to ensure stability and interpretability in online learning, but lacks interpretability in offline learning. Furthermore, some studies utilize physical information neural networks (PINNs) to identify parameters in motor models. The application of machine learning-based intelligent control strategies in multiphase motor control mainly includes implementing a novel neural network-based model reference adaptive control (MRAC) scheme for the speed loop of a five-phase permanent magnet synchronous motor. In existing technologies, reinforcement learning is deeply integrated into multiphase motor control, where the DDPG algorithm is used to address the structural complexity and computational burden of traditional control methods, while balancing physical constraints and actual system performance. Summary of the Invention
[0006] To address the aforementioned issues, this invention proposes a neural network control method that can be trained offline, explained, and deployed online for efficient dual-plane control of five-phase permanent magnet synchronous motors (PMSMs). This method overcomes the limitations of existing dual-plane current control methods while fully leveraging their technological advantages.
[0007] The specific plan is as follows:
[0008] A harmonic suppression control method for a five-phase permanent magnet synchronous motor based on machine learning includes the following steps:
[0009] S1. Construct a mathematical model of a five-phase permanent magnet synchronous motor drive system in a rotating coordinate system, and design a five-phase permanent magnet synchronous motor control system based on a deep neural network;
[0010] S2. The prior physical information of the motor is deeply integrated into the training process to enhance the generalization ability of the model. A hybrid optimization strategy is proposed to improve the fitting accuracy between the predicted network voltage and the actual operating voltage, suppress fluctuations in the prediction process, and make the predicted values more in line with the actual operating requirements.
[0011] Further, step S1 includes:
[0012] S11. Constructing the mathematical model of a five-phase permanent magnet synchronous motor drive system
[0013] The mathematical model in the synchronous rotating coordinate system is derived from the mathematical model of the five-phase permanent magnet synchronous motor in the natural coordinate system, combined with the constant amplitude coordinate transformation matrix; in the synchronous rotating dq coordinate system, the primary plane d-axis voltage u d1 Primary plane q-axis voltage u q1 Third plane d-axis voltage u d3 Third plane q-axis voltage u q3 With the first plane d-axis current i d1 , First-order plane q-axis current i q1 d-axis current i in the third plane d3 , third plane q-axis current i q3 The relationship between them is represented as
[0014]
[0015] Among them, R s L is the stator phase winding resistance. d1 and L q1 These are the d-axis and q-axis inductances, respectively, L ls For leakage, ω e Ψ is the rotor's electrical angular velocity. f For permanent magnet flux linkage;
[0016] The electromagnetic torque of a five-phase permanent magnet synchronous motor is generated by the fundamental component; in the synchronous rotating dq coordinate system, the electromagnetic torque T e Represented as:
[0017]
[0018] Where P n It is the extreme logarithm;
[0019] The mechanical motion of an electric motor follows Newton's second law, which is expressed as:
[0020]
[0021] Where J is the rotor moment of inertia, ω m T is the mechanical angular velocity. l For load torque, B m This is the mechanical damping coefficient;
[0022] S12. Machine Learning-Based Five-Phase Permanent Magnet Synchronous Motor Control System
[0023] Traditional machine learning employs supervised machine learning algorithms, using neural networks as direct controllers to calculate the required voltage in real time based on the motor state, thus replacing the output of traditional PI control; therefore, the neural network-based controller Nc is represented as:
[0024]
[0025] in Given the d-axis current in a primary plane, Given a q-axis current in a primary plane, Given a d-axis current in a cubic plane, Given a q-axis current in a cubic plane;
[0026] The number of neurons in the input and output layers matches the number of inputs and outputs, while the number of neurons in the hidden layers and their corresponding neurons are determined through repeated trials; its specific architecture is expressed as follows:
[0027]
[0028] Among them, NN (0) This represents the variables of the input layer neuron, where l is the number of hidden layers, and w l Let b be the hidden layer weight matrix. l For the hidden layer bias vector, NN (l) This represents the calculation result for layer l, where L represents the total number of layers in the neural network, and w L Let b be the output layer weight matrix.L Here, σ represents the output layer bias vector; σ represents the activation function, expressed as follows:
[0029]
[0030] Where z is the input to the activation function;
[0031] After completing the above architecture, the loss function is constructed and optimized to train the weight matrix and bias vector in the neural network; the mean squared error loss function is shown below:
[0032]
[0033] Where N is the number of neurons in the output layer, u i For the true value of the i-th output layer, This is the predicted value for the i-th output layer;
[0034] After defining the loss function, the data stream X is passed through the network to calculate the loss value; in order to optimize the parameters w and b using algorithms such as gradient descent, their gradients are calculated through a process relying on the backpropagation algorithm, as follows:
[0035]
[0036] Where θ represents the set of weight matrices and bias vectors in the neural network; based on the chain rule of differentiation, backpropagation propagates the gradient information of the loss function from the output layer back to the network layer by layer, thereby calculating the gradient of each parameter; after obtaining the gradients of the weights and biases, they are updated according to the gradient data; according to the chain rule of differentiation, the update algorithm is as follows:
[0037]
[0038] Where t is the number of iterations, η is the learning rate, and n is the number of neurons per layer;
[0039] In motor control systems, neural network-based controllers essentially perform forward propagation, calculating the first-order and third-order dq-axis voltage predictions according to the following formulas by applying the given input signal to the weight matrix and bias vector of an offline-trained model:
[0040]
[0041] Among them, b i x is the i-th bias vector element of the output layer. i For the i-th input element of the output layer, wi This is the i-th weight matrix element of the output layer.
[0042] Further, step S2 includes:
[0043] By using the voltage equation (1) to constrain the training of the neural network, the generalization ability and robustness of the model are enhanced when data is scarce; specifically, the residual term of the physical equation is introduced into the loss function of the neural network to ensure that the network follows physical laws while fitting the data; including the following steps:
[0044] S21, PINN Architecture and Physical Residual Definition
[0045] The PINN current controller utilizes a fully connected network to enhance the model's expressive power; the activation function was modified, and the hyperbolic tangent Tanh function was selected:
[0046]
[0047] Where x is the input to the activation function;
[0048] The physical residual R refers to the error term constructed by comparing the predicted output of the neural network with the theoretical value derived from physical laws; specifically, in the voltage prediction task of d1q1-d3q3, the predicted voltage U of the neural network is directly calculated. pred The theoretical voltage U derived from the voltage equation of a permanent magnet synchronous motor phy The difference between them:
[0049]
[0050] Where, r d1 The physical residual value of the d-axis voltage in the primary plane, r q1 The physical residual value of the q-axis voltage in the primary plane, r d3 The physical residual value of the d-axis voltage in the cubic plane, r q3 This represents the physical residual value of the q-axis voltage in the third plane.
[0051] When calculating the current derivative in the dataset, the central difference method is used to calculate the current derivative at the internal points, while the forward or backward difference method is used at the boundary points.
[0052] S22. Design of a loss function that integrates data and physical constraints.
[0053] In the PINN model of a five-phase permanent magnet synchronous motor, the total loss function L totalIt is the core coordinator for multi-objective optimization; through a weighted fusion mechanism, it integrates the constraints based on the physical laws of motors and the fitting objective of measured / simulated voltage data into an optimizable loss function, specifically in the following form:
[0054]
[0055]
[0056] Where, λ data For the data, the weighting coefficients, L data (θ) is the data fitting loss function, λ phy L is the weighting coefficient for the physical residuals. phy (θ) is the physical residual loss function, λ reg L is the regularization weight coefficient. reg (θ) is the regularization loss function;
[0057] Data fitting loss function L data (θ) remains consistent with formula (7) to ensure that the voltage predicted by the neural network approximates the actual measured value; when the dataset is sufficient, the weighting coefficient λ is increased. data Physical residual loss function L phy (θ) The forced neural network output satisfies the voltage equation of a five-phase permanent magnet synchronous motor. Its physical essence is to construct a virtual monitoring signal using deterministic physical equations; regularization loss L reg (θ) Prevents neural networks from overfitting to local minima of training data noise or physical residuals, thereby improving generalization ability;
[0058] S23, Training Process Optimization
[0059] In the parameter optimization of the PINN controller, the total loss function L is calculated. total (θ) gradient ∇L with respect to network parameter θ total (θ); the gradient of θ is calculated using backpropagation to find the optimal weights and biases; the gradients of the controller parameters are calculated using the following chain rule:
[0060]
[0061] in, Fit the gradient of the loss function to the data. The gradient of the physical residual loss function. The gradient of the regularization loss function;
[0062] During the back propagation of PINN, L phy The gradient propagation of (θ) is its core innovative mechanism, and its gradient propagation is as follows:
[0063]
[0064] in
[0065]
[0066] The relevant parameters can be calculated using equation (12);
[0067] The gradient of the first layer is further derived as follows:
[0068]
[0069] Where z (k) This represents the output of the k-th layer, and f represents the activation function; once the gradients of all layers are calculated, the controller parameters are updated through the Adam optimizer during the iteration process:
[0070]
[0071] After completing the Nadam iteration based on the Adam optimizer, the final optimized parameters θ are obtained. adam_final Subsequently, the synchronized parameter state is used as the initial parameter point and gradient input for the finite-memory Broyden-Fletcher-Goldfarb-Shanno optimizer; based on this, the L-BFGS algorithm constructs a function that satisfies s through an iterative update mechanism. k T g k Search direction s with condition <0 k This condition ensures s k This indicates the descent direction, providing an effective optimization path for subsequent parameter updates; s k The specific calculation formula is as follows:
[0072]
[0073] Where g k H represents the gradient vector at the current iteration point. k The Hessian matrix is used; the L-BFGS algorithm does not directly calculate the complete Hessian matrix H. k Instead, the parameters and gradient change vectors for the most recent m iterations are maintained in the following way:
[0074]
[0075] During the online search phase, the Wolfe condition is used to simultaneously balance convergence speed and stability, solving for the step size α that satisfies the following dual requirements. k >0: First, ensure that the objective function is sufficiently reduced, i.e.
[0076]
[0077] Secondly, the descent property of the search direction must be maintained, meaning the gradient direction and the search direction must maintain a negative inner product relationship; finally, the parameters are updated using the following formula:
[0078]
[0079] The beneficial effects of this invention are:
[0080] 1. A neural network model for dual-plane control of a five-phase permanent magnet synchronous motor was systematically derived: Through structured organization and theoretical derivation, a complete neural network control framework for dual-plane operation of a five-phase permanent magnet synchronous motor was established.
[0081] 2. Enhance controller generalization capability through physical information fusion: Deeply embed the physical characteristics of the motor into the neural network training process to significantly improve the controller's generalization performance under diverse operating conditions.
[0082] 3. Hybrid optimizer alleviates the loss problem caused by voltage deviation: To address the significant loss value caused by the deviation between theoretically calculated voltage and actual voltage, a hybrid optimizer is proposed to update network parameters, effectively narrowing the gap between predicted and actual values.
[0083] 4. Experimental verification of controller performance: The proposed controller was deployed on the experimental platform to verify that it can ensure stable operation of the motor and improve anti-interference performance. Attached Figure Description
[0084] Figure 1 This is the control structure diagram of the DNN method.
[0085] Figure 2 This is an optimization diagram of the network training process based on physical information.
[0086] Figure 3 The loss function graph is trained in two scenarios: purely data-driven and physically constrained.
[0087] Figure 4 This is a graph showing the comparison results of the optimizers.
[0088] Figure 5 The graph shows the residual values and distribution of four predicted voltages, (a) U d1 (b)U q1 ,(c)U d3,(d)U q3 .
[0089] Figure 6 These are steady-state performance diagrams for speed, torque, and A-phase current: (a) FOC, (b) DNN, (c) PINN-1, (d) PINN-2.
[0090] Figure 7 These are the phase current THD diagrams under four methods: (a) FOC, (b) DNN, (c) PINN-1, and (d) PINN-2.
[0091] Figure 8 These are voltage response diagrams: (a) FOC, (b) DNN, (c) PINN-2.
[0092] Figure 9 These are electromagnetic torque response diagrams: (a) FOC, (b) DNN, (c) PINN-2.
[0093] Figure 10 These are the voltage response results: (a) FOC, (b) DNN, (c) PINN-2.
[0094] Figure 11 The results are the electromagnetic torque Te response diagrams, (a) FOC, (b) PINN-2. Detailed Implementation
[0095] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are for illustrative purposes only and are not intended to limit the scope of the present invention.
[0096] This invention provides a harmonic suppression control method for a five-phase permanent magnet synchronous motor based on machine learning, comprising the following steps:
[0097] S1. Construct a mathematical model of a five-phase permanent magnet synchronous motor drive system in a rotating coordinate system, and design a five-phase permanent magnet synchronous motor control system based on a deep neural network;
[0098] S11. Constructing the mathematical model of a five-phase permanent magnet synchronous motor drive system
[0099] The mathematical model in the synchronous rotating coordinate system is derived from the mathematical model of the five-phase permanent magnet synchronous motor in the natural coordinate system, combined with the constant amplitude coordinate transformation matrix; in the synchronous rotating dq coordinate system, the primary plane d-axis voltage u d1 Primary plane q-axis voltage u q1 Third plane d-axis voltage u d3 Third plane q-axis voltage u q3 With the first plane d-axis current i d1 , First-order plane q-axis current i q1d-axis current i in the third plane d3 , third plane q-axis current i q3 The relationship between them is represented as
[0100]
[0101] Among them, R s L is the stator phase winding resistance. d1 and L q1 These are the d-axis and q-axis inductances, respectively, L ls For leakage, ω e Ψ is the rotor's electrical angular velocity. f For permanent magnet flux linkage;
[0102] The electromagnetic torque of a five-phase permanent magnet synchronous motor is generated by the fundamental component; in the synchronous rotating dq coordinate system, the electromagnetic torque T e Represented as:
[0103]
[0104] Where P n It is the extreme logarithm;
[0105] The mechanical motion of an electric motor follows Newton's second law, which is expressed as:
[0106]
[0107] Where J is the rotor moment of inertia, ω m T is the mechanical angular velocity. l For load torque, B m This is the mechanical damping coefficient;
[0108] S12. Machine Learning-Based Five-Phase Permanent Magnet Synchronous Motor Control System
[0109] The core of machine learning is to use algorithms to enable computers to automatically discover patterns and rules from large amounts of data, building models that can predict or make decisions on new data without explicit equations. It improves prediction accuracy and task performance by gradually adapting model parameters to data characteristics, ultimately achieving the ability to learn from data-driven experience.
[0110] Traditional machine learning uses supervised machine learning algorithms, treating neural networks as direct controllers, based on motor states (such as speed ω). e and current i d1 i q1 i d3 ,、i q3 Real-time calculation of the required voltage u d1 uq1 u d3 u q3 This replaces the output of traditional PI control; therefore, the neural network controller Nc is represented as:
[0111]
[0112] in Given the d-axis current in a primary plane, Given a q-axis current in a primary plane, Given a d-axis current in a cubic plane, Given a q-axis current in a cubic plane;
[0113] The number of neurons in the input and output layers matches the number of inputs and outputs, while the number of neurons in the hidden layers and their corresponding neurons are determined through repeated trials; its specific architecture is expressed as follows:
[0114]
[0115] Among them, NN (0) This represents the variables of the input layer neuron, where l is the number of hidden layers, and w l Let b be the hidden layer weight matrix. l For the hidden layer bias vector, NN (l) This represents the calculation result for layer l, where L represents the total number of layers in the neural network, and w L Let b be the output layer weight matrix. L Here, σ represents the output layer bias vector; σ represents the activation function, expressed as follows:
[0116]
[0117] Where z is the input to the activation function;
[0118] After completing the above architecture, the loss function is constructed and optimized to train the weight matrix and bias vector in the neural network; the mean squared error loss function is shown below:
[0119]
[0120] Where N is the number of neurons in the output layer, u i For the true value of the i-th output layer, This is the predicted value for the i-th output layer;
[0121] After defining the loss function, the data stream X is passed through the network to calculate the loss value; in order to optimize the parameters w and b using algorithms such as gradient descent, their gradients are calculated through a process relying on the backpropagation algorithm, as follows:
[0122]
[0123] Where θ represents the set of weight matrices and bias vectors in the neural network, based on the chain rule of differentiation, backpropagation propagates the gradient information of the loss function from the output layer back to the network layer by layer, thereby calculating the gradient of each parameter; after obtaining the gradients of the weights and biases, they are updated according to the gradient data; according to the chain rule of differentiation, the update algorithm is as follows:
[0124]
[0125] Where t is the number of iterations, η is the learning rate, and n is the number of neurons per layer;
[0126] Figure 1 The overall architecture of current control based on DNN-ML is shown, including nine input features (X), four fully connected output layers (u), and two hidden layers. The specific network parameters are shown in Table III.
[0127] In motor control systems, neural network-based controllers essentially perform forward propagation, calculating the target prediction value by applying a given input signal to the weight coefficients w and bias value b of an offline-trained model, according to the following formula:
[0128]
[0129] Among them, b i x is the i-th bias vector element of the output layer. i For the i-th input element of the output layer, w i This is the i-th weight matrix element of the output layer.
[0130] S2. Deeply integrate the prior physical information of the motor into the training process to enhance the generalization ability of the model, and propose a hybrid optimization strategy to improve the fitting accuracy between the predicted network voltage and the actual working voltage, suppress fluctuations in the prediction process, and make the predicted value more in line with the actual operating requirements.
[0131] PINNs are a hybrid approach that combines traditional physical models with deep learning. By utilizing the voltage equation (1) to constrain the training of the neural network, the generalization ability and robustness of the model are enhanced when data is scarce. Specifically, the residual terms of the physical equation are introduced into the loss function of the neural network to ensure that the network follows physical laws while fitting the data. This includes the following steps:
[0132] S21, PINN Architecture and Physical Residual Definition
[0133] The PINN current controller utilizes a fully connected network to enhance the model's expressive power; the activation function was modified, and the hyperbolic tangent Tanh function was selected:
[0134]
[0135] Where x is the input to the activation function;
[0136] This is because PINNs require the calculation of higher-order derivatives, and the Tanh function has higher-order differentiability, which has a significant impact on the accuracy of the network.
[0137] The physical residual R refers to the error term constructed by comparing the predicted output of the neural network with the theoretical value derived from physical laws; specifically, in the voltage prediction task of d1q1-d3q3, the predicted voltage U of the neural network is directly calculated. pred The theoretical voltage U derived from the voltage equation of a permanent magnet synchronous motor phy The difference between them:
[0138]
[0139] Where, r d1 The physical residual value of the d-axis voltage in the primary plane, r q1 The physical residual value of the q-axis voltage in the primary plane, r d3 The physical residual value of the d-axis voltage in the cubic plane, r q3 This represents the physical residual value of the q-axis voltage in the third plane.
[0140] When calculating the current derivative in the dataset, the central difference method is used to calculate the current derivative at the internal points, while the forward or backward difference method is used at the boundary points.
[0141] S22. Design of a loss function that integrates data and physical constraints.
[0142] In the PINN model of a five-phase permanent magnet synchronous motor, the total loss function L total It is the core coordinator for multi-objective optimization; through a weighted fusion mechanism, it integrates the constraints based on the physical laws of motors (such as voltage equations) and the fitting objectives of measured / simulated voltage data into an optimizable loss function, specifically in the following form:
[0143]
[0144]
[0145] Where, λ data For the data, the weighting coefficients, L data (θ) is the data fitting loss function, λ phy L is the weighting coefficient for the physical residuals. phy (θ) is the physical residual loss function, λ reg L is the regularization weight coefficient. reg (θ) is the regularization loss function;
[0146] This allows the current-voltage mapping relationship of the neural network to approach the accurate output under physical constraints, significantly improving the model's generalization ability in sparse data regions, and making it particularly suitable for high-precision motor control scenarios.
[0147] Data fitting loss function L data (θ) remains consistent with formula (7) to ensure that the voltage predicted by the neural network approximates the actual measured value (the actual measured value is also called the labeled dataset); when the dataset is sufficient, the weight coefficient λ can be appropriately increased. data Physical residual loss function L phy (θ) The forced neural network output satisfies the voltage equation of a five-phase permanent magnet synchronous motor. Its physical essence is to construct a virtual monitoring signal using deterministic physical equations; regularization loss L reg (θ) Prevents neural networks from overfitting to local minima of training data noise or physical residuals, thereby improving generalization ability;
[0148] This loss function fits the actual observed values through data terms, ensures global rationality with the help of physical terms, and treats the physical residuals as an infinite prior data source to compensate for unlabeled blind spots.
[0149] S23, Training Process Optimization
[0150] In the parameter optimization of the PINN controller, the total loss function L is calculated. total (θ) gradient ∇L with respect to network parameter θ total (θ); the gradient between the weights θ and the bias θ is calculated using backpropagation to find the optimal weights and biases; the gradients of the controller parameters are calculated using the following chain rule:
[0151]
[0152] in, Fit the gradient of the loss function to the data. The gradient of the physical residual loss function. The gradient of the regularization loss function;
[0153] In the backpropagation process of PINN, the gradient propagation of Lphy(θ) is its core innovative mechanism, and its gradient propagation is as follows:
[0154]
[0155] in
[0156]
[0157] The relevant parameters can be calculated using equation (12);
[0158] The gradient of the first layer is further derived as follows:
[0159]
[0160] Where z (k) This represents the output of the k-th layer, and f represents the activation function; once the gradients of all layers are calculated, the controller parameters are updated through the Adam optimizer during the iteration process:
[0161]
[0162] After completing the Nadam iteration based on the Adam optimizer, the final optimized parameters θ are obtained. adam_final Subsequently, this parameter state is synchronized and used as the initial parameter point and gradient input for the finite-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) optimizer. Based on this, the L-BFGS algorithm constructs a function that satisfies s through an iterative update mechanism. k T g k Search direction s with condition <0 k This condition ensures s k This indicates the descent direction, providing an effective optimization path for subsequent parameter updates; s k The specific calculation formula is as follows:
[0163]
[0164] Where g k H represents the gradient vector at the current iteration point. k The Hessian matrix is used; the L-BFGS algorithm does not directly calculate the complete Hessian matrix H. k Instead, the parameters and gradient change vectors for the most recent m iterations are maintained in the following way:
[0165]
[0166] Based on limited historical information, this recursive mechanism avoids explicitly storing and computing high-dimensional Hessian matrices, significantly reducing computational complexity.
[0167] During the online search phase, the Wolfe condition is used to simultaneously balance convergence speed and stability, solving for the step size α that satisfies the following dual requirements. k >0: First, ensure that the objective function is sufficiently reduced, i.e.
[0168]
[0169] Secondly, the descent property of the search direction must be maintained, meaning the gradient direction and the search direction must maintain a negative inner product relationship; finally, the parameters are updated using the following formula:
[0170] This update strategy initially integrates an efficient search direction constructed from historical gradient information, ensuring that while maintaining stability, each iteration step size approaches the optimal solution as closely as possible.
[0171] As an efficient algorithm for solving unconstrained optimization problems within the classic quasi-Newton framework, L-BFGS's core advantage lies in its iterative approach to approximate the low-rank approximation of the objective function's Hessian matrix inverse. This effectively avoids the high cost of directly calculating the complete Hessian matrix and its inverse in high-dimensional scenarios while maintaining a convergence speed similar to Newton's method. It is particularly noteworthy that L-BFGS exhibits significant quadratic convergence characteristics within locally convex regions—when the optimization process enters a "high-quality region" of the objective function (e.g., a neighborhood close to the global minimum), it can quickly converge to a high-precision optimal solution. This hybrid strategy, through the extensive exploration in the early stages of Adam and the local refinement in the later stages of L-BFGS, significantly improves the efficiency and quality of solutions to complex optimization problems.
[0172] The hybrid optimization strategy proposed in this invention combines the fast initial convergence characteristics of the Adam optimizer with the high-precision fine-tuning capability of the L-BFGS algorithm. The specific training process is as follows: Figure 2 As shown: First, the optimization framework described by equation (17) is used to perform several iterations to drive the optimization variables in the parameter space into a reasonable region near the global optimal solution; then, L-BFGS is switched to perform high-precision fine-tuning to achieve a collaborative optimization process of "fast initialization-high-precision convergence".
[0173] S3, Data Collection, Training and Simulation
[0174] S31. Data Collection and Processing
[0175] An experimental platform was built to collect the data required for training. The core processor of the RTU-BOX206 uses the TMS320F28377 chip, and the sampling frequency is set to 20kHz. Motor parameters are detailed in Table I.
[0176] A dual-loop controller based on space vector pulse width modulation (SVPWM) is adopted to achieve motor regulation through a coordinated control strategy of the fundamental component and the third harmonic component. During data acquisition experiments under different operating conditions, the control input i... d1 and i d3 -i q3 All values are set to zero. It is particularly important to note that the experimental platform uses a traction motor as the load torque source; therefore, the load must be removed before performing forward / reverse switching operations to avoid mechanical shock causing system damage.
[0177] Table I Motor Parameters
[0178]
[0179] During offline data acquisition, the focus is on covering key regions of the system's dynamic characteristics, such as typical moments like sudden speed changes or instantaneous load jumps. Therefore, when achieving the motor's fast response characteristics, the system often exhibits significant overshoot, which will be visually presented through specific data in subsequent experimental analysis. By fully recording the evolution characteristics of these dynamic processes, the training dataset can effectively capture the system's nonlinear characteristics. After completing the experimental data acquisition according to the operating conditions listed in Table II, the complete dataset is proportionally divided into training and test sets. In this invention, the first 70% is used as the training set for model parameter learning, and the remaining 30% is used as the test set to verify the model's generalization performance.
[0180] Table II Training Data Collection Conditions
[0181]
[0182] S32, Architecture Design and Data Training
[0183] The training process was conducted in a configured virtual environment, utilizing the PyTorch library to study training parameters and network architecture. Training was performed on a computer equipped with an AMD Ryzen 7500F 64-bit processor (base frequency 3.70GHz), 32GB of memory, and an NVIDIA GeForce RTX 4060 Ti graphics card (for GPU acceleration).
[0184] The four network architecture parameters designed for the theoretical content are detailed in Table III.
[0185] For both the deep neural network (DNN) and the initial physical information neural network version (PINN-1), the internal training epochs were set to 20,000, using the Adam optimizer with a learning rate of 0.001. Experiments involved training the loss function in both purely data-driven and physics-equation-constrained scenarios, with results as follows: Figure 3 As shown in (a) and 3(b). It is worth noting that the physical information loss term L... phy The value is significantly higher than that of the pure data-driven loss term L. data This may be related to model parameter perturbations. Nevertheless, this training result did not significantly affect the actual operating performance of the motor, and validation on the test dataset and experiments further support this conclusion. This invention employs an equal-weight allocation strategy to balance the weights of the two types of losses. Furthermore, based on engineering experience, the weight coefficient λ of the regularization loss term... reg Set to 10 -4 Finally, after completing the full training of PINN-1, the total loss function L... total The trend of change is as follows Figure 3 As shown in (c).
[0186] Building upon PINN-1, the second version of PINN (PINN-2) employs the L-BFGS optimizer for further optimization. The key parameters of the L-BFGS optimizer are set as follows: history record size of 100, maximum number of iterations (m) of 20, and number of training epochs of 500. Observing the decreasing trend of the loss function reveals that around the 12,000th epoch, the loss value shows no significant change, indicating redundancy in the epoch number parameter of the current Adam optimizer. This redundancy strategy is designed to prevent insufficient convergence of the Adam optimizer from masking the effectiveness of the L-BFGS algorithm when the L-BFGS optimizer is introduced. Since the initial gradient descent process of PINN-2 is similar to that of PINN-1, this invention only shows the loss function change curve after applying the L-BFGS optimizer, see [link to documentation]. Figure 4 The results show that using the L-BFGS optimizer further reduces the loss value and effectively improves the model's learning ability. PINN-3 is designed primarily to verify whether increasing the number of network layers can further improve the model's generalization ability.
[0187] Table III Network Structure Design Parameters
[0188]
[0189] S33, Test Set Validation
[0190] After training was completed, the network's ability to predict voltage using offline collected data was further tested. Table IV shows the loss value, mean squared error (MSE), and coefficient of determination (R²) for the test set.
[0191] Table IV Test Results
[0192]
[0193] Simulation results reveal the performance differences between different models in fitting the task: the currently designed deep neural network (DNN) exhibits superior high-precision fitting ability, accurately capturing the output characteristics of the field-oriented control (FOC) system. In contrast, the prediction error of the first-generation Physical Information Neural Network (PINN-1) is significantly higher than that of the DNN model. Notably, after optimization, the enhanced Physical Information Neural Network (PINN-2) achieves prediction performance approaching that of the DNN model. Further experiments show that increasing the number of hidden layer neurons in another variant network (PINN-3) does not significantly change the model's predictions, suggesting that simply increasing the size of the hidden layers has limited effect on improving the task under the current network architecture. Figure 5 The residual values and their distribution for four predicted voltages are shown.
[0194] S4. Experimental Verification
[0195] Regarding the model deployment on the experimental platform, network deployment was achieved by exporting the model parameters trained on a PC and writing forward propagation code in the RTU-BOX. Furthermore, all experiments employed the same modulation method to minimize performance differences caused by variations in modulation techniques.
[0196] S41, Steady-state performance
[0197] The focus was on verifying the steady-state control performance of three neural network controllers and comparing them with field-oriented control (FOC). To avoid duplication of previously acquired data conditions, the experimental conditions were set as follows: rotational speed 850 rpm and torque 6 Nm. Steady-state data was recorded in real time using the RTU-BOX's built-in software, and the results are as follows. Figure 6 As shown in the figure. Since the verification of the test set above shows that there is no significant difference between PINN-3 and PINN-2 in voltage calculation accuracy, no experimental comparison of their steady-state and dynamic performance was conducted.
[0198] Experimental results show that deep neural networks (DNNs) can approximate traditional field-oriented control (FOC) methods with high accuracy, consistent with traditional simulation analysis conclusions. However, due to large voltage calculation errors, Physical Information Neural Network 1 (PINN-1) exhibits significant current instability, leading to a significant increase in torque ripple. This phenomenon is related to... Figure 7 The harmonic analysis results corroborate each other. Notably, the control performance of the further optimized Physical Information Neural Network 2 (PINN-2) has converged to a level comparable to that of a DNN.
[0199] S42, Dynamic Performance
[0200] Dynamic characteristic analysis under different operating conditions is a crucial step in evaluating the performance of a control system. This section continues the method used in steady-state performance studies to further analyze the performance of different neural network controllers in dynamic processes. When the load torque changes abruptly from 0 to 6 Newtons, the predicted voltage values (i.e., the key control variables required by the controller) from the q1-d1 to q3-d3 axes are recorded in detail. Figure 8 As shown. The electromagnetic torque T collected synchronously. e Response curve as Figure 9 As shown.
[0201] Based on previous analysis, the control performance of PINN-1 is inferior to that of PINN-2, and therefore it was not included in the comparative experiments. Experimental results show that the NN controller outperforms the traditional FOC in dynamic overshoot suppression, mainly due to its strong nonlinear mapping characteristics. Meanwhile, PINN-2, which relies on a physical information constraint mechanism, exhibits a more significant optimization effect in dynamic overshoot suppression compared to the NN.
[0202] S43. Verification of control effect under extreme conditions
[0203] To fully verify the superior performance of the designed controller, the experiment focused on its generalization ability (i.e., overload capability) in sparse data scenarios. The experiment first drove the motor to operate stably in FOC mode. Based on this, DNN and PINN-2 computation tasks were simultaneously completed. Considering that the algorithm is still in the verification stage, to effectively avoid the risk of motor malfunction due to algorithm immaturity, this experiment specifically adopted a low-speed condition of 300 rpm, while applying a load torque of 15 Nm (this load level has reached 150% of the rated torque of the experimental prototype). It is important to emphasize that setting the low-speed condition not only meets the technical characteristics of the algorithm verification stage, but more importantly, it reduces the potential instability risk of the motor during operation by reducing the speed. Figure 10 The specific experimental results are presented.
[0204] like Figure 10 As shown, the voltage calculated by the neural network controller deviates significantly from the actual voltage required by the motor, causing the motor to malfunction and fail to operate normally during operation due to abnormal control commands triggering the protection mechanism. In contrast, the PINN-2 controller can accurately predict and output the voltage required by the motor, effectively ensuring the stability of motor operation and demonstrating more reliable control performance. Figure 11 The response curve of the electromagnetic torque Te is shown.
[0205] S44. Comparison of computational burden
[0206] Currently, the PINN-2 controller has demonstrated significant advantages in suppressing dynamic response overshoot due to its strong adaptability to complex operating conditions and robust control capabilities. However, verifying its computational efficiency remains of significant research value. Notably, compared to the traditional single-plane control architecture, the input dimension of the five-phase motor dual-plane PINN controller is approximately twice that of the former, a characteristic that may lead to a significant increase in computation time. Furthermore, the impact of the increased matrix computation caused by the growth in the number of neurons on the feasibility of deploying the experimental platform also needs in-depth verification. This invention compares the computation time of three control strategies: traditional FOC, PINN-2, and PINN-3. For DNN, PINN-1, and PINN-2, their data dimensions remain consistent, so theoretically, the computation time should be the same, and the actual results confirm this. The specific verification process is implemented by configuring the algorithm computation module in software and executing the test program. Detailed performance indicators are shown in Table V.
[0207] Table IV Comparison of Computational Burden
[0208] Control strategy Algorithm execution time FOC 8.79μs DNN 12.33μs PINN-1 12.24μs PINN-2 12.27μs PINN-3 36.59μs
[0209] Based on current experimental results, the execution time of the current network design is comparable to that of the Foremost Continuous Computation (FOC). However, it is noteworthy that the computation time increases significantly with the number of neurons in the network. This characteristic indicates that the existing network architecture is well-designed. Future research will explore the possibility of reducing the number of neurons in the hidden layers and optimizing the network structure to further shorten the algorithm's execution time, thereby adapting to controller platforms with lower control frequencies and reducing system manufacturing costs.
[0210] This invention addresses the limitations of traditional methods in controlling five-phase permanent magnet synchronous motors (PMSMs) by proposing a neural network controller that can be trained offline, is interpretable, and supports online deployment. Through theoretical derivation, physical information embedding training, and hybrid optimizer design, the controller achieves significant improvements in interpretability, generalization ability, and voltage deviation suppression. Experimental results demonstrate its advantages in steady-state accuracy, dynamic response, and anti-interference performance, providing a practical example for neural network methods in high-performance control of multiphase motors.
[0211] The technical means disclosed in this invention are not limited to those disclosed in the above embodiments, but also include technical solutions composed of any combination of the above technical features. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications are also considered within the scope of protection of this invention.
Claims
1. A harmonic suppression control method for a five-phase permanent magnet synchronous motor based on machine learning, characterized in that, Includes the following steps: S1. Construct a mathematical model of a five-phase permanent magnet synchronous motor drive system in a rotating coordinate system, and design a five-phase permanent magnet synchronous motor control system based on a deep neural network; S2. Deeply integrate the prior physical information of the motor into the training process to enhance the generalization ability of the model, and propose a hybrid optimization strategy to improve the fitting accuracy between the predicted network voltage and the actual working voltage, suppress fluctuations in the prediction process, and make the predicted value more in line with the actual operating requirements. Step S1 includes: S11. Constructing the mathematical model of a five-phase permanent magnet synchronous motor drive system The mathematical model in the synchronous rotating coordinate system is derived from the mathematical model of the five-phase permanent magnet synchronous motor in the natural coordinate system, combined with the constant amplitude coordinate transformation matrix; in the synchronous rotating dq coordinate system, the primary plane d-axis voltage u d1 Primary plane q-axis voltage u q1 d-axis voltage in the third plane d3 Third plane q-axis voltage u q3 With the first plane d-axis current i d1 , First-order plane q-axis current i q1 d-axis current i in the third plane d3 Third-dimensional plane q-axis current i q3 The relationship between them is represented as Among them, R s L is the stator phase winding resistance. d1 and L q1 These are the d-axis and q-axis inductances, respectively, L ls For leakage, ω e Ψ is the rotor's electrical angular velocity. f For permanent magnet flux linkage; The electromagnetic torque of a five-phase permanent magnet synchronous motor is generated by the fundamental component; in the synchronous rotating dq coordinate system, the electromagnetic torque T e Represented as: Where P n It is the extreme logarithm; The mechanical motion of an electric motor follows Newton's second law, which is expressed as: Where J is the rotor moment of inertia, ω m T is the mechanical angular velocity. l For load torque, B m This is the mechanical damping coefficient; S12. Machine Learning-Based Five-Phase Permanent Magnet Synchronous Motor Control System Traditional machine learning employs supervised machine learning algorithms, using neural networks as direct controllers to calculate the required voltage in real time based on the motor state, thus replacing the output of traditional PI control; therefore, the neural network-based controller Nc is represented as: in, Given the d-axis current in a primary plane, Given a q-axis current in a primary plane, Given the d-axis current in the cubic plane, Given a q-axis current in a cubic plane; The number of neurons in the input and output layers matches the number of inputs and outputs, while the number of neurons in the hidden layers and their corresponding neurons are determined through repeated trials; its specific architecture is expressed as follows: Among them, NN (0) This represents the variables of the input layer neuron, where l is the number of hidden layers, and w l Let b be the hidden layer weight matrix. l For the hidden layer bias vector, NN (l) This represents the calculation result for layer l, where L represents the total number of layers in the neural network, and w L Let b be the output layer weight matrix. L Here, σ represents the output layer bias vector; σ represents the activation function, expressed as follows: Where z is the input to the activation function; After completing the above architecture, the loss function is constructed and optimized to train the weight matrix and bias vector in the neural network; the mean squared error loss function is shown below: Where N is the number of neurons in the output layer, u i For the true value of the i-th output layer, This is the predicted value for the i-th output layer; After defining the loss function, the data stream X is passed through the network to calculate the loss value; in order to optimize the weight matrix and bias vector using algorithms such as gradient descent, their gradients are calculated through a process relying on the backpropagation algorithm, as follows: Where θ represents the weight matrix and bias vector in the neural network; based on the chain rule of differentiation, backpropagation propagates the gradient information of the loss function from the output layer back to the network layer by layer, thereby calculating the gradient of each parameter; after obtaining the gradients of the weights and biases, they are updated according to the gradient data; according to the chain rule of differentiation, the update algorithm is as follows: Where t is the number of iterations, η is the learning rate, and n is the number of neurons per layer; In motor control systems, neural network-based controllers essentially perform forward propagation by applying a given input signal to the weight matrix and bias vector of an offline-trained model. The predicted values of the first-order and third-order plane dq-axis voltages are then calculated according to the following formulas: Among them, b i x is the i-th bias vector element of the output layer. i For the i-th input element of the output layer, w i This is the i-th weight matrix element of the output layer.
2. The harmonic suppression control method for a five-phase permanent magnet synchronous motor based on machine learning according to claim 1, characterized in that, Step S2 includes: By using the voltage equation (1) to constrain the training of the neural network, the generalization ability and robustness of the model are enhanced when data is scarce; specifically, the residual term of the physical equation is introduced into the loss function of the neural network to ensure that the network follows physical laws while fitting the data; including the following steps: S21, PINN Architecture and Physical Residual Definition The PINN current controller utilizes a fully connected network to enhance the model's expressive power; the activation function was modified, and the hyperbolic tangent Tanh function was selected: Where x is the input to the activation function; The physical residual R refers to the error term constructed by comparing the predicted output of the neural network with the theoretical value derived from physical laws; specifically, in the voltage prediction task of d1q1-d3q3, the predicted voltage U of the neural network is directly calculated. pred The theoretical voltage U derived from the voltage equation of a permanent magnet synchronous motor phy The difference between them: Where, r d1 r is the physical residual value of the d-axis voltage in the primary plane. q1 r is the physical residual value of the q-axis voltage in the first plane. d3 The physical residual value of the d-axis voltage in the cubic plane, r q3 This represents the physical residual value of the q-axis voltage in the third plane. When calculating the current derivative in the dataset, the central difference method is used to calculate the current derivative at the internal points, while the forward or backward difference method is used at the boundary points. S22. Design of a loss function that integrates data and physical constraints. In the PINN model of a five-phase permanent magnet synchronous motor, the total loss function L total It is the core coordinator for multi-objective optimization; through a weighted fusion mechanism, it integrates the constraints based on the physical laws of motors and the fitting objective of measured / simulated voltage data into an optimizable loss function, specifically in the following form: Where, λ data For the data, the weighting coefficients, L data (θ) is the data fitting loss function, λ phy L is the weighting coefficient for the physical residuals. phy (θ) is the physical residual loss function, λ reg L is the regularization weight coefficient. reg (θ) is the regularization loss function; Data fitting loss function L data (θ) remains consistent with formula (7) to ensure that the voltage predicted by the neural network approximates the actual measured value; when the dataset is sufficient, the weighting coefficient λ is increased. data Physical residual loss function L phy (θ) The forced neural network output satisfies the voltage equation of a five-phase permanent magnet synchronous motor. Its physical essence is to construct a virtual monitoring signal using deterministic physical equations; regularization loss L reg (θ) Prevents neural networks from overfitting to local minima of training data noise or physical residuals, thereby improving generalization ability; S23, Training Process Optimization In the parameter optimization of the PINN controller, the total loss function L is calculated. total (θ) gradient ∇L with respect to network parameter θ total (θ); the gradient between the weights θ and the bias θ is calculated using backpropagation to find the optimal weights and biases; the gradients of the controller parameters are calculated using the following chain rule: in, Fit the gradient of the loss function to the data. The gradient of the physical residual loss function. The gradient of the regularization loss function; During the back propagation of PINN, L phy The gradient propagation of (θ) is its core innovative mechanism, and its gradient propagation is as follows: in The relevant parameters can be calculated using equation (12); The gradient of the first layer is further derived as follows: Where z (k) This represents the output of the k-th layer, and f represents the activation function; once the gradients of all layers are calculated, the controller parameters are updated through the Adam optimizer during the iteration process: After completing the Nadam iteration based on the Adam optimizer, the final optimized parameters θ are obtained. adam_final Subsequently, the synchronized parameter state is used as the initial parameter point and gradient input for the finite-memory Broyden-Fletcher-Goldfarb-Shanno optimizer; based on this, the L-BFGS algorithm constructs a function that satisfies s through an iterative update mechanism. k T g k Search direction s with condition <0 k This condition ensures s k This indicates the descent direction, providing an effective optimization path for subsequent parameter updates; s k The specific calculation formula is as follows: Where g k H represents the gradient vector at the current iteration point. k The Hessian matrix is used; the L-BFGS algorithm does not directly calculate the complete Hessian matrix H. k Instead, the parameters and gradient change vectors for the most recent m iterations are maintained in the following way: During the online search phase, the Wolfe condition is used to simultaneously balance convergence speed and stability, solving for the step size α that satisfies the following dual requirements. k >0: First, ensure that the objective function is sufficiently reduced, i.e. Secondly, the descent property of the search direction must be maintained, meaning the gradient direction and the search direction must maintain a negative inner product relationship; finally, the parameters are updated using the following formula: 。