#### Abstract

In view of the problems of complex deviation sources in gear machining and low accuracy of empirical prediction, in order to improve the detection accuracy and the operation speed of gears after machining, the failure sign algorithm of the firefly neural network (FSAFNN) is applied to the prediction of the deviation range of gear autonomous machining, and a gear tooth direction detection method is designed based on this method. The failure sign algorithm of the firefly neural network is constructed. Taking the tooth profile deviation in the gear machining process as the research target, a prediction model of the gear autonomous machining deviation is constructed, which can be used to effectively obtain the different invalid modes of the gear profile machining. The firefly neural network is quantitatively analyzed to obtain the main reasons for the tooth profile machining deviation. The firefly neural network algorithm can be used to take advantage of its advantages in metal and reflective object prediction. The final research results show that the method used in this paper can meet the requirements of high-precision and nondestructive detection of gears in industrial design, realize the division of gear accuracy levels, which can be used in the field of high-precision detection of other metal reflective objects, and is practical in the prediction of the deviation range of gear autonomous machining.

#### 1. Introduction

Gears are extremely important components of mechanical transmission systems and are widely used in machine tool processing, automobile manufacturing, construction machinery, and aerospace [1]. Because different industries have different requirements for the accuracy range of gears, the accuracy of the processed gears is detected in many different usage scenarios. The detection of gear accuracy is always a technical problem in the industrial field, and the corresponding accuracy detection items also include tooth profile, tooth direction, and circumferential joints [2, 3]. For different types of gear autonomous machining deviation range risks, due to the defects in the system security of the computer operation process, there is a huge security risk in the security, confidentiality, integrity, and detection mechanism of the entire computer operating system or data use and sharing process. Therefore, it is very important to design a prediction and protection system for the deviation range of gear autonomous machining. By developing and designing a security protection system that is consistent with current computer and multi-Internet network technologies, the security performance associated with the computer system can be better improved, and the integrity, confidentiality, and availability of the data in the system and the data application process can be ensured for better use. At present, the self-processing efficiency and accuracy of gears developed in the Chinese market are low. Aiming at the above problems, the processing data model of the firefly neural network data structure is constructed according to the failure symptom rule of the firefly neural network for the gear autonomous processing model. The data model can search adjacent columns to obtain the firefly neural network information of the autonomous processing model and use the depth-first traversal method of the slice model to establish the failure symptom function of the firefly neural network. Aiming at the “point cut” problem of the model column in the failure symptom of the firefly neural network, a high-performance computing method of machining accuracy based on the failure symptom algorithm of the firefly neural network is proposed [4, 5]. This algorithm performs automatic processing of gears through high-performance computing of failure symptoms of the firefly neural network. After obtaining the failure symptoms of the firefly neural network, according to the intersection points obtained by sorting, the automatic generation of the cross-sectional profile corresponding to the autonomous processing model is performed in OpenGL software. The first firefly neural network failure symptom data generated by the cutting of each contour ring can determine the profile direction of the model section.

In order to ensure the accuracy of the data and meet the requirements of high-precision gear nondestructive testing, the application of the firefly swarm neural network algorithm has the advantages of good straightness and anti-interference. In the gear distance measurement used here, the main method for measuring the accuracy of the gear orientation is as follows: combined with the neural network ranging method based on firefly swarm optimization, the accurate prediction of the tooth orientation is achieved by accurately positioning the rotary table and the parallel moving platform. Mainly combined with the firebug neural network ranging method, through the correct positioning movement of the rotary table and the parallel moving table, the accurate prediction of the direction of the gear teeth is realized.

#### 2. Methods

##### 2.1. Failure Sign Algorithm of the Firefly Neural Network

The failure sign algorithm of the firefly neural network can be used to effectively predict the deviation of the gear machining process. Select the best gear fitness for sorting, and use the input value of the variables in the algorithm to predict each link of the machining error. The error prediction step size selected in this paper is mainly determined by a Gaussian linear function, and then, the optimal fitness value corresponding to the ith machining process of the gear can complete the linear mapping between the minimum and maximum dependencies and is expressed as follows:

From the expression, the corresponding membership function of the ith gear tooth can be known. According to the formula, the membership degree corresponding to the gear tooth with the best fitness value can be obtained.where represents the prediction step size of in the jth dimension prediction range that can be used by the ith gear tooth. It can be expressed using a Gaussian membership function as

According to the above expression, it can be known that zbest represents the global optimum prediction zest. represents a randomly selected value in the interval [1, 6]. *H*(*t*) represents the function that changes constantly under the weighting function of the tth iteration, and meanwhile, it satisfies the maximum number of iterations and the number of real-time iterations that can be obtained at maxgen = 100.

###### 2.1.1. Determination of the Global Prediction Direction

During the process of determining the global prediction direction, it is necessary to combine the optimal and overall optimal conditions of the gear teeth to clarify the comparison between the predicted direction and the current gear teeth:

In the above expression, represents the optimum position determined after *t* iterations of the ith tooth, represents the previous optimum position of the ith tooth, represents the optimum location determined under the global prediction, represents the determined fitness value obtained at the position, and represents the fitness value obtained at the position. The direction determined according to the prediction can be based on the current optimum position and the optimum position obtained when the gear teeth pass through *t* iterations [7, 8].

This paper mainly determines the direction of gear machining according to the corresponding weighted values in different directions. It can be expressed as

In the formula, *W* is the inertia weight value and Φ1 and *φ*2 are constants whose value range is constant and uniformly distributed in [0, 1]. *T* is the current number of repetitions, and the value range is an integer between [2, maxgen], is the weighted maximum value and is the weighted minimum value.

###### 2.1.2. Location Update

After calculating the direction and step size of the gear tooth exploration, the position of the gear tooth needs to be updated. The updated formula is as follows:

*Definition 1. *Given , there exists an n-dimensional weight vector related to F, , and , so thatwhere is the ith largest factor of the array . Then, F is called as the analysis of the failure symptom algorithm of the n-dimensional firefly neural network.

The firefly’s gear teeth are binary encoded, and the update of the gear tooth position is moving instead of formula (4). Redefine the displacement of firefly in the kth dimension.Among them, *c* is the learning factor and *r* is a random number within [0, 1].

In order to make the value of displacement to be used to represent the probability that the binary bit takes 1, a Gaussian variogram is introduced. In order to express the probability that the binary bit obtains 1, the Gaussian variogram is imported, and in the displacement value [0, 1], the Gaussian variation function isAmong them, the probability that the firefly’s tooth passes through is 1 for moving.Its own value is modified, and rand () is a random value in [0, 1]. According to rand (), the value of is determined after comparing . Reference [9] specifies the maximum displacement value to limit the range of . Usually, the value range of is [−7, 7], and the probability of 0 or 1 for the limit binary bit of the displacement is controlled within [0.0028, 0.9865]. Figure 1.

The main steps of the failure symptoms of the firefly neural network are as follows [10, 11]:(1)Initialize the cluster size, the maximum times of iterations, the spatial dimension, the minimum and maximum dependencies, and the minimum and maximum weights, initialize the cluster gear teeth, and calculate the adaptability of each gear.(2)Find the gear teeth with the best fitness, find out the global best, usually the best gear tooth fitness value and the global best fitness value, and the most important thing in this step is the design of the adaptive function. In this experiment, the error obtained by the ensemble neural network training group is taken as the fitness value.(3)Iterative optimization: first, the parameters of the empirical gradient direction, prediction step size, direction, and Gaussian function are initialized. Then, the iteration cycle is entered, and the end of the cycle depends on the two-layer cycle of the maximum number of iterations and the size of the cluster. The empirical gradient calculation is determined based on the formula. Update the position according to the calculation steps and direction calculation formula } (l0), and click “Update the best value and best fitness value of teeth” to update the global best value and fitness value. Repeat the loop until the end condition is met, and output the global best fitness value(4)The optimal network weight value and threshold can be obtained. Train optimal weights and thresholds for a random initial value specifying a range of gear automachining deviations(5)Ensemble neural network training: initialize the network parameters, create a neural network, call the trainingdm algorithm to train the network, use the ensemble neural network for simulation prediction, calculate the error, and analyze the results [6]. Figure 1 shows the flowchart of the failure symptoms of the firefly neural network

##### 2.2. Prediction Process of the Deviation Range of Gear Autonomous Machining

During gear measurement, by properly adjusting the distance between objects and the intensity of the light source, as shown in Figure 2, a clearer image of the gear can be obtained. After the image is collected and transmitted, some noise is usually generated, which has a great impact on the subsequent processing results. Therefore, the acquired gear image is preprocessed to remove noise. The image generally has Gaussian noise, but the Gaussian filter can be used to remove the Gaussian noise appropriately. Therefore, the 5 × 5 Gaussian filter processes the image to ensure that the noise is filtered while the image edge information is effectively preserved.

The prediction system uses the displacement sensor of the firefly neural network as the main prediction tool, making the vibration accuracy in the force direction 0.12. The displacement sensors of the neural network of the two fireflies are, respectively, fixed with a universal rotating bracket and installed on the platform of the electronically controlled lifting platform [12, 13]. The positional relationship between the displacement sensor and gear of the firefly neural network is predicted, and the mathematical model is completed. Through the software system, the parameters of the table are set, and the action command is issued. The computer receives the command, issues the drive control command, and drives the servo motor control system. The gear center is the benchmark for processing gears and the basis for calculating the total deviation of gear teeth, which directly affects the measurement accuracy of gear parameters. Therefore, it is particularly important to determine the center position of the gear before establishing the mathematical model of the total deviation of the gear. In order to achieve the high-precision fit of the gear center, the index pad that meets the precision requirements is machined, and a plurality of circular holes are machined on the disc with the same diameter direction. The process of determining the center position of the gear through the calibration plate is shown in Figure 3.

In order to obtain the high precision of the gear machining process, the method adopted is based on the principle of diffuse reflection, and the displacement sensor of the KEYNCEI-065 model is selected. The thread of the sensor is ±0.99%, the error accuracy can reach 2.6 *μ*m, the reference distance is 76 mm, and ranging wavelength of the sensor is 686 nm. The distance test principle used is shown in Figure 4. According to the constructed firefly neural network, the beam processed by the gear can be corrected. Using the focusing lens to adjust the focus, it can be perpendicular to the surface of the object to be tested to realize the continuous movement of the incident object or to ensure that the incident light point collected by the test moves according to the incident optical axis according to its surface change. The sensor ranging process obtains scattered light from the incident light point by using the receiving lens, which can be imaged on the photoelectric receiving sensitivity surface. If the position of the test target surface is changed, the displacement *d* of the acquired image will also change.

Before the prediction, the system predicts the gear, and the prediction accuracy, the linearity of the jig, and the concentricity of the jig and the rotary table have a great impact on the prediction result [9, 14].

In Figure 5, La is the displacement sensor of the firefly neural network and *G* is the grinding cylinder. PQ is the distance from the sensor to the top circle of the gear, and NQ is the distance from the sensor to the bottom circle of the gear. Let , , , , , , and . It can be obtained with the diagram

From formula (12), formula (13) can be obtained:

It can be seen from the above formula that

From the triangle relation, we know

It is found that the position of the sensor does not change during the detection process. Therefore, the relationship between the distance *d* of any position detected by the sensor and the fractal circle radius *r* of the gear can be derived by the cosine law:

The purpose of making this mathematical model is to find the circumference of the gear. Because the pitch circle has no definite geometric position on the gear, the bifurcation circle can only be found according to the relative positional relationship between the bottom circle, the top circle, and the sensor of the gear. Therefore, the above calculation method can be obtained. As experimentally demonstrated, the method can be used to easily find the circumference of the gear and predicts well. After the spatial position prediction of the system is completed, the prediction of the tooth orientation of the gear begins.

#### 3. Analysis of Experiment and Results

Taking the standard installation gear pair in Table 1 as an example, the rated torque of the bull wheel is 250Nm. *K*1 = *K*2 = 0. Table 2 shows prediction curve optimization parameters of the high-order transmission error and the tooth profile autonomous machining deviation range. 6 is the result of TCA, LCA, and 5-axis linkage CNC gear paste simulation.(1)The theoretical overlap value of the gear pair used in this experiment is 2.19. According to the simulation steps of the algorithm, 1/9 of the gear meshing period is selected, and the number of contact points in this process is set to 22, so the obtained overlap value is 2.18, which is close to the theoretically predicted value. The bottom of the gear enters, which can quickly make the top of the gear teeth fall off, causing a large transmission error during the use of the gear. The tooth top of the gear bottom has an autonomous machining deviation range, which can effectively avoid the contact of the gear edge [15]. The tooth profile adopts a tangential connection at the transition point, the *t* tooth profile corresponding to the 3rd and 21st contact points is −27”, and the tooth profile corresponding to the 9th contact point is −5.”(2)In order to complete the prediction results of the gear machining deviation of the algorithm in this paper, using the helix angle and horizontal displacement corresponding to the rack cutter, there is a huge movement change at the gear end. The main change is that the input end and the output end of the gear are beyond the tolerance range of the automatic processing of the gear.(3)The motion and grinding wheel shape curve is used for the automatic machining deviation range of the gear, in which the value of 0 or 1 is used to represent the change. Prediction results of grinding errors of each axis of the machine tool.

It can be seen from Figure 6 that the total error of the left tooth surface is , and the total error of the right tooth surface is . It can be analyzed that the deviation of the helix of the gear is 29 *μ*m, and the theoretical accuracy of the gear is grade 9 [16]. The accuracy is grade 10, and the difference between the actual measurement result and the helical line deviation measured by the global prediction system is 30 *μ*m, with the difference of 2 *μ*m.

Figure 7 shows the comparison chart of the algorithm experimental results of PSO optimization, GA optimization, and the algorithm in this paper. The difference between the actual and predicted values of each optimization algorithm is evident from the graph.

According to the experimental test results in Figure 7, it in this paper, the neural network algorithm is used to calculate the predicted and measured values of gear machining errors. Compared with the PSO optimization algorithm and the GA optimization algorithm, the prediction error of this algorithm is smaller. In addition, although the error between the first predicted value and the actual value of the gear obtained by using the failure sign algorithm of the firefly neural network is relatively large, the error of the subsequent predicted value is gradually stable, which is close to the actual measured value, and the fluctuation of the obtained curve is relatively small. It can be seen that the data measured by this algorithm are more accurate and stable than those measured by the other two algorithms.

Table 3 shows the absolute errors between the 10 tested and true values obtained by three different optimization algorithms. The accuracy of the FSAFNN algorithm in Table 2 is higher.

Table 4 calculates the mean square errors of the three algorithms, respectively. For the macroinformation starting from Table 4, the mean square error of the predicted and actual values obtained with FSAFNN is the smallest. This also shows that the FSAFNN algorithm has higher accuracy and constant advantage.

#### 4. Conclusions

Since the deviation of gears in the machining process will seriously affect the service life of the machine, this paper builds a tooth profile deviation prediction model for gear hobbing by using the failure sign algorithm of the firefly neural network. The proposed method mainly uses the firefly neural network to correct the errors in gear tooth profile processing in time, which can enable the operator to correct the problems found and can provide the processing operator with a reference basis for correction. The gear data collected in this paper are mainly based on the accurate values obtained in the actual production process, which can effectively reduce the influence of human subjective factors on the evaluation results of gear processing, effectively solve the detection problem in gear processing, and accomplish the purpose of gear grading after rapid machining. The experimental analysis results show that compared with the traditional algorithm, the failure sign algorithm of the firefly neural network proposed in this paper can reduce the systematic deviation and the random error caused by the prediction accuracy in the process of high-precision prediction so as to realize the nondamage deviation prediction of the gear surface. This algorithm has many advantages, such as fast prediction speed, high efficiency, and strong anti-interference ability.

#### Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Acknowledgments

This research study was sponsored by the Science and Technology Project of Jiangxi Provincial Education Department. The project number is GJJ181106. The authors acknowledge the support.