# Crow Search Algorithm for MEMS Gyroscope Temperature Drift Signal and Processing for Denoising

Authors: Xichen Wang; Huiliang Cao; Xiaomin Duan
Journal: Shock and Vibration
 (2021)

---

## Abstract

To solve the problem of micro-electro-mechanical system (MEMS) gyroscope noise, this paper presents a variational mode decomposition (VMD) method based on crow search algorithm. First, the signal was decomposed by variational mode decomposition for optimization of crow search algorithm (CSA-VMD) method. The parameters required by the VMD method (penalty parameterα and decomposition number K) are given by the crow search algorithm, and then the signal is decomposed into the superposition of multiple subsignals, called intrinsic mode functions (IMFs). The sample entropy (SE) corresponding to each IMF is then obtained. By calculating the sample entropy, the noise signal can be divided into pure noise part, mixing part, and temperature drift part. Second, Savitzky–Golay smoothing denoising (SG) is used to filter the mixed noise signal to eliminate the influence of noise. Third, for the filtering of the drift part, the least square support vector machine optimized by the crow search algorithm (CSA-LSSVM) was used to filter, so as to reduce the effect of temperature drift. Finally, the processed signal is reconstructed to achieve the goal of denoising. Through the results, it can be found that the optimized VMD and LSSVM using CSA algorithm can achieve more effective denoising. After using the method proposed in this paper, the angular random walk value is 1.1175 ∗ 10−4°/h/√Hz, and the bias stability is 0.0017°/h. Compared with the original signal, the two signals are optimized by 98.1% and 98.2%, respectively. It can be seen from the experimental results that the proposed CSA-VMD method, SG method, and CSA-LSSVM method can effectively eliminate noise effects.


---

## Body

## 1. Introduction

In recent years, the research of micro-electro-mechanical system (MEMS) gyroscope is endless, and it has been widely used in aviation, spaceflight, navigation, and civil electronic equipment. The reason for this is that micro-electro-mechanical system (MEMS) gyroscope has high efficiency, low price, low energy consumption, and other cost-effective characteristics [1]. However, some inevitable defects of the MEMS gyroscope (e.g., noise and temperature drift) limit its application in many aspects [2]. Therefore, it is crucial to eliminate the influence of errors. There are two kinds of temperature error processing methods: hardware compensation and software compensation [3].By controlling the circuit and improving the structure of the gyroscope, the temperature performance of the gyroscope is improved and the hardware compensation is realized [4]. For instance, in [5], an innovative temperature compensation method is presented, which is based on variable temperature resistance-driven mode vibration characteristic compensation. In [6], it reduces the damping coefficient effect and designs an effective resonant frequency of the circuit.The appearance of software compensation makes up the disadvantage of high cost and complicated steps in the hardware compensation of MEMS gyroscope. By setting up the specific mathematical model, it achieves the goal of simple operation and high performance-price ratio. Similar to signal filtering, temperature compensation is also the most commonly used software compensation method for various gyroscopes and MEMS gyroscopes when dealing with temperature error. In [7], improved empirical mode decomposition (EMD) and integrated extreme learning machine (ELM) model are used for temperature compensation.In order to get the compensated signal and eliminate the drift and noise, we deal with the software temperature error of MEMS gyroscope. Through serial processing and parallel processing and according to the low frequency characteristics of the drift part and the high frequency characteristics of the noise part, they are processed, respectively [8]. Empirical mode decomposition (EMD) [9] and wavelet decomposition [10] are commonly used in multiscale analysis. However, mode mixing is often mixed with empirical mode decomposition (EMD), so ensemble empirical mode decomposition (EEMD) is proposed. In order to improve the shortcomings of EEMD, such as false mode, extra postprocessing, and large computation burden, and to avoid the problem of predecomposition and overdecomposition, this paper proposes a method to stratify the decomposed subsignals by using sample entropy.Variational mode decomposition (VMD) can achieve noise signal processing to a certain extent, and it is necessary to determine the values of two parametersα and K when using this method. Different values have different influences on the final denoising results. Therefore, when these two parameters are artificially set, incomplete decomposition or excessive decomposition will usually be caused. Similarly, when the least square support vector machine (LSSVM) realizes temperature compensation, it also involves the choice of two parameters. The advantage of crow search algorithm (CSA) is that it can determine the optimal value of parameters, so as to achieve the most efficient signal processing.The variational mode decomposition (VMD) method [11] optimized by CSA in this paper is used to decompose the noise signal, and the Savitzky–Golay smoothing denoising (SG) method is used to denoise the decomposed signal. The framework is as follows. We give a brief introduction to MEMS gyroscopes in Section 2. In Section 3, VMD and CSA-VMD are introduced, and the CSA algorithm is described in detail, and then the SG method is analyzed. In Section 4, the optimized VMD method is compared with the traditional VMD method to prove that the former is due to the latter. Section 5 draws the conclusion.


## 2. Dual-Mass MEMS Gyroscope

### 2.1. The Introduction of MEMS Gyroscope Structure

The gyroscope shown in Figure1 has a tuning fork structure. As can be seen from Figure 1, the operating mode of the rotating fork gyroscope can be divided into the drive mode and sense mode. Drive frame, drive combs, and drive springs constitute the drive mode [12, 13], sense frame, sense combs, and sense springs constitute the sense mode, and the mass is included in them. Under the control of the monitoring circuit, the two masses of the drive mode vibrate opposite each other along the x axis, driven by a certain amount of static electricity. When the angular velocity along the Z-axis is input, the vibration mass produces a Coriolis effect, and it then moves onto the Y-axis and becomes a motion of the sensory frame [14].Figure 1
Schematic of the dual-mass gyroscope structure.The gyroscope connects the spring (U-shaped) to the driving mass, and theX-axis of the driving spring is connected to the two sensory masses, respectively. The driving mode follows the shifting fork principle. Figure 2 shows the first four stages of simulation using Ansys software, and there are large frequency differences between the modes. Here set the actual driving mode as the fourth with a quality factor greater than 2000. The other three modes have different driving modes with different resonant frequencies, and driver reversing mode is what we expect. Therefore, the left and right Coriolis masses are two degrees of freedom of the driving frame (X-axis) and the feeling frame (Y-axis), respectively.(1)nx000ny000nyx¨y¨1y¨2+ωx2nxQx2000ωy1nyQy1000ωy2nyQy2x˙y˙1y˙2+ωx22nx000ωy12ny000ωy22nyxy1y2=Gdsinωdt−2ncΩzx˙−2ncΩzx˙,(2)xt=Gdsinωdt−tg−1ωx2ωd/Qx2ωx22−ωd2nxωx22−ωd22+ωx22ωd2/Qx22⟶ωd=ωx2xt=GdQx2nxωd2cosωdt=Axcosωdt,(3)y1,2t=−2ΩzωdGdsinωdt−tg−1ωx2ωd/Qx2ωx22−ωd2+π/2−tg−1ωy1,2ωd/Qy1,2ωy1,22−ωd2nxωx22−ωd22+ωx22ωd2/Qx22ωy1,22−ωd22+ωy1,22ωd2/Qy1,22⟶ωd=ωx2y1,2t=−2ΩzGdQx2sinωdtnxωdωy1,22−ωd22+ωy1,22ωd2/Qy1,22=Ay1,2sinωdt.Figure 2
First four modes: (a) drive in phase mode (first mode) with frequencyωx1 = 2623 × 2 rad/s; (b) sensing in phase mode (second mode) with frequency ωy1 = 3342 × 2 rad/s; (c) sensing in anti-phase mode (third mode) with frequency ωy2 = 3468 × 2 rad/s; (d) drive in anti-phase mode (fourth mode) with frequency ωx2 = 3484 × 2 πrad/s.
(a)(b)(c)(d)MEMS gyroscope is driven by alternating Coriolis forces caused by orthogonal vibration and rotation. Based on the principle of conservation of angular momentum, it is a constantly rotating object, and the axis direction does not change with the rotation of the bracket. MEMS gyroscopes use Coriolis forces to provide the tangential force exerted by a rotating object in radial motion. The equations of motion of a gyroscope are equations (1)–(3).nx is equivalent mass of drive mode, ny is the quality of sense mode, and nc is equivalent mass of Coriolis mass. x, y1, and y2 are the displacements of the driving mode, the sensing in-phase mode and the anti-phase mode respectively. Qx2, Qy1, and Qy2 are the quality factors of driving mode, sensing in-phase and anti-phase modes.


### 2.2. The Introduction of the Gyroscope Monitoring System

The monitoring system of the gyroscope is shown in Figure3. When the driving sensor comb perceives the displacement of the driving frame (set to x (t)), the signal is transmitted to the split amplifier to require the full-wave signal phasor, and the phase delay of the signal vector is 90°, which also satisfies the phasor and the AC drive signal. The low-pass filter and the rectifier are then applied to the extracted Vdac and the reference voltage Vref. After the comparator outputs, the integrator controller generates a control signal. Vdacsin (wdt) low-pass filter demodulates the moving signal. The yellow part of the image shows the sensing open-loop output signal [15, 16].Figure 3
Gyroscope system schematic diagram.By detecting the motion signals of the left and right sensing frames, the differential detection amplifier amplifies the output again and generates the motion signals of the sensing mode.Vdacsin (wdt) demodulation can obtain detection mode movement signal and eliminate noise [17]. To generate a sensing mode movement signal, the output signal can be processed with a second differential amplification. Acquisition of detected mode motion signals is combined with the use of low-pass filter noise cancellation.


## 2.1. The Introduction of MEMS Gyroscope Structure

The gyroscope shown in Figure1 has a tuning fork structure. As can be seen from Figure 1, the operating mode of the rotating fork gyroscope can be divided into the drive mode and sense mode. Drive frame, drive combs, and drive springs constitute the drive mode [12, 13], sense frame, sense combs, and sense springs constitute the sense mode, and the mass is included in them. Under the control of the monitoring circuit, the two masses of the drive mode vibrate opposite each other along the x axis, driven by a certain amount of static electricity. When the angular velocity along the Z-axis is input, the vibration mass produces a Coriolis effect, and it then moves onto the Y-axis and becomes a motion of the sensory frame [14].Figure 1
Schematic of the dual-mass gyroscope structure.The gyroscope connects the spring (U-shaped) to the driving mass, and theX-axis of the driving spring is connected to the two sensory masses, respectively. The driving mode follows the shifting fork principle. Figure 2 shows the first four stages of simulation using Ansys software, and there are large frequency differences between the modes. Here set the actual driving mode as the fourth with a quality factor greater than 2000. The other three modes have different driving modes with different resonant frequencies, and driver reversing mode is what we expect. Therefore, the left and right Coriolis masses are two degrees of freedom of the driving frame (X-axis) and the feeling frame (Y-axis), respectively.(1)nx000ny000nyx¨y¨1y¨2+ωx2nxQx2000ωy1nyQy1000ωy2nyQy2x˙y˙1y˙2+ωx22nx000ωy12ny000ωy22nyxy1y2=Gdsinωdt−2ncΩzx˙−2ncΩzx˙,(2)xt=Gdsinωdt−tg−1ωx2ωd/Qx2ωx22−ωd2nxωx22−ωd22+ωx22ωd2/Qx22⟶ωd=ωx2xt=GdQx2nxωd2cosωdt=Axcosωdt,(3)y1,2t=−2ΩzωdGdsinωdt−tg−1ωx2ωd/Qx2ωx22−ωd2+π/2−tg−1ωy1,2ωd/Qy1,2ωy1,22−ωd2nxωx22−ωd22+ωx22ωd2/Qx22ωy1,22−ωd22+ωy1,22ωd2/Qy1,22⟶ωd=ωx2y1,2t=−2ΩzGdQx2sinωdtnxωdωy1,22−ωd22+ωy1,22ωd2/Qy1,22=Ay1,2sinωdt.Figure 2
First four modes: (a) drive in phase mode (first mode) with frequencyωx1 = 2623 × 2 rad/s; (b) sensing in phase mode (second mode) with frequency ωy1 = 3342 × 2 rad/s; (c) sensing in anti-phase mode (third mode) with frequency ωy2 = 3468 × 2 rad/s; (d) drive in anti-phase mode (fourth mode) with frequency ωx2 = 3484 × 2 πrad/s.
(a)(b)(c)(d)MEMS gyroscope is driven by alternating Coriolis forces caused by orthogonal vibration and rotation. Based on the principle of conservation of angular momentum, it is a constantly rotating object, and the axis direction does not change with the rotation of the bracket. MEMS gyroscopes use Coriolis forces to provide the tangential force exerted by a rotating object in radial motion. The equations of motion of a gyroscope are equations (1)–(3).nx is equivalent mass of drive mode, ny is the quality of sense mode, and nc is equivalent mass of Coriolis mass. x, y1, and y2 are the displacements of the driving mode, the sensing in-phase mode and the anti-phase mode respectively. Qx2, Qy1, and Qy2 are the quality factors of driving mode, sensing in-phase and anti-phase modes.


## 2.2. The Introduction of the Gyroscope Monitoring System

The monitoring system of the gyroscope is shown in Figure3. When the driving sensor comb perceives the displacement of the driving frame (set to x (t)), the signal is transmitted to the split amplifier to require the full-wave signal phasor, and the phase delay of the signal vector is 90°, which also satisfies the phasor and the AC drive signal. The low-pass filter and the rectifier are then applied to the extracted Vdac and the reference voltage Vref. After the comparator outputs, the integrator controller generates a control signal. Vdacsin (wdt) low-pass filter demodulates the moving signal. The yellow part of the image shows the sensing open-loop output signal [15, 16].Figure 3
Gyroscope system schematic diagram.By detecting the motion signals of the left and right sensing frames, the differential detection amplifier amplifies the output again and generates the motion signals of the sensing mode.Vdacsin (wdt) demodulation can obtain detection mode movement signal and eliminate noise [17]. To generate a sensing mode movement signal, the output signal can be processed with a second differential amplification. Acquisition of detected mode motion signals is combined with the use of low-pass filter noise cancellation.


## 3. Algorithm

### 3.1. VMD Method

VMD is a method of signal decomposition, similar to aVinax filter bank [11]. The technology has the ability to determine the number of mode decomposition. Then, the search and the solving process can adaptively match best center frequency for each mode and limited bandwidth and can achieve effective separation of intrinsic mode components (IMF) and signal in the frequency domain and then get the effective decomposition of given signal components. The sum of the decomposed subcomponents is the original signal, and the constraint variational expression is as follows:(4)minϑk,ρk∑kεtεt+jπt∗ϑkte−jρkt22,s.t.∑kϑk=ζ,where ϑk represents the k-th IMF and ρk represents the central frequency.The Lagrange multiplier operatorλt and α solve the problem of constrained variation by transforming the constrained variation into unconstrained variation. Therefore, the Lagrangian is(5)Lϑk,ρk,λ=α∑kεtεt+jπt∗ϑkte−jρkt22+ft−∑kϑkt+λt,ζt−∑kϑkt.The multiplier alternating direction method (ADMM) can be used to solve equation (2) and is updated according to the following equations:(6)ϑ∧kn+1ρ=ζ∧ρ−∑j≠kϑ∧iρ+λ∧ρ/21+2αρ−ρk2,(7)ρkn+1=∫0∞ρϑ∧kρ2dρ∫0∞ϑ∧kρ2dρ.Update the Lagrange multiplierλ∧ by the following equation:(8)λ∧n+1ρ=λ∧nρ+τζ∧ρ−∑kϑ∧kn+1ρ.The update process is repeated until equation (9) is satisfied.(9)∑kϑ∧kn+1−ϑ∧kn22ϑ∧kn22<σ.Givenσ = 10−6, all IMFs can be recovered according to the above cycle. The specific VMD algorithm can be found in [18].


### 3.2. CSA-VMD Method

In the actual operation, the VMD method must set the parameters (α and K) artificially. In [19–22], it is explained that these two parameters have a great influence on the decomposition amount, resulting in overdecomposition or underdecomposition; thus, loss of effective information and incomplete denoising are caused. The CSA algorithm can reasonably determine the parameters and optimize the parameters to the optimal position. Figure 4 shows the flowchart of CSA-VMD.Figure 4
The flowchart of CSA-VMD method.CSA is called a crow search algorithm, which is observed from the behavior of crows. The crows put the food they have hunted in their nests and take it back when they eat it. Crows also observe other crows hiding food in their nests and attempt to steal the food from the current nest. When the first crow commits a theft, it will be on high alert and take certain protective measures to prevent itself from becoming the victim of stolen food. Research has shown that crows are highly logical, and they will use a variety of reasonable ways to protect their food, such as moving nests. They use their behavioral experience to predict what the next thief will do and to move their nest to a safer place to avoid food theft.Based on the habits of crows, the CSA algorithm is used in this paper to optimize the parameter selection of the traditional VMD method. The principles are as follows:(1)
Crows live in groups.(2)
Crows can remember the location of the nest where they hide their food.(3)
Crows have the ability to learn from other crows to steal food.(4)
Crows have a sense of protection and can reasonably choose the location of their new nest after being stolen.Next, according to the above principles, in order to determine the internal parameters of the VMD method, we will conduct the simulation of this algorithm in a three-dimensional environment.Step 1.
initialize the problem. Let the number of crowsN = 30, the probability of protection consciousness be AP = 0.1, the flight length be f1 = 2, all crows be regarded as a crow group, and the maximum iteration number be 30.Step 2.
Set the crow group and the crow memory matrix according to equations (10) and (11). Since the crows have no experience at the beginning, let the food be hidden in the crows’ nests, that is, the initial position.(10)Crows=x11x21x31x12x22x32⋯⋯⋯x1Nx2Nx3N,(11)memory=m11m21m31m12m22m32⋯⋯⋯m1Nm2Nm3N.Step 3.
Since internal parametersα and K need to be optimized, we put values of α and K into each nest.Step 4.
The fitness function (ft) was set to determine whether the crows formed memories.Step 5.
Identify the location of the crow’s new nest by equation (12) and determine if it is feasible. If feasible, update the nest location; otherwise, the original position remains unchanged.(12)xi,NEST+1=xi,NEST+rand∗f1∗mj,NEST−xi,NEST,rand≥AP,random,rand<AP,where xi,NEST+1 represents the new nest, xi,NEST represents the last nest, rand represents the consciousness probability of the crow, and mj,NEST represents the location of the new nest in the memory of the crow.Step 6.
Update the crow’s memory by equation (13).(13)mi,NEST+1=xi,NEST+1,ftxi,NEST+1≥ftmi,NEST,mi,NEST,ftxi,NEST+1<ftmi,NEST.Step 7.
Determine whether the iteration is completed, determine the best memory and the best position, and correspond to the internal parametersα and K of the VMD method.


### 3.3. SE Method

Take a time seriesfi=f1,f2,f3,…,fk, whose length is n. Renumber k. fi generating a sequence of vectors with dimension mfp1,fp2,…,fpk−p+1, where [23–25](14)fpi=fi,fi+1,…,fi+p−1,1≤i≤k−p+1.This means that there arem consecutive values of x. The distance between xp+1j and xpj is the absolute value of the maximum value of the difference between the two elements.(15)dxpi,xpj=maxh=0,…p−1xi+k−xj+h.Calculate the distance betweenxpi and xpj given, and record the number of distances that are less than or equal to r, which we call φi.(16)φipr=1k−p−1φi.Defineφpr as(17)φpr=1k−p∑i=1k−pφipr.When the dimension isk+1, calculate the number of xp+1i and xp+1j that are less than r apart from γi. Define γipr and γpr as(18)γipr=1k−p−1γi,γpr=1k−p∑i=1k−pγipr.The sample entropy is defined as(19)SampEnp,r=limk⟶∞−lnγprφpr.After CSA-VMD decomposition, sample entropy is used to classify the decomposed subsignals to achieve the purpose of denoising.


### 3.4. SG Filtering

The SG smoothing algorithm was proposed by Savitzky and Golay. Polynomial smoothing algorithm is based on least squares principle, also known as convolution smoothing. In [26], the algorithm is described in detail. Take m points near the original data x and set x as the origin. Next, construct 2m + 1 x-centered sampling points to take window data and then construct i-order polynomial:(20)qn=∑i=0Kaini.The corresponding residual is(21)εk=∑n=−MMqn−xn2=∑n=−MM∑i=0Kaini−xn2.The filtering result is(22)y0=q0=a0.Savitzky and Golay found that calculatinga0 is equivalent to performing a FIR filter on the original data. In other words, you can do it using convolution.(23)yn=∑m=−MMφmxn−m=∑m=n−mn+Mφn−mxm.WhenεK is the minimum value, it has a good fitting degree with the original data. The partial derivative of εK with respect to each parameter is 0.(24)∂εK∂aj=∑n=−MM2njqn−xn=∑n=−MM2nj∑i=0Kaini−xn=0.After the formula is solved, the result is(25)∑i=0K∑n=−MMni+jai=∑n=−MMnjxnj=0,1,…N.After equation (16), SG filtering is completed.


### 3.5. CSA-LSSVM Method

The introduction of CSA-LSSVM will be divided into two parts. SVM- and LSSVM-related issues will be explained.Support vector machine (SVM) can directly analyze the linear case. When the linearity is not separable, the nonlinear mapping algorithm is used to transform it into the linear separable state of the high-dimensional mode. In this way, the linear algorithm is used to analyze the original nonlinear situation in the high-dimensional space, and then it is extended to the function fitting and other machine learning problems.Based on structural risk minimization, SVM seeks a balance between the complexity (learning accuracy) and learning ability (error-free recognition) of the model constructed with limited sample information, so as to obtain the best generalization ability (generalization ability). SVM schematic diagram is shown in Figure5. Its optimal classification function is(26)fx=sgn∑k=1lmk∗ykFxk,x+n∗.Figure 5
SVM schematic diagram.Obviously, the SVM classification function is similar to the neural network in form, which obtains the corresponding output through the linear combination of the process nodes. The inner product of the support vector machine corresponds to the nodes, which is also called the support vector network. Due to the inequality constraint problem, SVM has great hindrance in solving Lagrange multiplier and alpha. The least square support vector machine (LSSVM) transforms the original inequality constraint problem into equality constraint, which greatly optimizes the solution process and speeds up the operation speed. Inequality constraints for SVM are as follows:(27)minJλ,μ=12λTλ+c∑k=1lμk2,s.t.ykλTφxk+n≥1−μk,k=1,…,N,μk≥0,k=1,…,N.The equality constraints for LSSVM are as follows:(28)minJλ,η=12λTλ+12ε∑k=1lηk2,s.t.yk=λTφxk+n+ηk,k=1,…,N,where μ is the relaxation variable and represents the introduction outlier in the support vector. The optimization objective contains η and μ, ε and c, and they determine the optimal hyperplane and the minimum deviation value. Next, the Lagrange multiplier method is used to find the maximum value of m in the classification function(29)Lλ,n,η,m=Jλ,η−∑k=1lmkλTφxk−n−yk+ηk.Take the derivative of the parameters, respectively, make the derivative result 0, and define the kernel matrixFxk,xt:(30)∂L∂λ=0⇒λ=∑k=1lmkφxk,∂L∂n=0⇒∑k=1lmk=0,∂L∂ηk=0⇒mk=εηk,k=1,…,l,∂L∂mk=0⇒λTφxk+n+ηk−yk=0,k=1,…,lFxk,xt=φxk⋅φxt,k,t=1,…,l.Obtain the linear equations of A and B:(31)01⋯11Fxk,xt+1/ε⋯Fxk,xt⋯⋯…1Fxk,xt⋯Fxk,xt+1/εnm1⋯ml=0y1⋯yl.After solving the equation and getting relevant data, the regression function of LSSVM is as follows:(32)fx=∑k=1lmkFxk,xt+n.The advantages of CSA-LSSVM are described below.Firstly, the least square support vector machine (LSSVM) is an improvement of the support vector machine (SVM), which realizes the optimization of temperature compensation effect. It is to change the inequality constraint of traditional support vector machine into equality constraint and take the error square and loss function as the experience loss of training set, so that the quadratic programming problem is transformed into the problem of solving linear equations, and the speed and convergence precision of solving the problem are improved.Secondly, CSA optimized the two parameters of LSSVM, GAM and SIG2, to find the optimal combination of parameters, so as to improve the classification accuracy and achieve the optimal processing of temperature compensation.The flowchart of CSA-LSSVM model recognition process is shown in Figure6.Figure 6
The flowchart of CSA-LSSVM method.


### 3.6. CSA-VMD-SG-LSSVM Method

Based on the previous explanation, this paper integrates the above methods and applies them to MEMS gyroscope denoising and temperature compensation. The flowchart is shown in Figure7. The specific steps are as follows:(1)
The experimental MEMS gyroscope output data are decomposed by variational mode decomposition (VMD).(2)
CSA is used to optimize the two parameters of VMD, and the optimal solution was obtained.(3)
The decomposed components are divided into drift layer, mixed layer, and pure noise layer by using sample entropy.(4)
CSA-LSSVM processing is applied to the trend layer, and SG filtering is applied to the mixed noise layer to remove the pure noise layer.(5)
The processed trend layer and the mixed noise layer are superimposed to form the final reconstructed signal.Figure 7
The flowchart of CSA-VMD-SG-LSSVM model.


## 3.1. VMD Method

VMD is a method of signal decomposition, similar to aVinax filter bank [11]. The technology has the ability to determine the number of mode decomposition. Then, the search and the solving process can adaptively match best center frequency for each mode and limited bandwidth and can achieve effective separation of intrinsic mode components (IMF) and signal in the frequency domain and then get the effective decomposition of given signal components. The sum of the decomposed subcomponents is the original signal, and the constraint variational expression is as follows:(4)minϑk,ρk∑kεtεt+jπt∗ϑkte−jρkt22,s.t.∑kϑk=ζ,where ϑk represents the k-th IMF and ρk represents the central frequency.The Lagrange multiplier operatorλt and α solve the problem of constrained variation by transforming the constrained variation into unconstrained variation. Therefore, the Lagrangian is(5)Lϑk,ρk,λ=α∑kεtεt+jπt∗ϑkte−jρkt22+ft−∑kϑkt+λt,ζt−∑kϑkt.The multiplier alternating direction method (ADMM) can be used to solve equation (2) and is updated according to the following equations:(6)ϑ∧kn+1ρ=ζ∧ρ−∑j≠kϑ∧iρ+λ∧ρ/21+2αρ−ρk2,(7)ρkn+1=∫0∞ρϑ∧kρ2dρ∫0∞ϑ∧kρ2dρ.Update the Lagrange multiplierλ∧ by the following equation:(8)λ∧n+1ρ=λ∧nρ+τζ∧ρ−∑kϑ∧kn+1ρ.The update process is repeated until equation (9) is satisfied.(9)∑kϑ∧kn+1−ϑ∧kn22ϑ∧kn22<σ.Givenσ = 10−6, all IMFs can be recovered according to the above cycle. The specific VMD algorithm can be found in [18].


## 3.2. CSA-VMD Method

In the actual operation, the VMD method must set the parameters (α and K) artificially. In [19–22], it is explained that these two parameters have a great influence on the decomposition amount, resulting in overdecomposition or underdecomposition; thus, loss of effective information and incomplete denoising are caused. The CSA algorithm can reasonably determine the parameters and optimize the parameters to the optimal position. Figure 4 shows the flowchart of CSA-VMD.Figure 4
The flowchart of CSA-VMD method.CSA is called a crow search algorithm, which is observed from the behavior of crows. The crows put the food they have hunted in their nests and take it back when they eat it. Crows also observe other crows hiding food in their nests and attempt to steal the food from the current nest. When the first crow commits a theft, it will be on high alert and take certain protective measures to prevent itself from becoming the victim of stolen food. Research has shown that crows are highly logical, and they will use a variety of reasonable ways to protect their food, such as moving nests. They use their behavioral experience to predict what the next thief will do and to move their nest to a safer place to avoid food theft.Based on the habits of crows, the CSA algorithm is used in this paper to optimize the parameter selection of the traditional VMD method. The principles are as follows:(1)
Crows live in groups.(2)
Crows can remember the location of the nest where they hide their food.(3)
Crows have the ability to learn from other crows to steal food.(4)
Crows have a sense of protection and can reasonably choose the location of their new nest after being stolen.Next, according to the above principles, in order to determine the internal parameters of the VMD method, we will conduct the simulation of this algorithm in a three-dimensional environment.Step 1.
initialize the problem. Let the number of crowsN = 30, the probability of protection consciousness be AP = 0.1, the flight length be f1 = 2, all crows be regarded as a crow group, and the maximum iteration number be 30.Step 2.
Set the crow group and the crow memory matrix according to equations (10) and (11). Since the crows have no experience at the beginning, let the food be hidden in the crows’ nests, that is, the initial position.(10)Crows=x11x21x31x12x22x32⋯⋯⋯x1Nx2Nx3N,(11)memory=m11m21m31m12m22m32⋯⋯⋯m1Nm2Nm3N.Step 3.
Since internal parametersα and K need to be optimized, we put values of α and K into each nest.Step 4.
The fitness function (ft) was set to determine whether the crows formed memories.Step 5.
Identify the location of the crow’s new nest by equation (12) and determine if it is feasible. If feasible, update the nest location; otherwise, the original position remains unchanged.(12)xi,NEST+1=xi,NEST+rand∗f1∗mj,NEST−xi,NEST,rand≥AP,random,rand<AP,where xi,NEST+1 represents the new nest, xi,NEST represents the last nest, rand represents the consciousness probability of the crow, and mj,NEST represents the location of the new nest in the memory of the crow.Step 6.
Update the crow’s memory by equation (13).(13)mi,NEST+1=xi,NEST+1,ftxi,NEST+1≥ftmi,NEST,mi,NEST,ftxi,NEST+1<ftmi,NEST.Step 7.
Determine whether the iteration is completed, determine the best memory and the best position, and correspond to the internal parametersα and K of the VMD method.


## 3.3. SE Method

Take a time seriesfi=f1,f2,f3,…,fk, whose length is n. Renumber k. fi generating a sequence of vectors with dimension mfp1,fp2,…,fpk−p+1, where [23–25](14)fpi=fi,fi+1,…,fi+p−1,1≤i≤k−p+1.This means that there arem consecutive values of x. The distance between xp+1j and xpj is the absolute value of the maximum value of the difference between the two elements.(15)dxpi,xpj=maxh=0,…p−1xi+k−xj+h.Calculate the distance betweenxpi and xpj given, and record the number of distances that are less than or equal to r, which we call φi.(16)φipr=1k−p−1φi.Defineφpr as(17)φpr=1k−p∑i=1k−pφipr.When the dimension isk+1, calculate the number of xp+1i and xp+1j that are less than r apart from γi. Define γipr and γpr as(18)γipr=1k−p−1γi,γpr=1k−p∑i=1k−pγipr.The sample entropy is defined as(19)SampEnp,r=limk⟶∞−lnγprφpr.After CSA-VMD decomposition, sample entropy is used to classify the decomposed subsignals to achieve the purpose of denoising.


## 3.4. SG Filtering

The SG smoothing algorithm was proposed by Savitzky and Golay. Polynomial smoothing algorithm is based on least squares principle, also known as convolution smoothing. In [26], the algorithm is described in detail. Take m points near the original data x and set x as the origin. Next, construct 2m + 1 x-centered sampling points to take window data and then construct i-order polynomial:(20)qn=∑i=0Kaini.The corresponding residual is(21)εk=∑n=−MMqn−xn2=∑n=−MM∑i=0Kaini−xn2.The filtering result is(22)y0=q0=a0.Savitzky and Golay found that calculatinga0 is equivalent to performing a FIR filter on the original data. In other words, you can do it using convolution.(23)yn=∑m=−MMφmxn−m=∑m=n−mn+Mφn−mxm.WhenεK is the minimum value, it has a good fitting degree with the original data. The partial derivative of εK with respect to each parameter is 0.(24)∂εK∂aj=∑n=−MM2njqn−xn=∑n=−MM2nj∑i=0Kaini−xn=0.After the formula is solved, the result is(25)∑i=0K∑n=−MMni+jai=∑n=−MMnjxnj=0,1,…N.After equation (16), SG filtering is completed.


## 3.5. CSA-LSSVM Method

The introduction of CSA-LSSVM will be divided into two parts. SVM- and LSSVM-related issues will be explained.Support vector machine (SVM) can directly analyze the linear case. When the linearity is not separable, the nonlinear mapping algorithm is used to transform it into the linear separable state of the high-dimensional mode. In this way, the linear algorithm is used to analyze the original nonlinear situation in the high-dimensional space, and then it is extended to the function fitting and other machine learning problems.Based on structural risk minimization, SVM seeks a balance between the complexity (learning accuracy) and learning ability (error-free recognition) of the model constructed with limited sample information, so as to obtain the best generalization ability (generalization ability). SVM schematic diagram is shown in Figure5. Its optimal classification function is(26)fx=sgn∑k=1lmk∗ykFxk,x+n∗.Figure 5
SVM schematic diagram.Obviously, the SVM classification function is similar to the neural network in form, which obtains the corresponding output through the linear combination of the process nodes. The inner product of the support vector machine corresponds to the nodes, which is also called the support vector network. Due to the inequality constraint problem, SVM has great hindrance in solving Lagrange multiplier and alpha. The least square support vector machine (LSSVM) transforms the original inequality constraint problem into equality constraint, which greatly optimizes the solution process and speeds up the operation speed. Inequality constraints for SVM are as follows:(27)minJλ,μ=12λTλ+c∑k=1lμk2,s.t.ykλTφxk+n≥1−μk,k=1,…,N,μk≥0,k=1,…,N.The equality constraints for LSSVM are as follows:(28)minJλ,η=12λTλ+12ε∑k=1lηk2,s.t.yk=λTφxk+n+ηk,k=1,…,N,where μ is the relaxation variable and represents the introduction outlier in the support vector. The optimization objective contains η and μ, ε and c, and they determine the optimal hyperplane and the minimum deviation value. Next, the Lagrange multiplier method is used to find the maximum value of m in the classification function(29)Lλ,n,η,m=Jλ,η−∑k=1lmkλTφxk−n−yk+ηk.Take the derivative of the parameters, respectively, make the derivative result 0, and define the kernel matrixFxk,xt:(30)∂L∂λ=0⇒λ=∑k=1lmkφxk,∂L∂n=0⇒∑k=1lmk=0,∂L∂ηk=0⇒mk=εηk,k=1,…,l,∂L∂mk=0⇒λTφxk+n+ηk−yk=0,k=1,…,lFxk,xt=φxk⋅φxt,k,t=1,…,l.Obtain the linear equations of A and B:(31)01⋯11Fxk,xt+1/ε⋯Fxk,xt⋯⋯…1Fxk,xt⋯Fxk,xt+1/εnm1⋯ml=0y1⋯yl.After solving the equation and getting relevant data, the regression function of LSSVM is as follows:(32)fx=∑k=1lmkFxk,xt+n.The advantages of CSA-LSSVM are described below.Firstly, the least square support vector machine (LSSVM) is an improvement of the support vector machine (SVM), which realizes the optimization of temperature compensation effect. It is to change the inequality constraint of traditional support vector machine into equality constraint and take the error square and loss function as the experience loss of training set, so that the quadratic programming problem is transformed into the problem of solving linear equations, and the speed and convergence precision of solving the problem are improved.Secondly, CSA optimized the two parameters of LSSVM, GAM and SIG2, to find the optimal combination of parameters, so as to improve the classification accuracy and achieve the optimal processing of temperature compensation.The flowchart of CSA-LSSVM model recognition process is shown in Figure6.Figure 6
The flowchart of CSA-LSSVM method.


## 3.6. CSA-VMD-SG-LSSVM Method

Based on the previous explanation, this paper integrates the above methods and applies them to MEMS gyroscope denoising and temperature compensation. The flowchart is shown in Figure7. The specific steps are as follows:(1)
The experimental MEMS gyroscope output data are decomposed by variational mode decomposition (VMD).(2)
CSA is used to optimize the two parameters of VMD, and the optimal solution was obtained.(3)
The decomposed components are divided into drift layer, mixed layer, and pure noise layer by using sample entropy.(4)
CSA-LSSVM processing is applied to the trend layer, and SG filtering is applied to the mixed noise layer to remove the pure noise layer.(5)
The processed trend layer and the mixed noise layer are superimposed to form the final reconstructed signal.Figure 7
The flowchart of CSA-VMD-SG-LSSVM model.


## 4. Experiment and Discussion

### 4.1. Experiments

By testing the temperature characteristics of MEMS gyroscopes, we can verify the accuracy and feasibility of the proposed method—CSA-VMD-SE-SG. The gyroscopes and instruments used in the experiment are shown in Figure8. The detection circuit is connected to the electrical signal through a metal pin and the printed circuit board is wrapped with a rubber pad to protect the printed circuit. To shield against electromagnetic interference, the coated printed circuit board is placed in a grounded metal housing. The structure chip connection interface (the first PCB) realizes the processing of the weak signal, and the sensing loop and the drive closed loop correspond to the two remaining PCBs, respectively. The experimental device has a signal generator for generating test voltage, signal amplitude, and phase; ±10 v DC voltage and ground power supply (Agilent E3631A) are obtained by means of multimeter (Agilent 34401A) and oscilloscope (Agilent DSO7104B). The temperature oven provides a full temperature range for our experiment; the actual bandwidth is measured by the measuring gyroscope [24].Figure 8
The equipment of temperature experiments.First, the MEMS gyroscope is powered for one hour at room temperature. The ambient temperature is raised to 60°C (initial temperature) using a temperature oven, and the temperature of the gyroscope’s inner shell remains the same as the ambient temperature. To ensure that there is no temperature difference between the gyroscope and the oven, the temperature of the oven should be kept at 10°C per hour during the data collection. The detailed experimental data and analysis process are presented below.


### 4.2. Experimental Results

The original data of the MEMS gyroscope experiment are shown in Figure9. The experiment is accompanied by noise interference. Figure 9 shows the output analysis and temperature drift analysis based on the experimental data. It can be seen from the image that there is a certain correlation between the two, and the voltage changes by 0.0301 V between 55°C and −32°C. To minimize the error of the experimental results, we need to carry out denoising operation. Next, we will process the noise signal to make it easy to compare the effect before and after noise removal.Figure 9
Temperature test results.We decompose the experimental data using the CSA-VMD method, as shown in Figure10, into eleven IMFs. Through experiments, we found that CSA found the optimal α and K (30 iterations). However, due to the influence of artificially set internal parameters, VMD has underdecomposition, as shown in Figure 11. Next, the sample entropy of the 11 components after decomposition is calculated, and the calculated results are shown in Figure 12. According to the sample entropy theory, the larger the sample entropy is, the more complex the sample component is. After the sample entropy is divided, the noisy component is divided into three parts, which are drift part, mixed noise part, and pure noise part.Figure 10
Signal after CSA-VMD.Figure 11
Signal after CSA-VMD.Figure 12
The result of sample entropy calculation.First of all, SG filtering is used to denoise the mixed noise part. As can be seen from Figure13, SG filtering can effectively filter out noise interference and retain effective data. Next, the drift part is compensated. The CSA-LSSVM compensation method adopts two groups of experimental data for training and testing. As shown in Figure 14, the predicted output and the test output have a good fit. The reconstructed signal after compensation is shown in Figure 15. It can be seen that the temperature drift phenomenon is greatly eliminated after compensation, and the fitting error is small.Figure 13
The result of SG filter.Figure 14
The result of CSA-LSSVM.Figure 15
The reconstructed signal of temperature drift part.


### 4.3. Comparison

In the following, we will intuitively illustrate the effectiveness of the processing method by comparing the eigenvalues of the original signal and the signal processed based on CSA-VMD-SG-LSSVM. Figure15 shows the comparison of denoising effects of different denoising methods in this experiment. It can be clearly seen that CSA-VMD-SG has the best denoising result. In order to illustrate the superiority and effectiveness of CSA algorithm, we separately compared VMD with CSA-VMD, LSSVM, and CSA-LSSVM.As shown in Figure16, due to the underdecomposition problem of VMD algorithm, although the noise is reduced to some extent, some noise is still not effectively removed. CSA-VMD selects the optimal parameters during the stratification, and after the optimal stratification, the noise can be removed to the maximum extent within the capability of the method, which lays a foundation for the subsequent SG filtering.Figure 16
Denoised signal after CSA-SG-LSSVM.Similarly, there are two parameters of LSSVM that need to be determined by CSA algorithm. Figure17 compares the predicted output and test output before and after the use of CSA. There is a significant error in the range of 6000 to 8000 seconds, and the LSSVM-predicted output has a large deviation from the test output. From the local magnification of other fitting parts, it can be seen that CSA-LSSVM has better fitting degree than LSSVM. The mean square error of LSSVM is 0.0049°/s, while that of CSA-LSSVM is 4.0678 ∗ 10−5°/s, which can intuitively show the differences between the two methods through data. No matter the mean difference or the contrast figure of two methods, CSA-LSSVM has a higher fitting effect than LSSVM and can better eliminate errors caused by temperature drift.Figure 17
The comparison between LSSVM and CSA-LSSVM.The variances of the two signals are calculated by Allan algorithm. Allan algorithm has a high degree of recognition in the aspect of gyroscope denoising analysis. Figure18 shows the processing results of signals before and after denoising using different algorithms. The results in the figure show that for the original signal, the angular random walk value is 0.0054°/h/√Hz, and the angular random walk value based on CSA-VMD-SE-SG-LSSVM processing is 1.1175 ∗ 10−4°/h/√Hz. The bias stability of the original signal is 0.0909°/h, and the denoising signal is 0.0017°/h. Compared with the original signal, angular random walk value of the processed signal is optimized by 98.1% and bias stability of it is optimized by 98.2%.Figure 18
Allan analysis of variance.In order to show the advantages of CSA algorithm directly, the Allan algorithm without using CSA algorithm is analyzed. The angular random walk value is 1.0364∗ 10−4°/h/√Hz, and the bias stability is 0.0103°/h. Compared with the original signal, these two indexes are optimized by 98.1% and 88.7%, respectively. It can be clearly seen from the optimized percentage that the optimized result of CSA algorithm is significantly better than the unoptimized one. Therefore, the method proposed in this paper can filter out the noise in the original signal well and has a good performance in the data processing of MEMS gyroscope.


## 4.1. Experiments

By testing the temperature characteristics of MEMS gyroscopes, we can verify the accuracy and feasibility of the proposed method—CSA-VMD-SE-SG. The gyroscopes and instruments used in the experiment are shown in Figure8. The detection circuit is connected to the electrical signal through a metal pin and the printed circuit board is wrapped with a rubber pad to protect the printed circuit. To shield against electromagnetic interference, the coated printed circuit board is placed in a grounded metal housing. The structure chip connection interface (the first PCB) realizes the processing of the weak signal, and the sensing loop and the drive closed loop correspond to the two remaining PCBs, respectively. The experimental device has a signal generator for generating test voltage, signal amplitude, and phase; ±10 v DC voltage and ground power supply (Agilent E3631A) are obtained by means of multimeter (Agilent 34401A) and oscilloscope (Agilent DSO7104B). The temperature oven provides a full temperature range for our experiment; the actual bandwidth is measured by the measuring gyroscope [24].Figure 8
The equipment of temperature experiments.First, the MEMS gyroscope is powered for one hour at room temperature. The ambient temperature is raised to 60°C (initial temperature) using a temperature oven, and the temperature of the gyroscope’s inner shell remains the same as the ambient temperature. To ensure that there is no temperature difference between the gyroscope and the oven, the temperature of the oven should be kept at 10°C per hour during the data collection. The detailed experimental data and analysis process are presented below.


## 4.2. Experimental Results

The original data of the MEMS gyroscope experiment are shown in Figure9. The experiment is accompanied by noise interference. Figure 9 shows the output analysis and temperature drift analysis based on the experimental data. It can be seen from the image that there is a certain correlation between the two, and the voltage changes by 0.0301 V between 55°C and −32°C. To minimize the error of the experimental results, we need to carry out denoising operation. Next, we will process the noise signal to make it easy to compare the effect before and after noise removal.Figure 9
Temperature test results.We decompose the experimental data using the CSA-VMD method, as shown in Figure10, into eleven IMFs. Through experiments, we found that CSA found the optimal α and K (30 iterations). However, due to the influence of artificially set internal parameters, VMD has underdecomposition, as shown in Figure 11. Next, the sample entropy of the 11 components after decomposition is calculated, and the calculated results are shown in Figure 12. According to the sample entropy theory, the larger the sample entropy is, the more complex the sample component is. After the sample entropy is divided, the noisy component is divided into three parts, which are drift part, mixed noise part, and pure noise part.Figure 10
Signal after CSA-VMD.Figure 11
Signal after CSA-VMD.Figure 12
The result of sample entropy calculation.First of all, SG filtering is used to denoise the mixed noise part. As can be seen from Figure13, SG filtering can effectively filter out noise interference and retain effective data. Next, the drift part is compensated. The CSA-LSSVM compensation method adopts two groups of experimental data for training and testing. As shown in Figure 14, the predicted output and the test output have a good fit. The reconstructed signal after compensation is shown in Figure 15. It can be seen that the temperature drift phenomenon is greatly eliminated after compensation, and the fitting error is small.Figure 13
The result of SG filter.Figure 14
The result of CSA-LSSVM.Figure 15
The reconstructed signal of temperature drift part.


## 4.3. Comparison

In the following, we will intuitively illustrate the effectiveness of the processing method by comparing the eigenvalues of the original signal and the signal processed based on CSA-VMD-SG-LSSVM. Figure15 shows the comparison of denoising effects of different denoising methods in this experiment. It can be clearly seen that CSA-VMD-SG has the best denoising result. In order to illustrate the superiority and effectiveness of CSA algorithm, we separately compared VMD with CSA-VMD, LSSVM, and CSA-LSSVM.As shown in Figure16, due to the underdecomposition problem of VMD algorithm, although the noise is reduced to some extent, some noise is still not effectively removed. CSA-VMD selects the optimal parameters during the stratification, and after the optimal stratification, the noise can be removed to the maximum extent within the capability of the method, which lays a foundation for the subsequent SG filtering.Figure 16
Denoised signal after CSA-SG-LSSVM.Similarly, there are two parameters of LSSVM that need to be determined by CSA algorithm. Figure17 compares the predicted output and test output before and after the use of CSA. There is a significant error in the range of 6000 to 8000 seconds, and the LSSVM-predicted output has a large deviation from the test output. From the local magnification of other fitting parts, it can be seen that CSA-LSSVM has better fitting degree than LSSVM. The mean square error of LSSVM is 0.0049°/s, while that of CSA-LSSVM is 4.0678 ∗ 10−5°/s, which can intuitively show the differences between the two methods through data. No matter the mean difference or the contrast figure of two methods, CSA-LSSVM has a higher fitting effect than LSSVM and can better eliminate errors caused by temperature drift.Figure 17
The comparison between LSSVM and CSA-LSSVM.The variances of the two signals are calculated by Allan algorithm. Allan algorithm has a high degree of recognition in the aspect of gyroscope denoising analysis. Figure18 shows the processing results of signals before and after denoising using different algorithms. The results in the figure show that for the original signal, the angular random walk value is 0.0054°/h/√Hz, and the angular random walk value based on CSA-VMD-SE-SG-LSSVM processing is 1.1175 ∗ 10−4°/h/√Hz. The bias stability of the original signal is 0.0909°/h, and the denoising signal is 0.0017°/h. Compared with the original signal, angular random walk value of the processed signal is optimized by 98.1% and bias stability of it is optimized by 98.2%.Figure 18
Allan analysis of variance.In order to show the advantages of CSA algorithm directly, the Allan algorithm without using CSA algorithm is analyzed. The angular random walk value is 1.0364∗ 10−4°/h/√Hz, and the bias stability is 0.0103°/h. Compared with the original signal, these two indexes are optimized by 98.1% and 88.7%, respectively. It can be clearly seen from the optimized percentage that the optimized result of CSA algorithm is significantly better than the unoptimized one. Therefore, the method proposed in this paper can filter out the noise in the original signal well and has a good performance in the data processing of MEMS gyroscope.


## 5. Conclusion

A temperature error denoising method for MEMS gyroscope based on CSA-VMD-SG-LSSVM is proposed in this paper. First of all, the above methods are effective in denoising. In both VMD and LSSVM, the optimized results using CSA are better than those before optimization. Each component can be distinguished from the analysis of the SE of each component, and the mixing layer can be filtered by SG and CSA-LSSVM compensates the drift layer. Then, by comparing the angular random walk value and the bias stability of the signal before and after denoising, the optimization effect is intuitively demonstrated. It can be seen from the above experimental results that the proposed method is more effective in MEMS gyroscope denoising.



---

*Source: 9929966-2021-08-13.xml*