PID self-tuning method, device and equipment based on improved wavelet neural network

By improving the wavelet neural network and optimization algorithm, the problem of slow convergence speed and easy falling into the minimum value of the BP neural network in the self-tuning of PID parameters is solved, the PID parameters are quickly adjusted, and the robustness and stability of the motor closed-loop control system are improved. efficiency.

CN114995106BActive Publication Date: 2024-08-27NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210617948.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-01
Publication Date
2024-08-27
Estimated Expiration
2042-06-01

AI Technical Summary

Technical Problem

In the existing technology, BP neural network has problems such as lack of unified theoretical guidance for network scale, slow convergence speed, and easy falling into minimum values ​​during PID parameter self-tuning.

Method used

Using the improved wavelet neural network, through POLYWOG3 function activation and transfer learning initialization, combined with the momentum gradient descent method and grid search to optimize the hyperparameters, the PID parameters can be quickly adjusted to achieve self-tuning of the PID control output.

Benefits of technology

It significantly improves the convergence speed of PID parameters, saves development and control time, enhances the robustness of the motor closed-loop control system, and improves work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114995106B
    Figure CN114995106B
Patent Text Reader

Abstract

The present application relates to a PID self-tuning method, device and equipment based on a wavelet neural network, the method comprising: obtaining a wavelet neural network and activating it using a POLYWOG3 function, establishing an improved wavelet neural network including an input layer, a hidden layer and an output layer; initializing the improved wavelet neural network based on a network weight initialization method of transfer learning, obtaining the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer; calculating the output of the input layer, the output of the hidden layer and the output layer in turn according to the improved wavelet neural network and the two initial weights; calculating the output of the PID control using a PID control algorithm according to the output of the output layer; when the output of the PID control meets a preset standard, using the output of the output layer as the proportional coefficient, integral coefficient and differential coefficient of the PID controller, and performing PID self-tuning on the motor. The use of this method can improve the network convergence speed and prevent the network from falling into a local optimum.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of motor control technology, and in particular to a PID self-tuning method, device and equipment based on an improved wavelet neural network. Background Art

[0002] In the control of motors, according to different application scenarios, people often need to control the motor to rotate to a certain angle quickly, stably and accurately. Proportional differential integral PID control is a relatively mature control method currently used in motor control. The classic PID closed-loop control algorithm performs closed-loop control on the controlled object, and obtains satisfactory results by adjusting the three PID parameters: proportional coefficient Kp, integral coefficient Ki and differential coefficient Kd. The adjustment of PID parameters mostly relies on expert experience, and when system parameter disturbances and external interference occur, the PID parameters need to be re-adjusted, which consumes a lot of resources. Therefore, a PID parameter self-tuning controller based on intelligent control strategy was born, among which the intelligent control strategy represented by neural network PID control has become a hot topic.

[0003] In the prior art, the BP neural network PID method based on reverse error propagation has the defects of no unified and complete theoretical guidance on network scale, slow convergence speed, and the network easily falling into the minimum value. Summary of the invention

[0004] Based on this, it is necessary to provide a PID self-tuning method, device and equipment based on an improved wavelet neural network to address the above technical problems, which can have strong generalization ability, approximation ability and fast convergence ability.

[0005] The PID self-tuning method based on improved wavelet neural network includes:

[0006] Acquire a wavelet neural network and activate it using the POLYWOG3 function to establish an improved wavelet neural network; the improved wavelet neural network includes: an input layer, a hidden layer and an output layer;

[0007] Initializing the improved wavelet neural network based on the network weight initialization method of transfer learning to obtain the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer; calculating the output of the input layer, the output of the hidden layer and the output layer in sequence according to the improved wavelet neural network, the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer; calculating the output of PID control using a PID control algorithm according to the output of the output layer;

[0008] When the output of the PID control meets the preset standard, the output of the output layer is used as the proportional coefficient, integral coefficient and differential coefficient of the PID controller to perform PID self-tuning on the motor.

[0009] In one embodiment, a network weight initialization method based on transfer learning is used to initialize the improved wavelet neural network to obtain the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer, including:

[0010] The improved wavelet neural network is randomly initialized by using a method of generating a standard normal distribution random number to obtain an initialized improved wavelet neural network;

[0011] Performing numerical simulation of tracking sinusoidal signals on the initialized improved wavelet neural network, and deriving a loss function of the initialized improved wavelet neural network;

[0012] When the loss function is less than 0.001, a network weight output function is called to output an initial weight between the input layer and the hidden layer and an initial weight between the hidden layer and the output layer.

[0013] In one embodiment, the improved wavelet neural network is initialized based on the network weight initialization method of transfer learning to obtain the initial weight between the input layer and the hidden layer and the initial weight between the hidden layer and the output layer, and further includes:

[0014] Based on the improved momentum gradient descent method, a coarse-grained search method is used to determine the initial range of the hyperparameter; according to the initial range, a fine-grained search method is used to determine the optimal value of the hyperparameter, and the initial weights between the hidden layer and the output layer and the initial weights between the input layer and the hidden layer are successively updated with the optimal values.

[0015] In one embodiment, according to the improved wavelet neural network, the initial weights between the input layer and the hidden layer, and the initial weights between the hidden layer and the output layer, sequentially calculating the output of the input layer, the output of the hidden layer, and the output of the output layer includes:

[0016] Obtaining a valued improved wavelet neural network according to the improved wavelet neural network, the initial weights between the input layer and the hidden layer, and the initial weights between the hidden layer and the output layer;

[0017] Sampling the target input and real-time output of the PID control system corresponding to the improved wavelet neural network after assignment, and calculating the error at the sampling time to obtain the network input of the improved wavelet neural network;

[0018] According to the network input, obtaining the input of the input layer;

[0019] The wavelet neural network algorithm is adopted to calculate the output of the input layer, the output of the hidden layer and the output layer in sequence according to the input of the input layer and the improved wavelet neural network.

[0020] In one embodiment, using a wavelet neural network algorithm, according to the input of the input layer and the improved wavelet neural network, sequentially calculating the output of the input layer, the output of the hidden layer, and the output of the output layer includes:

[0021] Obtaining the number of hidden layer nodes and the number of output layer nodes of the improved wavelet neural network, and obtaining a first weighting coefficient between the input layer and the hidden layer and a second weighting coefficient between the hidden layer and the output layer through transfer learning;

[0022] The input of the input layer of the improved wavelet neural network is the output of the input layer;

[0023] The wavelet neural network algorithm is used to calculate the input of the hidden layer according to the output of the input layer, the number of nodes in the hidden layer and the first weight coefficient; the output of the hidden layer after the input of the hidden layer is activated by the hidden layer activation function is the output of the hidden layer;

[0024] Calculating the input of the output layer according to the output of the hidden layer, the number of nodes in the output layer and the second weighting coefficient;

[0025] The output of the output layer after the input of the output layer is activated by the output layer activation function is the output of the output layer.

[0026] In one embodiment, when the output of the PID control does not meet the preset standard, the current iteration number is counted as 1;

[0027] The improved wavelet neural network is trained according to the output of the PID control, the number of iterations is updated to be the current number of iterations plus 1, and the first weight coefficient between the input layer and the hidden layer and the second weight coefficient between the hidden layer and the output layer are updated using the momentum gradient descent method under the hyperparameter optimization based on the improved grid search to obtain an adjusted first weight coefficient and an adjusted second weight coefficient;

[0028] The improved wavelet neural network is resampled, and according to the adjusted first weighting coefficient and the adjusted second weighting coefficient, the output of the input layer, the output of the hidden layer and the output layer are calculated in sequence, and the output of the PID control is calculated until the output of the PID control meets the preset standard.

[0029] In one embodiment, the momentum gradient descent method under the hyperparameter optimization based on the improved grid search is used to update the first weight coefficient between the input layer and the hidden layer and the second weight coefficient between the hidden layer and the output layer, and the adjusted first weight coefficient and the adjusted second weight coefficient are obtained, including:

[0030] A performance indicator function of the controlled object is obtained, and a momentum gradient descent method under hyperparameter optimization based on improved grid search is used to search and adjust the negative directions of the first weighting coefficient and the second weighting coefficient according to the performance indicator function, and the chain rule is used to obtain the adjusted first weighting coefficient and the adjusted second weighting coefficient.

[0031] In one embodiment, according to the output of the output layer, a PID control algorithm is used to calculate the output of the PID control, including:

[0032] The output of the output layer is used as a loop proportional coefficient, a loop integral coefficient and a loop differential coefficient to calculate the output increment of the PID control;

[0033] A PID control algorithm is used to calculate the output of the PID control according to the output increment of the PID control.

[0034] The PID self-tuning device based on improved wavelet neural network includes:

[0035] A network building module is used to obtain a wavelet neural network and activate it using the POLYWOG3 function to build an improved wavelet neural network; the improved wavelet neural network includes: an input layer, a hidden layer and an output layer;

[0036] A calculation module, used for initializing the improved wavelet neural network based on a network weight initialization method of transfer learning, obtaining an initial weight between the input layer and the hidden layer and an initial weight between the hidden layer and the output layer; calculating the output of the input layer, the output of the hidden layer and the output layer in sequence according to the improved wavelet neural network, the initial weight between the input layer and the hidden layer and the initial weight between the hidden layer and the output layer; and calculating the output of PID control using a PID control algorithm according to the output of the output layer;

[0037] The output module is used to perform PID self-tuning on the motor by using the output of the output layer as the proportional coefficient, integral coefficient and differential coefficient of the PID controller when the output of the PID control meets the preset standard.

[0038] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0039] Acquire a wavelet neural network and activate it using the POLYWOG3 function to establish an improved wavelet neural network; the improved wavelet neural network includes: an input layer, a hidden layer and an output layer;

[0040] Initializing the improved wavelet neural network based on the network weight initialization method of transfer learning to obtain the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer; calculating the output of the input layer, the output of the hidden layer and the output layer in sequence according to the improved wavelet neural network, the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer; calculating the output of PID control using a PID control algorithm according to the output of the output layer;

[0041] When the output of the PID control meets the preset standard, the output of the output layer is used as the proportional coefficient, integral coefficient and differential coefficient of the PID controller to perform PID self-tuning on the motor.

[0042] The above-mentioned PID self-tuning method, device and equipment based on improved wavelet neural network use POLYWOG 3 function to activate the middle layer of wavelet neural network, and use sigmoid function to activate the output layer of wavelet neural network to obtain improved wavelet neural network; use the network weight initialization method based on transfer learning to initialize the improved wavelet neural network based on POLYWOG3, calculate the output of input layer, hidden layer and output layer according to the initialized improved wavelet neural network, and calculate the output of PID control; through the self-iterative learning of improved wavelet neural network, adjust the proportional coefficient Kp, integral coefficient Ki and differential coefficient Kd of PID control, automatically approach the optimal solution of PID parameters, and perform online self-tuning on PID parameters. The accuracy of the closed-loop control algorithm in the present invention reaches the effect that the ordinary neural network with two hidden layers needs to iterate 200 times after 40epochs, which can make up for the deficiency of traditional BP neural network in adjusting PID parameters, significantly improve the speed of obtaining the optimal PID parameters, that is, the convergence speed, save development time and control time, improve the robustness of the motor closed-loop control system, save manpower, material and financial resources, and improve work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a flow chart of a PID self-tuning method based on an improved wavelet neural network in one embodiment;

[0044] Figure 2 A schematic diagram of the overall framework of a motor closed-loop control system in one embodiment;

[0045] Figure 3A schematic diagram of the structure of an improved wavelet neural network in one embodiment;

[0046] Figure 4 A schematic diagram of a PID algorithm in one embodiment;

[0047] Figure 5 A schematic diagram of the range of optimal values ​​of the hyperparameter learning rate based on improved grid search;

[0048] Figure 6 A schematic diagram of the range of optimal values ​​of the hyperparameter momentum factor based on the improved grid search;

[0049] Figure 7 is a schematic diagram of a simulation result in a specific embodiment;

[0050] Figure 8 is a schematic diagram of an error result in a specific embodiment;

[0051] Fig. 9 It is a curve output schematic diagram of a PID controller in a specific embodiment;

[0052] Fig.10 A schematic diagram of a curve of PID parameters in a specific embodiment;

[0053] Fig.11 is a schematic diagram of simulation results in another specific embodiment;

[0054] Fig.12 is a schematic diagram of an error result in another specific embodiment;

[0055] Fig.13 It is a curve output schematic diagram of a PID controller in another specific embodiment;

[0056] Fig.14 A schematic diagram of a curve of PID parameters in another specific embodiment;

[0057] Fig.15 It is a structural block diagram of a PID self-tuning device based on an improved wavelet neural network in one embodiment;

[0058] Fig.16 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0060] like Figure 1As shown, the present application provides a PID self-tuning method based on an improved wavelet neural network, which can be applied in Figure 2 The motor closed-loop overall control structure shown in FIG. The motor closed-loop overall structure includes an improved wavelet neural network module, an incremental PID controller module, and a control object module (motor). The improved wavelet neural network module is used to set the proportional coefficient, integral coefficient, and differential coefficient, which are used in the incremental PID algorithm to set the PID parameters. The incremental PID controller is used to output Δu(t), which is the output increment of the system, and u(t) is the actual output of the control object.

[0061] In one embodiment, a PID self-tuning method based on an improved wavelet neural network comprises the following steps:

[0062] Step 102, obtaining a wavelet neural network and activating it with a POLYWOG3 function to establish an improved wavelet neural network; the improved wavelet neural network includes: an input layer, a hidden layer and an output layer.

[0063] Specifically, a wavelet neural network is obtained, and the middle layer neurons of the wavelet neural network are activated based on the POLYWOG3 function to obtain the hidden layer of the improved wavelet neural network; and the improved wavelet neural network is established according to the input layer, output layer and hidden layer of the wavelet neural network.

[0064] POLYWOG3 function refers to Poly nominals Wind Owed with Gaussians function.

[0065] Step 104, based on the network weight initialization method of transfer learning, the improved wavelet neural network is initialized to obtain the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer; according to the improved wavelet neural network, the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer, the output of the input layer, the output of the hidden layer and the output layer are calculated in sequence; according to the output of the output layer, the PID control algorithm is used to calculate the output of the PID control.

[0066] Specifically, the improved wavelet neural network is randomly initialized by using a method for generating standard normal distribution random numbers, that is, the improved wavelet neural network is trained by using random numbers that conform to the standard normal distribution range between [-1,1] to obtain an initialized improved wavelet neural network; the initialized improved wavelet neural network is numerically simulated to track sinusoidal signals, and a loss function of the initialized improved wavelet neural network is derived; when the loss function is less than 0.001, the network weight output function is called to output the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer.

[0067] It should be noted that the network weight initialization method based on transfer learning refers to the entire process of initializing the improved wavelet neural network and obtaining the initial weights.

[0068] The network weight output function and calling the network weight output function to output weights are both existing technologies and will not be described in detail here.

[0069] Based on the improved momentum gradient descent method, a coarse-grained search method is used to determine the initial range of the hyperparameter; according to the initial range, a fine-grained search method is used to determine the optimal value of the hyperparameter, and the initial weights between the hidden layer and the output layer and the initial weights between the input layer and the hidden layer are successively updated with the optimal values.

[0070] It should be noted that the improved momentum gradient descent method refers to an improved grid search momentum gradient descent method that integrates the coarse-grained search method and the fine-grained search method.

[0071] According to the improved wavelet neural network, the initial weights between the input layer and the hidden layer, and the initial weights between the hidden layer and the output layer, an improved wavelet neural network after assignment is obtained; the target input and real-time output of the PID control system corresponding to the improved wavelet neural network after assignment are sampled, and the error at the sampling time is calculated to obtain the network input of the improved wavelet neural network; according to the network input (including: target input, real-time output and error at the sampling time), the input of the input layer is obtained; the number of hidden layer nodes and the number of output layer nodes of the improved wavelet neural network are obtained, and the input layer and the output layer are obtained through transfer learning. a first weighted coefficient between hidden layers and a second weighted coefficient between the hidden layer and the output layer; the input of the input layer of the improved wavelet neural network is the output of the input layer; the input of the hidden layer is calculated according to the output of the input layer, the number of nodes in the hidden layer and the first weighted coefficient by using a wavelet neural network algorithm; the output of the hidden layer after the input of the hidden layer is activated by a hidden layer activation function is the output of the hidden layer; the input of the output layer is calculated according to the output of the hidden layer, the number of nodes in the output layer and the second weighted coefficient; the output of the output layer after the input of the output layer is activated by an output layer activation function is the output of the output layer.

[0072] The output of the output layer is used as a loop proportional coefficient, a loop integral coefficient and a loop differential coefficient to calculate the output increment of the PID control; and the output of the PID control is calculated according to the output increment of the PID control using a PID control algorithm.

[0073] The PID control algorithm can adopt a position PID algorithm or an incremental PID algorithm.

[0074] Preferably, an incremental PID algorithm is used. The calculation of the incremental PID algorithm is only related to the error of three adjacent sampling times, which reduces the calculation complexity of the system; the output of the incremental PID is the increment of the control quantity, which reduces the impact on the stability of the system; the incremental PID algorithm is used in the motor closed-loop control system, which is simple to calculate and more robust.

[0075] Step 106, when the output of the PID control meets the preset standard, the output of the output layer is used as the proportional coefficient, integral coefficient and differential coefficient of the PID controller to perform PID self-tuning on the motor.

[0076] The output of the PID control meets the preset standard means: calculating the error between the output of the PID control and the target, and judging that the error meets the preset standard, and the preset standard may be mean square error MSE<0.001.

[0077] When establishing the improved wavelet neural network, the number of output layer nodes is set to 3. When the output of the PID control meets the preset standard, the output of the output layer has three values, which correspond to the proportional coefficient, integral coefficient and differential coefficient of the PID controller respectively.

[0078] When the output of the PID control does not meet the preset standard, the current number of iterations is counted as 1; the improved wavelet neural network is trained according to the output of the PID control, and the number of iterations is updated to be the current number of iterations plus 1; the performance index function of the controlled object is obtained, and the momentum gradient descent method under the hyperparameter optimization based on the improved grid search is used to perform back propagation calculation on the network, that is, the negative directions of the first weighting coefficient and the second weighting coefficient are searched and adjusted according to the performance index function, and the first weighting coefficient between the input layer and the hidden layer and the second weighting coefficient between the hidden layer and the output layer are updated by the chain rule to obtain the adjusted first weighting coefficient and the adjusted second weighting coefficient; the improved wavelet neural network is resampled, and according to the adjusted first weighting coefficient and the adjusted second weighting coefficient, the output of the input layer, the output of the hidden layer and the output layer are calculated in sequence, and the output of the PID control is calculated until the output of the PID control meets the preset standard.

[0079] That is to say, in this embodiment, when the improved wavelet neural network is used for PID parameter self-tuning, the improved wavelet neural network is first initialized with random weights that conform to the standard normal distribution, the network (here refers to the improved wavelet neural network) is trained, and a weight matrix with an evaluation index (mean absolute error) less than a certain threshold (0.001) is derived as the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer; then, based on the initial weights, the improved wavelet neural network after assignment is obtained; the PID control system corresponding to the improved wavelet neural network after assignment is sampled, the output of each layer of the network and the output of the PID control are calculated, the error between the output of the PID control and the target is determined, and the layers of the improved wavelet neural network (input layer, hidden layer, etc.) are adjusted by the error. The weights of the input layer and output layer are updated, and the weight matrix with the evaluation index (mean absolute error) less than a certain threshold (0.001) is derived as the new weight to train the improved wavelet neural network; the PID control system corresponding to the trained improved wavelet neural network is resampled, and the outputs of each layer of the network and the output of the PID control are recalculated, and the error between the output of the PID control and the target is re-judged until the error meets the preset standard, then the proportional coefficient, integral coefficient and differential coefficient are output, and the PID self-tuning of the motor is performed; during the training process, the improved grid search momentum gradient descent method is used to optimize the hyperparameter combination (two hyperparameters) in the momentum gradient descent method, and the optimal hyperparameters when performing PID parameter tuning are obtained, thereby accelerating the training process of the improved wavelet neural network.

[0080] In this embodiment, the wavelet basis function for constructing the improved wavelet neural network is the POLYWOG3 function. The wavelet transform in the improved wavelet neural network uses a filter with the same shape, different bandwidth and main frequency to filter the input signal, so that it has the ability to decay rapidly, adapt to new data more strongly and avoid large extrapolation errors. Therefore, it is more suitable for the PID parameter tuning method.

[0081] In addition, in the process of applying the improved wavelet neural network to PID parameter tuning, the initialization of the network weights, that is, the selection of the initial weights, did not adopt the random initialization method in the prior art, but adopted the transfer learning method, and exported the weight parameters learned by the network when processing task A, as the initial weights when processing task B. In combination with the needs of PID parameter tuning, the transfer learning method was improved, and the function tracing method was used to derive the initial weights, avoiding the risk of falling into the local optimum and increasing the network training time, reducing the difficulty of network training to a certain extent, jumping out of the local optimum can drop to the global optimum and reducing the network training time.

[0082] In addition, the wavelet neural network belongs to a feedforward neural network, and the updating process of its network weights is based on the reverse gradient propagation algorithm. In the reverse gradient propagation process, the network weights adjust the weight descent step size according to the learning rate, but for the adjustment of the learning rate, a learning rate is generally selected and kept unchanged throughout the training process. The method of training the network with a fixed learning rate is easy to miss the optimal value during the network training process and cause an oscillation state. In the process of updating the weights, this embodiment adopts an improved grid search momentum gradient descent method, adopts a method of adding a momentum term, and replaces the gradient at the current moment with the moving average of the gradient as the update direction of the parameters, thereby alleviating the oscillation problem in the gradient descent method. The moving average of the gradient is realized by multiplying the gradient increment of the previous moment by the momentum factor. The hyperparameters in the momentum gradient descent method are the learning rate and the momentum factor. Moreover, on the basis of the momentum gradient descent method, during the network training process, an improved grid search method is adopted to determine the values ​​of the two hyperparameters, learning rate and momentum factor. A coarse-grained search is performed first and then a fine-grained search is performed, which can accelerate the process of hyperparameter selection. It avoids the complexity of manual search methods and the problem that traditional grid search methods consume more computing resources and time resources when the search range is large, accelerates the network optimization process, and makes the improved wavelet neural network have the characteristics of fast convergence, strong generalization ability and strong approximation ability.

[0083] The above-mentioned PID self-tuning method, device and equipment based on improved wavelet neural network use POLYWOG 3 function to activate the middle layer of the wavelet neural network, and use sigmoid function to activate the output layer of the wavelet neural network to obtain an improved wavelet neural network; use the network weight initialization method based on transfer learning to initialize the improved wavelet neural network based on POLYWOG3, and use the momentum gradient optimization method to calculate the output of the input layer, hidden layer and output layer according to the initialized improved wavelet neural network, and calculate the output of PID control, wherein the hyperparameters in the momentum gradient optimization method are used to find the optimal hyperparameter combination through improved grid search; through the self-iterative learning of the improved wavelet neural network, the proportional coefficient Kp, integral coefficient Ki and differential coefficient Kd of the PID control are adjusted, the optimal solution of the PID parameters is automatically approached, and the PID parameters are self-tuned online. The accuracy of the closed-loop control algorithm in the present invention reaches the effect that an ordinary neural network with two hidden layers needs 200 iterations to achieve after 40 epochs, which can make up for the shortcomings of traditional BP neural network in adjusting PID parameters, significantly improves the speed of obtaining the optimal PID parameters, i.e., the convergence speed, saves development time and control time, improves the robustness of the motor closed-loop control system, saves manpower, material and financial resources, and improves work efficiency.

[0084] It should be understood that although Figure 1The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0085] In one embodiment, Figure 3 The structure of the improved wavelet neural network shown in FIG. 1 includes an input layer, a hidden layer and an output layer.

[0086] Among them, the activation function of the hidden layer is the POLYWOG3 function.

[0087] like Figure 4 As shown, the target input and real-time output of the PID control system are sampled to obtain the target input, the actual output of the control system, and the error at the sampling time is calculated:

[0088] error(k)=rin(k)-yout(k)

[0089] Where error(k) is the error at the sampling time, rin(k) is the target input, and yout(k) is the actual output of the system.

[0090] According to the target input rin(k), the actual output yout(k) and the error error(k) at the sampling time, the input of the input layer is obtained:

[0091] X j =[rin(k),yout(k),e(k),1]

[0092] Where, X j represents the input of the input layer, rin(k) represents the target position value set at time k, yout(k) represents the actual return value of the motor control system collected at that time, e(k) represents the difference between the target value and the actual value at time k, and the constant 1 is used to enhance the stability of the network;

[0093] Get the number of input layer nodes input_nodes of the improved wavelet neural network to be 4, the number of hidden layer nodes hidden_nodes to be 5, and the number of output layer nodes output_node to be 3;

[0094] The weights of each layer of the network are initialized using random numbers from a standard normal distribution. (i.e. the first weighting coefficient) and (i.e., the second weighting coefficient), where j represents the input layer node, i represents the hidden layer node, and l represents the output layer node. The optimization method in the reverse gradient propagation process selects the momentum gradient descent method, and its formula can be expressed as:

[0095]

[0096] The learning rate and momentum factor are hyperparameters, and the learning rate η is taken as 0.20 and the momentum factor α is taken as 0.05.

[0097] The input value rin(k) of the PID control system and the real-time output value yout(k) of the system are obtained by sampling, and the error error(k) is calculated:

[0098] rin(k)=sin(2πt)

[0099] error(k)=rin(k)-yout(k)

[0100] Derive the weights of the wavelet neural network when the mean square error (MSE) is less than 0.001 and save it as and Among them, the formulas of loss function E(k) and mean absolute error in wavelet neural network are as follows:

[0101]

[0102]

[0103] The improved grid search method is used to find the optimal combination of hyperparameters. First, a coarse-grained search is performed to obtain: learning rate η∈(0, 0.4), momentum factor α∈(0, 0.2); secondly, a fine-grained search is used to search for the optimal combination of learning rate and momentum factor, and the change step size Ns of the learning rate and momentum factor is 0.01.

[0104] Output the hyperparameter combination with the smallest mean absolute error (MAE) during 1500 iterations of the wavelet neural network;

[0105] Based on the above wavelet neural network structure, the network weights obtained by transfer learning and the above optimal hyperparameter combination, the process of PID parameter tuning is carried out on the improved wavelet neural network.

[0106] Using the wavelet neural network algorithm, according to the input of the input layer and the number of nodes in the input layer, the output of the input layer can be obtained:

[0107]

[0108] In the formula, is the output of the input layer, I is the input of the input layer, and m is the number of input neurons;

[0109] According to the output of the input layer, the number of nodes in the hidden layer and the first weight coefficient, the input of the hidden layer is calculated:

[0110]

[0111] In the formula, represents the input of the hidden layer, It represents the weight between the j node of the input layer and the i node of the hidden layer, i.e. the first weight coefficient. The superscripts 1, 2, and 3 represent the first layer of the network, i.e. the input layer, the second layer, i.e. the hidden layer, and the third layer, i.e. the output layer, respectively. k represents the current moment.

[0112] The output of the hidden layer after the input of the hidden layer is activated by the hidden layer activation function is the output of the hidden layer:

[0113]

[0114]

[0115] In the formula, is the output of the hidden layer, and activation_function is the activation function of the hidden layer, that is, the POLYWOG3 wavelet basis function.

[0116] The output of the hidden layer is used as the input of the output layer:

[0117]

[0118] In the formula, represents the input of the output layer, is the connection weight between the hidden layer i node and the output layer l node, that is, the second weighting coefficient.

[0119] The input of the output layer is calculated according to the number of nodes in the output layer and the second weighting coefficient; the output of the output layer after the input of the output layer is activated by the output layer activation function is the output of the output layer:

[0120]

[0121]

[0122]

[0123]

[0124]

[0125] In the formula, Represents the output of the output layer, and activation_function2() represents the activation function of the network output layer, which is the sigmoid function.

[0126] The output of the output layer is used as the loop proportional coefficient, loop integral coefficient and loop differential coefficient, and the output increment Δu(k) of the PID control is calculated according to the moment error error(k); the PID control algorithm is used to calculate the output of the PID control according to the output increment Δu(k) of the PID control:

[0127]

[0128] Where Δu(k) is the output increment of PID control, and u(k) is the output of PID control.

[0129] When the output of the PID control meets the preset standard, the output of the output layer is used as the proportional coefficient Kp, integral coefficient Ki and differential coefficient Kd of the PID controller to perform PID self-tuning on the motor.

[0130] When the output of PID control does not meet the preset standard, the current iteration number is counted as k=1; the improved wavelet neural network is trained according to the output of PID control, and the update iteration number is the current iteration number plus 1 to obtain the performance index function of the control object:

[0131]

[0132] Where E(k) is the performance index function of the controlled object, rin(k) is the target input value at time k, and yout(k) represents the actual output value at time k.

[0133] The first weighting coefficient and the second weighting coefficient of the improved wavelet neural network are modified by the gradient descent method, that is, the weighting coefficient ( and ) is searched and adjusted in the negative direction, and a momentum term is added to make the global convergence fast, that is,

[0134]

[0135] Where η is the selected learning rate learning_rate and α is the momentum factor.

[0136] Using the chain rule We can get:

[0137]

[0138]

[0139] because Unknown, use symbolic function The calculation error caused by this can be compensated by adjusting the learning rate η.

[0140] Combining the above formulas, we can get the following relationship:

[0141]

[0142] The calculation formula of the adjusted second weighting coefficient is as follows:

[0143]

[0144] activation_function2'=activation_function2*(1-activation_function2)

[0145] Among them, the output layer activation function is the sigmoid function, that is, activation_function2; activation_function2' represents the first-order derivative of the sigmoid function.

[0146] The calculation formula of the adjusted first weighting coefficient is as follows:

[0147]

[0148]

[0149] The activation function of the hidden layer of the wavelet neural network is POLYWOG3 function, namely activation_function, and activation_function' represents the first-order derivative of POLYWOG3.

[0150] The wavelet neural network is resampled, and according to the adjusted first weighting coefficient and the adjusted second weighting coefficient, the output of the input layer, the output of the hidden layer and the output layer are calculated in sequence, and the output of the PID control is calculated until the output of the PID control meets the preset standard.

[0151] like Figure 5 and Figure 6 As shown in the figure, the improved grid search and coarse-grained search method are used to determine the learning rate η and momentum factor α in the momentum gradient descent method. The large range of the optimal values ​​of the two hyperparameters is η∈[0,0.4], α∈[0,1]. From the results, it can be analyzed that the range of fine-grained search is η∈[0,0.35], α∈[0,0.2].

[0152] like Figures 7 to 10 As shown, in a specific embodiment, assuming that the input target value rin(k)=1.0, the number of input layer neurons (i.e., the number of input layer nodes) is 4, the number of hidden layer neurons (i.e., the number of hidden layer nodes) is 5, the number of output layer neurons (i.e., the number of output layer nodes) is 3, and the initial value of the weighting coefficient adopts the weight obtained based on transfer learning. At this time, the weights derived between the network layers are:

[0153] wi=[-0.7305-0.7305 0.0213-0.7104;

[0154] -0.2837 0.2520-0.7449-0.6741;

[0155] 0.3626 1.1929-0.5405 0.6550;

[0156] 0.4073-0.9621 1.2831 0.2714;

[0157] 1.7764-0.3547 0.1100-0.4806]

[0158] wo=[0.8159 0.3199 0.6403-0.0833 0.0776;

[0159] -0.0563 0.3532 0.8935 0.2788-0.5236;

[0160] 0.7784 0.5149 0.8255 0.5545-0.5367]

[0161] Based on the learning rate η = 0.32 and the inertia coefficient α = 0.13 obtained by the improved grid search, the random function of the motor is:

[0162]

[0163] Where u is the output of the PID controller.

[0164] The simulation results are as follows Figure 7 As shown in the figure, the vertical line represents the actual output of the controller yout, the horizontal line represents the target value rin, and the error curve is as follows Figure 8 As shown, the PID controller error output curve is as follows Fig. 9 As shown, the parameter output curves of the three parameters Kp, Ki, and Kd of the PID controller are as follows: Fig.10 shown.

[0165] like Figures 11 to 14As shown, in another specific embodiment, assuming that the input target value rin(k)=sin(2πt), the number of input layer neurons (i.e., the number of input layer nodes) is 4, the number of hidden layer neurons (i.e., the number of hidden layer nodes) is 5, the number of output layer neurons (i.e., the number of output layer nodes) is 3, the learning rate η=0.20, the inertia coefficient α=0.05, the initial value of the weighting coefficient adopts the weight obtained based on transfer learning, the learning rate η=0.32 based on the improved grid search, the inertia coefficient α=0.13, and the simulation model of the motor control system is:

[0166]

[0167] Where u is the output of the PID controller.

[0168] The simulation results are as follows Fig.11 As shown in the figure, the actual controller output yout fits the target value rin well, and the error curve is as follows: Fig.12 As shown, the PID controller output curve is as follows Fig.13 As shown, the parameter output curves of the three parameters Kp, Ki, and Kd of the PID controller are as follows: Fig.14 shown.

[0169] In one embodiment, Fig.15 As shown, a PID self-tuning device based on an improved wavelet neural network is provided, comprising: a network building module 1502, a calculation module 1504 and an output module 1506, wherein:

[0170] The network building module 1502 is used to obtain the wavelet neural network and use the POLYWOG3 function to activate it to build an improved wavelet neural network; the improved wavelet neural network includes: an input layer, a hidden layer and an output layer;

[0171] The calculation module 1504 is used to initialize the improved wavelet neural network based on the network weight initialization method of transfer learning, and obtain the initial weight between the input layer and the hidden layer and the initial weight between the hidden layer and the output layer; according to the improved wavelet neural network, the initial weight between the input layer and the hidden layer, and the initial weight between the hidden layer and the output layer, the output of the input layer, the output of the hidden layer, and the output of the output layer are calculated in sequence; according to the output of the output layer, the output of PID control is calculated using a PID control algorithm;

[0172] The output module 1506 is used to perform PID self-tuning on the motor using the output of the output layer as the proportional coefficient, integral coefficient and differential coefficient of the PID controller when the output of the PID control meets the preset standard.

[0173] In one embodiment, the calculation module 1504 is also used to initialize the improved wavelet neural network based on the network weight initialization method of transfer learning to obtain the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer, including: randomly initializing the improved wavelet neural network using a method of generating standard normally distributed random numbers to obtain an initialized improved wavelet neural network; performing numerical simulation of tracking sinusoidal signals on the initialized improved wavelet neural network to derive a loss function of the initialized improved wavelet neural network; when the loss function is less than 0.001, calling the network weight output function to output the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer.

[0174] In one embodiment, the computing module 1504 is also used to initialize the improved wavelet neural network based on the network weight initialization method of transfer learning, obtain the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer, and also includes: based on the improved momentum gradient descent method, using a coarse-grained search method to determine the initial range of the hyperparameter; based on the initial range, using a fine-grained search method to determine the optimal value of the hyperparameter, and using the optimal value to update the initial weights between the hidden layer and the output layer and the initial weights between the input layer and the hidden layer.

[0175] In one embodiment, the calculation module 1504 is also used to calculate the output of the input layer, the output of the hidden layer and the output layer in sequence according to the improved wavelet neural network, the initial weights between the input layer and the hidden layer, and the initial weights between the hidden layer and the output layer, including: obtaining the improved wavelet neural network after assignment according to the improved wavelet neural network, the initial weights between the input layer and the hidden layer, and the initial weights between the hidden layer and the output layer; sampling the target input and real-time output of the PID control system corresponding to the improved wavelet neural network after assignment, and calculating the error at the sampling time to obtain the network input of the improved wavelet neural network; obtaining the input of the input layer according to the network input; using the wavelet neural network algorithm, according to the input of the input layer and the improved wavelet neural network, sequentially calculating the output of the input layer, the output of the hidden layer and the output layer.

[0176] In one embodiment, the calculation module 1504 is also used to use a wavelet neural network algorithm to calculate the output of the input layer, the output of the hidden layer and the output layer in sequence according to the input of the input layer and the improved wavelet neural network, including: obtaining the number of hidden layer nodes and the number of output layer nodes of the improved wavelet neural network, and obtaining the first weighting coefficient between the input layer and the hidden layer and the second weighting coefficient between the hidden layer and the output layer through transfer learning; the input of the input layer of the improved wavelet neural network is the output of the input layer; using the wavelet neural network algorithm, according to the output of the input layer, the number of hidden layer nodes and the first weighting coefficient, the input of the hidden layer is calculated; the output of the hidden layer after the input is activated by the hidden layer activation function is the output of the hidden layer; the input of the output layer is calculated according to the output of the hidden layer, the number of output layer nodes and the second weighting coefficient; the output of the output layer after the input is activated by the output layer activation function is the output of the output layer.

[0177] In one embodiment, the output module 1506 is also used to count the current iteration number as 1 when the output of the PID control does not meet the preset standard; train the improved wavelet neural network according to the output of the PID control, update the iteration number to be the current iteration number plus 1, and use the momentum gradient descent method under the hyperparameter optimization based on the improved grid search to update the first weighted coefficient between the input layer and the hidden layer and the second weighted coefficient between the hidden layer and the output layer to obtain the adjusted first weighted coefficient and the adjusted second weighted coefficient; re-sample the improved wavelet neural network, and calculate the output of the input layer, the output of the hidden layer and the output layer in turn according to the adjusted first weighted coefficient and the adjusted second weighted coefficient, and calculate the output of the PID control until the output of the PID control meets the preset standard.

[0178] In one embodiment, the output module 1506 is also used to adopt the momentum gradient descent method under the hyperparameter optimization based on the improved grid search to update the first weight coefficient between the input layer and the hidden layer and the second weight coefficient between the hidden layer and the output layer, and obtain the adjusted first weight coefficient and the adjusted second weight coefficient, including: obtaining the performance index function of the controlled object, adopting the momentum gradient descent method under the hyperparameter optimization based on the improved grid search, searching and adjusting the negative direction of the first weight coefficient and the second weight coefficient according to the performance index function, and adopting the chain rule to obtain the adjusted first weight coefficient and the adjusted second weight coefficient.

[0179] In one embodiment, the calculation module 1504 is also used to use a PID control algorithm based on the output of the output layer to calculate the output of the PID control, including: using the output of the output layer as a loop proportional coefficient, a loop integral coefficient and a loop differential coefficient to calculate the output increment of the PID control; using the PID control algorithm to calculate the output of the PID control based on the output increment of the PID control.

[0180] The specific definition of the PID self-tuning device based on the improved wavelet neural network can be found in the above definition of the PID self-tuning method based on the improved wavelet neural network, which will not be repeated here. Each module in the above device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0181] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.16 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a PID self-tuning method based on an improved wavelet neural network is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse. The computer device can be a simulation device, the input device inputs relevant information to the simulation device, the processor executes the program in the memory to perform combined simulation, and the display screen displays relevant simulation results.

[0182] Those skilled in the art will understand that Fig.16 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0183] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.

[0184] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0185] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. PID self-tuning method based on improved wavelet neural network, It is characterized in that include: Obtain the wavelet neural network and activate it using the POLYWOG3 function to establish an improved wavelet neural network; The improved wavelet neural network comprises: an input layer, a hidden layer and an output layer; Initializing the improved wavelet neural network based on the network weight initialization method of transfer learning to obtain the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer; calculating the output of the input layer, the output of the hidden layer and the output layer in sequence according to the improved wavelet neural network, the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer; calculating the output of PID control using a PID control algorithm according to the output of the output layer; When the output of the PID control meets the preset standard, the output of the output layer is used as the proportional coefficient, integral coefficient and differential coefficient of the PID controller to perform PID self-tuning on the motor; The network weight initialization method based on transfer learning is used to initialize the improved wavelet neural network to obtain the initial weight between the input layer and the hidden layer and the initial weight between the hidden layer and the output layer, including: The improved wavelet neural network is randomly initialized by using a method of generating a standard normal distribution random number to obtain an initialized improved wavelet neural network; Performing numerical simulation of tracking sinusoidal signals on the initialized improved wavelet neural network, and deriving a loss function of the initialized improved wavelet neural network; When the loss function is less than 0.001, calling a network weight output function to output an initial weight between the input layer and the hidden layer and an initial weight between the hidden layer and the output layer; The network weight initialization method based on transfer learning is used to initialize the improved wavelet neural network to obtain the initial weight between the input layer and the hidden layer and the initial weight between the hidden layer and the output layer, and further includes: Based on the improved momentum gradient descent method, a coarse-grained search method is used to determine the initial range of the hyperparameter; according to the initial range, a fine-grained search method is used to determine the optimal value of the hyperparameter, and the initial weights between the hidden layer and the output layer and the initial weights between the input layer and the hidden layer are successively updated with the optimal values; According to the improved wavelet neural network, the initial weights between the input layer and the hidden layer, and the initial weights between the hidden layer and the output layer, sequentially calculating the output of the input layer, the output of the hidden layer, and the output of the output layer includes: Obtaining a valued improved wavelet neural network according to the improved wavelet neural network, the initial weights between the input layer and the hidden layer, and the initial weights between the hidden layer and the output layer; Sampling the target input and real-time output of the PID control system corresponding to the improved wavelet neural network after assignment, and calculating the error at the sampling time to obtain the network input of the improved wavelet neural network; According to the network input, obtaining the input of the input layer; Using a wavelet neural network algorithm, according to the input of the input layer and the improved wavelet neural network, the output of the input layer, the output of the hidden layer and the output of the output layer are calculated in sequence; Using a wavelet neural network algorithm, according to the input of the input layer and the improved wavelet neural network, sequentially calculating the output of the input layer, the output of the hidden layer, and the output of the output layer includes: Obtaining the number of hidden layer nodes and the number of output layer nodes of the improved wavelet neural network, and obtaining a first weighting coefficient between the input layer and the hidden layer and a second weighting coefficient between the hidden layer and the output layer through transfer learning; The input of the input layer of the improved wavelet neural network is the output of the input layer; The wavelet neural network algorithm is used to calculate the input of the hidden layer according to the output of the input layer, the number of nodes in the hidden layer and the first weight coefficient; the output of the hidden layer after the input of the hidden layer is activated by the hidden layer activation function is the output of the hidden layer; Calculating the input of the output layer according to the output of the hidden layer, the number of nodes in the output layer and the second weighting coefficient; The output of the output layer after the input of the output layer is activated by the output layer activation function is the output of the output layer.

2. The method according to claim 1, It is characterized in that When the output of the PID control does not meet the preset standard, the current iteration number is counted as 1; The improved wavelet neural network is trained according to the output of the PID control, the number of iterations is updated to be the current number of iterations plus 1, and the first weight coefficient between the input layer and the hidden layer and the second weight coefficient between the hidden layer and the output layer are updated using the momentum gradient descent method under the hyperparameter optimization based on the improved grid search to obtain the adjusted first weight coefficient and the adjusted second weight coefficient; The improved wavelet neural network is resampled, and according to the adjusted first weighting coefficient and the adjusted second weighting coefficient, the output of the input layer, the output of the hidden layer and the output layer are calculated in sequence, and the output of the PID control is calculated until the output of the PID control meets the preset standard.

3. The method according to claim 2, It is characterized in that Adopting the momentum gradient descent method under the hyperparameter optimization based on the improved grid search, updating the first weight coefficient between the input layer and the hidden layer and the second weight coefficient between the hidden layer and the output layer, and obtaining the adjusted first weight coefficient and the adjusted second weight coefficient includes: A performance indicator function of the controlled object is obtained, and a momentum gradient descent method under hyperparameter optimization based on improved grid search is used to search and adjust the negative directions of the first weighting coefficient and the second weighting coefficient according to the performance indicator function, and the chain rule is used to obtain the adjusted first weighting coefficient and the adjusted second weighting coefficient.

4. The method according to any one of claims 1 to 3, It is characterized in that According to the output of the output layer, a PID control algorithm is used to calculate the output of the PID control including: The output of the output layer is used as a loop proportional coefficient, a loop integral coefficient and a loop differential coefficient to calculate the output increment of the PID control; A PID control algorithm is used to calculate the output of the PID control according to the output increment of the PID control.

5. PID self-tuning device based on improved wavelet neural network, It is characterized in that include: The network building module is used to obtain the wavelet neural network and use the POLYWOG3 function to activate it to build an improved wavelet neural network; The improved wavelet neural network comprises: an input layer, a hidden layer and an output layer; The calculation module is used for initializing the improved wavelet neural network based on the network weight initialization method of transfer learning, and obtaining the initial weight between the input layer and the hidden layer and the initial weight between the hidden layer and the output layer; according to the improved wavelet neural network, the initial weight between the input layer and the hidden layer and the initial weight between the hidden layer and the output layer, the output of the input layer, the output of the hidden layer and the output layer are calculated in sequence; according to the output of the output layer, the output of PID control is calculated by using the PID control algorithm; the improved wavelet neural network is initialized based on the network weight initialization method of transfer learning, and the initial weight between the input layer and the hidden layer and the initial weight between the hidden layer and the output layer are obtained, including: using a method of generating standard normal distribution random numbers to randomly initialize the improved wavelet neural network to obtain an initialized improved wavelet neural network; performing numerical simulation of tracking sinusoidal signals on the initialized improved wavelet neural network to derive the loss function of the initialized improved wavelet neural network; when the loss function is less than 0.001, calling the network weight output function to output the initial weight between the input layer and the hidden layer and the initial weight between the hidden layer and the output layer; initializing the improved wavelet neural network based on the network weight initialization method of transfer learning to obtain the initial weight between the input layer and the hidden layer and the initial weight between the hidden layer and the output layer, further comprising: based on the improved momentum gradient descent method, using a coarse-grained search method to determine the initial range of the hyperparameter; according to the initial range, using a fine-grained search method to determine the optimal value of the hyperparameter, and using the optimal value to successively search the hyperparameters between the hidden layer and the output layer. The initial weights and the initial weights between the input layer and the hidden layer are updated; the output of the input layer, the output of the hidden layer and the output layer are calculated in sequence according to the improved wavelet neural network, the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer, including: obtaining an assigned improved wavelet neural network according to the improved wavelet neural network, the initial weights between the input layer and the hidden layer and the initial weights between the hidden layer and the output layer; sampling the target input and real-time output of the PID control system corresponding to the assigned improved wavelet neural network, and calculating the sampling time The error at the moment is used to obtain the network input of the improved wavelet neural network; according to the network input, the input of the input layer is obtained; according to the input of the input layer and the improved wavelet neural network, the output of the input layer, the output of the hidden layer and the output layer are calculated in sequence using the wavelet neural network algorithm; according to the input of the input layer and the improved wavelet neural network, the output of the input layer, the output of the hidden layer and the output layer are calculated in sequence using the wavelet neural network algorithm, which includes: obtaining the number of hidden layer nodes and the number of output layer nodes of the improved wavelet neural network, and obtaining the number of hidden layer nodes of the input layer and the output layer through transfer learning. The first weighting coefficient between the hidden layers and the second weighting coefficient between the hidden layer and the output layer; the input of the input layer of the improved wavelet neural network is the output of the input layer; the wavelet neural network algorithm is used to calculate the input of the hidden layer according to the output of the input layer, the number of nodes in the hidden layer and the first weighting coefficient; the output of the hidden layer after the input of the hidden layer is activated by the hidden layer activation function is the output of the hidden layer; the input of the output layer is calculated according to the output of the hidden layer, the number of nodes in the output layer and the second weighting coefficient; the output of the output layer after the input of the output layer is activated by the output layer activation function is the output of the output layer;. The output module is used to perform PID self-tuning on the motor by using the output of the output layer as the proportional coefficient, integral coefficient and differential coefficient of the PID controller when the output of the PID control meets the preset standard.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Time series prediction and intelligent control combined online parameter adjustment method and system

    CN102902203A

  • Improved PSO-BP neural network-based brushless DC motor control method

    CN108365784A