1 BP Network Improvement The structure of BP neural network is shown as 1. BP neural network is a feedforward-free forward network. The neurons in the network are arranged in layers. In addition to the input layer and output layer, there is at least one hidden layer. The output of neurons in each layer is transmitted to the next layer. This transfer is achieved by the connection weight ω of the neural network to enhance, reduce, or suppress these outputs. The error back-propagation process in the BP network learning process is accomplished by minimizing an error function. The main application of the BP neural network error function is J = 1 2∑N k = 1(tk-ok)2. (1) Where: k is the sample number; tk is the expected output; ok is the network output. That is, the optimization problem of the traditional BP network by adjusting the connection weight ω is Δωjk(i +1)=-ηJωjk(i). (2) The optimization problem represented by equation (2) does not consider the magnitude of the estimated variables for each sample. Therefore, when the network terminates training, the optimization result is that the absolute error of each sample fit is small. However, under different accelerator opening degrees, the range of engine torque may be several tens of times worse. If neural network estimation is used, if equation (1) is still used as the error function, the final result of optimization may make every sample in the engine torque. The absolute error of the fitting is small, but relative to the case of a low throttle opening, that is, a sample with a small estimated engine torque variable, the relative error may be relatively large, resulting in uneven fitting. Therefore, the error function of the traditional BP network is changed to J = 1 2∑N k = 1 tk-oktk 2 . (3) In the network termination training, the optimization result is that the relative error of each sample fitting is small, so that each sample is better fitted. 2 Establishment of Engine Torque Estimation Model To predict the engine speed, the required network structure is multi-input-single-output. Therefore, this paper uses the BP network of this structure as an example. 2. 1 Generation of data samples In order to successfully train a neural network, generating a sample set of data is the first step. The data in this paper was measured on a DA465 engine test bench as shown in 2. The experimental data includes accelerator opening, engine speed, intake manifold pressure, intake air temperature, and corresponding output torque. Here, the accelerator opening α, which mainly affects the output torque of the engine, and the engine speed ne are used as the input of the network, and the corresponding optimal output torque T e is the desired output of the network. See original experimental data in 1. 1 Engine torque The experimental data is processed prior to neural network training. That is, the experimental data in 1 is normalized. For the input data, each component range is between 0 and 1. Because the BP network output layer used in this paper uses the S-type activation function, this function is characterized by the intermediate output part being more sensitive to changes in the input, and the output parts at both ends of the input The change response is relatively insensitive, for which it is considered that the output data is compressed within a range closer to the center point, so the output data range is processed between 0.1 and 0.9. The data of the normalized learning sample set is shown as 2. 2 normalized engine torque sample set 2.2 Establishment of neural network model For the BP neural network used, the number of layers of the network, the number of neurons in the hidden layer, the training precision, and the transfer function between the input layer and the hidden layer, the hidden layer and the output layer, and the like have to be selected. a) The number of network layers The greater the number of network network layers, the less reliable the back propagation error signal is near the input layer. A 3-layer BP network structure was selected. b) Number of neurons in the hidden layer When the number of layers is determined, too few neurons will cause discomfort in the network, and too many neurons will cause the network to adapt. This article chooses the hidden layer as five neurons. c) Training Accuracy If the curve is simply fitted, the accuracy is higher and the network learning effect is better. In addition, the torque estimation must be performed in the text. The training accuracy should not be set too high during the estimation, and the training accuracy The higher the degree is, the higher the curve fitting correlation is, but the data cannot be accurately estimated. If the accuracy is too low, the learning effect will be deteriorated, the correlation of the curve fitting will become lower, and the error of the data estimation will also become very large. This article chooses training accuracy of 0. 05. d) The transfer function determines the input layer and the hidden layer. The transfer function between the hidden layer and the output layer uses the unipolar Sigmoid function, ie y(x)=11 + e-x.(4) 2. 3 Application of optimal stopping method in training In general, the training and test errors in the neural network learning process are based on the test error of the test sample as a generalization error. With the reduction of training error, the generalization error gradually decreases at the beginning, but after reaching the minimum point, although the training error continues to decrease, the generalization error gradually increases and an overfitting phenomenon occurs. The key to the application of the optimal stopping method is to determine when the learning algorithm stops, ie, to obtain a minimum point of generalization error, thereby effectively avoiding the phenomenon of over-fitting. When the optimal stopping method is applied, the collected sample data sets are randomly divided into a training set, a verification set, and a test set before training. The test set is optional. The training set is used to train the neural network and the verification set is used to monitor the network training process. When training the network, network training and network verification are alternated. When the network begins to enter the overfitting, the verification error will gradually increase, the network training should be stopped in advance, and return the network parameters when the verification error takes the minimum value. According to reference [10], the neural network training steps using the optimal stopping method are as follows: Initial learning round k = l, maximum learning round k max, fitting accuracy E min, threshold m; Take S as the training sample to train the network in a round, obtain a set of connection weights and thresholds, and the corresponding E(k); Calculate the relative error square sum mean E yz(k) predicted by the model for the validation sample S yz under the current connection weights and thresholds; The following conditions are met: 1k = k max; 2E(k) ≤ E min. 3E yzmin The verification error increases temporarily due to oscillations in the training process, which can lead to premature termination of the network training. For this reason, the termination conditions of network training have been improved: When the verification error increases from small to large, the network training is not stopped immediately, but the observation is continued, and a threshold value m is set, if the verification error occurs continuously for m times When it becomes larger, it is considered that the network has experienced an overfitting phenomenon, thus stopping the training of the network. 3 experimental results and analysis Here, an improved BP neural network is used to establish an engine torque estimation model. The input is the two auxiliary variables of throttle opening and engine speed, and the output is the engine torque. The throttle opening is 10%, 20%, 40%, 60%, 80%, 90% as the test set ST of the network, and the other openings are randomly divided into the training sample S and the verification sample SYZ. The training process uses the most Excellent stopping method, the maximum number of training cycles is 1 000, the target error is 0. 05, the initial learning rate is 0.005, the learning rate growth coefficient is 10, the learning rate reduction coefficient is 0.2, and the threshold value is m = 20. According to the neural network structure determined in Section 2.2, the training sample S and the verification sample S YZ are used together to complete the neural network learning task. After the training is completed, the obtained connection rights and thresholds are saved, thereby completing off-line construction of the engine output torque model. In order to further explain the performance of the modeling algorithms introduced, the model M1 with improved error function and optimal stopping method for network training was established, and neither the improved error function nor the optimal stopping method was used for network training. The traditional BP network model M2. Among them, the network structures of M 1 and M 2 are the same, and the learning data are all the training samples S and the verification samples S YZ, and the test data are all ST. The termination condition of M1 training is that the number of rounds of the cycle reaches k =1 000 or the mean square of the fitting error is less than 0. 05.3 is the error variation curve in the training process of the modeling method used in this paper, and 4 is the training process in the traditional BP network. Error curve. From the comparison of 3 and 4, it can be seen that when M1 has a number of rounds of k = 51, the network terminates training because it satisfies the condition of the optimal stopping method. However, M2 stops the network training after the round number k = 243. Therefore, adopting an improved BP network can shorten the network training time and improve the efficiency of the network. 5 and 6 are the training results of the engine torque estimation using the improved BP network and the traditional BP network, respectively, which includes the comparison of the data after the network learning and the experimentally measured data in the test sample. From 5 and 6, we can see that after improving the error function, the relative error of the engine torque estimated by the BP network and the test sample data at different accelerator opening and engine speed is relatively small. However, the traditional BP network estimated torque has a relatively large error with the experimental sample data in the individual positions of the accelerator opening and the engine speed. Therefore, the improved BP network is better than the traditional BP network prediction effect. 7 and 8 are the error distributions of the engine torque estimation using the improved BP network and the traditional BP network respectively. From 8 and 9, it can be seen that the error of engine torque and sample data estimated by the improved BP network is within 6 Nm, and most of the errors are within 5% of the set training error. The traditional BP network predicted torque and sample data error reached a maximum of 9 Nm. Therefore, the improved BP network prediction accuracy is better than the traditional BP network. From the experimental results, we can see that by improving the error function, we can effectively avoid the inhomogeneous phenomenon while reducing the relative error; and we can train the network by introducing the optimal stop method. On the one hand, the training times of the network Significantly reduced, on the other hand, also improves the accuracy of the model's prediction. 4 Conclusion In this paper, an improved BP neural network is proposed. By improving the error function of the BP network and using the optimal stopping method to train the network, the overfitting phenomenon of the traditional BP network is overcome to some extent, and the network is improved. The efficiency and accuracy of the output data. Using this network, a model for estimating the engine output torque is established. The experimental results show that the engine output torque model based on the improved BP neural network can reduce the training load of the network and reduce the error of network training output data and sample data compared with the traditional BP network model, and improve the engine output. The accuracy of the torque estimate. Drone Battery,Drone Motor Battery,Drone Lipo Battery,Agriculture Drone Battery Dongying Tianqi Technology Co., Ltd. , https://www.uav5.com