Comparator and MEMS gyroscope

By using a programmable resistor in the comparator of the MEMS gyroscope to automatically compensate for the input offset voltage, the problem of timing changes caused by the input offset in the existing technology is solved, and the temperature coefficient offset performance of the gyroscope is improved without increasing the The signal quality is improved while reducing the area.

CN118713635APending Publication Date: 2024-09-27MEMSIC SEMICON (TIANJIN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410705018.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

The input offset voltage of the comparator in the existing MEMS gyroscope causes timing changes, affecting the temperature coefficient offset and temperature coefficient sensitivity of the gyroscope, and the existing AC coupling method cannot effectively eliminate the offset and comparator driving the charge amplifier output Internal input offset, causing signal quality degradation.

Method used

Design a comparator that contains a programmable resistor to automatically compensate or correct the input offset voltage. By calculating the actual value of the duty cycle of the comparison signal, and adjusting the resistor value to make it approach the ideal value, automatic compensation for the input offset is achieved. .

Benefits of technology

It effectively reduces the phase error of the comparator output, improves the temperature coefficient offset performance of the MEMS gyroscope, reduces the impact of temperature changes on the gyroscope output signal, and solves the input offset problem without increasing the chip area. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118713635A
    Figure CN118713635A
Patent Text Reader

Abstract

The invention provides a comparator and an MEMS (Micro Electro Mechanical System) gyroscope. The comparator comprises an input stage, an output stage and a deviation compensation module. The input stage comprises a first programmable resistor and a second programmable resistor, and the input stage receives positive-phase and negative-phase input signals; the output stage outputs a comparison signal of the positive phase input signal and the negative phase input signal; the deviation compensation module calculates the actual value of the duty ratio of the comparison signal, and outputs a resistance control signal to adjust the resistance value of the first programmable resistor and / or the second programmable resistor when the actual value of the duty ratio of the comparison signal does not meet the requirement. And the actual value of the duty ratio of the comparison signal approaches or is equal to the ideal value of the duty ratio of the comparison signal. In this way, the input offset voltage of the comparator can be automatically compensated or corrected.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the field of circuit design, and in particular to a comparator capable of automatically compensating for input offset voltage and a MEMS (Micro-Electro-Mechanical System) gyroscope using the comparator. [Background technology]

[0002] The Chinese patent application with patent number 202211717826.0 discloses a MEMS gyroscope, the structure of which is as follows: Figure 1 The MEMS gyroscope 100 includes a MEMS inertial sensing part 110 and a gyroscope interface circuit. The MEMS inertial sensing part 110 is a sensor device of the MEMS gyroscope 100 .

[0003] like Figure 1 As shown, the MEMS inertial sensing part 110 includes: a driving capacitor group D_p and D_n, a driving detection capacitor group D_sense_p and D_sense_n, and a detection capacitor group of one or more axes. The gyro interface circuit includes: a driving circuit, a detection circuit of one or more axes, and a digital processing circuit 121. The driving circuit includes a driving charge amplifier DSCA, a first input end of the driving charge amplifier DSCA is connected to one end of the first driving detection capacitor D_sense_p in the driving detection capacitor group D_sense_p and D_sense_n, and a second input end of the driving charge amplifier DSCA is connected to one end of the second driving detection capacitor D_sense_n in the driving detection capacitor group D_sense_p and D_sense_n. The detection circuit includes a detection charge amplifier SCSA for one or more axes, a first input end of the detection charge amplifier SCSA of each axis is connected to one end of the first detection capacitor in the detection capacitor group of the corresponding axis, and a second input end of the detection charge amplifier of each axis is connected to one end of the second detection capacitor in the detection capacitor group of the corresponding axis. As shown Figure 1 As shown, the driving circuit further includes a comparator Comp, a phase-locked loop PLL, a driving analog-to-digital converter DADC, an automatic gain control digital-to-analog converter AGC_DAC and a driving mixer d_mixer.

[0004] The digital processing circuit 121 includes an automatic gain control module (AGC) 1212. The first input terminal of the comparator Comp is connected to the first output terminal of the driving charge amplifier DSCA, the second input terminal of the comparator Comp is connected to the second output terminal of the driving charge amplifier DSCA, the reference input terminal ref_pll of the phase-locked loop PLL is connected to the output terminal of the comparator Comp, the comparator Comp provides a reference clock to the phase-locked loop PLL, and the output terminal of the phase-locked loop PLL is connected to the digital processing circuit 121. The phase-locked loop PLL generates a phase-locked loop clock pll_clk based on the reference clock.

[0005] The digital processing circuit 121 generates a feedback clock pll_fb_clk with the same frequency and phase as the reference clock based on the phase-locked loop clock pll_clk, and provides the feedback clock pll_fb_clk to the feedback input terminal fb_pll of the phase-locked loop PLL. The digital processing circuit 121 shifts the feedback clock pll_fb_clk by -90 degrees and provides it to the driving mixer d_mixer through the driving clock port as a driving clock signal clk_gyro.

[0006] The two input ends of the driving analog-to-digital converter DADCC are respectively connected to the first output end and the second output end of the driving charge amplifier DSCA to convert the voltage signal output by the driving charge amplifier DSCA into a digital voltage signal. The automatic gain control module AGC performs low-pass filtering on the digital voltage signal by driving the low-pass filter DLPF, and then gives a digital gain control signal DAC_da for controlling the driving amplitude through a PID controller. The digital gain control signal DAC_da is converted into an analog gain control signal by the automatic gain control digital-to-analog converter AGC_DAC and provided to the driving mixer d_mixer.

[0007] The driving mixer d_mixer generates a driving signal according to the driving clock signal and the analog gain control signal to drive the mass blocks corresponding to the driving capacitor groups D_p and D_n to perform simple harmonic motion. As the mass blocks perform simple harmonic motion, the capacitance of the driving detection capacitor groups D_sense_p and D_sense_n changes.

[0008] The charge transfer caused by the change of the driving detection capacitor group D_sense_p and D_sense_n is sensed and amplified by the driving charge amplifier DCSA and converted into a voltage signal. The comparator Comp converts the output of the driving charge amplifier DCSA into a square wave signal, and the square wave signal of the comparator Comp flips at the zero-crossing point of the output of the driving charge amplifier DCSA. The phase-locked loop PLL uses the output of the comparator Comp as its reference clock and outputs a multiplied high-frequency clock of the reference clock as the phase-locked loop clock pll_clk. The digital processing circuit 121 generates a feedback clock pll_fb_clk with the same frequency and phase as the reference clock based on the phase-locked loop clock pll_clk through frequency division. The phase-locked loop PLL loop can realize the self-excited start-up of the MEMS gyroscope and lock the vibration frequency of the MEMS drive near the resonant frequency of the drive, thereby ensuring the stable operation of the gyroscope.

[0009] A first connection end of the driving mixer d_mixer is connected to one end of a first driving capacitor D_p in the driving capacitor group, and a second connection end of the driving mixer d_mixer is connected to one end of a second driving capacitor D_n in the driving capacitor group.

[0010] Since the square wave signal output by the comparator Comp will be used as the reference clock, the output of the comparator Comp needs to be very accurate, and at the same time, the delay and delay variation (such as changes with temperature) must be minimized. The delay variation of the reference clock with temperature may cause the TCO and TCS specifications of the entire gyroscope product to deteriorate, and TCO (low temperature coefficient offset) and TCS (temperature coefficient sensitivity) are key specifications of gyroscope products, indicating the stability of the gyroscope output signal (dps) when the temperature changes.

[0011] In previous gyroscope products, a simple comparator Comp was connected to the output of the driving charge amplifier DCSA. There are two problems with this:

[0012] 1) Due to variations (mismatches) in (CMOS) production technology, each comparator has an input offset voltage. This input offset voltage changes with temperature, and changes in the input offset voltage translate into timing changes in the output of the comparator Comp.

[0013] 2) The driver charge amplifier DCSA also has an output offset voltage, which is also an input offset voltage for the comparator Comp. This offset voltage may be caused by production defects (mismatch) of the driver charge amplifier DCSA (integrated circuit technology, such as CMOS) or by leakage currents in the MEMS technology (MEMS technology defects) and / or leakage currents at the MEMS-CMOS interface (ESD protection device, solder pad leakage).

[0014] Due to the effects of leakage current, a large feedback resistor is required between the output and input of the driver charge amplifier DCSA to determine the DC input voltage without causing too much phase shift. The phase shift is caused by the parallel RC combination, which consists of the feedback resistor and the feedback capacitor mentioned above, and also exists between the input and output, and realizes the main function of the driver charge amplifier DCSA (current integration / amplification). The typical value of the feedback resistor of the driver charge amplifier DCSA is 1GΩ. When the leakage current (the difference between the positive and negative input terminals) is only 10pA, the output offset voltage of the driver charge amplifier DCSA is V off,DCSA =I leak ·R FB =10pA·1GΩ=10mV. Therefore, assuming that the leakage current is only 10pA, the offset voltage generated is about 10mV, and by properly designing and laying out the driving charge amplifier DCSA and the comparator, the input offset voltage can be kept below 10mV.

[0015] The effect of the offset voltage on the timing error of the comparator output can be calculated. For example, if the offset voltage is V offset =10mV driving charge amplifier DCSA output signal, its amplitude Vampl is: Vampl = 1V, then the phase error for:

[0016]

[0017] To achieve acceptable TCO (temperature coefficient offset), the phase error (variation with temperature) must be (much) below 0.1°. Note that an amplitude of 1V is a relatively large amplitude, and for a given offset voltage, a smaller amplitude will result in a larger phase error.

[0018] One technique to remove DC offset in the signal chain is to add an AC coupling capacitor, QDAC, such as Figure 1 As shown. The AC coupling capacitor QDAC will be placed between the output of the driving charge amplifier DCSA and the input of the comparator. However, in the intended application (gyroscope readings), AC coupling is not practical due to some limitations. The AC coupling high-pass cutoff frequency (-3dB frequency) is calculated as:

[0019]

[0020] Where C is the AC coupling capacitor value, R is the resistor, which is used to connect the nodes after AC coupling ( Figure 1The required DC voltage is provided at the input of the comparator in the DC coupling circuit. To avoid signal attenuation and, more importantly (in this application), phase shift, the cutoff frequency must be much lower than the required signal frequency (>10 times). The required signal frequency (i.e., the driving resonance frequency of the MEMS) is about 25 kHz. To obtain a cutoff frequency at least 10 times lower (2.5kHz), large components that occupy a large chip area are required, such as C=10pF and R=6.5MΩ. Please note that since the signal at the output of the driving charge amplifier DCSA and the input of the comparator is a differential signal, both R and C need to be placed 2 times, doubling the area calculated above. In addition, the AC coupling method can only eliminate the offset of the output of the driving charge amplifier DCSA, but cannot eliminate the internal input offset of the comparator.

[0021] Therefore, it is urgent to propose a new technical solution to solve the above problems. [Summary of the invention]

[0022] One of the objectives of the present invention is to provide a comparator and a MEMS gyroscope using the comparator, wherein the comparator can automatically compensate or correct an input offset voltage of the comparator.

[0023] According to one aspect of the present invention, the present invention provides a comparator, which includes: an input stage, which includes a first programmable resistor coupled to a positive input side and a second programmable resistor coupled to a negative input side, wherein the input stage receives a positive input signal and a negative input signal; an output stage coupled to the input stage, which includes an output end, and outputs a comparison signal of the positive input signal and the negative input signal through the output end; a deviation compensation module, which is used to calculate the actual value of the duty cycle of the comparison signal, and when the actual value of the duty cycle of the comparison signal does not meet the requirements, the output resistance control signal adjusts the resistance value of the first programmable resistor and / or the second programmable resistor, thereby making the actual value of the duty cycle of the comparison signal approach or equal to the ideal value of the duty cycle of the comparison signal.

[0024] According to another aspect of the present invention, the present invention provides a MEMS gyroscope, which includes: a MEMS inertial sensing part, which includes: a driving capacitor group, a driving detection capacitor group, and a detection capacitor group of one or more axes; a gyroscope interface circuit, which includes: a driving circuit, a detection circuit of one or more axes, and a digital processing circuit; the driving circuit includes a driving charge amplifier, a first input end of the driving charge amplifier is connected to one end of a first driving detection capacitor in the driving detection capacitor group, a second input end of the driving charge amplifier is connected to one end of a second driving detection capacitor in the driving detection capacitor group, and the detection circuit includes a detection charge amplifier for one or more axes. , the first input end of the detection charge amplifier of each axis is connected to one end of the first detection capacitor in the detection capacitor group of the corresponding axis, and the second input end of the detection charge amplifier of each axis is connected to one end of the second detection capacitor in the detection capacitor group of the corresponding axis. The driving circuit also includes the comparator and phase-locked loop mentioned above, the first input end of the comparator is connected to the first output end of the driving charge amplifier, the second input end of the comparator is connected to the second output end of the driving charge amplifier, the reference input end of the phase-locked loop is connected to the output end of the comparator, the comparator provides a reference clock to the phase-locked loop, and the output end of the phase-locked loop is connected to the digital processing circuit.

[0025] Compared with the prior art, the comparator in the present invention can automatically compensate or correct the input offset voltage of the comparator by adjusting the resistance values ​​of the first programmable resistor and the second programmable resistor.

Brief Description of the Drawings

[0026] 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. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:

[0027] Figure 1 This is the structural schematic diagram of the MEMS gyroscope.

[0028] Figure 2 is a circuit diagram of a comparator in one embodiment of the present invention;

[0029] Figure 3 for Figure 1 A schematic diagram of the structure of a programmable resistor in a comparator;

[0030] Figure 4 This is an example diagram of compensation of the input offset voltage of the comparator in the present invention; [Specific implementation method]

[0031] 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.

[0032] The term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in 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.

[0033] In the present invention, unless otherwise clearly specified and limited, terms such as "connected", "connected", "coupled", "connected" and the like indicating electrical connection should be understood in a broad sense; for example, it can be directly connected or indirectly connected through an intermediate medium, and the intermediate medium can be an electronic component, a functional circuit, etc. For example, the case where A and B are coupled includes A and B being directly connected, and also includes A and B being connected through electronic components and functional circuits. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0034] like Figure 1 As shown, the input signal of the comparator Comp comes from the driving charge amplifier DCSA, and the signal of the driving charge amplifier DCSA comes from the driving detection capacitor group D_sense_p and D_sense_n, and the mechanical simple harmonic motion of the mass block of the MEMS will cause the capacitance of the driving detection capacitor group D_sense_p and D_sense_n to change, so the ideal value of the duty cycle of the comparison signal output by the comparator Comp should be 50%, and this fact can be used to correct or compensate for the potential input offset of the comparator Comp. If the comparator Comp has a positive input offset voltage, the actual value of the duty cycle of the comparison signal output by the comparator Comp will be lower than 50%, and if the comparator Comp has a negative input offset voltage, the actual value of the duty cycle of the comparison signal output by the comparator Comp will be higher than 50%.

[0035] Figure 2 FIG. 2 is a circuit diagram of a comparator 200 in one embodiment of the present invention. Figure 2 As shown, the comparator includes an input stage 210 , an output stage 220 and an offset compensation module 230 .

[0036] The input stage 210 includes a first programmable resistor R1 coupled to the positive phase input side and a second programmable resistor R2 coupled to the negative phase input side, wherein the input stage receives a positive phase input signal Vin+ and a negative phase input signal Vin-. The output stage 220 is coupled to the input stage and includes an output terminal, through which a comparison signal S of the positive phase input signal and the negative phase input signal is output.

[0037] The deviation compensation module 230 is used to calculate the actual value of the duty cycle of the comparison signal S, and when the actual value of the duty cycle of the comparison signal does not meet the requirements, the output resistance control signal (Control signal) adjusts the resistance value of the first programmable resistor R1 and / or the second programmable resistor R2 to increase or decrease the difference between the resistance values ​​of the first programmable resistor and the second programmable resistor, thereby making the actual value of the duty cycle of the comparison signal approach or equal to the ideal value of the duty cycle of the comparison signal. Specifically, the resistance control signal is determined based on the difference between the actual value of the duty cycle of the comparison signal and the ideal value of the duty cycle of the comparison signal. In one embodiment, the resistance value of the first programmable resistor R1 or the second programmable resistor R2 can be controlled separately, or the resistance values ​​of the first programmable resistor R1 and the second programmable resistor R2 can be controlled simultaneously.

[0038] When the actual value of the duty cycle of the comparison signal is equal to the ideal value of the duty cycle of the comparison signal, or when the difference between the actual value and the ideal value of the duty cycle of the comparison signal is less than a predetermined range, or when the actual value of the duty cycle of the comparison signal is closest to the ideal value of the duty cycle of the comparison signal (for example, if the actual value of the duty cycle of the comparison signal is adjusted again in the expectation of being closer to the ideal value of the duty cycle of the comparison signal, it will instead exceed the ideal value of the duty cycle of the comparison signal), the actual value of the duty cycle of the comparison signal meets the requirement, which means that the input deviation voltage of the comparator can be compensated or corrected by utilizing the deviation intentionally set between the first programmable resistor and the second programmable resistor, and at this time, the resistance control signal is output so that the first programmable resistor and / or the second programmable resistor maintains the current resistance value.

[0039] Specifically, the comparison signal S flips when the positive phase input signal is equal to the negative phase input signal. Preferably, the ideal value of the duty cycle of the comparison signal is 50%. In other embodiments, the ideal value of the duty cycle of the comparison signal may also be other values, such as 40%, etc., as long as the specific value of the ideal value of the duty cycle of the comparison signal can be known in advance.

[0040] like Figure 2As shown, the input stage 210 further includes a first differential transistor MP1 connected in series between the middle node A and the first programmable resistor R1 and a second differential transistor MP2 connected in series between the middle node A and the second programmable resistor R2. The gate of the first differential transistor MP1 receives the positive phase input signal Vin+, and the gate of the second differential transistor MP2 receives the negative phase input signal Vin-. The input stage 210 further includes a first current source I1 connected between the first power supply terminal VDD and the middle node A, for providing injection current to the middle node A. The other end of the first programmable resistor R1 is coupled to the second power supply terminal, and the other end of the second programmable resistor R2 is coupled to the second power supply terminal, which can be a ground terminal. The first differential transistor MP1 and the second differential transistor MP2 are both PMOS transistors. The source of the first differential transistor MP1 is coupled to the middle node A, the drain of the first differential transistor MP1 is coupled to the first programmable resistor R1, the source of the second differential transistor MP2 is coupled to the middle node A, and the drain of the second differential transistor MP2 is coupled to the second programmable resistor R2.

[0041] Figure 3 for Figure 1 Schematic diagram of the structure of the first programmable resistor R1 in the comparator in FIG. Each programmable resistor includes a resistor unit string formed by a plurality of resistor units connected in series and a programming switch connected in parallel with each resistor unit in part or all of the resistor units. By controlling the conduction or disconnection of each programming switch, the resistor unit corresponding to the programming switch is removed or incorporated into the resistor unit string, thereby controlling the resistance value of each programmable resistor. Preferably, the resistance value of each resistor unit in the resistor unit string is X, 2 1 *X, 2 2 *X, ..., 2 N *X, where N is the number of resistance units, and N is a natural number greater than or equal to 2, so that a larger programmable resistance range can be obtained with fewer resistance units. Figure 3 As shown, the first programmable resistor R1 includes a resistor unit string formed by four resistor units R11-R14 connected in series and three programming switches S12-S14, each programming switch is connected in parallel with a resistor unit. For example, when the programming switch S12 is turned on, the first programmable resistor R1 will not include the resistor unit R12, and when the programming switch S12 is turned off, the first programmable resistor R1 will include the resistor unit R12. Of course, N can also be other values, such as 6, 9, etc. The programming switch can be implemented by a MOS transistor.

[0042] like Figure 2As shown, the output stage 220 includes: a second current source I2, a first bias current output unit 221 coupled to the second current source I2, a second bias current output unit 222 coupled to the second current source I2, and an output module 223. The input end of the first bias current output unit 221 is coupled to the node between the first differential transistor MP1 and the first programmable resistor R1, and the first bias current is injected into the node B through its output end. The input end of the second bias current output unit 222 is coupled to the node between the second differential transistor MP2 and the second programmable resistor R2, and the second bias current is extracted from the node B through its output end. The first bias current competes with the second bias current at the node B. The input end of the output module 223 is coupled to the node B, and the output end thereof outputs a comparison signal.

[0043] In one embodiment, the first bias current output unit 221 includes PMOS transistors MP3, MP6, and an NMOS transistor MN1, wherein the PMOS transistors MP3 and MP6 form a current mirror, the sources of the PMOS transistors MP3 and MP6 are coupled to the first power supply terminal VDD, the gates of the PMOS transistors MP3 and MP6 are interconnected, the drain of the PMOS transistor MP6 serves as an output terminal to inject the first bias current into the node B, the gate of the NMOS transistor MN1 serves as an input terminal to couple to the node between the first differential transistor MP1 and the first programmable resistor R1, the drain of the NMOS transistor MN1 is coupled to the drain of the PMOS transistor MP3, and the source of the NMOS transistor MN1 is coupled to one end of the second current source. The second bias current output unit 222 includes PMOS transistors MP4, MP5, NMOS transistors MN2, MN3 and MN4, wherein the PMOS transistors MP4 and MP5 form a current mirror, the sources of the PMOS transistors MP4 and MP5 are coupled to the first power supply terminal VDD, the gates of the PMOS transistors MP4 and MP5 are interconnected, the drain of the NMOS transistor MN2 is coupled to the drain of the PMOS transistor MP4, the source of the NMOS transistor MN2 is coupled to one end of the second current source I2, the drain of the PMOS transistor MP5 is coupled to the drain of the NMOS transistor MN3, the NMOS transistors MN3 and MN4 form a current mirror, the sources of the NMOS transistors MN3 and MN4 are coupled to the second power supply terminal, the gates of the NMOS transistors MN3 and MN4 are interconnected, and the drain of the NMOS transistor MN4 is used as an output terminal to extract the second bias current to the node B. The output module includes a plurality of cascaded inverters, such as 2 or 4 cascaded inverters.

[0044] Figure 2Only one example of the first bias current output unit 221 and the second bias current output unit 222 is given. In other embodiments, the first bias current output unit 221 and the second bias current output unit 222 may also adopt other existing structures. Figure 2 A specific circuit structure of the input stage 210 is given in FIG. 1 . In other embodiments, other existing circuit structures may also be used.

[0045] In one embodiment, the deviation compensation module 230 uses a clock signal to count the positive phase level and the negative phase level of the comparison signal to obtain the actual value of the duty cycle of the comparison signal. When the actual value of the duty cycle of the comparison signal meets the requirements, the resistance control signal is output so that the first programmable resistor R1 and / or the second programmable resistor R2 maintain the current resistance value. When the actual value of the duty cycle of the comparison signal does not meet the requirements, the resistance control signal is output to adjust the resistance value of the first programmable resistor R1 and / or the second programmable resistor R2 to increase or decrease the difference between the resistance values ​​of the first programmable resistor and the second programmable resistor, wherein the difference between the resistance values ​​of the first programmable resistor and the second programmable resistor that is increased or decreased is related to the difference between the actual value and the ideal value of the duty cycle of the comparison signal. The frequency of the clock signal is much higher than the frequency of the comparison signal, for example, the frequency of the clock signal is more than 10 times higher than the frequency of the comparison signal.

[0046] Preferably, the deviation compensation module 230 includes a counting module, a counting register and a control output module. In a counting cycle, the counting module uses a clock signal to count up (i.e., increase) from an initial value (0 in the first counting cycle, and a signed count value obtained in the previous counting cycle in subsequent counting cycles) at the first transition edge (e.g., rising edge) of the comparison signal and obtains a count value, stops counting up at the second transition edge (e.g., falling edge) of the comparison signal and starts counting down from the current count value (i.e., the maximum value obtained by counting after the first transition edge) and obtains a count value, and when the next first transition edge of the comparison signal is reached, the counting cycle ends, and the signed count value obtained is stored in the count value stored in the counting register, and the signed count value obtained is used as the initial value of the next counting cycle. The count value stored in the counting register reflects the difference between the initial actual value and the ideal value of the duty cycle of the comparison signal. Since the signed count value is the difference between the count value during the high level period of the comparison signal and the count value during the low level period of the comparison signal, if the duty cycle of the comparison signal is 50%, the signed count value should be 0. When the first transition edge is a rising edge, if the signed count value is positive, it means that the high level time is longer, and if the signed count value is negative, it means that the low level time is longer.

[0047] The control output module determines the expected resistance value of the first programmable resistor R1 and the expected resistance value of the second programmable resistor R2 according to the count value and the initial resistance value in the count register, and outputs a first resistance control signal representing the determined expected resistance value of the first programmable resistor to the first programmable resistor R1, so that the resistance value of the first programmable resistor is equal to its expected resistance value, and outputs a second resistance control signal representing the determined expected resistance value of the second programmable resistor to the second programmable resistor R2, so that the resistance value of the second programmable resistor is equal to its expected resistance value. Preferably, the deviation resistance value is determined according to the count value in the count register, the expected resistance value of the first programmable resistor R1 is the difference or sum of the initial resistance value and the deviation resistance value, and the expected resistance value of the second programmable resistor R2 is the sum or difference of the initial resistance value and the deviation resistance value.

[0048] When the count value in the counting register is stable, it means that the actual value of the duty cycle of the comparison signal is equal to its ideal value, or, the difference between the actual value and the ideal value of the duty cycle of the comparison signal is less than a predetermined range, or, the actual value of the duty cycle of the comparison signal is closest to the ideal value of the duty cycle of the comparison signal. At this time, the actual value of the duty cycle of the comparison signal meets the requirements.

[0049] Figure 4 FIG. 4 is an example diagram of compensating the input offset voltage of the comparator in the present invention.

[0050] Figure 4 (a) is a timing diagram of the comparison signal output by the comparator, wherein the input offset voltage Voffset is 10 mV.

[0051] Figure 4 (b) is a graph showing the actual value of the duty cycle of the comparison signal output by the comparator during the calibration process, wherein the actual value of the duty cycle gradually approaches the ideal value of 50% from an initial value of about 50.46.

[0052] Figure 4 (c) is a schematic diagram of the counting value of the counting module, which counts upward when the level is high and counts downward when the level is low;

[0053] Figure 4 (d) is a schematic diagram of the count value in the counting register;

[0054] Figure 4(e) is an example diagram of the first resistance control signal and the second resistance control signal output by the control output module. In this example, the first resistance control signal is the upper diagram, and the second resistance control signal is the lower diagram. The value of the first resistance control signal = 128 (corresponding to the initial resistance value) + the count value in the counting register (corresponding to the deviation resistance value), and the value of the second resistance control signal = 128 - the count value in the counting register (corresponding to the deviation resistance value).

[0055] from Figure 4 It can be seen that after about 4 cycles of the comparison signal output by the comparator, the actual value of the duty cycle of the comparison signal is already very close to the ideal value of 50%.

[0056] In this way, the effect of the comparator's input offset voltage is automatically compensated or corrected and can be continuously tracked. If the input offset voltage changes with temperature, the loop will track this change and keep the phase shift caused by the input offset voltage change to a minimum. This ultimately improves the performance of the MEMS gyroscope's TCO.

[0057] The present invention can automatically compensate or correct the offset that occurs at the input end of the comparator, whether the offset is due to the output offset of the driving charge amplifier DCSA or the internal input offset of the comparator, and the compensation can be achieved by adjusting the duty cycle of the comparison signal output by the comparator to 50%. All these components of the comparator occupy a relatively small area (much smaller than the large R and large C in the background technology), so the present invention solves the problem related to the input offset without occupying too much area.

[0058] According to another aspect of the present invention, there is provided a MEMS gyroscope, comprising: a MEMS inertial sensing portion, comprising: a driving capacitor group, a driving detection capacitor group, and a detection capacitor group for one or more axes; a gyroscope interface circuit, comprising: a driving circuit, a detection circuit for one or more axes, and a digital processing circuit; the driving circuit comprises a driving charge amplifier, a first input terminal of the driving charge amplifier is connected to one end of a first driving detection capacitor in the driving detection capacitor group, a second input terminal of the driving charge amplifier is connected to one end of a second driving detection capacitor in the driving detection capacitor group, the detection circuit comprises a detection charge amplifier for one or more axes, and the detection charge amplifier for each axis is connected to one end of a second driving detection capacitor in the driving detection capacitor group; The first input end of the detection charge amplifier is connected to one end of the first detection capacitor in the detection capacitor group of the corresponding axis, and the second input end of the detection charge amplifier of each axis is connected to one end of the second detection capacitor in the detection capacitor group of the corresponding axis. The driving circuit also includes the comparator 200 and the phase-locked loop mentioned above, the first input end of the comparator 200 is connected to the first output end of the driving charge amplifier, the second input end of the comparator 200 is connected to the second output end of the driving charge amplifier, the reference input end of the phase-locked loop is connected to the output end of the comparator, the comparator 200 provides a reference clock to the phase-locked loop, and the output end of the phase-locked loop is connected to the digital processing circuit.

[0059] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. 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 may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification.

[0060] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify and vary the above embodiments within the scope of the present invention.

Claims

1. A comparator, characterized in that: It includes: An input stage, comprising a first programmable resistor coupled to a positive phase input side, and a second programmable resistor coupled to a negative phase input side, wherein the input stage receives a positive phase input signal and a negative phase input signal; an output stage coupled to the input stage, comprising an output terminal, through which a comparison signal of the positive-phase input signal and the negative-phase input signal is output; The deviation compensation module is used to calculate the actual value of the duty cycle of the comparison signal, and when the actual value of the duty cycle of the comparison signal does not meet the requirements, output a resistance control signal to adjust the resistance value of the first programmable resistor and / or the second programmable resistor, thereby making the actual value of the duty cycle of the comparison signal approach or equal to the ideal value of the duty cycle of the comparison signal.

2. The comparator according to claim 1, characterized in that: The comparison signal flips when the positive phase input signal is equal to the negative phase input signal. The ideal value of the duty cycle of the comparison signal is 50%. The resistance control signal is determined according to the difference between the actual value of the duty cycle of the comparison signal and the ideal value of the duty cycle of the comparison signal, When the actual value of the duty cycle of the comparison signal is equal to the ideal value of the duty cycle of the comparison signal, or when the difference between the actual value and the ideal value of the duty cycle of the comparison signal is less than a predetermined range, or when the actual value of the duty cycle of the comparison signal is closest to the ideal value of the duty cycle of the comparison signal, the actual value of the duty cycle of the comparison signal meets the requirement, and the resistance control signal is outputted so that the first programmable resistor and / or the second programmable resistor maintains the current resistance value.

3. The comparator according to claim 1, characterized in that: The input stage further includes a first differential transistor connected in series between the intermediate node A and the first programmable resistor and a second differential transistor connected in series between the intermediate node A and the second programmable resistor, wherein the gate of the first differential transistor receives a positive phase input signal, and the gate of the second differential transistor receives a negative phase input signal. The input stage further includes a first current source connected between the first power supply terminal and the intermediate node A, for providing an injection current to the intermediate node A. The other end of the first programmable resistor is coupled to the second power supply terminal, and the other end of the second programmable resistor is coupled to the second power supply terminal.

4. The comparator according to claim 3, characterized in that: Each programmable resistor includes a resistor unit string formed by a plurality of resistor units connected in series and a programming switch connected in parallel with each resistor unit in part or all of the resistor units. By controlling the conduction or disconnection of each programming switch, the resistor unit corresponding to the programming switch is removed or incorporated into the resistor unit string, thereby controlling the resistance value of each programmable resistor. The resistance value of each resistor unit in the resistor unit string is X, 2 1 *X, 2 2 *X, ..., 2 N *X, where N is the number of resistance units and N is a natural number greater than or equal to 2.

5. The comparator according to claim 3, characterized in that: The output stage comprises: a second current source; a first bias current output unit coupled to the second current source, having an input terminal coupled to a node between the first differential transistor and the first programmable resistor, and injecting a first bias current into node B through an output terminal; A second bias current output unit coupled to the second current source, having an input terminal coupled to a node between the second differential transistor and the second programmable resistor, and extracting a second bias current from node B through an output terminal; The output module has an input terminal coupled to the node B and an output terminal outputting a comparison signal.

6. The comparator according to claim 5, characterized in that: The first bias current output unit includes PMOS transistors MP3, MP6, and an NMOS transistor MN1, wherein the PMOS transistors MP3 and MP6 form a current mirror, the sources of the PMOS transistors MP3 and MP6 are coupled to the first power supply terminal VDD, the gates of the PMOS transistors MP3 and MP6 are interconnected, the drain of the PMOS transistor MP6 is used as an output terminal to inject the first bias current into the node B, the gate of the NMOS transistor MN1 is used as an input terminal to couple to the node between the first differential transistor and the first programmable resistor, the drain of the NMOS transistor MN1 is coupled to the drain of the PMOS transistor MP3, and the source of the NMOS transistor MN1 is coupled to one end of the second current source. The second bias current output unit includes PMOS transistors MP4 and MP5, and NMOS transistors MN2, MN3 and MN4, wherein the PMOS transistors MP4 and MP5 form a current mirror, the sources of the PMOS transistors MP4 and MP5 are coupled to the first power supply terminal VDD, the gates of the PMOS transistors MP4 and MP5 are interconnected, the drain of the NMOS transistor MN2 is coupled to the drain of the PMOS transistor MP4, the source of the NMOS transistor MN2 is coupled to one end of the second current source, the drain of the PMOS transistor MP5 is coupled to the drain of the NMOS transistor MN3, the NMOS transistors MN3 and MN4 form a current mirror, the sources of the NMOS transistors MN3 and MN4 are coupled to the second power supply terminal, the gates of the NMOS transistors MN3 and MN4 are interconnected, and the drain of the NMOS transistor MN4 is used as an output terminal to extract a second bias current to the node B. The output module includes a plurality of cascaded inverters.

7. The comparator according to claim 2, characterized in that: The deviation compensation module uses a clock signal to count the positive phase level and the negative phase level of the comparison signal to obtain an actual value of the duty cycle of the comparison signal, and the frequency of the clock signal is more than 10 times higher than the frequency of the comparison signal. When the actual value of the duty cycle of the comparison signal meets the requirement, the resistance control signal is output so that the first programmable resistor and / or the second programmable resistor maintains the current resistance value, When the actual value of the duty cycle of the comparison signal does not meet the requirement, the resistance control signal is output to adjust the resistance value of the first programmable resistor and / or the second programmable resistor to increase or decrease the difference between the resistance values ​​of the first programmable resistor and the second programmable resistor, wherein the increased or decreased difference between the resistance values ​​of the first programmable resistor and the second programmable resistor is related to the difference between the actual value and the ideal value of the duty cycle of the comparison signal.

8. The comparator according to claim 7, characterized in that: The deviation compensation module includes a counting module, a counting register and a control output module. The counting module uses the clock signal to count upward from the initial value and obtain the count value at the first transition edge of the comparison signal, stops counting upward and starts counting downward from the current count value and obtains the count value at the second transition edge of the comparison signal, and when the next first transition edge of the comparison signal is reached, the counting cycle ends, and the obtained signed count value is stored in the counting register, and the obtained signed count value is used as the initial value of the next counting cycle, wherein the count value stored in the counting register reflects the difference between the initial actual value and the ideal value of the duty cycle of the comparison signal; The control output module determines the expected resistance value of the first programmable resistor and the expected resistance value of the second programmable resistor according to the count value and the initial resistance value in the count register, and outputs a first resistance control signal representing the determined expected resistance value of the first programmable resistor to the first programmable resistor, so that the resistance value of the first programmable resistor is equal to its expected resistance value, and outputs a second resistance control signal representing the determined expected resistance value of the second programmable resistor to the second programmable resistor, so that the resistance value of the second programmable resistor is equal to its expected resistance value.

9. The comparator according to claim 8, characterized in that: When the count value in the counting register is stable, it indicates that the actual value of the duty cycle of the comparison signal is equal to its ideal value, or the difference between the actual value and the ideal value of the duty cycle of the comparison signal is less than a predetermined range, or the actual value of the duty cycle of the comparison signal is closest to the ideal value of the duty cycle of the comparison signal. At this time, the actual value of the duty cycle of the comparison signal meets the requirement. Determine the deviation resistance value according to the count value in the count register, The expected resistance value of the first programmable resistor is the difference or sum of the initial resistance value and the deviation resistance value. The expected resistance value of the second programmable resistor is the sum or difference of the initial resistance value and the deviation resistance value.

10. A MEMS gyroscope, characterized in that: It includes: The MEMS inertial sensing part includes: a driving capacitor group, a driving detection capacitor group, and a detection capacitor group of one or more axes; A gyro interface circuit, which includes: a drive circuit, a detection circuit for one or more axes, and a digital processing circuit; The driving circuit comprises a driving charge amplifier, a first input terminal of the driving charge amplifier is connected to one end of a first driving detection capacitor in the driving detection capacitor group, and a second input terminal of the driving charge amplifier is connected to one end of a second driving detection capacitor in the driving detection capacitor group. The detection circuit includes one or more detection charge amplifiers of the axis, wherein the first input end of the detection charge amplifier of each axis is connected to one end of the first detection capacitor in the detection capacitor group of the corresponding axis, and the second input end of the detection charge amplifier of each axis is connected to one end of the second detection capacitor in the detection capacitor group of the corresponding axis. The driving circuit also includes a comparator and a phase-locked loop as described in any one of claims 1-9, wherein the first input terminal of the comparator is connected to the first output terminal of the driving charge amplifier, the second input terminal of the comparator is connected to the second output terminal of the driving charge amplifier, the reference input terminal of the phase-locked loop is connected to the output terminal of the comparator, the comparator provides a reference clock to the phase-locked loop, and the output terminal of the phase-locked loop is connected to the digital processing circuit.