An Initial Alignment Technology of Shearer Inertial Navigation Positioning Based on a Fruit Fly-Optimized Kalman Filter Algorithm

The shearer is one of the core equipment of the fully mechanized coal face. The fast and accurate positioning of the shearer is the prerequisite for its memory cutting, intelligent height adjustment, and intelligent speed adjustment. Inertial navigation technology has many advantages such as strong autonomy, good concealment, and high reliability. The accurate positioning of the shearer based on inertial navigation can not only determine its operating position but also measure the direction of movement. However, when inertial navigation is used to locate the shearer in motion, the cumulative errors will occur, resulting in inaccurate positioning of the shearer. The accuracy of the initial alignment is directly related to the working precision of the inertial navigation system. In order to improve the efficiency and accuracy of initial alignment, an improved initial alignment method is proposed in this paper, which uses a fruit fly-optimized Kalman filter algorithm for initial alignment. In order to improve the filtering performance, the fruit fly-optimized Kalman filter algorithm uses an improved fruit fly algorithm to realize the adaptive optimization of system noise variance. Finally, simulation and experiments verify the effectiveness of the fruit fly-optimized Kalman filter algorithm.


Introduction
Coal is the main energy in China. With the development of the mining industry, coal mine accidents occur frequently, and coal mining technology tends to be unmanned and intelligent.
e application of inertial navigation on the shearer has become one of the important mining technologies for unmanned and intelligent coal mining [1,2], which is used for the rapid and effective autonomous positioning of the shearer. Due to the error accumulation problem in inertial navigation, the initial error should be minimized before the navigation calculation. e accuracy of the initial alignment is directly related to the working precision of the inertial navigation system. erefore, the rapid and accurate initial alignment becomes a research hotspot [3][4][5]. For an inertial navigation system, the initial alignment is to determine an initial value such as an attitude matrix at the initial moment. In the initial alignment, using the output information of the inertial component, the appropriate filtering method is selected for initial alignment. en, the misalignment angle between the calculated navigation coordinate system and the real navigation coordinate system is estimated to correct the attitude matrix, so that the calculated coordinate system and the real coordinate system are obtained as close as possible [6,7]. Kalman filtering (KF) has a good application for linear system filtering, but Kalman filter (KF) cannot filter nonlinear systems. For the nonlinear systems, the Extended Kalman Filter (EKF) and the Unscented Kalman Filter (UKF) were invented, and their principle is to convert nonlinear systems into linear systems for filtering [8,9]. e Extended Kalman Filter (EKF) approximates the nonlinear model to a linear model by Taylor expansion while the Unscented Kalman Filter (UKF) approximates the nonlinear model to a linear model through Unscented Transformation (UT); such methods can solve nonlinear model filtering, but they introduce a large amount of computation [10][11][12].
In recent years, intelligent algorithms have been widely used in the field of artificial intelligence and deep learning, and the more classical ones are genetic algorithms (GA) [13], particle swarm optimization (PSO), and so on [14]. e fruit fly optimization algorithm (FOA) is an intelligent algorithm that seeks global optimization based on fruit fly foraging behavior. e fruit fly itself is superior to other species in sensory perception, especially in the sense of smell and vision, and the olfactory organs can find all kinds of scents floating in the air and even smell food sources 40 kilometers away. en, after flying near the food location, it can use its sensitive vision to find food and the location where the companions gather and fly in that direction [15,16]. Compared with other classical intelligent algorithms, the fruit fly optimization algorithm (FOA) has been applied to various fields because of its simple structure, fast convergence speed, and high convergence precision, and it attracted the interest of a large number of researchers. Since the search path of the fruit fly optimization algorithm (FOA) has difficulty in meeting the requirements of practical engineering requirements, many scholars have improved the search path of the fruit fly optimization algorithm (FOA) [17,18]. e search path of fruit fly optimization algorithm (FOA) is subject to uniform distribution, for the difficulty of meeting the practical engineering application. Literature 19 proposes several improved fruit fly optimization paths and uses improved fruit fly optimization algorithm to optimize the dual-tree complex wavelet algorithm (DTCWT) for denoising in practical engineering applications and achieved reliable results [19]. In the literature 20, Gaussian distribution replaces the original uniform distribution path in fruit fly optimization algorithm (FOA), and it is used to optimize wavelet decomposition (WT) and empirical mode decomposition (EMD) to denoise the cutting sound of the shearer and then improve the recognition accuracy of the shearer cutting state [20]. Since the selection of the system noise variance Q parameter of Kalman filter (KF) has a significant influence on the filtering effect [21], the selection of the Q is a major difficulty for scholars to study; most of them now use experience to choose Q, but, in practical engineering applications, it is difficult to find a suitable empirical value. In this paper, an improved fruit fly optimization algorithm is used to find the appropriate Q value of Kalman filter (KF) and then the improved Kalman filter is used to optimize the initial alignment of the shearer positioning. e rest of the paper is organized as follows. Section 2 is the basic theory. In Section 3, the initial alignment method based on the fruit fly-optimized Kalman filter algorithm is presented. e simulation test and physical experiment are described in Section 4, and the conclusions are drawn in Section 5.

Kalman Filter.
With the development of mathematical theory and technology, many filtering ideas and methods suitable for inertial navigation have emerged, and the classic algorithm is Kalman filter (KF). In the early 1960s, Kalman and Bucy proposed this linear filtering method, which combines the concepts of recursive ideas and state variables. KF can estimate the state quantity of the system according to the observation measurement that can be observed in the system and continuously correct the state value and use the system state equation and observation equation to calculate and recurse the parameters. Since the mean square error obtained by estimating the state quantity is less than or equal to the other estimated mean square error, the KF method is also called the optimal estimation method.
Assume that the state equation and the observation equation of the system are as follows: where X(k) represents the state vector at system k, A represents the state transition matrix of the system from k − 1 to k, and W(k − 1) represents the process noise of the system. Z(k) represents the observation vector at the time of system k and V(k) represents the observed noise. Γ represents the noise drive matrix of the system and H represents the observation matrix. Generally, it is assumed that W(k − 1) and V(k) are mutually independent white noises, and their covariances are Q K and R K , respectively, and the correlation covariance of the two is 0. e recursive process of the estimated value X(k | k) of the state value X(k) at time k is as follows.
e predicted equation of the state variables is e updated equation for estimating the state variables is e expression matrix of the filter gain is e matrix equation for predicting covariance is e updated equation of the covariance matrix is All the above equations are the recursive process of the Kalman filter. Only X0 and P0 need to be known, and the optimal estimation value of the state quantity at time k can be derived from the observation at the corresponding time.

2
Computational Intelligence and Neuroscience

Fruit Fly Optimization Algorithm.
e fruit fly optimization algorithm is a bionic algorithm based on the foraging behavior of fruit fly, and the basic flow of the original fruit fly optimization algorithm can be divided into the following steps: Step 1. Initialization algorithm parameters: population size, sizepop; maximum number of iterations, maxgen; initial position range, LR; and random flight distance, FR; and equation (7) is the initial position calculation of the fruit fly: Step 2. e random direction and distance of the fruit fly searching for food are given, and the random search direction and distance are as shown in the following equation: Step 3. Since the position of the food cannot be known, the distance from the origin of the coordinate (Disti) is estimated in advance, and, then, the reciprocal is used as the taste concentration determination value (Si). e calculation formulas of the two are as shown in the following equation: Step 4. e taste concentration determination value (S(i)) is substituted into the taste concentration determination function; the taste concentration (smell(i)) of the individual position of the fruit fly is obtained; the minimum concentration value is found; and then they are saved and recorded, as shown in the following equation: where bestsmell is the minimum taste concentration, bestindex is the corresponding fruit fly individual, and Smell is the set of taste concentration in this group.
Step 5. e latest taste concentration will be compared with the best taste concentration obtained before; if the latest taste concentration is better than the previous generation, the latest fruit fly position and taste concentration will be updated, as in the following equation: Otherwise, Step 2 to Step 4 will be repeated until a better taste density value is found.
Step 6. When the taste density value reaches the preset precision value or the run reaches the maximum number of iterations, the loop ends; otherwise, Step 2 to Step 5 will be repeated.

Model of Navigation.
e shearer inertial navigation positioning is to fix the inertial sensor (gyroscope and accelerometer) on the shearer and obtain the angular velocity and acceleration information of the shearer separately after the calculation of the navigation computer, the attitude, speed, and position of the shearer in the navigation coordinate system are obtained. e positional parameters in strap-down inertial navigation system are determined by mutual conversion between different coordinate systems, and several coordinate systems need to be defined, and the required coordinate systems are shown in Figure 1. e inertial coordinate system (i-system) is the measurement reference of the inertial sensor and the origin at the center of the Earth; the coordinate axis has no rotation with respect to the star; the axial direction is defined as x i , y i , and z i ; and the z i is consistent with the direction of the polar axis of the Earth. Earth coordinate system (e-system) is fixed to the Earth and the origin also at the center of the Earth. Similarly, each axis is defined as x e , y e , and z e , and the z e direction is consistent with the direction of the polar axis of the Earth and x e along the intersection of the Greenwich meridian and the equatorial plane. e e system rotates at an angular velocity ω ie with respect to the i system about z e , and ω ie is the Earth's rotational speed. e navigation coordinate system (n-system), also known as the local geographic coordinate system, is located at the position where the navigation system is located, and this paper is set at the end of the working face at the start position of the shearer. e coordinate axes point in the direction of the east (x n ), the true north (y n ), and the sky (z n ) direction (the direction of the local vertical line). e calculated navigation coordinate system (t-system) is calculated by calculation, and there is a platform error with the real navigation coordinate system (n-system). e carrier coordinate system (b-system), which can be called the shearer coordinate system, is fixed with the shearer, and the origin is located at the center of gravity of the shearer. As shown in Figure 1(b), it is an orthogonal coordinate system, and the z b points are vertically up, the x b along the direction of advancing, and the y b points to the direction of running. e angle of rotation about the x-axis is called the roll angle, which is recorded as θ; the angle of rotation about the y-axis is called the pitch angle, which is recorded as c; and the angle of rotation about the z-axis is called the yaw angle, which is recorded as φ. e attitude angle of the shearer is represented by the transformation relationship between the shearer coordinate system and the navigation coordinate system.
When the shearer is performing inertial navigation, the navigation parameters are obtained through the mathematical relationships, and the calculation errors of mathematical relationships have a close relationship with the Computational Intelligence and Neuroscience system accuracy. erefore, the correct navigation equations need to be established.
Consider the shearer as a rigid body and set the shearer position vector to r. e inertial navigation system has many mechanical arrangement methods and because the shearer runs along the surface of the Earth, this paper selects the arrangement of the navigation coordinate system. e following are the derivation process of the navigation equations based on this arrangement. According to the Coriolis equation, the inertial velocity can be expressed in terms of the Earth's velocity, as shown in the following equation: w ie is the angular velocity of the Earth's rotation. Let(dr/dt)| e � v e ; when equation (12) is derived, in the following equation can be obtained: Combining equations (12) and (13) and taking the angular velocity of the Earth's rotation as a constant, the expression can be obtained, as shown in in the following equation: It is known that the specific force f is the vector sum of the inertial force and the gravitational force, that is, Setting it in equation (14), the following equation can be obtained: In equation (15), ω ie × v e is the Coriolis acceleration and ω ie × [ω ie × r] is the centripetal acceleration, which cannot be separated from the gravitational acceleration g caused by mass gravity. e sum of the acceleration caused by mass gravitation and centripetal force constitutes the local gravity vector; therefore, g − ω ie × [ω ie × r] can be regarded as the local gravity vector, which is represented by g 1 . e available expression is as shown in the following equation: In the mechanical arrangement of the navigation coordinate system, Earth velocity is expressed as v n e , and its rate of change relative to the n-system can be expressed by the rate of change under the i-system, as shown in the following equation: In equation (17), ω ie is the angular velocity of the Earth's rotation and ω en is the rotational angular velocity of the nsystem relative to the e-system. Combining equation (16), equation (17) can be expressed as a form in the navigation coordinate system, as shown in the following equation: Equation (18) is the basic equation of the coal mining machine inertial navigation system. f n is the specific acceleration in the navigation system, and its component form v n e is the projection of the speed of the shearer relative to the Earth in the n-system and the coordinate axes are along the east, north, and local vertical lines.
. ω n ie is the angular velocity of the Earth's rotation in the n-system, which can be expressed as ω n ie � 0 ω ie cos L − ω ie sin L T , and L is the latitude where the n system is located. ω n en is the projection of the angular velocity of the n-system relative to the e-system in the n-system, which can also be the rotational angular velocity of the n-series relative to the e-system, and it can be expressed as the rate of change of longitude and Since the working environment of the shearer is a fully mechanized face, the deviation between the local gravity vector and the vertical can be ignore, so, g 1 can be expressed as g 1 � 0 0 g 1 T . Combining the above conditions and the algorithm of vector cross multiplication, the scalar representation of equation (19) can be obtained: e rate of change of longitude l can be expressed by _ l � (v E /[(R 0 + h)cos L]) and the rate of change of latitude L can be expressed by _ L � (v N /(R 0 + h)). R 0 is the average radius of the Earth and h is the altitude at which the navigation coordinate system is located. In addition, there is a relationship: f n � C n b f b , where C n b is the direction cosine matrix, also known as the attitude matrix, which can be used to convert the measured value of the specific force into the navigation coordinate system, and f b is the measured value of the triaxial accelerometer. en, equation (20) can also be expressed as

Improved Fruit Fly Optimization
Algorithm. Due to the simple structure and fast convergence of the fruit fly optimization algorithm, it is widely used in engineering scheduling, neural network parameter optimization, pattern recognition, signal denoising, and so forth. However, after deep research, domestic and foreign scholars found that the algorithm is easy to fall into local optimum, and its population diversity is less, lacking a mutation mechanism. e original fruit fly optimization algorithm has two drawbacks: (1) From equation (8), the position of each fruit fly is a random step size at the optimal position of the current population during the generation of the next generation of individual flies. is method only depends on the optimal position of the current population and has nothing to do with its own position, which greatly reduces the diversity of the population and is easy to fall into local optimum.
(2) In the process of producing the next generation of fruit fly individuals, the search range of the fruit fly is determined by the random flight distance FR. Choosing a larger random step size FR has a better ability to jump out of the local optimum, but it is easy to cause the search to be too slow. Choosing a smaller FR has a faster convergence rate, but it is easy to fall into the local optimum, so the original FR is difficult to meet the actual requirements.
In response to the above shortcomings, two improvements to the fruit fly optimization algorithm are presented in this paper: (1) Fruit flies are divided into two parts. When the next generation group is generated, if the optimal value is not updated for more than two generations, the current optimal position of the fruit fly is accepted, and, otherwise, the current position of the fruit fly itself is accepted. (2) New search path is taken. When the optimal value is not updated for more than two generations, Student's t-distribution is used instead of the uniform distribution as the search step. at is, the original rand (FR) is replaced by trnd (FR) and the number of iterations of the algorithm is used as the degree of freedom of the student's t-distribution. On the contrary, according to the characteristic that the frequency is inversely proportional to the wavelength, the frequency variable f is introduced and the difference between the current position and the optimal position is multiplied by the frequency variable f as the search step. Student's t-distribution is shown in Figure 2.
In the first improvement, this improved scheme divides the fruit fly population into two parts, adopting different starting positions, increasing the diversity of fruit flies, and helping the algorithm to jump out of local optimum.
Computational Intelligence and Neuroscience 5 In the second improvement, for path 1, as shown in Figure 2, when the degree of freedom of Student's t-distribution is larger, the distribution is closer to the Gaussian distribution. In this paper, the number of iterations is taken as its degree of freedom; as the number of iterations increases, the previous step size of the search path is larger, and the later step size is smaller. And it has a faster search speed and the ability to jump out of local optimum. For path 2, the fruit fly itself moves in the direction of the optimal value by f times the linear distance, so the search speed is faster. According to the inverse of the frequency and the wavelength, the frequency variable f is used to control the distance of the flight. f constantly changes to meet the open flight distance, which has a good effect on the algorithm jumping out of local optimum. e basic process of the improved fruit fly optimization algorithm can be divided into the following steps: Step 1. Initialization algorithm parameters: population size, sizepop; maximum number of iterations, maxgen; initial position range, LR; random flight distance, FR; dimension, d; frequency variables, fmin and fmax; number of iterations, g; and so on. Equation (7) is the initial position calculation of the fruit fly and obtains the optimal value of the current population by Step 2-Step 4 in Section 2.2.
Step 2. When more than two generations do not update the optimal value, the current population optimal position is taken as the starting point, Student's t-distribution is used instead of the uniform distribution as the search step, and the degree of freedom is selected as the number of iterations, as shown in the following equation: Otherwise, the position of the fruit fly itself is taken as the starting point, and the search process is as shown in in the following equation: Step 3. e distance from the origin of the coordinate (Disti) and the taste density judgment value (S(i)) are estimated, and the calculation process of the two is as shown in equation (9).
Step 4. e taste concentration determination value (Si) is substituted into the taste concentration determination function to obtain the taste concentration (smell(i)) of the individual position of the fruit fly; find the minimum concentration value, then, save it, and record its position. e process is as shown in equation (10).
Step 5. e latest taste concentration will be compared to the best taste concentration obtained before. If the latest taste concentration is better than the previous generation, the latest fruit fly position and taste concentration will be updated as shown in equation (11). Otherwise, Step 2 to Step 4 are repeated until a better taste density value is found.
Step 6. When the taste density value reaches the preset precision value or reaches the maximum number of iterations, the loop ends; otherwise, Step 2 to Step 5 are repeated.

Initial Alignment Based on a Fruit Fly-Optimized Kalman
Filter Algorithm. When using strap-down inertial navigation to locate the shearer, in order to reduce the influence of interference signal and error, it is necessary to study the filtering method, especially the initial alignment. e effective filtering method can not only reduce the operation speed but also improve the system alignment accuracy. Based on the analysis of the advantages and disadvantages of common filtering algorithms, a fruit fly-optimized Kalman filter algorithm is proposed to improve the initial alignment accuracy of the inertial navigation system. In order to improve the filtering performance, the fruit fly-optimized Kalman filter algorithm uses an improved fruit fly algorithm to realize the adaptive optimization of system noise variance, and, then, it is used to conduct initial alignment. e initial alignment is divided into coarse alignment and fine alignment.

Coarse Alignment.
In the coarse alignment, the attitude matrix C n b is directly estimated by the measurable quantities such as the gravity vector and the Earth angular velocity vector. Given the local longitude l and latitude L, the components of the gravity acceleration g and the Earth rotation speed ω ie in the navigation system can be determined. Setting a new vector r � g × w ie , according to the transformation matrix C n b between the navigation system and the carrier system, the following expression can be obtained:  Computational Intelligence and Neuroscience ere exists en, the following equation can be obtained: e coarse alignment of C n b can be carried out by the abovementioned equation.

Fine Alignment.
e coarse alignment results in the transformation matrix between the carrier coordinate system and the calculated navigation coordinate system. Because there are instrument errors in both gyroscopes and accelerometers, the direct calculation results cannot meet the alignment accuracy required by the project. erefore, after the initial alignment, the precise alignment is required. e fine alignment is based on the coarse alignment, and the platform error angle [ϕ×] is accurately estimated; then, obtain the accurate initial attitude matrix C n b . From the literature [22][23][24], the error model can be obtained. e attitude error equation is where ϕ � ϕ E ϕ U ϕ N T , ω n in is the angular velocity of the n series relative to the i-system projected under the n-system, δω n in is the calculated error vector of ω n in , and δω n ib indicates that the gyro output error in the navigation coordinate system is gyro drift ε w . e velocity error equation is where' ∼ 'means the calculated value, the angular velocity of the n series relative to the i series is projected under the n series, ω n ie and ω n en are obtained in Section 2.3, δω n ie is the calculated error vector of ω n ie , δω n en is the calculated error vector of ω n en , and δg n 1 is the calculated error vector of g n 1 : where C t n means the transformation matrix for the navigation coordinate system and calculated coordinate system, and it can be expressed as [ϕ×] is an antisymmetric matrix of vectors ϕ E ϕ N ϕ U ; ϕ E , ϕ N , and ϕ U represent the angle error of east, north, and sky, respectively. ε a is the zero offset of output error of the accelerometer. e position error equation is where R M and R N are the Earth's radii of the meridian circle and the prime vertical circle, L and l are the longitude and latitude, and v E and v N are the east and north velocity with their velocity errors δv E and δv N , respectively. Because the initial alignment time is short, the gyro drift and acceleration bias can be considered as random constants. e model of the inertial device can be written as where ε w � ε wE ε wN ε wU and ε a � ε aE ε aN ε aU . Since the shearer's speed is basically unchanged during actual operation, the system error equation of the inertial navigation of the shearer can be obtained from equation (31): where the X is error vector and W is inertial device error vector, and their expressions are as follows: (33) In this paper, two horizontal velocity errors are selected as the observed measurement; they are δv E and δv N . en, the observation equation of the system is In the above equation, H � I 2 0 2×8 and V is the system observation noise. In order to conveniently and efficiently use the optimized KF algorithm for recursive calculation, equations (32) and (34) are discretized, and the expression is as shown in the following equation: In the above equation, X k is the state vector of the system, Z k is the observation sequence, W k is the process noise sequence, V k is the observed noise sequence, Ο k,k− 1 is the state transition matrix, Γ k− 1 is the noise input matrix, and Η k is the observation matrix.
e fitness function of the algorithm is selected as Computational Intelligence and Neuroscience where x P is the predicted value, x t is the true value, the fitness is the fitness function, and E[ * ] is the mean value. e basic flow of the improved Kalman filter algorithm can be divided into the following steps: Step 1. Initialization algorithm parameters: population size, sizepop; maximum number of iterations, maxgen; initial position range, LR; random flight distance, FR; dimension, d; frequency variables, fmin and fmax; number of iterations, g; and so on. Equation (7) is the initial position calculation of the fruit fly and obtains the optimal value of the current population by Step 2 to Step 4 in Section 2.2.
Step 2. e optimal value is not updated for more than two generations, and equation (21) is searched by optimization; otherwise, equation (22) is used.
Step 3. e distance from the origin of the coordinate (Disti) and the taste concentration determination value (S(i)) are estimated, and the calculation process of the two is as shown in equation (9).
Step 4. For Kalman filter alignment, the state equation and observation equations are (32) and (34), respectively, and the discretization equation is (35). e taste concentration judgment value is taken as the system noise variance of the Kalman filter algorithm, and the Kalman (S(i)) update process is as follows: and the mean state error and the estimated state variable are calculated as the fitness evaluation standard, and the minimum concentration value is found and saved, and its position is recorded. e process is as shown in the following equation: � min(Smell(i)).

(38)
Among them, bestsmell is the minimum taste concentration, bestindex is the corresponding fruit fly individual, and Smell is the concentration set in this group.
Step 5. e latest taste concentration will be compared to the best taste concentration obtained before. If the latest taste concentration is better than the previous generation, the latest fruit fly position and taste concentration will be updated as shown in equation (11), and the optimal noise variance will be updated as the following equation: Otherwise, Step 2 to Step 4 are repeated until a better taste density value is found.
Step 6. When the taste density value reaches the preset precision value or reaches the maximum number of iterations, the loop ends; otherwise, Step 2 to Step 5 are repeated.
e flow chart of the improved algorithm is shown in Figure 3.
e pseudocode for the improved Kalman filter algorithm is shown in Algorithm 1.

Simulation.
e simulation processing software of this article is MATLAB2014; the hardware configuration is processor Intel Xeon E5506 (2.13 GHz), memory 8G, graphics card NVIDIA Tesla C1060, and hard disk capacity 240G, and software environment is Windows7 (x64).

Simulation of Improved Fruit Fly Optimization Algorithm.
is paper selected the original fruit fly optimization algorithm FOA [15] and replaced the original fruit fly step with the Gaussian distribution algorithm GFOA [20], the particle swarm algorithm PSO [14], and the improved fruit fly optimization algorithm IFOA for comparison.
In this simulation, some parameters set for the FOA and GFOA are the same. Some key parameters are given: maximum iteration is 100, population size is 20, and location range is [− 1.0, 1.0]. In the IFOA algorithm, the frequency variables fmin and fmax are 0 and 2, respectively, the other parameters are the same as FOA and GFOA.
In the PSO, maximum iteration is 100, population size is 20, two acceleration coefficients are 1.49, inertia weight factor is 0.65, population range is [− 5, 5], and velocity range is [− 1, 1]. is paper selects the following six test functions to verify the effectiveness of the algorithm. e optimal value of the Ackley function is 0, the optimal value of the Griewank function is 0, the optimal value of the Zettl function is − 0.003791, and the optimal value of the Testtubeholder function is − 10.8723. e optimal value of the Helicalvalley function is 0, and the optimal value of the Wood function is 0. Comparison of the optimization process of the four algorithms is in Figure 4.

Computational Intelligence and Neuroscience
Optimal values of different algorithms are given in Table 1; it can be seen from the above table that the IFOA algorithm proposed in this paper can be the closest to the optimal value of the test function. From Figure 4, the declining curve of the IFOA algorithm proposed in this paper is faster than others, which proves that the IFOA algorithm takes the shortest time to reach the optimal value, and the search process is the fastest.   Table 2.
Kalman (S(i)) % Obtain smell concentration Smell(i) � MSE (Kalman (S(i))) End % Obtain the best individual concentration Sbest, X ⟵ min(Smell(i)) % Obtain the optimal system noise covariance Q ⟵ Sbest End ALGORITHM 1: Initial alignment based on a fruit fly-optimized Kalman filter. 10 Computational Intelligence and Neuroscience  Figure 5 is the errors of angles, the best overall is the algorithm IFOA-KF proposed in this article, the best of the remaining three is the GFOA-KF algorithm, followed by the FOA-KF algorithm, and the worst is the PSO-KF algorithm. e errors are shown in Table 3.

Simulation Results and Analysis.
As can be seen from Table 3, the algorithm proposed in this paper has the smallest error in the three angles of pitch, roll, and yaw. From the average error point of view, the smallest algorithm is the algorithm proposed in this paper, only 0.000029257. From the analysis of alignment accuracy, it is 45.71% higher than the PSO-KF algorithm, 24.82% higher than the FOA-KF algorithm, and 15.98% higher than the GFOA-KF algorithm. It can be seen that the best algorithm is the algorithm proposed in this paper. e above analysis can conclude that the fruit fly-optimized Kalman filter algorithm is superior to several other algorithms.
ere are two reasons for the above phenomenon: (1) e original Kalman filter has a good estimation speed and accuracy for the pitch and the roll angle, but the estimation accuracy and speed of yaw angle are poor, which is determined by the nature of the error. e filtering of ε wU value is relatively difficult in a short time; this is because it takes the longest time to reflect the velocity observation. When it has a large deviation, the initial error will be continuously amplified after several integrations, resulting in a relatively short estimation speed and accuracy of the yaw angle. (2) e optimized Kalman algorithm uses the intelligent algorithm to adaptively optimize the Kalman Q value and judges the appropriate Q value based on the variance of the true value and the predicted value. is method improves the filtering accuracy of the Kalman algorithm. e proposed algorithm has made two improvements in the original fruit fly optimization algorithm, which enhances the diversity and the ability to jump out of the local optimum, and improves the search speed.

Experimental.
In order to further verify the research results, an initial alignment experiment was conducted in this paper, and the experimental local parameters are shown in Table 4. e experimental platform is shown in Figure 6. In this experiment, the low-precision inertial measurement module JY901 fixed on the body of the shearer was used to collect the three-axis acceleration and angular velocity of the shearer. In the Raspberry Pi 3b, the initial alignment based on a fruit fly-optimized Kalman filter algorithm was used to process the measured raw data obtained by the JY901. Finally, the result is displayed on the host computer. Use the high-precision inertial measurement module ADIS16448 to obtain the shearer's true attitude angle, the pitch angle is − 0.002 degrees, the roll angle is 0.008 degrees, and the yaw angle is 0.004 degrees; they are used as true comparison values to verify the performance of the algorithm in this paper. e initial alignment process at three angles is shown in Figure 7. e red line in Figure 7 is the initial alignment based on a fruit fly-optimized Kalman filter algorithm proposed in this paper. It can be clearly seen that the algorithm proposed in this paper is superior to several other algorithms in the initial alignment of the yaw angle, pitch angle, and roll angle. e final alignment result of the pitch angle is 0.0078 degrees, the final alignment result of the roll angle is 0.0100 degrees, and the final alignment result of the yaw angle is 0.0415 degrees. e final alignment errors of pitch angle, roll angle, and yaw angle are 0.0098 degrees, 0.0020 degrees, and 0.036 degrees, respectively; the alignment errors in the three directions are all within 0.05 degrees, and the effectiveness of the method proposed in this paper is proved. From the alignment accuracy of three angles, the alignment accuracy of yaw angle is the worst, which is because the initial alignment time of yaw angle is the longest, and the alignment accuracy is poor in a short time. e proposed algorithm in this paper uses the intelligent algorithm to adaptively optimize the Kalman Q value that improves the     Computational Intelligence and Neuroscience 13 filtering accuracy of the Kalman algorithm. erefore, it has the best initial alignment accuracy than the other three algorithms.

Conclusions
e selection of the system noise variance Q of the filtering algorithm has a great influence on the filtering effect. Because the fruit fly optimization algorithm has a simple structure and high search efficiency, the fruit fly optimization algorithm was used to optimize the Q value to seek optimal filtering effect in this paper. On the other hand, the fruit fly optimization algorithm also has the disadvantage of being easily trapped in local optimum and so on. Two improvements to the fruit fly optimization algorithm are proposed in this paper. When the fitness function value is not updated for more than two generations, the optimal position is accepted; otherwise, its own position is accepted.    Secondly, the original search path is instead by the two new search paths; the diversity and search speed of the fruit fly optimization algorithm are improved and are easier to jump out of local optimum. In the simulation experiment, the good results are achieved by using the improved fruit fly optimization algorithm to optimize the Kalman filter in this paper. en, the industrial experiment was carried out and the effectiveness of the proposed algorithm is proved.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare no conflicts of interest.

Authors' Contributions
Zhongbin Wang and Miao Wan conceived and designed the experiments; Lei Si and Chao Tan performed the experiments; Hao Wang and Lei Si analyzed the data; and Miao Wan wrote the paper.