Switching control method and device of motor control algorithm, equipment and storage medium
By using the pre-trained backpropagation neural network prediction model, the motor's target control algorithm is determined based on the difference between the current intersection current of the motor and the preset intersection current, the problems of severe resonance and large overshoot in the existing motor control switching methods are solved, and a smoother and more reliable motor control algorithm switching is achieved.
Patent Information
- Application Number
- CN202411881036.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-02-28
AI Technical Summary
The existing motor control switching methods have problems such as severe resonance, large overshoot, long switching time, and slow switching response, which is difficult to ensure the stability and reliability of the switching control of the motor control algorithm.
By obtaining the current intersection current of the motor, using the pre-trained backpropagation neural network prediction model, the current state is output based on the difference between the current intersection current and the preset intersection current, and the target control algorithm of the motor is determined based on the current state, the previous state and the difference, so as to perform motor control.
It effectively avoids serious resonance and large overshoot problems during the switching process of the motor control algorithm, and improves the stability and reliability of the switching control of the motor control algorithm.
Smart Images

Figure CN119543723A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of motor control technology, and in particular to a switching control method, device, equipment and storage medium for a motor control algorithm. Background Art
[0002] In recent years, artificial intelligence technology has caused a huge response in the field of power electronics and power transmission, especially artificial neural networks, which have caused a series of technical barriers that can be established in the field of power electronics. As a complex field that requires high control precision, power electronics has undergone several rounds of innovation in the past few decades. Taking the field of motor control as an example, the field-oriented control (FOC) algorithm with steady-state high performance, the direct torque control (DTC) algorithm with faster dynamic response, and the model predictive control (MPC) algorithm applied to the field of motor control have been born.
[0003] The existing motor control switching method needs to be determined according to the specific motor type, control system design and control objectives. During the switching process, it is necessary to pay close attention to the state and control performance of the motor. There are problems such as severe resonance, large overshoot, long switching time and slow switching response, which makes it difficult to ensure the stability and reliability of the motor control algorithm switching control. Summary of the invention
[0004] Embodiments of the present invention provide a method, device, equipment and storage medium for switching control of a motor control algorithm to improve the stability and reliability of switching control of the motor control algorithm.
[0005] In a first aspect, an embodiment of the present invention provides a switching control method of a motor control algorithm, which includes:
[0006] Get the current quadrature axis current of the motor;
[0007] Outputting a current state based on a difference between the current quadrature-axis current and a preset quadrature-axis current through a pre-trained prediction model;
[0008] Acquire a previous state output by the prediction model, and determine a target control algorithm for the motor according to the current state, the previous state, and the difference;
[0009] The motor is controlled based on the target control algorithm.
[0010] In a second aspect, an embodiment of the present invention provides a switching control device for a motor control algorithm, comprising:
[0011] A quadrature-axis current acquisition unit, used for acquiring the current quadrature-axis current of the motor;
[0012] A current state output unit, configured to output a current state based on a difference between the current quadrature-axis current and a preset quadrature-axis current through a pre-trained prediction model;
[0013] A control algorithm confirmation unit, configured to obtain a previous state of the prediction model output, and determine a target control algorithm for the motor according to the current state, the previous state, and the difference;
[0014] A motor control unit is used to control the motor based on the target control algorithm.
[0015] In a third aspect, an embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the switching control method of the motor control algorithm described in the first aspect is implemented.
[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the switching control method of the motor control algorithm described in the first aspect above.
[0017] The embodiment of the present invention provides a switching control method, device, equipment and storage medium for a motor control algorithm, the method comprising: obtaining the current quadrature axis current of the motor; outputting the current state based on the difference between the current quadrature axis current and the preset quadrature axis current through a pre-trained prediction model; obtaining the previous state output by the prediction model, and determining the target control algorithm of the motor according to the current state, the previous state and the difference; and controlling the motor based on the target control algorithm. The embodiment of the present invention outputs the current state according to the difference between the current quadrature axis current and the preset quadrature axis current through a prediction model, and then determines the target control algorithm of the motor according to the current state and the previous state, thereby avoiding the serious resonance and large overshoot problems during the switching process of the motor control algorithm, and is conducive to improving the stability and reliability of the switching control of the motor control algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0019] Figure 1A schematic flow chart of a switching control method of a motor control algorithm provided by an embodiment of the present invention;
[0020] Figure 2 A schematic diagram of a first sub-process of a switching control method of a motor control algorithm provided by an embodiment of the present invention;
[0021] Figure 3 A schematic flow chart of a switching control method of a motor control algorithm provided by another embodiment of the present invention;
[0022] Figure 4 A schematic diagram of the structure of a back propagation neural network model provided by an embodiment of the present invention;
[0023] Figure 5 A schematic diagram of a second sub-process of the switching control method of the motor control algorithm provided by an embodiment of the present invention;
[0024] Figure 6 A schematic diagram of a third sub-process of the switching control method of the motor control algorithm provided by an embodiment of the present invention;
[0025] Figure 7 A fourth flow chart of a switching control method of a motor control algorithm provided by an embodiment of the present invention;
[0026] Figure 8 A fifth flow chart of a switching control method of a motor control algorithm provided by an embodiment of the present invention;
[0027] Fig. 9 A schematic diagram of the switching condition determination principle of the motor control algorithm provided by an embodiment of the present invention;
[0028] Fig.10 A schematic block diagram of a switching control device for a motor control algorithm provided by an embodiment of the present invention;
[0029] Fig.11 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0032] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0033] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0034] See also Figure 1 , Figure 1 A schematic flow chart of a switching control method of a motor control algorithm provided by an embodiment of the present invention. The switching control method of a motor control algorithm provided by an embodiment of the present invention is applied to a motor control system.
[0035] S1: Get the current quadrature-axis current of the motor.
[0036] Specifically, as an important branch of artificial neural networks, back propagation neural networks (BPNN) have shown more and more applications in the field of motor control. Back propagation neural networks have the ability to improve the application performance of field oriented control (FOC) and model predictive control (MPC) in power converters, which is reflected in the ability of back propagation neural networks to construct the association between their applications based on the complex relationship between various independent and non-independent variables. In an embodiment of the present application, the training of artificial neural networks is realized by utilizing the back propagation neural network algorithm and different control methods are switched according to different conditions. FOC is used in steady state and MPC is switched to in dynamic state, thereby realizing the switching control of the motor control algorithm and improving the reliability and stability of the switching control of the motor control algorithm.
[0037] In an embodiment of the present application, the current quadrature-axis current of the motor is acquired, wherein the quadrature-axis current refers to the q-axis current, which refers to the current used to control the rotation component of the rotor magnetic field in motor control.
[0038] S2: Outputting the current state based on the difference between the current quadrature-axis current and the preset quadrature-axis current through a pre-trained prediction model.
[0039] Specifically, the current state is outputted according to the difference between the current cross-axis current and the preset cross-axis current through a pre-trained prediction model. In the embodiment of the present application, the prediction model is a back propagation neural network, which is iteratively trained to match the output value with the target value, and outputs an appropriate switching signal, so that the control system has good control characteristics in both dynamic and steady states. Among them, the current state includes steady state and transient state. The preset cross-axis current is a pre-set q-axis current.
[0040] See also Figure 2 , Figure 2 A specific implementation of step S2 is shown, which is described in detail as follows:
[0041] S21: Calculate the difference between the current quadrature-axis current and the preset quadrature-axis current to obtain a target difference.
[0042] S22: Calculate the output of the hidden layer based on the target difference using the pre-trained prediction model to obtain a first target output.
[0043] S23: Using a Sigmoid function to calculate the output of the output layer based on the first target output, to obtain the current state.
[0044] Specifically, the difference between the current cross-axis current and the preset cross-axis current is calculated to obtain the target difference, which is used as the initial input of the prediction model. In the prediction model, the target difference is input into the input layer, and then the net input of the hidden layer is calculated in the hidden layer (i.e., the hidden layer) through the weight matrix and the bias matrix, and the net input of the hidden layer is activated by the Sigmoid function to obtain the hidden layer output. Then in the output layer, the net input of the output layer is calculated according to the hidden layer output, the weight matrix and the bias matrix, and the net input of the output layer is activated by the Sigmoid function to obtain the output layer output, thereby obtaining the current state.
[0045] See also Figure 3 and Figure 4 , Figure 3 A specific implementation method before step S2 is shown. Figure 4 The structural diagram of the back propagation neural network model provided by the embodiment of the present invention is described in detail as follows:
[0046] S201: Initialize the model parameters of the back propagation neural network.
[0047] Specifically, the back propagation neural network includes a weight matrix and a bias matrix. In an embodiment of the present application, the weight matrix W1 (hidden layer weight matrix) and W2 (output layer weight matrix), and the bias matrix b1 (hidden layer bias matrix) and b2 (output layer bias matrix) are randomly initialized. In a specific embodiment, the initial weight coefficient W and the bias coefficient b are selected to be 0, and the number of initial iterations is usually set to 10.
[0048] S202: Acquire an initial quadrature-axis current, and use a difference between the initial quadrature-axis current and the preset quadrature-axis current as initial training data.
[0049] Specifically, the initial quadrature-axis current I is obtained. q , calculate the initial quadrature axis current I q With the preset quadrature axis current The difference is The difference ΔI q as initial training data.
[0050] S203: Performing model training on the back propagation neural network using the initial training data to obtain the prediction model.
[0051] Specifically, the back propagation neural network is trained by initial training data, and the mean square error between the predicted value and the true value is used to train the neural network to evaluate the performance of the entire system. Each weight parameter W and bias parameter b is continuously used by the Levenberg-Marquardt algorithm (LM algorithm) until the most suitable weight matrix W and bias matrix b that can obtain the minimum error between the predicted value and the true value are selected, and W and b can be used to update the latest neural network. When the model training is completed, a prediction model is obtained.
[0052] See also Figure 5 , Figure 5 A specific implementation of step S203 is shown, which is described in detail as follows:
[0053] S2031: Calculate the outputs of the hidden layer and the output layer in sequence based on the initial training data through the back propagation neural network to obtain a first output and a second output.
[0054] See also Figure 6 , Figure 6 A specific implementation of step S2031 is shown, which is described in detail as follows:
[0055] S20311: Calculate the net input of the hidden layer based on the initial training data and the model parameters.
[0056] Specifically, the net input of the hidden layer is calculated by formula (1):
[0057] z h (t) = W1(t)x + b1(t) (1);
[0058] Among them, x is the initial training data, W1 is the hidden layer weight matrix, b1 is the hidden layer bias matrix, t is the training data input batch, Z h is the net input to the hidden layer.
[0059] S20312: Using a Sigmoid function to calculate the output of the hidden layer based on the net input of the hidden layer to obtain a first output.
[0060] Specifically, the output of the hidden layer is calculated based on the net input of the hidden layer using the Sigmoid function to obtain the first output, and the calculation method is shown in formula (2);
[0061] a h (t) = σ(z h (t)) (2);
[0062] Among them, a h is the first output, and σ(·) is the Sigmoid function.
[0063] S20313: Calculate the net input of the output layer according to the first output and the model parameters.
[0064] Specifically, the net input of the output layer is calculated by formula (3):
[0065] z o (t) = W2(t)a h (t)+b2(t) (3);
[0066] Among them, W2 is the output layer weight matrix, b2 is the output layer bias matrix, Z o is the net input to the output layer.
[0067] S20314: Using the Sigmoid function to calculate the output of the output layer based on the net input of the output layer to obtain a second output.
[0068] Specifically, the net input of the output layer is substituted into the Sigmoid function for calculation to obtain the second output, which is calculated as shown in formula (4);
[0069] ao(t)=σ(zo(t))(4);
[0070] Among them, a o is the second output.
[0071] S2032: Calculate an output error and a gradient error according to the first output and the second output.
[0072] Specifically, the output error and the gradient error are calculated according to the first output and the second output, and then the mean square error between the predicted value and the true value is calculated based on the output error and the gradient error to train the back propagation neural network, thereby evaluating the performance of the entire system.
[0073] See also Figure 7 , Figure 7 A specific implementation of step S2032 is shown, which is described in detail as follows:
[0074] S20321: Calculate the output error according to a preset target output and the second output.
[0075] Specifically, the output error is calculated based on the preset target output and the second output. In a specific embodiment, the preset target output is y(t) (0 or 1), and the output layer error e(t) is as shown in formula (5):
[0076] e(t)=(a o (t)-y(t)) 2 (5).
[0077] S20322: Calculate the output layer error descent gradient based on the output error, the Sigmoid function and the model parameters.
[0078] Specifically, the output layer error descent gradient is calculated based on the output error, Sigmoid function and model parameters by formula (6), which is:
[0079]
[0080] Among them, σ is the Sigmoid activation function, δ o is the output layer error descent gradient.
[0081] S20323: Calculate the hidden layer error descent gradient according to the first output, the Sigmoid function and the model parameters.
[0082] The output layer error descent gradient is calculated based on the first output, the Sigmoid function and the model parameters by formula (7), which is:
[0083]
[0084] Among them, δ h is the gradient of the hidden layer error descent.
[0085] S2033: Using the LM algorithm to update the model parameters based on the gradient error, obtain the model parameters of the back-propagation neural network, and obtain an updated back-propagation neural network.
[0086] Specifically, the LM algorithm is used to update the model parameters based on the gradient error to obtain the model parameters of the back propagation neural network, and the updated back propagation neural network is obtained. Among them, the Levenberg-Marquardt (LM) algorithm is an optimization algorithm for solving nonlinear least squares problems. Compared with the traditional range conjugate gradient, it has extremely fast convergence and higher accuracy. The algorithm can balance the convergence speed and stability of the algorithm by dynamically adjusting the damping factor.
[0087] In a specific embodiment, the output layer weight matrix is updated by formula (8), which is as follows:
[0088]
[0089] Among them, η is the learning rate, which is used to control the step size of each update; δ o (t) is the output layer error descent gradient. The output layer bias matrix is updated by formula (9), which is:
[0090] b2(t+1)=b2(t)-ηδ o (t)(9).
[0091] The hidden layer weight matrix is updated by formula (10), which is:
[0092] W1(t+1)=W1(t)-ηδ h (t)x T (10);
[0093] Among them, η is the learning rate, δ h is the gradient of the hidden layer error descent.
[0094] Update the hidden layer bias matrix through formula (11), formula (11) is:
[0095] b1(t+1)=b1(t)-ηδ h (t)(11).
[0096] S2034: Retrain the updated back propagation neural network using the initial training data until the output error is less than a preset threshold or the number of iterations reaches a preset number of iterations, thereby obtaining the prediction model.
[0097] Specifically, the updated back propagation neural network is retrained with the initial training data by back propagation until the output error is less than a preset threshold or the number of iterations reaches a preset number of iterations, thereby obtaining the prediction model. It should be noted that the preset threshold and the preset number of iterations are set according to actual conditions and are not limited here.
[0098] In a specific embodiment, the parameter setting of the back propagation neural network includes 10 iterations of training, because more than 10 iterations do not bring more significant performance improvements. Therefore, 10 is selected as the most suitable iteration value. During the training process, it is necessary to ensure that the training set is large enough (for example, including tens of thousands or hundreds of thousands of acquisition points or more).
[0099] S3: Obtain a previous state output by the prediction model, and determine a target control algorithm for the motor according to the current state, the previous state and the difference.
[0100] Specifically, the current state output by the prediction model includes transient state and steady state. When the output value y(t) is 0, it indicates steady state, and when y(t) is 1, it indicates transient state. Then, the target control algorithm of the motor is determined according to the current state, the previous state and the difference.
[0101] See also Figure 8 and Fig. 9 , Figure 8 A specific implementation of step S3 is shown. Fig. 9 The schematic diagram of the switching condition determination principle of the motor control algorithm provided by the embodiment of the present invention is described in detail as follows:
[0102] S31: Obtain the previous state of the prediction model output.
[0103] S32: If the current state is a transient state, the target control algorithm of the motor is determined to be the model predictive control.
[0104] S33: If the current state and the previous state are both steady states, the target control algorithm of the motor is determined to be the field oriented control.
[0105] S34: If the current state is a steady state, the previous state is a transient state, and the difference is less than zero, the target control algorithm of the motor is determined to be the field-oriented control.
[0106] S35: If the current state is a steady state, the previous state is a transient state, and the difference is greater than or equal to zero, the target control algorithm of the motor is determined to be the model predictive control.
[0107] Specifically, if the current state is transient, the target control algorithm of the motor is determined to be model predictive control; if the current state and the previous state are both steady states, the target control algorithm of the motor is determined to be magnetic field oriented control; if the current state is steady state, the previous state is transient and the difference is less than zero, the target control algorithm of the motor is determined to be magnetic field oriented control; if the current state is steady state, the previous state is transient and the difference is greater than or equal to zero, the target control algorithm of the motor is determined to be model predictive control. In the embodiment of the present application, it is to ensure that the current cross-axis current accurately tracks the preset cross-axis current quickly to maintain the advantage of steady-state operation of FOC under various system setting conditions. In addition, the embodiment of the present application can distinguish between steady state and dynamic situations, but when switching from MPC to FOC, a significant dynamic effect will appear at the end of the switching state area. Therefore, using the embodiment of the present application through fast dynamic response, a response result with an average basically zero steady-state error can be maintained.
[0108] S4: Controlling the motor based on the target control algorithm.
[0109] Specifically, after the target control algorithm is determined, if the current motor control algorithm is different from the target control algorithm, the motor control algorithm is switched to the target control algorithm to control the motor; if the current motor control algorithm is the same as the target control algorithm, the current control algorithm continues to be used to control the motor.
[0110] In an embodiment of the present application, the current quadrature axis current of the motor is obtained; the current state is output based on the difference between the current quadrature axis current and the preset quadrature axis current through a pre-trained prediction model; the previous state output by the prediction model is obtained, and the target control algorithm of the motor is determined based on the current state, the previous state and the difference; the motor is controlled based on the target control algorithm. In an embodiment of the present invention, the current state is output based on the difference between the current quadrature axis current and the preset quadrature axis current through a prediction model, and then the target control algorithm of the motor is determined based on the current state and the previous state, thereby avoiding the serious resonance and overshoot problems during the switching process of the motor control algorithm, and is conducive to improving the stability and reliability of the switching control of the motor control algorithm.
[0111] In the embodiment of the present application, the back propagation neural network can be combined to significantly achieve smooth switching and reliable performance maintenance between various control modes, and maintain the control mode under the optimal condition when the motor control algorithm is switched. At the same time, the embodiment of the present application takes into account the advantages of good FOC steady-state characteristics and good MPC dynamic characteristics, has fast dynamic response characteristics and good steady-state tracking error, can achieve steady-state tracking zero error, and the motor control system of the embodiment of the present application has stronger robustness.
[0112] The embodiment of the present invention further provides a switching control device for a motor control algorithm, which is used to execute any embodiment of the switching control method for the motor control algorithm described above. Fig.10 , Fig.10 A schematic block diagram of a switching control device for a motor control algorithm provided by an embodiment of the present invention.
[0113] Among them, Fig.10 As shown, the switching control device 5 of the motor control algorithm includes a quadrature-axis current acquisition unit 51 , a current state output unit 52 , a control algorithm confirmation unit 53 and a motor control unit 54 .
[0114] A quadrature-axis current acquisition unit 51 is used to acquire the current quadrature-axis current of the motor;
[0115] A current state output unit 52, configured to output a current state based on a difference between the current quadrature-axis current and a preset quadrature-axis current through a pre-trained prediction model;
[0116] A control algorithm confirmation unit 53, used to obtain a previous state of the prediction model output, and determine a target control algorithm for the motor according to the current state, the previous state and the difference;
[0117] The motor control unit 54 is used to control the motor based on the target control algorithm.
[0118] Furthermore, the current state output unit 52 also includes:
[0119] A model parameter initialization unit, used to initialize the model parameters of the back propagation neural network;
[0120] A training data generating unit, used for obtaining an initial quadrature-axis current, and taking a difference between the initial quadrature-axis current and the preset quadrature-axis current as initial training data;
[0121] The model training unit is used to perform model training on the back propagation neural network using the initial training data to obtain the prediction model.
[0122] Furthermore, the model training unit includes:
[0123] An output calculation unit, used to calculate the outputs of the hidden layer and the output layer in sequence based on the initial training data through the back propagation neural network to obtain a first output and a second output;
[0124] a gradient error calculation unit, configured to calculate an output error and a gradient error according to the first output and the second output;
[0125] A parameter updating unit, used to update the model parameters based on the gradient error using the LM algorithm, obtain the model parameters of the back propagation neural network, and obtain an updated back propagation neural network;
[0126] A training iteration unit is used to retrain the updated back propagation neural network with the initial training data until the output error is less than a preset threshold or the number of iterations reaches a preset number of iterations, thereby obtaining the prediction model.
[0127] Furthermore, the output calculation unit includes:
[0128] A first net input unit, used for calculating the net input of the hidden layer according to the initial training data and the model parameters;
[0129] A first output unit, configured to calculate the output of the hidden layer based on the net input of the hidden layer by using a Sigmoid function to obtain a first output;
[0130] A second net input unit, used for calculating the net input of the output layer according to the first output and the model parameters;
[0131] The second output unit is used to calculate the output of the output layer based on the net input of the output layer by using the Sigmoid function to obtain a second output.
[0132] Furthermore, the gradient error includes an output layer error descent gradient and a hidden layer error descent gradient; and the gradient error calculation unit includes:
[0133] an output error calculation unit, configured to calculate the output error according to a preset target output and the second output;
[0134] An output layer error descent gradient calculation unit, used to calculate the output layer error descent gradient according to the output error, Sigmoid function and the model parameters;
[0135] A hidden layer error descent gradient calculation unit is used to calculate the hidden layer error descent gradient according to the first output, the Sigmoid function and the model parameters.
[0136] Further, the current state output unit 52 includes:
[0137] a target difference generating unit, configured to calculate a difference between the current quadrature-axis current and the preset quadrature-axis current to obtain a target difference;
[0138] A first target output generating unit, configured to calculate the output of the hidden layer based on the target difference through the pre-trained prediction model to obtain a first target output;
[0139] The output layer output unit is used to calculate the output of the output layer based on the first target output using a Sigmoid function to obtain the current state.
[0140] Furthermore, the target control algorithm includes magnetic field oriented control and model predictive control; the control algorithm confirmation unit 53 includes:
[0141] A previous state acquisition unit, used to acquire the previous state output by the prediction model;
[0142] a first algorithm determination unit, configured to determine, if the current state is a transient state, that the target control algorithm of the motor is the model predictive control;
[0143] a second algorithm determination unit, configured to determine, if both the current state and the previous state are steady states, that the target control algorithm of the motor is the field oriented control;
[0144] a third algorithm determination unit, configured to determine the target control algorithm of the motor as the field oriented control if the current state is a steady state, the previous state is a transient state, and the difference is less than zero;
[0145] The fourth algorithm determination unit is used to determine the target control algorithm of the motor as the model predictive control if the current state is a steady state, the previous state is a transient state, and the difference is greater than or equal to zero.
[0146] In an embodiment of the present application, the current quadrature axis current of the motor is obtained; the current state is output based on the difference between the current quadrature axis current and the preset quadrature axis current through a pre-trained prediction model; the previous state output by the prediction model is obtained, and the target control algorithm of the motor is determined based on the current state, the previous state and the difference; the motor is controlled based on the target control algorithm. In an embodiment of the present invention, the current state is output based on the difference between the current quadrature axis current and the preset quadrature axis current through a prediction model, and then the target control algorithm of the motor is determined based on the current state and the previous state, thereby avoiding the serious resonance and overshoot problems during the switching process of the motor control algorithm, and is conducive to improving the stability and reliability of the switching control of the motor control algorithm.
[0147] The switching control device of the motor control algorithm can be implemented in the form of a computer program. The computer program can be used in Fig.11 Runs on the computer device shown.
[0148] See also Fig.11 , Fig.115 is a schematic block diagram of a computer device provided by an embodiment of the present invention. The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a device bus 501 , wherein the memory may include a storage medium 503 and an internal memory 504 .
[0149] The storage medium 503 can store an operating device 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can execute a switching control method of a motor control algorithm.
[0150] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0151] The internal memory 504 provides an environment for the operation of the computer program 5032 in the storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute the switching control method of the motor control algorithm.
[0152] The network interface 505 is used for network communication, such as providing transmission of data information, etc. Those skilled in the art can understand that the structure shown in the embodiment of the present application is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device 500 to which the solution of the present invention is applied. The specific computer device 500 may include more or less components than those shown in the figure, or combine some components, or have a different arrangement of components.
[0153] The processor 502 is used to run a computer program 5032 stored in the memory to implement the switching control method of the motor control algorithm disclosed in the embodiment of the present invention.
[0154] Those skilled in the art will appreciate that the embodiments of the computer device shown in the embodiments of the present application do not constitute a limitation on the specific configuration of the computer device. In other embodiments, the computer device may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, in some embodiments, the computer device may only include a memory and a processor. In such embodiments, the structure and function of the memory and the processor are consistent with the above-described embodiments, and will not be described in detail herein.
[0155] It should be understood that in the embodiment of the present invention, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0156] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the switching control method of the motor control algorithm disclosed in the embodiment of the present invention is implemented.
[0157] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment, devices and units can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0158] In the several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. Units with the same function may also be combined into one unit. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or units, or may be an electrical, mechanical or other form of connection.
[0159] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0160] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0161] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a background server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), disk or optical disk and other media that can store program codes.
[0162] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A switching control method for a motor control algorithm, characterized in that: include: Get the current quadrature axis current of the motor; Outputting a current state based on a difference between the current quadrature-axis current and a preset quadrature-axis current through a pre-trained prediction model; Acquire a previous state output by the prediction model, and determine a target control algorithm for the motor according to the current state, the previous state, and the difference; The motor is controlled based on the target control algorithm.
2. The switching control method of the motor control algorithm according to claim 1, characterized in that: Before outputting the current state based on the difference between the current quadrature-axis current and the preset quadrature-axis current through the pre-trained prediction model, the method further includes: Initialize the model parameters of the back-propagation neural network; Acquire an initial quadrature-axis current, and use a difference between the initial quadrature-axis current and the preset quadrature-axis current as initial training data; The back propagation neural network is trained using the initial training data to obtain the prediction model.
3. The switching control method of the motor control algorithm according to claim 2, characterized in that: The step of performing model training on the back propagation neural network using the initial training data to obtain the prediction model comprises: The back propagation neural network sequentially calculates the outputs of the hidden layer and the output layer based on the initial training data to obtain a first output and a second output; Calculate an output error and a gradient error according to the first output and the second output; Using the LM algorithm to update the model parameters based on the gradient error, obtain the model parameters of the back propagation neural network, and obtain an updated back propagation neural network; The updated back propagation neural network is retrained using the initial training data until the output error is less than a preset threshold or the number of iterations reaches a preset number of iterations, thereby obtaining the prediction model.
4. The switching control method of the motor control algorithm according to claim 3, characterized in that: The step of calculating the outputs of the hidden layer and the output layer in sequence based on the initial training data through the back propagation neural network to obtain the first output and the second output includes: Calculate the net input of the hidden layer based on the initial training data and the model parameters; Calculating the output of the hidden layer based on the net input of the hidden layer using a Sigmoid function to obtain a first output; Calculate a net input of the output layer based on the first output and the model parameters; The Sigmoid function is used to calculate the output of the output layer based on the net input of the output layer to obtain a second output.
5. The switching control method of the motor control algorithm according to claim 3, characterized in that: The gradient error includes an output layer error descent gradient and a hidden layer error descent gradient; and the output error and the gradient error are calculated according to the first output and the second output, including: Calculating the output error according to a preset target output and the second output; Calculate the output layer error descent gradient according to the output error, the Sigmoid function and the model parameters; The hidden layer error descent gradient is calculated according to the first output, the Sigmoid function and the model parameters.
6. The switching control method of the motor control algorithm according to any one of claims 1 to 5, characterized in that: Outputting the current state based on the difference between the current quadrature-axis current and the preset quadrature-axis current through a pre-trained prediction model includes: Calculating a difference between the current quadrature-axis current and the preset quadrature-axis current to obtain a target difference; Calculate the output of the hidden layer based on the target difference by using the pre-trained prediction model to obtain a first target output; The output of the output layer is calculated based on the first target output using a Sigmoid function to obtain the current state.
7. The switching control method of the motor control algorithm according to any one of claims 1 to 5, characterized in that: The target control algorithm includes magnetic field oriented control and model predictive control; the obtaining of the previous state output by the prediction model and determining the target control algorithm of the motor according to the current state, the previous state and the difference include: Obtaining the previous state of the prediction model output; If the current state is a transient state, the target control algorithm of the motor is determined to be the model predictive control; If the current state and the previous state are both steady states, the target control algorithm of the motor is determined to be the field oriented control; If the current state is a steady state, the previous state is a transient state, and the difference is less than zero, the target control algorithm of the motor is determined to be the field oriented control; If the current state is a steady state, the previous state is a transient state, and the difference is greater than or equal to zero, the target control algorithm of the motor is determined to be the model predictive control.
8. A switching control device for a motor control algorithm, characterized in that: include: A quadrature-axis current acquisition unit, used for acquiring the current quadrature-axis current of the motor; A current state output unit, configured to output a current state based on a difference between the current quadrature-axis current and a preset quadrature-axis current through a pre-trained prediction model; A control algorithm confirmation unit, configured to obtain a previous state of the prediction model output, and determine a target control algorithm for the motor according to the current state, the previous state, and the difference; A motor control unit is used to control the motor based on the target control algorithm.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the switching control method of the motor control algorithm according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to execute the switching control method of the motor control algorithm according to any one of claims 1 to 7.