Electric aircraft permanent magnet synchronous motor current sensor failure control method and system based on LSTM network
The permanent magnet synchronous motor control method of electric aircraft with current sensor failure is reconstructed through the LSTM network, which solves the flight safety threat caused by current sensor failure, realizes stable control in the embedded system, and improves the reliability and safety of the electric aircraft.
Patent Information
- Application Number
- CN202510487460.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-11
Smart Images

Figure CN120301277A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of permanent magnet synchronous motor current sensor control, and particularly to a method for controlling the failure of a permanent magnet synchronous motor current sensor in an electric aircraft based on an LSTM network. Background Art
[0002] As a kind of motor with high efficiency and high power density, the permanent magnet synchronous motor is widely used in the fields of modern industry and electric aircraft. With the rapid development of aviation technology, contemporary electric aircraft have gradually attracted wide attention due to their advantages such as environmental protection, high energy efficiency, and low noise. Especially, electric aircraft have shown great application potential in short-distance transportation, emergency rescue, etc. due to their characteristics of light weight and low carbon emissions, and have become an important development direction of the future aviation industry. The permanent magnet synchronous motor has an important position in the propulsion system of electric aircraft. Its structure is simple and its reliability is high, making it suitable for operation in complex environments. As the core component of the power system of electric aircraft, the permanent magnet synchronous motor has many advantages such as high efficiency, high power density, and good dynamic response characteristics, and has been widely used in the field of electric aircraft. However, in the control system of electric aircraft, the vector control strategy is usually adopted, which relies on current sensors to obtain three-phase currents. If the current sensors fail, it will directly threaten the flight safety of the aircraft. Therefore, it is of great significance to study how to ensure flight safety in the case of current sensor failure.
[0003] The current sensor plays a crucial role in the motor control process of electric aircraft and is used to collect the three-phase currents of the motor required by the permanent magnet synchronous motor vector control algorithm in real time.
[0004] To solve the problem of sensor failure, a variety of sensorless control technologies based on software algorithms have been proposed in recent years. For example, current and position estimation methods based on sliding mode observers or extended Kalman filters use the motor mathematical model to achieve sensorless control. However, these methods are sensitive to changes in motor parameters and are prone to system imbalance due to sudden changes in motor parameters. As the motor ages, its parameters such as resistance and inductance will change, resulting in a decrease in estimation accuracy. Noise and external interference can also affect the stability and accuracy of the estimation, and the computational complexity is high. Traditional observers and filtering algorithms have high requirements for the computing resources of the controller and are difficult to be implemented in real time in embedded systems. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a method for controlling the failure of a permanent magnet synchronous motor current sensor in an electric aircraft based on an LSTM network, so as to ensure that the aircraft will not lose power due to the failure of the current sensor during flight and improve the operation safety of the electric aircraft.
[0006] The technical solution of the present invention is as follows: On the one hand, the present invention provides a method for controlling the failure of a current sensor of a permanent magnet synchronous motor of an electric aircraft based on an LSTM network, including:
[0007] S1: The current acquisition module and voltage acquisition module installed on the three-phase power cable of the motor respectively collect the two-phase current and three-phase voltage signals of the motor. Among them, the three-phase voltage signals u a , u b and u c are output as two-phase voltage u α and u β signals after Clark transformation. The two-phase voltage u α and u β signals are used as the input of the fault diagnosis module;
[0008] The two-phase current i a and i b of the motor are obtained as two-phase current i α and i β after Clark transformation;
[0009] The position angle θ of the motor is collected by the position sensor installed on the permanent magnet synchronous motor, and the speed signal n is obtained after transformation of the position angle θ;
[0010] S2: Adopt sliding mode variable structure control to obtain the predicted current and
[0011] S3: Compare the predicted current and with the two-phase current i α and i β . If the difference is less than 5%, it is determined that no current failure fault has occurred, and the switch K s is set to 0; if the difference is greater than 5%, it is determined that a current failure fault has occurred, and the switch K s is set to 1;
[0012] S4: When it is detected that a current sensor failure fault occurs and K s is set to 1, start the LSTM network to reconstruct the two-phase current of the motor. The speed signal n is used as the input of the LSTM network, and i d and i q can be predicted;
[0013] S5: The i d and i q currents pass through the PI module to obtain u q and u d , and obtain u α and u β after Park inverse transformation., it is converted into the space vector pulse width modulation module SVPWM signal to drive the inverter Inverter to provide three-phase alternating current for the permanent magnet synchronous motor.
[0014] Specifically, the three-phase voltage signals u a , u b and u c are output as two-phase voltage u α and u β signals after Clark transformation:
[0015]
[0016] wherein, u α and u β are respectively the alternating current voltages of the motor in the two-phase stationary coordinate system.
[0017] Specifically, the two-phase currents i a and i b of the motor are obtained as two-phase currents i α and i β through Clark transformation:
[0018]
[0019] wherein, i α and i β are respectively the alternating current of the motor in the two-phase stationary coordinate system.
[0020] Specifically, the position angle θ of the motor is collected by a position sensor installed on the permanent magnet synchronous motor, and the position angle θ is transformed to obtain a speed signal:
[0021] The mechanical angular velocity of the motor is obtained from the motor position angle θ:
[0022]
[0023] wherein, ω is the mechanical angular velocity of the motor;
[0024] The motor speed can be expressed as:
[0025]
[0026] wherein, n is the motor speed.
[0027] Specifically, the predicted current and are obtained by using sliding mode variable structure control, and the predicted current and are compared with the two-phase currents i α and i β, if the difference is less than 5%, it is determined that no current failure fault has occurred, and the switch is set to 0; if the difference is greater than 5%, it is determined that a current failure fault has occurred, including:
[0028] The voltage equation of the permanent magnet synchronous motor in the two-phase stationary coordinate system is expressed as:
[0029]
[0030] Among them, R s is the stator resistance; and are the components of the current values estimated by the sliding mode observer on the α-axis and β-axis; L s is the inductance of the permanent magnet synchronous motor. The motor usually adopts a surface-mounted type, and the relationship between the d-axis inductance L d and the q-axis inductance L q can be expressed as L d = L q = L s ; ψ f is the permanent magnet flux linkage; ω e is the electrical angular velocity of the motor, p is the number of pole pairs;
[0031] The back electromotive force of the motor in the two-phase stationary coordinate system is expressed as:
[0032]
[0033] Among them, e α , e β are the back electromotive forces of the motor in the two-phase stationary coordinate system respectively;
[0034] From equations (5) and (6), it can be obtained that:
[0035]
[0036] From equation (7), it can be obtained that:
[0037]
[0038] The back electromotive force of the motor is expressed as a function of the sliding mode control law:
[0039]
[0040] Among them, ν α , ν β is the sliding mode control law of the sliding mode observer; K is the sliding mode gain value; sign() is the sign function; s α and s β are the sliding mode surface functions;
[0041] From equations (8) and (9), it can be obtained that:
[0042]
[0043] The synovial surface function is expressed as:
[0044]
[0045] Make the time derivative of the Lyapunov function V(s) always less than zero, prove the convergence of the system, and prove the convergence of the errors s α and s β :
[0046] First, the Lyapunov function can be expressed as:
[0047]
[0048] Taking the derivative gives:
[0049]
[0050] Among them, and can be expressed as:
[0051]
[0052] Substituting into Equation (13) gives:
[0053]
[0054] For the error to converge, it is necessary to ensure:
[0055]
[0056] That is:
[0057]
[0058] If:
[0059]
[0060] Then there must be:
[0061]
[0062] Equation (16) holds, ensuring that the errors s α and s β will converge to 0, so that the observer can correctly estimate and Take the maximum value:
[0063]
[0064] As can be seen from Equation (6), since the amplitudes of the sine and cosine functions are at most 1, therefore:
[0065]
[0066] The maximum back electromotive force can be expressed as:
[0067] e max = ω e ψ f (22)
[0068] As can be seen from Equation (20), K should satisfy K > e max , and it can be taken as:
[0069]
[0070] Substituting the value of K into Equation (9) gives When satisfies Equation (24), it can be determined that a current sensor failure fault has occurred, and K s is set to 1:
[0071]
[0072] If the current sensor has not failed, K s is set to 0, and after Park transformation, i d and i q are obtained:
[0073]
[0074] where i d and i q are the two-phase currents of the motor in the d and q coordinate systems respectively.
[0075] Specifically, when K s is set to 1, the LSTM network is enabled, and its input X t is and the output H t is
[0076] The LSTM network consists of three gates and a memory unit;
[0077] The forget gate determines which information needs to be discarded from the memory unit, and the formula is as follows:
[0078]
[0079] where: F t is the output of the forget gate, ranging from 0 to 1; σ is the Sigmoid activation function; H t-1 is the output of the previous moment; X tIs the current input b f Is the forget gate bias term; W f Is the forget gate weight matrix: Is the input X t To the weight matrix of the forget gate; Is the output H at the previous moment t-1 To the weight matrix of the forget gate; directly obtained in the trained network, and their dimensions are respectively:
[0080]
[0081] n h Is the number of hidden layer units set by oneself during network training; n x Is the dimension of the input features. The LSTM neural network contains 4 gates, and the dimension is multiplied by the coefficient 4;
[0082] The input gate controls which new information is written into the memory cell, and the formula is as follows:
[0083]
[0084] Among them: I t Is the activation value of the input gate, indicating the proportion of information allowed to be written into the memory cell at the current moment, ranging from 0 to 1; b i Is the bias term of the input gate, used to adjust the output of the activation function; W i Is the weight matrix of the input gate, defining the influence of the hidden state at the previous moment and the current input on the input gate: Is the input X t To the weight matrix of the input gate; Is the output H at the previous moment t-1 To the weight matrix of the input gate, and their dimensions are respectively:
[0085]
[0086] The output gate determines the value of the hidden state at the current moment, and the formula is:
[0087]
[0088] Among them: O t Is the activation value of the output gate, indicating the degree of influence of the content of the current memory cell on the output; b o Is the bias term of the output gate; W o Is the weight matrix of the output gate: Is the input X t To the weight matrix of the output gate; Is the output H at the previous moment t-1 To the weight matrix of the output gate, and their dimensions are respectively:
[0089]
[0090] Memory unit: Candidate memory value:
[0091]
[0092] Where: is the candidate memory value, representing the potential memory value generated according to the current input and the previous hidden state; tanh is the hyperbolic tangent function, used to limit the value between -1 and 1; b c is the bias term of the candidate memory value; W c is the weight matrix of the candidate memory value: is the input X t to the weight matrix of the candidate memory unit; is the hidden state H t-1 to the weight matrix of the candidate memory unit. Their dimensions are respectively:
[0093]
[0094] After the forget gate, input gate, and candidate memory unit, the memory unit can be updated to:
[0095]
[0096] Where: C t is the memory unit value at the current moment; F t is the output value of the forget gate, determining the proportion of the memory unit information retained at the previous moment; C t-1 is the memory unit value at the previous moment; is the contribution of the new memory value to the current memory unit;
[0097] Based on the memory unit C t and the output gate O t then the current output can be obtained:
[0098] H t = O t ·tanh(C t ) (35)
[0099] Where: H t is the output at the current moment, that is
[0100] Through the above forward derivation formula, a linear transformation is performed on the input X t and the output H t-1 at the previous moment to obtain the forget gate, input gate, candidate memory value, and memory, and finally obtain the current output
[0101] For the first time step \(t = 0\), the initial values of the hidden state and the memory cell state are set manually:
[0102] Initialized to zero: \(H_0 = 0\) and \(C_0 = 0\), where \(H_0\) is the output at time zero and \(C_0\) is the memory cell at time zero;
[0103] Randomly initialized: \(H_0=\text{random value}\) and \(C_0=\text{random value}\);
[0104] Learn the initial values during training: Treat \(H_0\) and \(C_0\) as trainable parameters and update them along with the training of the network.
[0105] Specifically, the PI module in S5 includes speed PI and current PI, where,
[0106] e n =n ref -n(36)
[0107] Calculate the speed error:
[0108] where \(n\) is the actual rotational speed, \(n ref is the given rotational speed, and \(e n is the difference between the given rotational speed and the actual rotational speed;
[0109] Use a PI controller to calculate the reference torque:
[0110] T ref =K p,n e n +K i,n ∫e n dt(37)
[0111] where \(T ref is the reference torque, \(K p,n is the proportional gain of speed, and \(K i,n is the integral gain of speed;
[0112] Convert the torque reference value to a current reference value according to the motor parameters:
[0113]
[0114] where \(I qref is the desired q-axis current, and \(K t is the torque constant of the motor;
[0115] The current PI is the inner loop, and its control objective is to regulate the stator current to reach the target value on the dq axes;
[0116] Calculate the current error:
[0117] e d =i dref -id , e q = i qref -i q (39)
[0118] Calculate the voltage control amount using a PI controller:
[0119]
[0120] where u d and u q , are the voltages on the d-axis and q-axis, used to generate the SVPWM signal, K p,d and K p,q are the proportional gains of the current errors on the d-axis and q-axis respectively, and K i,d and K i,q are the integral gains of the current errors on the d-axis and q-axis respectively;
[0121] After obtaining u d and u q , through the inverse Park transformation:
[0122]
[0123] Obtain u α and u β , then input them into the SVPWM to obtain the duty cycle signal for controlling the inverter switches, and finally obtain the three-phase AC voltage of the motor through the inverter to control the motor, is the coordinate axis rotation angle.
[0124] On the other hand, the present invention provides a current sensor failure control system for a permanent magnet synchronous motor of an electric aircraft based on an LSTM network, including: a voltage acquisition module: used to acquire the three-phase input voltage of the motor;
[0125] a current acquisition module: used to acquire two-phase currents of the three-phase currents of the motor;
[0126] a position acquisition module for acquiring the position angle of the motor;
[0127] The fault diagnosis module obtains the predicted current and through the sliding mode variable structure control method and compares it with the actually transformed i α and i β currents to judge whether a current failure fault occurs;
[0128] The LSTM network module is used to complete current reconstruction through the motor position and speed signals when a current sensor failure fault is detected, and obtain i d and i q currents;
[0129] The PI module includes a speed PI and a current PI. The speed PI is used to adjust the speed of the motor, and the current PI is used to adjust the stator current.
[0130] The present invention provides a method for controlling the failure of a current sensor of a permanent magnet synchronous motor for an electric aircraft based on an LSTM network. This method is based on a neural network. When a current sensor failure is detected, it can ensure the stable operation of the motor vector control strategy, prevent the failure of the motor control system from shutting down due to the failure of the current sensor, ensure that the power of the electric aircraft is not lost, and further improve the reliability of the electric aircraft. The present invention obtains the weights of the neural network through offline training, reconstructs the neural network model and uses it to predict the motor current. First, the sliding mode control of the fault diagnosis module can be used to detect whether the current sensor fails. If a current sensor failure occurs, the LSTM network can be used to reconstruct the current, ensuring that the motor does not stop and improving the reliability and safety of the system.
[0131] The present invention adopts a modular design, and the weights of the neural network can be loaded into the control system as an independent module, which is convenient for upgrading and maintenance. Improvement of accuracy and robustness: Through a large amount of data training, the weights can capture the complex dynamic behavior and nonlinear characteristics of the permanent magnet synchronous motor control system. Adaptability to parameter changes: Through the derived neural network formula, even if the motor parameters (such as resistance, inductance, etc.) change, the prediction accuracy is still relatively high. The neural network has a certain ability to suppress noise in the input data, making the prediction results more stable. When the current sensor fails, directly using the weights of the LSTM network for derivation reduces the disasters caused by the failure of the current sensor during the flight of the aircraft. This control method adopts a low-cost solution, enabling more enterprises and industries to adopt advanced motor control technologies, promoting the popularization and development of industrial automation, and improving the flight safety of the aircraft. Description of the Drawings
[0132] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments in line with the present invention, and are used together with the specification to explain the principles of the present invention.
[0133] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0134] Figure 1 It is a structural block diagram of an electric aircraft motor control system provided for the disclosed embodiments of the present invention;
[0135] Figure 2The LSTM network diagram provided by the disclosed embodiments of the present invention;
[0136] Figure 3 The flowchart of the failure control method for the current sensor of the permanent magnet synchronous motor of the electric aircraft based on the LSTM network provided by the disclosed embodiments of the present invention. Detailed implementation manners
[0137] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description involves the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all the implementation manners consistent with the present invention. On the contrary, they are only examples of the systems consistent with some aspects of the present invention as detailed in the appended claims.
[0138] The electric power system of an electric aircraft usually uses a vector control method. The vector control method relies on current sensors to collect the three-phase current of the motor in real time. However, current sensors are prone to failure faults in harsh flight environments (such as high temperature, high humidity, or vibration conditions). Once the current sensor fails, it will cause the electric power system of the aircraft to shut down, endangering the operation safety of the aircraft. The permanent magnet synchronous motor has significant nonlinear characteristics. Traditional observers based on physical models rely strongly on parameters and are prone to estimation errors under dynamic conditions. The LSTM network has the characteristic of being adaptable to complex nonlinearities. This method can realize predicting the motor current through the LSTM network in the mode of current sensor failure, avoiding the occurrence of aircraft flight faults caused by current sensor failure, and ensuring the stable operation of the electric aircraft. The long short-term memory (abbreviation: LSTM) network is a special recurrent neural network (RNN). Compared with the traditional RNN, the LSTM network can effectively capture long-term dependence relationships and avoid the problem of gradient disappearance by introducing a gating mechanism.
[0139] This implementation provides a failure control method for the current sensor of the permanent magnet synchronous motor of an electric aircraft based on the LSTM network. The motor control system of the electric aircraft mainly consists of a voltage acquisition module, a current acquisition module, a fault diagnosis module, an LSTM, a Clark transformation module, an SVPMW module, an Inverter module, etc. Its system structure is as Figure 1 shown.
[0140] S1: The current acquisition module and the voltage acquisition module installed on the three-phase power cable of the motor respectively collect the two-phase current and three-phase voltage signals of the motor, and after Clark transformation, output the two-phase voltage u α and u β signals as the input of the fault diagnosis module;
[0141] Voltage acquisition: The three-phase input voltage u of the motor is acquired through voltage sensors installed on the three-phase lines of the motor. a , u b and u c . Through Clark voltage transformation, the three-phase input voltage is transformed into an alternating current voltage in the two-phase stationary coordinate system.
[0142]
[0143] Among them, u α and u β are respectively the alternating current voltages of the motor in the two-phase stationary coordinate system.
[0144] Current acquisition: Two-phase currents i a and i b among the three-phase currents of the motor are respectively acquired through current sensors installed on the three-phase lines of the motor. Through Clark current transformation, two-phase currents in the two-phase stationary coordinate system are obtained.
[0145]
[0146] Among them, i α and i β are respectively the alternating current currents of the motor in the two-phase stationary coordinate system.
[0147] Position acquisition: The position angle θ of the motor is acquired through a position sensor installed on the permanent magnet synchronous motor.
[0148] The mechanical angular velocity of the motor is obtained from the motor position angle θ:
[0149]
[0150] Among them, ω is the mechanical angular velocity of the motor.
[0151] The motor speed can be expressed as:
[0152]
[0153] Among them, n is the motor speed.
[0154] S2: Predictive current can be obtained by adopting sliding mode variable structure control and Then compare with the two-phase currents i a and i b The two-phase currents i α and i β obtained by Clark transformation of the two-phase currents. If their difference is less than 5%, it is determined that no current failure fault has occurred, and the switch is set to 0. If their difference is greater than 5%, it is determined that a current failure fault has occurred;
[0155] Fault diagnosis: Among them, eα , e β are the back electromotive forces of the motor in the two-phase stationary coordinate system respectively. From equations (5) and (6), we can obtain:
[0156]
[0157] From equation (7), we can obtain:
[0158]
[0159] The back electromotive force of the motor can be expressed as a function of the sliding mode control law:
[0160]
[0161] where ν α , ν β is the sliding mode control law of the sliding mode observer; K is the sliding mode gain value; sign() is the sign function; s α and s β are the sliding mode surface functions.
[0162] From equations (8) and (9), we can obtain:
[0163]
[0164] The sliding mode surface function can be expressed as:
[0165]
[0166] To ensure that the sliding mode observer can correctly estimate the current and it is necessary to prove the convergence of the error s α and s β of the sliding mode observer. In the sliding mode control theory, a common stability analysis method is the Lyapunov stability analysis, that is, if a Lyapunov function V(s) can be found such that its time derivative is always less than zero, it can be proved that the system converges.
[0167] First of all, the Lyapunov function can be expressed as:
[0168]
[0169] Taking the derivative, we can obtain:
[0170]
[0171] where and can be expressed as:
[0172]
[0173] Substituting into Equation (13), we get:
[0174]
[0175] For the error to converge, it is necessary to ensure:
[0176]
[0177] That is:
[0178]
[0179] If:
[0180]
[0181] Then there must be:
[0182]
[0183] Equation (16) holds, ensuring that the errors s α and s β will converge to 0, so that the observer can correctly estimate and
[0184] Taking the maximum value:
[0185]
[0186] From Equation (6), since the amplitudes of the sine and cosine functions are at most 1, then:
[0187]
[0188] The maximum value of its back electromotive force can be expressed as:
[0189] e max = ω e ψ f (22)
[0190] From Equation (20), K should satisfy K > e max . It can be taken as:
[0191] K = 1.2·e max (23)
[0192] Substituting the value of K into Equation (9), we can obtain
[0193] S3: When satisfies Equation (24), it can be determined that a current sensor failure fault has occurred, and K s is set to 1:
[0194]
[0195] If the current sensor does not fail, K s is set to 0, and after Park transformation, i d and i q can be obtained:
[0196]
[0197] where i d and i q are the two-phase currents of the motor in the d and q coordinate systems respectively.
[0198] S4: When a current sensor failure is detected, the LSTM network is used to complete current reconstruction through the motor position and speed signals to obtain the id and iq currents. The LSTM network is mainly composed of three gates and a memory unit. The LSTM network is as Figure 2 shown. When K s is set to 1, the LSTM network is enabled, and its input X t is and the output H t is
[0199] The forget gate determines which information needs to be discarded from the memory unit. The formula is as follows:
[0200]
[0201] where: F t is the output of the forget gate, ranging from 0 to 1; σ is the Sigmoid activation function; H t-1 is the output of the previous moment; X t is the current input b f is the forget gate bias term; W f is the forget gate weight matrix: is the weight matrix from the input X t to the forget gate; is the weight matrix from the output H t-1 of the previous moment to the forget gate. It can be directly obtained in the trained network, and its dimensions are respectively:
[0202]
[0203] n h is the number of hidden layer units set by oneself during network training; n x is the dimension of the input features. The speed and position are used to predict the current, and the speed and position are two input dimensions. Since the LSTM neural network contains 4 gates, the dimension needs to be multiplied by the coefficient 4.
[0204] The input gate controls which new information is written into the memory cell, and the formula is as follows:
[0205]
[0206] Where: I t is the activation value of the input gate, representing the proportion of information allowed to be written into the memory cell at the current moment, with a range of 0, 1; b i is the bias term of the input gate, used to adjust the output of the activation function; W i is the weight matrix of the input gate, defining the influence of the previous hidden state and the current input on the input gate: is the weight matrix from the input X t to the input gate; is the weight matrix from the previous output H t-1 to the input gate. Their dimensions are respectively:
[0207]
[0208] The output gate determines the value of the hidden state (i.e., the output) at the current moment, and the formula is:
[0209]
[0210] Where: O t is the activation value of the output gate, representing the degree of influence of the content of the current memory cell on the output; b o is the bias term of the output gate; W o is the weight matrix of the output gate: is the weight matrix from the input X t to the output gate; is the weight matrix from the previous output H t-1 to the output gate. Their dimensions are respectively:
[0211]
[0212] Candidate memory value:
[0213]
[0214] Where: is the candidate memory value, representing the potential memory value generated based on the current input and the previous hidden state; tanh is the hyperbolic tangent function, used to limit the value between -1 and 1; b c is the bias term of the candidate memory value; W c is the weight matrix of the candidate memory value: is the weight matrix from the input X t to the candidate memory cell; is the hidden state H t-1The weight matrix to the candidate memory units. Their dimensions are respectively:
[0215]
[0216] After having the forget gate, input gate, and candidate memory units, the memory unit can be updated to:
[0217]
[0218] Where: C t is the value of the memory unit at the current moment; F t is the output value of the forget gate, determining the proportion of the memory unit information from the previous moment to be retained; C t-1 is the value of the memory unit at the previous moment; is the contribution of the new memory value to the current memory unit.
[0219] After having the memory unit C t and the output gate O t we can obtain the current output:
[0220] H t = O t ·tanh(C t ) (35)
[0221] Where: H t is the output at the current moment, i.e.,
[0222] Through the above forward derivation formula, a linear transformation is performed on the input X t and the output H t-1 at the previous moment to obtain the forget gate, input gate, candidate memory value, and memory, and finally obtain the current output For the first time step t = 0, we need to manually set the initial values of the hidden state and memory unit state. Common practices are:
[0223] (1) Initialize to zero
[0224] H0 = 0 and C0 = 0, where H0 is the output at time zero and C0 is the memory unit at time zero.
[0225] (2) Random initialization
[0226] H0 = random value and C0 = random value.
[0227] (3) Learn the initial values during training
[0228] Take H0 and C0 as trainable parameters and update them along with the training of the network.
[0229] The core logic of the above formula design:
[0230] Gate mechanism: LSTM realizes selective retention, update, and output of information flow by introducing three gates (forget gate, input gate, output gate). This mechanism avoids the problem of gradient vanishing in traditional RNNs.
[0231] Memory cell: C t is the core, which accumulates and updates information in a weighted manner and can effectively retain the dependency information of the motor over a long time.
[0232] Nonlinear transformation: Sigmoid and Tanh functions provide flexible input / output range control and enhance the expressive power of the model.
[0233] S5: Predict i d and i q and then obtain u through the PI module q and u d , obtain u through Park inverse transformation α and u β , convert it into an SVPWM signal to drive the inverter and provide three-phase alternating current for the permanent magnet synchronous motor.
[0234] The speed PI is the outer loop, and its goal is to regulate the speed of the motor.
[0235] e n = n ref - n (36)
[0236] Calculate the speed error:
[0237] where n is the actual speed, n ref is the given speed, and e n is the difference between the given speed and the actual speed.
[0238] Use the PI controller to calculate the reference torque:
[0239] T ref = K p,n e n + K i,n ∫e n dt (37)
[0240] where T ref is the reference torque, K p,n is the proportional gain of speed, and K i,n is the integral gain of speed.
[0241] Convert the torque reference value to the current reference value according to the motor parameters:
[0242]
[0243] where I qrefis the desired q-axis current, K t is the torque constant of the motor.
[0244] The current PI is the inner loop, and its control objective is to regulate the stator current to reach the target value on the dq axes.
[0245] Calculate the current error:
[0246] e d = i dref - i d , e q = i qref - i q (39)
[0247] where i dref is the desired current on the d-axis, i d and i q are the actual currents on the d-axis and q-axis respectively, e d and e q are the differences between the desired and actual currents on the d-axis and q-axis respectively.
[0248] Use the PI controller to calculate the voltage control quantity:
[0249]
[0250] where u d and u q , are the voltages on the d-axis and q-axis, used to generate the SVPWM signal, K p,d and K p,q are the proportional gains of the current errors on the d-axis and q-axis respectively, K i,d and K i,q are the integral gains of the current errors on the d-axis and q-axis respectively.
[0251] After obtaining u d and u q , through the inverse Park transformation:
[0252]
[0253] Obtain u α and u β , then input them into the SVPWM to obtain the duty cycle signal for controlling the inverter switches, and finally obtain the three-phase AC voltage of the motor through the inverter to control the motor. is the coordinate axis rotation angle.
[0254] The vector control of the permanent magnet synchronous motor requires accurate measurement of the stator currents i q and i d, such measurements usually rely on hardware current sensors. However, in practical applications, the current sensors may bring the following problems: the sensors may fail due to environmental changes (such as high temperature or vibration). Once the current sensor fails, it can be promptly detected by the fault diagnosis module and the stator current can be predicted through the LSTM network. q and the stator current d , improving the system safety and reliability and avoiding dangerous situations.
[0255] The control method provided by the present invention does not require complex online calculations, reducing the real-time operation load. The neural network weights (such as W ih , W hh , b) are solidified after offline training and can be directly used in the derivation formula. The derivation process only needs to perform matrix operations (addition and multiplication), with simple calculations and high efficiency, which can meet the real-time operation requirements of embedded devices. By retraining the weights, the neural network can adapt to different motors or control requirements without modifying the controller logic.
[0256] The working principle of a current-sensorless method applicable to the cruise state of an aircraft proposed by the present invention is as follows: in the cruise state of the aircraft, by performing fault detection on the real-time phase current i α and the stator current β , it can be monitored whether the current sensor fails. Once a fault is detected, the historical speed and position data are analyzed through the LSTM network to predict the future stator current, realizing current-sensorless vector control. This effectively avoids serious accidents caused by sudden failures of current sensors during the cruise of the aircraft. Through its gating mechanism of forget gate, input gate and output gate, the LSTM network selectively remembers or forgets input information, thus effectively capturing motor data. Its control flow chart is as Figure 3 shown.
[0257] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the technical principle of the present invention, several improvements and deformations can still be made, and these changes and deformations should also be regarded as the protection scope of the present invention.
Claims
1. A method for controlling the failure of a current sensor of a permanent magnet synchronous motor of an electric aircraft based on an LSTM network, characterized in that, Including: S1: Collect the two-phase current and three-phase voltage signals of the motor through the current acquisition module and voltage acquisition module installed on the three-phase power cable of the motor, where the three-phase voltage signals u a , u b and u c are output as two-phase voltage signals u α and u β after Clark transformation, and the two-phase voltage signals u α and u β are used as the inputs of the fault diagnosis module; The two-phase current i of the motor a and i b are obtained through Clark transformation to get two-phase currents i α and i β ; Collect the position angle θ of the motor through a position sensor installed on the permanent magnet synchronous motor, and obtain the speed signal n through the transformation of the position angle θ; S2: Adopt sliding mode variable structure control to obtain the predicted current and S3: Compare the predicted current and with the two-phase currents i α and i β . If the difference is less than 5%, it is determined that no current failure fault has occurred, and the switch K s is set to 0; if the difference is greater than 5%, it is determined that a current failure fault has occurred, and the switch K s is set to 1; S4: When it is detected that a current sensor failure fault occurs and K s is set to 1, start the LSTM network to reconstruct the two-phase current of the motor. The speed signal n is used as the input of the LSTM network, and then i d and i q can be predicted; S5: i d and i q The current passes through the PI module to obtain u q and u d , and through the inverse Park transformation, u α and u β are obtained, which are converted into space vector pulse width modulation module SVPWM signals to drive the inverter Inverter to provide three-phase alternating current for the permanent magnet synchronous motor.
2. The method for controlling the failure of the current sensor of the permanent magnet synchronous motor of the electric aircraft based on the LSTM network according to claim 1, wherein The three-phase voltage signals u a , u b and u c After Clark transformation, the two-phase voltage signals u α and u β are output: where u α and u β are the AC voltages of the motor in the two-phase stationary coordinate system, respectively.
3. The method for controlling the failure of the current sensor of the permanent magnet synchronous motor of the electric aircraft based on the LSTM network according to claim 1, wherein The two-phase current i of the motor a and i b are transformed by the Clark transformation to obtain two-phase currents i α and i β : wherein, i α and i β are respectively the alternating current of the motor in the two-phase stationary coordinate system.
4. The method for controlling the failure of the current sensor of the permanent magnet synchronous motor of the electric aircraft based on the LSTM network according to claim 1, wherein, The position angle θ of the motor is collected through a position sensor installed on the permanent magnet synchronous motor, and the speed signal is obtained through the transformation of the position angle θ: Obtain the mechanical angular velocity of the motor from the motor position angle θ: Where, ω is the mechanical angular velocity of the motor; The motor speed can be expressed as: Where, n is the motor speed.
5. The method for controlling the failure of the current sensor of the permanent magnet synchronous motor of the electric aircraft based on the LSTM network according to claim 1, characterized in that, The predicted current is obtained by using sliding mode variable structure control and Compare the predicted current and with the two-phase currents i α and i β , if the difference is less than 5%, it is determined that no current failure fault has occurred, and the switch is set to 0; If the difference is greater than 5%, it is determined that a current failure fault occurs, including: The voltage equation of the permanent magnet synchronous motor in the two-phase stationary coordinate system is expressed as: Among them, R s is the stator resistance; and are the components of the current value estimated by the sliding mode observer on the α-axis and β-axis; L s is the inductance of the permanent magnet synchronous motor. The motor usually adopts a surface-mounted type. The relationship between the d-axis inductance L d and the q-axis inductance L q can be expressed as L d = L q = L s ; ψ f is the permanent magnet flux linkage; ω e is the electrical angular velocity of the motor, p is the number of pole pairs; The back electromotive force of the motor in the two-phase stationary coordinate system is expressed as: where, e α , e β are respectively the back electromotive forces of the motor in the two-phase stationary coordinate system; From Equation (5) and Equation (6), it can be obtained that: From Equation (7), it can be obtained that: The motor back electromotive force is expressed as a function of the sliding mode control rate: where, ν α , ν β is the sliding mode control rate of the sliding mode observer; K is the sliding mode gain value; sign() is the sign function; s α and s β are the sliding mode surface functions; From Equation (8) and Equation (9), it can be obtained that: The sliding mode surface function is expressed as: Make the time derivative of the Lyapunov function V(s) always less than zero, prove the convergence of the system, and prove the convergence of the errors s α and s β : First, the Lyapunov function can be expressed as: Taking the derivative, it can be obtained that: Among them, and can be expressed as: Substituting into Equation (13) gives: For the error to converge, it is necessary to ensure that: That is: If: Then there must be: Equation (16) holds, ensuring that the errors s α and s β will converge to 0, enabling the observer to correctly estimate and Taking the maximum value: K > max{|e α |, |e β |} (20) From Equation (6), it can be seen that since the amplitudes of the sine function and the cosine function are at most 1, therefore: The maximum value of its back electromotive force can be expressed as: e max = ω e ψ f (22) As can be seen from Equation (20), K should satisfy K > e max , and it can be taken as: K = 1.2·e max (23) Substituting the value of K into Equation (9) gives When If the condition of Equation (24) is satisfied, it can be determined that a current sensor failure fault has occurred. K s Set to 1: If the current sensor does not fail, K s is set to 0, and after Park transformation, i d and i q can be obtained as follows: where i d and i q are the two-phase currents of the motor in the d- and q-coordinate systems, respectively.
6. The method for controlling the failure of the current sensor of the permanent magnet synchronous motor of the electric aircraft based on the LSTM network according to claim 1, characterized in that K s When set to 1, enable the LSTM network, and its input X t is the output H t is The LSTM network consists of three gates and a memory unit; The forget gate determines which information needs to be discarded from the memory unit, and the formula is as follows: Where: F t is the output of the forget gate, ranging from 0 to 1; σ is the Sigmoid activation function; H t-1 is the output of the previous moment; X t is the current input b f is the forget gate bias term; W f is the forget gate weight matrix: is the weight matrix from the input X t to the forget gate; is the weight matrix from the previous moment's output H t-1 to the forget gate; directly obtained in the trained network, and their dimensions are respectively: n h is the number of hidden layer units set by oneself when training the network; n x is the dimension of the input features. The LSTM neural network contains 4 gates, and the dimension is multiplied by the coefficient 4; The input gate controls which new information is written into the memory unit, and the formula is as follows: Where: I t is the activation value of the input gate, representing the proportion of information allowed to be written into the memory cell at the current moment, with a range of 0, 1; b i is the bias term of the input gate, used to adjust the output of the activation function; W i is the weight matrix of the input gate, defining the influence of the previous hidden state and the current input on the input gate: is the input X t to the weight matrix of the input gate; is the weight matrix from the previous output H t-1 to the input gate, and their dimensions are respectively: The output gate determines the value of the hidden state at the current moment, and the formula is: Where: O t is the activation value of the output gate, representing the degree to which the content of the current memory cell is allowed to affect the output; b o is the bias term of the output gate; W o is the weight matrix of the output gate: is the weight matrix from the input X t to the output gate; is the weight matrix from the previous output H t-1 to the output gate, and their dimensions are respectively: Memory unit: Candidate memory value: Wherein: is the candidate memory value, representing the potential memory value generated according to the current input and the previous hidden state; tanh is the hyperbolic tangent function, used to limit the value between -1 and 1; b c is the bias term of the candidate memory value; W c is the weight matrix of the candidate memory value: is the input X t to the weight matrix of the candidate memory cell; is the hidden state H t-1 to the weight matrix of the candidate memory cell. Their dimensions are respectively: After relying on the forget gate, the input gate and the candidate memory unit, the memory unit can be updated as: Where: C t is the memory cell value at the current moment; F t is the output value of the forget gate, which determines the proportion of the memory cell information from the previous moment to be retained; C t-1 is the memory cell value at the previous moment; is the contribution of the new memory value to the current memory cell; Based on the memory cell C t and the output gate O t After that, the current output can be obtained: H t = O t ·tanh(C t ) (35) Where: H t is the output at the current moment, namely Using the above forward derivation formula for the input X t and the output H at the previous moment t-1 perform a linear transformation to obtain the forget gate, input gate, candidate memory value, and memory, and finally obtain the current output For the first time step t = 0, the initial values of the hidden state and the memory unit state are manually set: Initialized to zero: H0 = 0 and C0 = 0, H0 is the output at time zero, and C0 is the memory unit at time zero; Random initialization: H0 = random value and C0 = random value; Learning the initial value during training: Regarding H0 and C0 as trainable parameters and updating them together with the training of the network.
7. The method for controlling the failure of the current sensor of the permanent magnet synchronous motor of the electric aircraft based on the LSTM network according to claim 1, characterized in that The PI module in S5 includes speed PI and current PI, where, e n = n ref -n (36) Calculate the speed error: where n is the actual rotational speed, and n ref is the given rotational speed, and e n is the difference between the given rotational speed and the actual rotational speed; Use the PI controller to calculate the reference torque: T ref = K p,n e n + K i,n ∫ e n dt (37) where T ref is the reference torque, K p,n is the proportional gain of the speed, K i,n is the integral gain of the speed; Convert the torque reference value to the current reference value according to the motor parameters: where I qref is the desired q-axis current, and K t is the torque constant of the motor; The current PI is the inner loop, and its control objective is to adjust the stator current to reach the target value on the dq axis; Calculate the current error: e d = i dref -i d , e q = i qref -i q (39) Use the PI controller to calculate the voltage control quantity: where u d and u q , are the voltages of the d-axis and q-axis, used to generate the SVPWM signal, K p,d and K p,q are the proportional gains of the d-axis and q-axis current errors respectively, K i,d and K i,q are the integral gains of the d-axis and q-axis current errors respectively; Obtain u d and u q After that, through the inverse Park transformation: Obtain u α and u β , and then input them into SVPWM to obtain the duty cycle signal for controlling the inverter switches. Finally, through the inverter, the three-phase AC voltage of the motor is obtained to control the motor. is the rotation angle of the coordinate axis.
8. A permanent magnet synchronous motor current sensor failure control system for an electric aircraft based on an LSTM network, characterized in that, Including: Voltage acquisition module: used to collect the three-phase input voltage of the motor; Current acquisition module: used to collect two-phase currents among the three-phase currents of the motor; Position acquisition module is used to collect the position angle of the motor; The fault diagnosis module obtains the predicted current through the sliding mode variable structure control method and and compares it with the i α and i β currents obtained by actual transformation to determine whether a current failure fault occurs; The LSTM network module is used to complete current reconstruction through the motor position and speed signals when a failure of the current sensor is detected, and obtain i d and i q currents; The PI module includes speed PI and current PI, where the speed PI is used to adjust the speed of the motor; The current PI is used to adjust the stator current.
Citation Information
Cited By
Motor position sensorless control method and device, equipment and medium
CN121530265A