Nonlinear compensation method of MEMS sensor, storage medium and computer

By performing fixed-point quantization and multiplication shift optimization on the nonlinear compensation formula of MEMS sensor, the problem of degradation of measurement accuracy caused by the nonlinear characteristics of MEMS sensor is solved, reducing hardware costs and improving real-time compensation efficiency.

CN120427043APending Publication Date: 2025-08-05MEMSIC SEMICON WUXI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510575720.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

The output signal of MEMS sensors often exhibits nonlinear characteristics, resulting in a decrease in measurement accuracy. The existing nonlinear compensation technology requires high-bit width multiplier and large computing volume, which increases the chip hardware cost and affects real-time compensation efficiency.

Method used

The initial nonlinear compensation formula is quantized and shifted in fixed-point, and then the multiplication and shift optimization is performed on the fixed-point quantized formula to reduce the bit width of the multiplier and intermediate data.

Benefits of technology

By optimizing the nonlinear compensation formula, the bit width of the multiplier and intermediate data is reduced, hardware resources are saved and real-time compensation efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120427043A_ABST
    Figure CN120427043A_ABST
Patent Text Reader

Abstract

The invention provides a nonlinear compensation method of an MEMS sensor, a storage medium and a computer. The non-linear compensation method comprises the following steps: performing fixed-point quantization on an initial non-linear compensation formula and shifting to obtain a non-linear compensation formula after fixed-point quantization; performing multiplication shift optimization on each item in the nonlinear compensation formula after fixed-point quantization to obtain an optimized nonlinear compensation formula; and performing nonlinear compensation on an input signal from the MEMS sensor based on the optimized nonlinear compensation formula. In this way, the bit widths of the multiplier and the intermediate variable can be reduced to save hardware resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field

[0001] The present invention relates to the field of nonlinear compensation of MEMS sensors, and in particular to a nonlinear compensation method, a storage medium and a computer based on MEMS sensors. [Background Technology]

[0002] MEMS (micro-electromechanical system) sensors, with their advantages of miniaturization and low power consumption, are widely used in consumer electronics, industrial control, the Internet of Things, and other fields. However, due to factors such as material properties and manufacturing processes, the output signals of MEMS sensors often exhibit nonlinear characteristics, resulting in reduced measurement accuracy. Therefore, nonlinear compensation technology is needed to compensate for the nonlinearity of the sensor output.

[0003] Nonlinear compensation can usually be performed according to the following nonlinear compensation formula:

[0004] y=A n *x n +A n-1 *x n-1 …+A1*x+A0, where y is the output after nonlinear compensation; x is the input before nonlinear compensation, n is x to the power of n, A n is the compensation coefficient of different order terms. Note that this formula is a floating point calculation formula, that is, the coefficient A0-A n and variables x are floating point numbers.

[0005] When implementing the nonlinear compensation in a chip, fixed-point quantization and shifting are required. The formula after fixed-point quantization is:

[0006] y=A n *x n >>W n +A n-1 *x n-1 >>W n-1 …+A1*x>>W1+A0>>W0

[0007] Among them, W n is the number of shifts for terms of different orders. Note that this formula is a fixed-point calculation formula, meaning both the coefficient A0-An and the variable x are fixed-point numbers. However, when performing nonlinear compensation, the multiplier must have a high bit width, resulting in a large computational load. This not only increases chip hardware cost but also may affect real-time compensation efficiency. [Summary of the invention]

[0008] One of the objectives of the present invention is to provide a nonlinear compensation method for a MEMS sensor, a storage medium, and a computer, which can reduce the bit width of a multiplier and the bit width of intermediate data to save hardware resources.

[0009] According to one aspect of the present invention, a nonlinear compensation method for a MEMS sensor is provided, which comprises: performing fixed-point quantization on an initial nonlinear compensation formula and shifting the formula to obtain a fixed-point quantized nonlinear compensation formula, wherein the initial nonlinear compensation formula is: y = A n *x n +A n-1 *x n-1 …+A1*x+A0, where y is the output signal after nonlinear compensation, x is the input signal before nonlinear compensation, and x n is x to the power of n, A n is the compensation coefficient of different order terms, n is a natural number greater than or equal to 1, and A0-A in the initial nonlinear compensation formula n , x are all floating point numbers, and the nonlinear compensation formula after fixed-point quantization is: y = A n *x n >>W n +A n-1 *x n-1 >>W n-1 …+A1*x>>W1+A0>>W0, W1 to W n is the number of shifts of different order terms, W1 to W n is a natural number greater than or equal to 1. A0-A in the nonlinear compensation formula after fixed-point quantization n , x are both fixed-point numbers; multiplication and shift optimization is performed on each item in the nonlinear compensation formula after fixed-point quantization to obtain an optimized nonlinear compensation formula; nonlinear compensation is performed on the input signal from the MEMS sensor based on the optimized nonlinear compensation formula.

[0010] According to another aspect of the present invention, the present invention provides a storage medium storing program instructions, wherein the program instructions are executed to perform the above-mentioned nonlinear compensation method.

[0011] According to another aspect of the present invention, the present invention provides a computer, comprising a processor and a memory, wherein the memory stores program instructions, and the processor runs the program instructions to perform the above-mentioned nonlinear compensation method.

[0012] Compared with the prior art, the present invention optimizes the multiplication and shift of each term in the nonlinear compensation formula after fixed-point quantization, thereby reducing the bit width of the required multiplier and the bit width of the intermediate data, thereby saving hardware resources.

Brief Description of the Drawings

[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive effort. Among them:

[0014] Figure 1 FIG. 1 is a flow chart of a nonlinear compensation method for a MEMS sensor according to an embodiment of the present invention. [Specific implementation method]

[0015] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0016] As used herein, "one embodiment" or "embodiment" refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in various places throughout this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0017] The present invention provides a nonlinear compensation method for a MEMS sensor, which can reduce the bit width of a multiplier and the bit width of intermediate data to save hardware resources.

[0018] Figure 1 FIG. 1 is a flow chart of a nonlinear compensation method for a MEMS sensor in one embodiment of the present invention. Figure 1 As shown, the nonlinear compensation method includes the following steps.

[0019] Step 110, the initial nonlinear compensation formula is fixed-point quantized and shifted to obtain a nonlinear compensation formula after fixed-point quantization, wherein the initial nonlinear compensation formula is: y = A n *x n +A n-1 *x n-1 …+A1*x+A0, where y is the output signal after nonlinear compensation, x is the input signal before nonlinear compensation, and x n is x to the power of n, A n is the compensation coefficient of different order terms, n is a natural number greater than or equal to 1, and A0-A in the initial nonlinear compensation formula n , x are all floating point numbers, and the nonlinear compensation formula after fixed-point quantization is: y = A n *x n >>W n +A n-1 *x n-1 >>W n-1…+A1*x>>W1+A0>>W0, W1 to W n is the number of shifts of different order terms, W1 to W n is a natural number greater than or equal to 1. A0-A in the nonlinear compensation formula after fixed-point quantization n , x are both fixed-point numbers.

[0020] Step 120 , performing multiplication and shift optimization on each term in the fixed-point quantized nonlinear compensation formula to obtain an optimized nonlinear compensation formula.

[0021] Specifically, step 120 includes:

[0022] Perform multiplication and shift optimization on each power shift term in the nonlinear compensation formula after fixed-point quantization, where A n *x n >>W n is a power shift term, and the multiplication and shift optimization of each power shift term includes:

[0023] Step 121, for the power shift term A n *x n >>W n Perform multiply-shift optimization, which includes:

[0024] a) First, adjust the multiplication order according to the bit width:

[0025] If b An ≤b x ,A n *x n >>W n =A n *x*x…*x>>W n , a total of n x multiplications, b An A n The bit width, b x is the bit width of x;

[0026] If b An >b x ,A n *x n >>W n =x*x…*x*A n >>W n , a total of n items x are multiplied;

[0027] b) Then, A n *x*x…*x>>W n or x*x…*x*A n >>W nArrange it into a product of two terms with a shift: X1 * X2 >> N, where X1 is the first multiplier and X2 is the product of all the remaining multipliers after the first multiplier. At this time, X1 is A n or x, and X2 is (x * x... * x) or (x... * x * A n ), and N is W n ; N is greater than or equal to 1, the bit width of the first multiplier X1 is b1, the bit width of the second multiplier X2 is b2, and N is the shift amount, where b1 ≤ b2

[0028] c) Subsequently, perform the multiplication - shift optimization for X1 * X2 >> N:

[0029] If b1 ≥ N, the multiplication - shift optimization cannot be performed, and the original multiplication - shift operation is still maintained:

[0030] X1 * X2 >> N = X1 * X2 >> N

[0031] If b1 < N, then perform the multiplication - shift optimization for X1 * X2 >> N, that is:

[0032] X1 * X2 >> N = X1 * [X2 >> (N - b1)] >> b1;

[0033] d) If X2 in X1 * [X2 >> (N - b1)] >> b1 can still be split into the product of two numbers (that is, X2 is still the product of multiple numbers, such as X2 is (x * x... * x) or (x... * x * A n )), then according to step b), arrange X2 >> (N - b1) into X1 * X2 >> N, where X1 is the first multiplier and X2 is the product of all the remaining multipliers after the first multiplier, and then perform the multiplication - shift optimization according to step c), repeating the above multiplication - shift optimization until X2 cannot be split into the product of two numbers again.

[0034] The following analyzes the principle of the multiplication - shift optimization that can be performed on X1 * X2 >> N.

[0035] X1 * X2 >> N = X1 * (X2 msb << (N - b1)+X2 lsb ) >> N

[0036] Among them, X2 lsb is the low N - b1 bits of X2, X2 msb is the high b1 + b2 - N bits of X2, and X2 msb = X2 >> (N - b1).

[0037] Considering the numerical range of X1 * X2 lsb < 2 b1+N-b1 , it can be deduced that X1 * X2 lsb >> N = 0, that is:

[0038] X1*X2>>N=X1*(X2 msb <<(N-b1)+X2 lsb )>>N={X1*(X2 msb <<(N-b1))>>N}+{X1*

[0039] X2 lsb >>N}

[0040] =X1*[X2>>(N-b1)]<<(N-b1)>>N=X1*[X2>>(N-b1)]>>b1.

[0041] Step 122, using the same method (ie for the power shift term A n *x n >>W n The multiplication and shift optimization method) for the remaining power shift terms A n-1 *x n-1 >>W n-1 ...each power shift term in A1*x>>W1 is optimized by multiplication and shift.

[0042] Step 130 : Perform nonlinear compensation on the input signal from the MEMS sensor based on the optimized nonlinear compensation formula.

[0043] Since the nonlinear compensation formula is optimized by multiplication and shift, when executing the multiplication operation in the nonlinear compensation formula, the bit width of the multiplier and the bit width of the intermediate data can be reduced, thereby saving hardware resources.

[0044] According to another aspect of the present invention, a storage medium is provided, which stores program instructions, wherein the program instructions are executed to perform the nonlinear compensation method described above. For the sake of simplicity, the specific content of the nonlinear compensation method is not repeated here.

[0045] According to another aspect of the present invention, a computer is provided, comprising a processor and a memory, wherein the memory stores program instructions, and the processor executes the program instructions to perform the nonlinear compensation method described above. For the sake of brevity, the specific details of the nonlinear compensation method are not repeated here.

[0046] In the description of this specification, reference to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification.

[0047] Although embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention, and that those skilled in the art may make changes, modifications and variations to the above embodiments within the scope of the present invention.

Claims

1. A nonlinear compensation method for a MEMS sensor, characterized in that: It includes: The initial nonlinear compensation formula is fixed-point quantized and shifted to obtain the nonlinear compensation formula after fixed-point quantization, where the initial nonlinear compensation formula is: y = A n *x n +A n-1 *x n-1 …+A1*x+A0, where y is the output signal after nonlinear compensation, x is the input signal before nonlinear compensation, and x n is the power of x, A n is the compensation coefficient of different order terms, n is a natural number greater than or equal to 1, and A0-A in the initial nonlinear compensation formula n , x are all floating point numbers, and the nonlinear compensation formula after fixed-point quantization is: y = A n *x n >>W n +A n-1 *x n-1 >>W n-1 …+A1*x>>W1+A0>>W0, W1 to W n is the number of shifts of different order terms, W1 to W n is a natural number greater than or equal to 1. A0-A in the nonlinear compensation formula after fixed-point quantization n , x are both fixed-point numbers; Performing multiplication and shift optimization on each term in the non-linear compensation formula after fixed-point quantization to obtain an optimized non-linear compensation formula; and Based on the optimized non-linear compensation formula, performing non-linear compensation on the input signal from the MEMS sensor.

2. The nonlinear compensation method according to claim 1, wherein: The performing multiplication and shift optimization on each term in the non-linear compensation formula after fixed-point quantization to obtain an optimized non-linear compensation formula includes: Perform multiplication and shift optimization on each power shift term in the nonlinear compensation formula after fixed-point quantization, where A n *x n >>W n is a power shift term, and the multiplication and shift optimization of each power shift term includes: For the power shift term A n *x n >>W n Perform multiply-shift optimization, which includes: a) First, adjusting the consecutive multiplication order according to the bit width: If b An ≤b x ,A n *x n >>W n =A n *x*x…*x>>W n , a total of n x multiplications, b An A n The bit width, b x is the bit width of x; If b An >b x ,A n *x n >>W n =x*x…*x*A n >>W n , a total of n items x are multiplied; b) Then, A n *x*x…*x>>W n or x*x…*x*A n >>W n Arrange it into two multiplications and shifts X1*X2>>N, where X1 is the first multiplier and X2 is the multiplication of all the remaining multipliers after the first multiplier. At this time, X1 is A n or x, X2 is (x*x…*x) or (x…*x*A n ), N is W n ; N is greater than or equal to 1, the bit width of the first multiplier X1 is b1, the bit width of the second multiplier X2 is b2, N is the number of shifts, where b1≤b2, c) Subsequently, performing multiplication and shift optimization on X1*X2>>N: If b1≥N, multiplication and shift optimization cannot be performed, and the original multiplication and shift operation is still maintained: X1*X2>>N = X1*X2>>N If b1<N, then perform multiplication and shift optimization on X1*X2>>N, that is: X1*X2>>N = X1*[X2>>(N - b1)]>>b1; d) If X2 in X1*[X2>>(N - b1)]>>b1 can still be split into the consecutive multiplication of two numbers, then according to step b), organize X2>>(N - b1) into X1*X2>>N, and then perform multiplication and shift optimization according to step c), repeating the above multiplication and shift optimization until X2 cannot be split into the consecutive multiplication of two numbers again; Use the same method to shift the remaining power terms A n-1 *x n-1 >>W n-1 ...each power shift term in A1*x>>W1 is optimized by multiplication and shift.

3. A storage medium, characterized in that: It stores program instructions, and the program instructions are run to execute the non-linear compensation method as described in any one of claims 1-2.

4. A computer, characterized in that: It includes a processor and a memory. The memory stores program instructions, and the processor runs the program instructions to execute the non-linear compensation method as described in any one of claims 1-2.