Zero compensation method, device and equipment of MEMS (Micro Electro Mechanical System) gyroscope and storage medium
By optimizing the interpolation point distribution and fitting the zero-drift polynomial using the spline interpolation method, the problem of difficulty in taking into account both accuracy and cost in MEMS gyroscope zero-position compensation is solved, and a balance between high precision and low computational storage costs is achieved.
Patent Information
- Application Number
- CN202510108158.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-04-29
AI Technical Summary
Existing MEMS gyroscope zero compensation methods cannot take into account both high precision and low computational storage costs, especially when dealing with complex nonlinear drift characteristics.
By optimizing the distribution position of interpolation points, using the spline interpolation method to obtain a zero drift polynomial, characterizing the mathematical relationship between temperature and zero data, and determining the zero compensation value based on the current temperature.
The zero-position compensation accuracy is improved, the calculation amount and parameter storage amount are reduced, and the balance between accuracy and cost is achieved.
Smart Images

Figure CN119901316A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of signal processing technology, and in particular to a zero-position compensation method, device, equipment and storage medium for a MEMS gyroscope. Background Art
[0002] Micro-Electro-Mechanical System (MEMS) gyroscope is a high-precision inertial sensor widely used in vehicle navigation, consumer electronics and other fields. However, due to the limitations of MEMS manufacturing process, the zero-position signal of MEMS gyroscope usually has problems such as drift, noise and temperature sensitivity, which seriously affects the measurement accuracy of MEMS gyroscope. Therefore, it is necessary to perform temperature compensation on the zero-position signal of MEMS gyroscope.
[0003] In the related art, linear interpolation compensation or polynomial fitting compensation is usually used to compensate the zero position of MEMS gyroscope. Among them, linear interpolation compensation often uses equally spaced linear interpolation to perform interpolation compensation, which means that when using linear interpolation compensation, more storage space is needed to store compensation parameters to achieve higher compensation accuracy. In addition, the equally spaced linear interpolation method also has the problem of difficulty in effectively capturing complex nonlinear drift characteristics. Polynomial fitting compensation requires the use of high-order parameters for fitting compensation operations, which has a high computational complexity and is not suitable for embedded systems such as MEMS gyroscopes.
[0004] In summary, most of the existing zero-position compensation methods cannot take into account both compensation accuracy and computational storage costs at the same time, and cannot reduce computational and storage costs while achieving high-precision zero-position compensation. Summary of the invention
[0005] The embodiments of the present invention provide a method, device, electronic device and storage medium for zero-position compensation of a MEMS gyroscope, so as to solve the problem that compensation accuracy and calculation and storage cost cannot be taken into account at the same time during the zero-position compensation process of the MEMS gyroscope.
[0006] In a first aspect, an embodiment of the present invention provides a zero position compensation method for a MEMS gyroscope, comprising:
[0007] Obtain the zero position data of the MEMS gyroscope at different temperatures respectively;
[0008] According to the preset number of interpolation points and the preset fitting error range, the distribution position of each interpolation point is optimized to obtain the optimal distribution position of each interpolation point;
[0009] Based on the optimal distribution position of each interpolation point, spline interpolation is performed on the zero-position data of the MEMS gyroscope at different temperatures to obtain a zero-position drift polynomial by fitting; the zero-position drift polynomial is used to characterize the mathematical relationship between temperature and zero-position data;
[0010] The current zero position data of the MEMS gyroscope is determined according to the current temperature of the MEMS gyroscope and the zero position drift polynomial, and the zero position compensation value is determined according to the current zero position data.
[0011] In a possible implementation, the optimizing the distribution position of each interpolation point according to the preset number of interpolation points and the preset fitting error range to obtain the optimal distribution position of each interpolation point includes:
[0012] Initialize the particle swarm according to the preset number of interpolation points and obtain the position of each particle in the particle swarm;
[0013] Based on the position of each particle, calculate the fitness value of each particle;
[0014] Based on the optimal fitness value, update the position of each particle;
[0015] Check whether the optimal fitness value is within the preset fitting error range and whether the current number of iterations reaches the preset number of iterations;
[0016] If the optimal fitness value is not within the preset fitting error range and the current number of iterations has not reached the preset number of iterations, the process jumps to the step of calculating the fitness value of each particle based on the position of each particle and updates the current number of iterations until the optimal fitness value is within the preset fitting error range or the current number of iterations reaches the preset number of iterations. The optimal distribution position of each interpolation point is determined according to the position of the particle corresponding to the optimal fitness value.
[0017] In a possible implementation, the position of each particle represents an interpolation point distribution situation; the interpolation point distribution situation includes the distribution position of each interpolation point;
[0018] The step of calculating the fitness value of each particle based on the position of each particle includes:
[0019] For each particle, determine the distribution position of each interpolation point according to the position of the particle;
[0020] According to the distribution of each interpolation point, spline interpolation is performed on the zero position data of the MEMS gyroscope at different temperatures, and the zero position drift curve is obtained by fitting.
[0021] The sum of squares of deviations between the zero drift curve and a preset standard zero curve is calculated, and the sum of squares of deviations is determined as the fitness value of the particle.
[0022] In a possible implementation, the zero drift polynomial includes a plurality of cubic polynomials;
[0023] Based on the optimal distribution position of each interpolation point, spline interpolation is performed on the zero position data of the MEMS gyroscope at different temperatures to fit the zero position drift polynomial, including:
[0024] Based on the temperature order, the zero position data of the MEMS gyroscope at different temperatures are segmented to obtain the zero position data in multiple temperature intervals;
[0025] Based on the optimal distribution position of each interpolation point, spline interpolation is performed on the zero-position data in each temperature interval to fit a cubic polynomial corresponding to each temperature interval; the cubic polynomial is used to characterize the mathematical relationship between temperature and zero-position data.
[0026] In a possible implementation, determining the current zero position data of the MEMS gyroscope according to the current temperature of the MEMS gyroscope and the zero position drift polynomial includes:
[0027] Determine, according to the current temperature of the MEMS gyroscope, a cubic polynomial corresponding to the temperature interval in which the current temperature is located;
[0028] The current zero position data of the MEMS gyroscope is determined according to the current temperature and the cubic polynomial.
[0029] In a possible implementation manner, determining a zero position compensation value according to the current zero position data includes:
[0030] Obtain preset standard zero position data;
[0031] The difference between the standard zero position data and the current zero position data is determined as a zero position compensation value.
[0032] In a possible implementation manner, before calculating the sum of squares of deviations between the zero drift curve and a preset standard zero curve, the method further includes:
[0033] In the full operating temperature range of the MEMS gyroscope, the zero position data of the MEMS gyroscope at different temperatures are collected respectively;
[0034] The zero-position data at different temperatures are denoised using high-order polynomial fitting to extract a preset standard zero-position curve.
[0035] In a second aspect, an embodiment of the present invention provides a zero position compensation device for a MEMS gyroscope, comprising:
[0036] An acquisition module, used for respectively acquiring zero position data of the MEMS gyroscope at different temperatures;
[0037] An optimization module is used to optimize the distribution position of each interpolation point according to a preset number of interpolation points and a preset fitting error range to obtain the optimal distribution position of each interpolation point;
[0038] Compensation modules for:
[0039] Based on the optimal distribution position of each interpolation point, spline interpolation is performed on the zero-position data of the MEMS gyroscope at different temperatures to obtain a zero-position drift polynomial by fitting; the zero-position drift polynomial is used to characterize the mathematical relationship between temperature and zero-position data;
[0040] The current zero position data of the MEMS gyroscope is determined according to the current temperature of the MEMS gyroscope and the zero position drift polynomial, and the zero position compensation value is determined according to the current zero position data.
[0041] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the processor implements the steps of the method described in the first aspect or any possible implementation manner of the first aspect.
[0042] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect or any possible implementation method of the first aspect are implemented.
[0043] The embodiment of the present invention provides a zero-position compensation method, device, equipment and storage medium for a MEMS gyroscope. Before performing spline interpolation on zero-position data, the distribution position of each interpolation point is optimized in advance to obtain the optimal distribution position of each interpolation point, so that the optimal fitting of the zero-position data can be achieved on the basis of a small number of interpolation points, and a zero-position drift polynomial can be obtained. Based on the optimally fitted zero-position drift polynomial, a zero-position compensation value is determined, which can effectively improve the accuracy of zero-position compensation. At the same time, the zero-position drift polynomial obtained by spline interpolation fitting has a lower order and fewer polynomial parameters, which can effectively reduce the amount of calculation and parameter storage in the zero-position compensation process, thereby achieving a balance between the accuracy of zero-position compensation and the cost of calculation and storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0045] Figure 1 is a flow chart of a method for implementing a zero position compensation of a MEMS gyroscope provided by an embodiment of the present invention;
[0046] Figure 2 is a schematic diagram of the fitting of the zero drift curve provided by an embodiment of the present invention;
[0047] Figure 3 is a flowchart for implementing the optimization of the distribution position of interpolation points provided by an embodiment of the present invention;
[0048] Figure 4 is a schematic diagram of the fitting of the standard zero position curve provided by an embodiment of the present invention;
[0049] Figure 5 It is a structural schematic diagram of a zero-position compensation device of a MEMS gyroscope provided in an embodiment of the present invention;
[0050] Figure 6 is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0052] In the related art, linear interpolation compensation or polynomial fitting compensation is usually used to perform zero-position compensation on the MEMS gyroscope. Among them, linear interpolation compensation often uses equally spaced linear interpolation for interpolation compensation. Equally spaced linear interpolation often requires more storage space to store compensation parameters to achieve higher compensation accuracy. The equally spaced linear interpolation method also has the problem of being difficult to effectively capture complex nonlinear drift characteristics. Polynomial fitting compensation requires the use of high-order parameters for fitting compensation operations to achieve higher compensation accuracy. However, the computational complexity of fitting compensation operations using high-order parameters is relatively high, which is not suitable for embedded systems such as MEMS gyroscopes. In other words, most of the existing zero-position compensation methods cannot take into account both compensation accuracy and computational storage costs at the same time.
[0053] In order to achieve high-precision zero-position compensation while reducing the calculation and storage costs, in an embodiment of the present invention, before interpolation compensation is performed, the distribution position of the interpolation points is optimized in advance to obtain the optimal distribution position of each interpolation point. Spline interpolation compensation is performed based on the optimal distribution position, thereby effectively improving the zero-position compensation accuracy of the MEMS gyroscope. At the same time, the zero-position drift polynomial obtained by spline interpolation has a lower order and fewer polynomial parameters, which can effectively reduce the amount of calculation and parameter storage in the zero-position compensation process, thereby achieving a balance between zero-position compensation accuracy and calculation and storage costs.
[0054] In order to make the purpose, technical solutions and advantages of the present invention more clear, specific embodiments will be described below in conjunction with the accompanying drawings.
[0055] Figure 1 The implementation flow chart of the zero position compensation method of the MEMS gyroscope provided in the embodiment of the present invention is described in detail as follows:
[0056] Step 101, obtaining zero position data of the MEMS gyroscope at different temperatures respectively.
[0057] In the embodiment of the present invention, the MEMS gyroscope can be installed on a test platform with high stability and matched with a thermostat with temperature control function. By controlling the temperature of the thermostat, the ambient temperature of the MEMS gyroscope is gradually changed, and the zero position data output by the MEMS gyroscope at different temperatures within the full working temperature range are collected.
[0058] Among them, the zero-position data of the MEMS gyroscope at different temperatures is used for subsequent interpolation fitting to obtain the mathematical relationship between temperature and zero-position data.
[0059] Step 102, optimizing the distribution position of each interpolation point according to the preset number of interpolation points and the preset fitting error range, to obtain the optimal distribution position of each interpolation point.
[0060] Here, the number of interpolation points and the fitting error range can be determined according to actual conditions, and are not specifically limited in the embodiment of the present invention.
[0061] The embodiment of the present invention can determine the optimal distribution position of each interpolation point in the interpolation fitting process by optimizing the distribution position of the interpolation points. Performing subsequent interpolation fitting operations based on the optimal distribution position can maximize the fitting accuracy, thereby effectively ensuring the zero compensation accuracy.
[0062] It can be understood that the distribution position of each interpolation point includes the temperature and zero position data corresponding to each interpolation point.
[0063] Step 103 , based on the optimal distribution position of each interpolation point, spline interpolation is performed on the zero position data of the MEMS gyroscope at different temperatures to obtain a zero position drift polynomial by fitting.
[0064] According to the optimal distribution position of each interpolation point obtained by optimization, the embodiment of the present invention can perform spline interpolation on the zero position data of the MEMS gyroscope at different temperatures, and then fit the zero position drift curve. The zero position drift curve is used to characterize the zero position data corresponding to the MEMS gyroscope at different temperatures. Figure 2 , Figure 2 The zero drift curve obtained by spline interpolation fitting based on the optimal distribution position of each interpolation point is shown.
[0065] The mathematical expression corresponding to the zero drift curve is the zero drift polynomial. The zero drift polynomial is used to characterize the mathematical relationship between temperature and zero data.
[0066] In some embodiments, when determining the zero drift polynomial, the zero position data of the MEMS gyroscope at different temperatures can be segmented based on the order of temperature magnitude to obtain zero position data in multiple temperature intervals; then, based on the optimal distribution position of each interpolation point, the zero position data in each temperature interval is spline interpolated to fit the cubic polynomial corresponding to each temperature interval. Here, the cubic polynomial is used to characterize the mathematical relationship between temperature and zero position data.
[0067] Compared with the traditional method of fitting the zero-position data of the MEMS gyroscope into a single curve, the embodiment of the present invention can use multiple interconnected different curves to characterize the correspondence between temperature and zero-position data by fitting the zero-position data at different temperatures in segments, which makes it easier to capture the nonlinear drift characteristics of the zero-position data, thereby improving the fitting accuracy of the zero-position data, and is particularly suitable for MEMS gyroscopes with highly nonlinear temperature drift characteristics.
[0068] Furthermore, the embodiment of the present invention adopts a spline interpolation method, which can ensure the smoothness of each segmented curve at the connection point, so that the overall curve is smooth, and the value and the second-order derivative are continuous.
[0069] Here, the mathematical expression of each segmented curve may be a cubic polynomial, and the zero drift polynomial in the embodiment of the present invention may include multiple cubic polynomials. The embodiment of the present invention obtains multiple cubic polynomials by segmented fitting, which can reduce the polynomial order on the basis of accurately capturing the nonlinear drift characteristics of zero-position data, thereby reducing the calculation and storage costs.
[0070] Step 104, determining the current zero position data of the MEMS gyroscope according to the current temperature of the MEMS gyroscope and the zero position drift polynomial, and determining the zero position compensation value according to the current zero position data.
[0071] In some embodiments, when determining the current zero position data of the MEMS gyroscope, a cubic polynomial corresponding to the temperature range of the current temperature can be determined based on the current temperature of the MEMS gyroscope; then, the current temperature is substituted into the cubic polynomial to calculate the current zero position data of the MEMS gyroscope.
[0072] According to the above, the zero drift polynomial contains multiple cubic polynomials. Among them, the cubic polynomial can be expressed as: a3t 3 +a2t 2 +a1t+a0=L.
[0073] Wherein, a3, a2, a1 and a0 represent polynomial parameters corresponding to the cubic polynomial, t represents temperature, and L represents zero-position data.
[0074] The embodiment of the present invention can write the above polynomial parameters into the zero position compensation module in the MEMS gyroscope through the communication interface. The zero position compensation module can automatically find the corresponding temperature interval according to the current temperature value of the MEMS gyroscope in real time during the operation of the MEMS gyroscope, and calculate the current zero position data according to the cubic polynomial parameters corresponding to the temperature interval.
[0075] In some embodiments, when determining the zero position compensation value, preset standard zero position data may be acquired, and the difference between the standard zero position data and the current zero position data may be determined as the zero position compensation value.
[0076] Here, the standard zero-bit data may be determined according to actual conditions, and the embodiment of the present invention does not specifically limit this.
[0077] During the operation of the MEMS gyroscope, the MEMS gyroscope will measure the temperature in real time and compensate the zero-position drift according to the cubic polynomial parameters in the zero-position compensation module, so that the compensated zero-position output has high stability and low temperature drift characteristics, meeting the high-precision application requirements of the MEMS gyroscope.
[0078] Compared with the prior art, the embodiment of the present invention optimizes the distribution position of each interpolation point in advance before performing spline interpolation on the zero-position data, and obtains the optimal distribution position of each interpolation point, so that the optimal fitting of the zero-position data can be achieved on the basis of a small number of interpolation points, and a zero-position drift polynomial can be obtained. Based on the optimally fitted zero-position drift polynomial, the zero-position compensation value is determined, which can effectively improve the accuracy of zero-position compensation. At the same time, the zero-position drift polynomial obtained by spline interpolation fitting has a lower order and fewer polynomial parameters, which can effectively reduce the amount of calculation and parameter storage in the zero-position compensation process, thereby achieving a balance between the accuracy of zero-position compensation and the cost of calculation and storage.
[0079] The following is a detailed introduction to the implementation method of optimizing the distribution position of interpolation points.
[0080] The embodiment of the present invention mainly uses the particle swarm optimization algorithm to optimize the distribution position of each interpolation point, see Figure 3 , and its specific implementation is as follows:
[0081] Step 301, initializing a particle swarm according to a preset number of interpolation points, and obtaining the position of each particle in the particle swarm;
[0082] The position of each particle in the particle group represents an interpolation point distribution, including the distribution position of each interpolation point. In an embodiment of the present invention, the number of interpolation points is used to determine the data dimension of the position of the particle. Exemplarily, when the number of interpolation points is 6, the position of each particle can be expressed as X = [x1, x2, ..., x6], where x1, x2 and x6 respectively represent the distribution positions of different interpolation points in each particle.
[0083] The embodiment of the present invention randomly generates the positions of multiple particles according to the above data dimensions, and at the same time, can also randomly generate the speed of each particle.
[0084] Step 302, calculating the fitness value of each particle based on the position of each particle;
[0085] According to the above, the position of each particle represents an interpolation point distribution situation; the interpolation point distribution situation includes the distribution position of each interpolation point.
[0086] In some embodiments, when calculating the fitness value, for each particle, the distribution position of each interpolation point can be determined according to the position of the particle; then, according to the distribution position of each interpolation point, spline interpolation is performed on the zero-position data of the MEMS gyroscope at different temperatures to obtain a zero-position drift curve by fitting; then, the sum of square deviations between the zero-position drift curve and a preset standard zero-position curve is calculated, and the sum of square deviations is determined as the fitness value of the particle.
[0087] Here, the sum of squares of deviations between the zero drift curve and the preset standard zero curve is used to characterize the error between the zero drift curve and the standard zero curve. The embodiment of the present invention uses the error as the fitness value of each particle to evaluate the curve fitting accuracy corresponding to each particle, thereby continuously iterating and optimizing to obtain particles corresponding to the optimal curve fitting accuracy.
[0088] On the basis of determining the fitness value of each particle, for each particle, the embodiment of the present invention can also compare the current fitness value of the particle with the previous optimal fitness value of the particle, so as to update the optimal fitness value of the particle, thereby updating the optimal individual position of each particle.
[0089] Here, for each particle, the position corresponding to the optimal fitness value of the particle is the optimal individual position of the particle.
[0090] On this basis, the current fitness values of all particles can also be compared, so as to determine the minimum fitness value as the global optimal fitness value, and then determine the position of the particle corresponding to the global optimal fitness value.
[0091] Step 303, based on the optimal fitness value, update the position of each particle;
[0092] Here, the optimal fitness value is the global optimal fitness value. The embodiment of the present invention updates the speed of each particle according to the particle position corresponding to the global optimal fitness value and the optimal individual position of each particle, and then updates the current position of each particle according to the updated speed.
[0093] Step 304, detecting whether the optimal fitness value is within a preset fitting error range, and whether the current number of iterations reaches a preset number of iterations;
[0094] Here, the preset fitting error range can be determined according to actual conditions, and the embodiment of the present invention does not specifically limit this. Exemplarily, the preset fitting error range can be 0 to 0.01.
[0095] Step 305: If the optimal fitness value is not within the preset fitting error range and the current iteration number has not reached the preset iteration number, the process jumps to the step of calculating the fitness value of each particle based on the position of each particle and updates the current iteration number until the optimal fitness value is within the preset fitting error range or the current iteration number reaches the preset iteration number, and the optimal distribution position of each interpolation point is determined according to the position of the particle corresponding to the optimal fitness value.
[0096] Here, the global minimum fitness value is the optimal fitness value. The position of the particle corresponding to the optimal fitness value is the optimal distribution position of each interpolation point.
[0097] In essence, the particle swarm algorithm takes the error between the zero drift curve obtained by fitting the distribution position of each interpolation point and the preset standard zero curve as the optimization target, and is used to iteratively optimize the distribution position of each interpolation point until the error between the zero drift curve and the preset standard zero curve is within the preset fitting error range.
[0098] Here, the sum of squares of deviations between the zero drift curve and a preset standard zero curve represents the error between the zero drift curve and the preset standard zero curve.
[0099] In each iteration of the particle swarm optimization algorithm, the distribution position of each interpolation point is updated, and the zero drift curve of the entire working temperature range is fitted using the spline interpolation method. The fitting result is compared with the standard zero curve, and the fitting error (i.e., the sum of squared deviations) is calculated. According to the fitting error, the distribution position of the interpolation point is adjusted until the fitting error is within the preset fitting error range or the number of iterations reaches the preset number of iterations, and the iterative optimization is completed to obtain the optimal distribution position of each interpolation point.
[0100] Here, when the particle swarm optimization algorithm is used to optimize the distribution position of the interpolation points, the lowest temperature and the highest temperature can be fixed as variable prices, and only the distribution position of the intermediate interpolation points can be optimized.
[0101] The embodiment of the present invention uses a particle swarm optimization algorithm to optimize the optimal distribution position of each interpolation point. The interpolation point at the optimal distribution position is the most critical position point in curve fitting, which can achieve high-precision fitting with the least number, thereby improving the accuracy of zero compensation.
[0102] In some embodiments, before calculating the above-mentioned sum of squared deviations, zero-position data of the MEMS gyroscope at different temperatures may be collected within the entire operating temperature range of the MEMS gyroscope; and the zero-position data at different temperatures may be denoised using high-order polynomial fitting to extract a preset standard zero-position curve.
[0103] Among them, the zero-position data collected in the entire working temperature range inevitably contains data noise. Here, in order to maximize the accuracy of the standard zero-position curve, the embodiment of the present invention can use a polynomial of as high order as possible to denoise the noisy zero-position data containing noise, and fit and extract the standard zero-position curve. For details, see Figure 4 , Figure 4 A fitting schematic diagram of the standard zero-position curve is shown.
[0104] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0105] The following is an embodiment of the device of the present invention. For details not described in detail therein, reference may be made to the corresponding method embodiment described above.
[0106] Figure 5 The structure diagram of the zero position compensation device of the MEMS gyroscope provided by the embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:
[0107] like Figure 5As shown, the zero position compensation device 5 of the MEMS gyroscope includes: an acquisition module 51 , an optimization module 52 and a compensation module 53 .
[0108] An acquisition module 51 is used to respectively acquire zero position data of the MEMS gyroscope at different temperatures;
[0109] An optimization module 52 is used to optimize the distribution position of each interpolation point according to a preset number of interpolation points and a preset fitting error range to obtain an optimal distribution position of each interpolation point;
[0110] The compensation module 53 is used for:
[0111] Based on the optimal distribution position of each interpolation point, spline interpolation is performed on the zero-position data of the MEMS gyroscope at different temperatures, and a zero-position drift polynomial is obtained by fitting; the zero-position drift polynomial is used to characterize the mathematical relationship between temperature and zero-position data;
[0112] According to the current temperature of the MEMS gyroscope and the zero-position drift polynomial, the current zero-position data of the MEMS gyroscope is determined, and according to the current zero-position data, the zero-position compensation value is determined.
[0113] Optionally, the optimization module 52 is specifically used for:
[0114] Initialize the particle swarm according to the preset number of interpolation points and obtain the position of each particle in the particle swarm;
[0115] Based on the position of each particle, calculate the fitness value of each particle;
[0116] Based on the optimal fitness value, update the position of each particle;
[0117] Check whether the optimal fitness value is within the preset fitting error range and whether the current number of iterations reaches the preset number of iterations;
[0118] If the optimal fitness value is not within the preset fitting error range and the current number of iterations has not reached the preset number of iterations, the process jumps to the step of calculating the fitness value of each particle based on the position of each particle and updates the current number of iterations until the optimal fitness value is within the preset fitting error range or the current number of iterations reaches the preset number of iterations. The optimal distribution position of each interpolation point is determined according to the position of the particle corresponding to the optimal fitness value.
[0119] Optionally, the position of each particle represents an interpolation point distribution; the interpolation point distribution includes the distribution position of each interpolation point; the optimization module 52 is specifically used for:
[0120] For each particle, determine the distribution position of each interpolation point according to the position of the particle;
[0121] According to the distribution of each interpolation point, spline interpolation is performed on the zero position data of the MEMS gyroscope at different temperatures, and the zero position drift curve is obtained by fitting.
[0122] The sum of squared deviations between the zero drift curve and the preset standard zero curve is calculated, and the sum of squared deviations is determined as the fitness value of the particle.
[0123] Optionally, the zero drift polynomial includes a plurality of cubic polynomials; the compensation module 53 is specifically used for:
[0124] Based on the temperature order, the zero position data of the MEMS gyroscope at different temperatures are segmented to obtain the zero position data in multiple temperature intervals;
[0125] Based on the optimal distribution position of each interpolation point, spline interpolation is performed on the zero-position data in each temperature interval to fit a cubic polynomial corresponding to each temperature interval; the cubic polynomial is used to characterize the mathematical relationship between temperature and zero-position data.
[0126] Optionally, the compensation module 53 is specifically used for:
[0127] According to the current temperature of the MEMS gyroscope, a cubic polynomial corresponding to the temperature range of the current temperature is determined;
[0128] According to the current temperature and the cubic polynomial, the current zero position data of the MEMS gyroscope is determined.
[0129] Optionally, the compensation module 53 is specifically used for:
[0130] Obtain preset standard zero position data;
[0131] The difference between the standard zero position data and the current zero position data is determined as the zero position compensation value.
[0132] Optionally, the optimization module 52 is further used for:
[0133] In the full operating temperature range of the MEMS gyroscope, the zero position data of the MEMS gyroscope at different temperatures are collected respectively;
[0134] The zero-position data at different temperatures are denoised using high-order polynomial fitting, and the preset standard zero-position curve is extracted.
[0135] The present device embodiment can be used to implement the above method embodiment. Its technical principle and implementation effect are the same as those of the above method embodiment, and will not be described in detail here.
[0136] Figure 6 Schematic diagram of an electronic device provided by an embodiment of the present invention. Figure 6As shown, the electronic device 6 of this embodiment includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60. When the processor 60 executes the computer program 62, the steps in the above-mentioned embodiments of the zero position compensation method of the MEMS gyroscope are implemented, for example Figure 1 Alternatively, when the processor 60 executes the computer program 62, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 5 The functions of modules 51 to 53 are shown.
[0137] Exemplarily, the computer program 62 may be divided into one or more modules / units, one or more modules / units are stored in the memory 61 and executed by the processor 60 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments that can implement specific functions, and the instruction segments are used to describe the execution process of the computer program 62 in the electronic device 6. For example, the computer program 62 may be divided into Figure 5 Modules 51 to 53 are shown.
[0138] The electronic device 6 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 6 may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will appreciate that Figure 6 It is only an example of the electronic device 6 and does not constitute a limitation of the electronic device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0139] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0140] The memory 61 may be an internal storage unit of the electronic device 6, such as a hard disk or memory of the electronic device 6. The memory 61 may also be an external storage device of the electronic device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 6. Further, the memory 61 may also include both an internal storage unit of the electronic device 6 and an external storage device. The memory 61 is used to store computer programs and other programs and data required by the electronic device. The memory 61 may also be used to temporarily store data that has been output or is to be output.
[0141] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0142] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0143] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0144] In the embodiments provided by the present invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0145] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0146] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0147] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned embodiments of the zero-position compensation method of each MEMS gyroscope can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for zero position compensation of a MEMS gyroscope, characterized in that: include: Obtain the zero position data of the MEMS gyroscope at different temperatures respectively; According to the preset number of interpolation points and the preset fitting error range, the distribution position of each interpolation point is optimized to obtain the optimal distribution position of each interpolation point; Based on the optimal distribution position of each interpolation point, spline interpolation is performed on the zero-position data of the MEMS gyroscope at different temperatures to obtain a zero-position drift polynomial by fitting; the zero-position drift polynomial is used to characterize the mathematical relationship between temperature and zero-position data; The current zero position data of the MEMS gyroscope is determined according to the current temperature of the MEMS gyroscope and the zero position drift polynomial, and the zero position compensation value is determined according to the current zero position data.
2. The zero position compensation method of the MEMS gyroscope according to claim 1, characterized in that: The method of optimizing the distribution position of each interpolation point according to the preset number of interpolation points and the preset fitting error range to obtain the optimal distribution position of each interpolation point includes: Initialize the particle swarm according to the preset number of interpolation points and obtain the position of each particle in the particle swarm; Based on the position of each particle, calculate the fitness value of each particle; Based on the optimal fitness value, update the position of each particle; Check whether the optimal fitness value is within the preset fitting error range and whether the current number of iterations reaches the preset number of iterations; If the optimal fitness value is not within the preset fitting error range and the current number of iterations has not reached the preset number of iterations, the process jumps to the step of calculating the fitness value of each particle based on the position of each particle and updates the current number of iterations until the optimal fitness value is within the preset fitting error range or the current number of iterations reaches the preset number of iterations. The optimal distribution position of each interpolation point is determined according to the position of the particle corresponding to the optimal fitness value.
3. The zero position compensation method of the MEMS gyroscope according to claim 2, characterized in that: The position of each particle represents a distribution of interpolation points; the interpolation point distribution includes the distribution position of each interpolation point; The step of calculating the fitness value of each particle based on the position of each particle includes: For each particle, determine the distribution position of each interpolation point according to the position of the particle; According to the distribution of each interpolation point, spline interpolation is performed on the zero position data of the MEMS gyroscope at different temperatures, and the zero position drift curve is obtained by fitting. The sum of squares of deviations between the zero drift curve and a preset standard zero curve is calculated, and the sum of squares of deviations is determined as the fitness value of the particle.
4. The zero position compensation method of a MEMS gyroscope according to any one of claims 1 to 3, characterized in that: The zero drift polynomial includes a plurality of cubic polynomials; Based on the optimal distribution position of each interpolation point, spline interpolation is performed on the zero position data of the MEMS gyroscope at different temperatures to fit the zero position drift polynomial, including: Based on the temperature order, the zero position data of the MEMS gyroscope at different temperatures are segmented to obtain the zero position data in multiple temperature intervals; Based on the optimal distribution position of each interpolation point, spline interpolation is performed on the zero-position data in each temperature interval to fit a cubic polynomial corresponding to each temperature interval; the cubic polynomial is used to characterize the mathematical relationship between temperature and zero-position data.
5. The zero position compensation method of a MEMS gyroscope according to claim 4, characterized in that: Determining the current zero position data of the MEMS gyroscope according to the current temperature of the MEMS gyroscope and the zero position drift polynomial includes: Determine, according to the current temperature of the MEMS gyroscope, a cubic polynomial corresponding to the temperature interval in which the current temperature is located; The current zero position data of the MEMS gyroscope is determined according to the current temperature and the cubic polynomial.
6. The zero position compensation method of a MEMS gyroscope according to any one of claims 1 to 3, characterized in that: Determining a zero position compensation value according to the current zero position data includes: Obtain preset standard zero position data; The difference between the standard zero position data and the current zero position data is determined as a zero position compensation value.
7. The zero position compensation method of a MEMS gyroscope according to claim 3, characterized in that: Before calculating the sum of squares of deviations between the zero drift curve and a preset standard zero curve, the method further includes: In the full operating temperature range of the MEMS gyroscope, the zero position data of the MEMS gyroscope at different temperatures are collected respectively; The zero-position data at different temperatures are denoised using high-order polynomial fitting to extract a preset standard zero-position curve.
8. A zero position compensation device for a MEMS gyroscope, characterized in that: include: An acquisition module, used for respectively acquiring zero position data of the MEMS gyroscope at different temperatures; An optimization module is used to optimize the distribution position of each interpolation point according to a preset number of interpolation points and a preset fitting error range to obtain the optimal distribution position of each interpolation point; Compensation modules for: Based on the optimal distribution position of each interpolation point, spline interpolation is performed on the zero-position data of the MEMS gyroscope at different temperatures to obtain a zero-position drift polynomial by fitting; the zero-position drift polynomial is used to characterize the mathematical relationship between temperature and zero-position data; The current zero position data of the MEMS gyroscope is determined according to the current temperature of the MEMS gyroscope and the zero position drift polynomial, and the zero position compensation value is determined according to the current zero position data.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the zero position compensation method of the MEMS gyroscope as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the zero position compensation method of the MEMS gyroscope as claimed in any one of claims 1 to 7 are implemented.