Digital quartz crystal temperature sensor and temperature detection method
Patent Information
- Application Number
- CN202211612600.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-14
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-12-14
AI Technical Summary
然而,石英谐振器之间参数存在差异,模拟分立器件参数之间也有差异,因此,闭环振荡电路无法保证石英谐振器在其谐振频率点处振荡,驱动信号的频率与谐振频率会存在一定的频差,无法保证温度测量结果的准确性
[0036] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the temperature detection method as described above.
Smart Images

Figure CN116007779B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of temperature measurement technology, and in particular to a digital quartz crystal temperature sensor and a temperature detection method. Background Technology
[0002] Temperature sensors are crucial thermal quantity sensors, playing a vital role in daily life and industrial production. Based on their working principles and physical mechanisms, temperature sensors can be categorized into thermocouple temperature sensors, resistance temperature detectors (RTDs), PN junction temperature sensors, and quartz crystal temperature sensors. Traditional temperature sensors such as thermocouples, RTDs, and PN junction sensors suffer from high nonlinearity, low sensitivity, poor long-term stability, and high power consumption. Furthermore, under strong magnetic field interference, the sensitivity of traditional temperature sensors decreases significantly, sometimes even rendering them inoperable. The resonant frequency of a quartz crystal shifts with changes in ambient temperature; this physical mechanism can be used to design quartz crystal temperature sensors. Among various temperature sensors, only quartz crystal temperature sensors calculate the ambient temperature value based on the frequency signal. Quartz crystals also possess excellent piezoelectric properties, a high quality factor, and resistance to strong magnetic fields. Therefore, quartz crystal temperature sensors offer advantages such as high precision, high resolution, good repeatability, good long-term stability, and low power consumption.
[0003] Currently, quartz crystal temperature sensors typically use analog circuits to drive the quartz crystal, and then a frequency metering circuit measures the frequency output signal of the quartz crystal closed-loop oscillation circuit. The closed-loop oscillation circuit employs a self-excited oscillation drive scheme to track the resonant frequency of the quartz crystal, ensuring that the quartz resonator oscillates at its resonant frequency. However, parameters differ between quartz resonators, and there are also differences between the parameters of analog discrete components. Therefore, the closed-loop oscillation circuit cannot guarantee that the quartz resonator oscillates at its resonant frequency; a frequency difference will exist between the driving signal frequency and the resonant frequency, compromising the accuracy of the temperature measurement results. Summary of the Invention
[0004] To address the problems existing in the prior art, the present invention provides a digital quartz crystal temperature sensor and a temperature detection method.
[0005] This invention provides a digital quartz crystal temperature sensor, comprising: a quartz resonator, a signal amplification circuit, and a controller;
[0006] The signal amplification circuit is connected to the quartz resonator and the controller respectively, and is used to convert the response signal output by the quartz resonator and transmit it to the controller.
[0007] The controller includes an analog-to-digital converter module, a data processing module, an oscillation circuit, and a digital-to-analog converter module connected in sequence; the analog-to-digital converter module is connected to the signal amplification circuit, and the digital-to-analog converter module is connected to the quartz resonator;
[0008] The oscillation circuit is used to output a drive signal to the digital-to-analog converter module and the data processing module; wherein, the drive signal is used to drive the quartz resonator;
[0009] The data processing module is used to demodulate the response signal based on the driving signal to obtain a demodulated signal of the response signal, and to compensate the response signal based on the demodulated signal to obtain a compensated response signal; it is also used to determine the target frequency of the driving signal based on the compensated response signal and output it to the oscillation circuit, wherein the target frequency is used by the oscillation circuit to adjust the frequency of the driving signal; and it is also used to determine the temperature detection value of the environment in which the quartz resonator is located based on the target frequency.
[0010] According to the digital quartz crystal temperature sensor provided by the present invention, the driving signal includes a sine signal and a cosine signal, wherein the frequency of the sine signal is the same as the frequency of the cosine signal;
[0011] The oscillation circuit is used to output the sine signal to the digital-to-analog converter module, and to output the sine signal and the cosine signal to the data processing module;
[0012] The data processing module is used to perform in-phase demodulation and quadrature demodulation on the response signal based on the sine signal and the cosine signal, respectively, to obtain the first in-phase component and the first quadrature component of the response signal, and to determine the compensated response signal based on the first in-phase component and the first quadrature component.
[0013] According to the digital quartz crystal temperature sensor provided by the present invention, the data processing module is specifically used for:
[0014] Based on a preset compensation phase angle, the first in-phase component and the first quadrature component are phase angle compensated to obtain the second in-phase component and the second quadrature component of the response signal;
[0015] The second orthogonal component is compensated based on the preset orthogonal component compensation coefficient to obtain the third orthogonal component;
[0016] The second in-phase component and the third quadrature component are used to characterize the compensated response signal.
[0017] According to the digital quartz crystal temperature sensor provided by the present invention, the data processing module is specifically used for:
[0018] The first in-phase component, the first quadrature component, and the compensation phase angle are input into a preset in-phase compensation model to obtain the second in-phase component; wherein, the in-phase compensation model is used to characterize the first correspondence between the second in-phase component and the first in-phase component, the first quadrature component, and the compensation phase angle;
[0019] The first in-phase component, the first quadrature component, and the compensation phase angle are input into a preset quadrature compensation model to obtain the second quadrature component; wherein, the quadrature compensation model is used to characterize the second correspondence between the second quadrature component and the first in-phase component, the first quadrature component, and the compensation phase angle.
[0020] According to the digital quartz crystal temperature sensor provided by the present invention, the data processing module is specifically used for:
[0021] The phase of the compensated response signal is determined based on the second in-phase component and the third quadrature component;
[0022] The target frequency of the driving signal is determined based on the phase difference between the compensated response signal and the target phase.
[0023] According to the digital quartz crystal temperature sensor provided by the present invention, the controller further includes a gain control module, the input terminal of the gain control module is connected to the data processing module and the oscillation circuit respectively, and the output terminal of the gain control module is connected to the digital-to-analog conversion module;
[0024] The data processing module is also used to determine the gain coefficient of the driving signal based on the compensated response signal;
[0025] The gain control module is used to adjust the amplitude of the sinusoidal signal based on the gain coefficient and then output it to the digital-to-analog conversion module.
[0026] According to the digital quartz crystal temperature sensor provided by the present invention, the data processing module is specifically used for:
[0027] The amplitude of the compensated response signal is determined based on the second in-phase component and the third quadrature component;
[0028] The gain coefficient of the driving signal is determined based on the difference between the amplitude of the compensated response signal and the target amplitude.
[0029] According to the digital quartz crystal temperature sensor provided by the present invention, the data processing module is specifically used for:
[0030] Based on the preset correspondence between the resonant frequency and temperature of the quartz resonator, the temperature corresponding to the target frequency is determined and used as the temperature detection value of the environment in which the quartz resonator is located.
[0031] The present invention also provides a temperature detection method, comprising:
[0032] Acquire a drive signal output from an oscillation circuit and a response signal output from a quartz resonator; wherein the drive signal is used to drive the quartz resonator.
[0033] The response signal is demodulated based on the driving signal to obtain the demodulated signal of the response signal, and the response signal is compensated based on the demodulated signal to obtain the compensated response signal.
[0034] The target frequency of the driving signal is determined based on the compensated response signal, and the target frequency is used by the oscillation circuit to adjust the frequency of the driving signal.
[0035] The temperature detection value of the environment in which the quartz resonator is located is determined based on the target frequency.
[0036] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the temperature detection method as described above.
[0037] In the digital quartz crystal temperature sensor and temperature detection method provided by this invention, the data processing module uses the driving signal output by the oscillation circuit as a reference signal to demodulate the response signal output by the quartz resonator to obtain the demodulated signal of the response signal. Based on the demodulated signal, the response signal is compensated to obtain the compensated response signal. The target frequency of the driving signal is determined based on the compensated response signal and output to the oscillation circuit so that the oscillation circuit can adjust the frequency of the driving signal based on the target frequency, so that the phase difference between the response signal and the driving signal of the quartz resonator is 0° across the entire temperature range. Thus, the quartz resonator can always oscillate at its resonant frequency across the entire temperature range. Closed-loop driving of the quartz resonator is realized digitally, thereby effectively improving the accuracy and reliability of the temperature detection results when determining the temperature detection value of the environment where the quartz resonator is located based on the target frequency. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0039] Figure 1 This is one of the structural schematic diagrams of the digital quartz crystal temperature sensor provided by the present invention;
[0040] Figure 2 This is a schematic diagram of the structure of the quartz resonator provided by the present invention;
[0041] Figure 3 This is the second schematic diagram of the structure of the digital quartz crystal temperature sensor provided by the present invention;
[0042] Figure 4 This is a schematic diagram illustrating the working principle of the digital quartz crystal temperature sensor provided by the present invention;
[0043] Figure 5 This is a schematic flowchart of the temperature detection method provided by the present invention;
[0044] Figure 6 This is a schematic diagram of the original in-phase component and the original quadrature component provided by the present invention;
[0045] Figure 7 This is a schematic diagram of the compensated in-phase and quadrature components provided by the present invention;
[0046] Figure 8 This is a comparison chart of the frequency of the driving signal provided by the present invention and the temperature detection results of the temperature sensor built into the ARM main controller;
[0047] Figure 9 This is a comparison chart of the offline fitting temperature and the frequency of the driving signal of the digital quartz crystal temperature sensor provided by the present invention at three temperature points: 0℃, 10℃ and 20℃.
[0048] Figure 10 This is a schematic diagram of the measured ambient temperature output online by the digital quartz crystal temperature sensor provided by the present invention;
[0049] Figure 11 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0051] like Figure 1 As shown, the digital quartz crystal temperature sensor of the present invention includes at least: a quartz resonator 101, a signal amplification circuit 102, and a controller 103;
[0052] The signal amplification circuit 102 is connected to the quartz resonator 101 and the controller 103 respectively, and is used to convert the response signal output by the quartz resonator 101 and transmit it to the controller 103.
[0053] The controller 103 includes an analog-to-digital converter module 104, a data processing module 105, an oscillation circuit 106, and a digital-to-analog converter module 107 connected in sequence; the analog-to-digital converter module 104 is connected to the signal amplification circuit 102, and the digital-to-analog converter module 107 is connected to the quartz resonator 101.
[0054] The oscillation circuit 106 is used to output a drive signal to the digital-to-analog converter module 107 and the data processing module 105; wherein, the drive signal is used to drive the quartz resonator 101;
[0055] The data processing module 105 is used to demodulate the response signal based on the driving signal to obtain a demodulated signal of the response signal, and to compensate the response signal based on the demodulated signal to obtain a compensated response signal; it is also used to determine the target frequency of the driving signal based on the compensated response signal and output it to the oscillation circuit 106, wherein the target frequency is used by the oscillation circuit 106 to adjust the frequency of the driving signal; and it is also used to determine the temperature detection value of the environment in which the quartz resonator 101 is located based on the target frequency.
[0056] In this embodiment, the quartz resonator 101 is the sensitive device in the quartz crystal temperature sensor. Typically, a quartz crystal is processed into a quartz wafer along a specific cutting direction, and electrodes are plated onto the quartz wafer to form the quartz resonator 101. The specific type of quartz resonator 101 can be set according to actual needs; for example, it can be a thickness-shear quartz resonator or a bending vibration quartz resonator. While the thickness-shear quartz resonator technology is relatively mature, its resonant frequency is on the order of megahertz, resulting in high power consumption in the oscillation circuit 106 and a relatively long response time for the temperature sensor. In this embodiment, the quartz resonator 101 is preferably a bending vibration quartz resonator.
[0057] The signal amplification circuit 102 can be a preamplifier operational amplifier used to convert the response signal output by the quartz resonator 101. The response signal can be a current signal, which can be converted into a voltage signal without distortion by the preamplifier operational amplifier and output to the controller 103.
[0058] The controller 103 can be an ARM main controller chip, including an analog-to-digital converter module 104, a data processing module 105, an oscillation circuit 106, and a digital-to-analog converter module 107 connected in sequence. The analog-to-digital converter module 104 is electrically connected to the signal amplification circuit 102, and the digital-to-analog converter module 107 is electrically connected to the quartz resonator 101, so that the quartz resonator 101, the signal amplification circuit 102, and the controller 103 form a closed loop.
[0059] The analog-to-digital conversion module 104 is used to further convert the converted response signal into a digital signal and transmit it to the data processing module 105.
[0060] The oscillation circuit 106 is used to output a drive signal to the digital-to-analog converter module 107 and the data processing module 105; wherein, the digital-to-analog converter module 107 is used to convert the drive signal into digital signal and transmit it to the quartz resonator 101, so as to drive the quartz resonator 101 through the drive signal, which can be a sine signal and / or a cosine signal.
[0061] In practical applications, due to the delays in the hardware and software of the quartz crystal temperature sensor during operation, as well as the relative changes in the components of the quartz resonator 101 across the entire temperature range, a phase difference will occur between the response signal and the drive signal, causing the quartz resonator 101 to fail to oscillate at its resonant frequency. These hardware and software delays can include the frequency response time of the signal amplification circuit 102, the signal conversion time of the analog-to-digital conversion module 104, and the program execution time of the controller 103.
[0062] Based on this, in this embodiment, the data processing module 105 can use the driving signal as a reference signal to demodulate the response signal to obtain the demodulated signal of the response signal, and compensate the response signal based on the demodulated signal to obtain the compensated response signal. The target frequency of the driving signal is determined based on the compensated response signal and output to the oscillation circuit 106 so that the oscillation circuit 106 can adjust the frequency of the driving signal based on the target frequency, so that the phase difference between the response signal and the driving signal of the quartz resonator 101 is 0° in the entire temperature range. Thus, the quartz resonator 101 can always oscillate at its resonant frequency in the entire temperature range. The closed-loop drive of the quartz resonator 101 is realized in a digital way, thereby improving the accuracy and reliability of the temperature detection results.
[0063] In addition, since the phase difference between the response signal and the driving signal of the quartz resonator 101 is 0° across the entire temperature range in this embodiment, the target frequency of the driving signal is the resonant frequency of the quartz resonator 101. Thus, the temperature detection value of the environment in which the quartz resonator 101 is located can be quickly and accurately determined based on the target frequency of the driving signal.
[0064] Currently, quartz crystal temperature sensors typically use analog circuits to drive the quartz crystal, and then a frequency counting circuit measures the frequency output signal of the quartz closed-loop oscillation circuit 106. The quartz closed-loop oscillation circuit 106 uses a self-excited oscillation driving scheme to track the resonant frequency of the quartz crystal, so that the quartz resonator 101 can oscillate at its resonant frequency point. However, there are differences in the parameters between the quartz resonators 101, and there are also differences in the parameters between the analog discrete components. Therefore, the closed-loop oscillation circuit 106 cannot guarantee that the quartz resonator 101 will oscillate at its resonant frequency point, and there will be a certain frequency difference between the frequency of the driving signal and the resonant frequency, which cannot guarantee the accuracy of the temperature measurement results.
[0065] In this embodiment, the data processing module 105 uses the driving signal as a reference signal to demodulate the response signal to obtain the demodulated signal of the response signal. Based on the demodulated signal, the response signal is compensated to obtain the compensated response signal. The target frequency of the driving signal is determined based on the compensated response signal and output to the oscillation circuit 106. This allows the oscillation circuit 106 to adjust the frequency of the driving signal based on the target frequency, so that the phase difference between the response signal and the driving signal of the quartz resonator 101 is 0° across the entire temperature range. Thus, the quartz resonator 101 can always oscillate at its resonant frequency across the entire temperature range. Closed-loop driving of the quartz resonator 101 is realized digitally, thereby improving the accuracy and reliability of the temperature detection results.
[0066] Meanwhile, this implementation uses digital closed-loop drive for the quartz resonator 101, saving a large number of discrete components, making the circuit design simpler, and reducing the overall size of the temperature sensor and the system power consumption.
[0067] In an exemplary embodiment, the driving signal includes a sine signal and a cosine signal, wherein the frequency of the sine signal is the same as the frequency of the cosine signal;
[0068] The oscillation circuit 106 is used to output the sine signal to the digital-to-analog converter module 107, and to output the sine signal and the cosine signal to the data processing module 105;
[0069] The data processing module 105 is used to perform in-phase demodulation and quadrature demodulation on the response signal based on the sine signal and the cosine signal, respectively, to obtain the first in-phase component and the first quadrature component of the response signal, and to determine the compensated response signal based on the first in-phase component and the first quadrature component.
[0070] In this embodiment, the driving signal output by the oscillation circuit 106 includes a sine signal and a cosine signal. The sine and cosine signals have the same frequency and amplitude. Initially, the frequency and amplitude of the sine and cosine signals can be preset initial values. During the driving process, the frequencies of the sine and cosine signals are adjusted in real time according to the target frequency output by the data processing module 105 to ensure that the phase difference between the response signal of the quartz resonator 101 and the driving signal is 0° across the entire temperature range. It can be understood that the phase of the sine and cosine signals is fixed at 0°.
[0071] The oscillation circuit 106 outputs a sinusoidal signal to the digital-to-analog converter module 107, which performs digital-to-analog conversion before outputting the signal to the quartz resonator 101 to drive it. Simultaneously, the oscillation circuit 106 outputs both a sinusoidal and a cosine signal to the data processing module 105. The data processing module 105 performs in-phase demodulation on the response signal based on the sinusoidal signal to obtain the first in-phase component, and quadrature demodulation on the response signal based on the cosine signal to obtain the first quadrature component. Based on the first in-phase and first quadrature components, the compensation value of the response signal can be effectively determined. This compensation ensures that the quartz resonator 101 oscillates at its resonant frequency throughout the entire temperature range, further improving the accuracy and reliability of the temperature detection results.
[0072] Meanwhile, traditional temperature sensors that drive the quartz resonator 101 via analog methods can only obtain frequency data and cannot obtain information such as the quality factor of the quartz resonator 101, thus failing to provide data basis for the optimization and improvement of the temperature sensor and the quartz resonator 101. In this embodiment, the controller 103 can also output the demodulated first in-phase component and the first quadrature component, thereby providing data basis for the optimization and improvement of the temperature sensor and the quartz resonator 101.
[0073] In an exemplary embodiment, the data processing module 105 is specifically used for:
[0074] Based on a preset compensation phase angle, the first in-phase component and the first quadrature component are phase angle compensated to obtain the second in-phase component and the second quadrature component of the response signal;
[0075] The second orthogonal component is compensated based on the preset orthogonal component compensation coefficient to obtain the third orthogonal component;
[0076] The second in-phase component and the third quadrature component are used to characterize the compensated response signal.
[0077] In practical applications, hardware and software delays such as the frequency response time of the signal amplification circuit 102, the signal conversion time of the analog-to-digital conversion module 104, and the program execution time of the controller 103 cause a phase difference between the response signal and the drive signal, which leads to the mutual coupling of the first in-phase component and the first quadrature component, making it impossible to guarantee the accuracy of the temperature detection results.
[0078] Based on this, this embodiment performs phase angle compensation on the first in-phase component and the first quadrature component based on a preset compensation phase angle, which can effectively avoid the mutual coupling between the first in-phase component and the first quadrature component. That is, through phase angle compensation, the phase difference between the response signal and the drive signal caused by the software and hardware delay in the temperature sensor can be effectively compensated.
[0079] In addition, the equivalent circuit of the quartz resonator 101 can be as follows: Figure 2As shown, the circuit includes a first branch and a second branch connected in parallel. The first branch is an RLC series branch, including an equivalent resistance R1, an equivalent inductance L1, and a first equivalent capacitance C1 connected in series. The second branch includes a second equivalent capacitance C0, which is a static capacitance. Over the entire temperature range, the relative change in the equivalent resistance R1 is much greater than the relative change in the second equivalent capacitance C0, resulting in the total current phase flowing through the quartz resonator 101 not being completely consistent at the resonant frequency points corresponding to different ambient temperatures. If the room temperature phase value of the quartz resonator 101 is used as the target phase, the frequency of the driving signal generated by the oscillation circuit 106 over the entire temperature range will deviate significantly from the actual resonant frequency of the quartz resonator 101, and the obtained target frequency will not be the true resonant frequency of the quartz resonator 101.
[0080] Figure 2 In this embodiment, at the resonant frequency of the quartz resonator 101, the first branch is purely resistive. Under optimal compensation phase, the second in-phase component is contributed only by the equivalent resistance R1, and the second quadrature component is contributed only by the second equivalent capacitance C0. Therefore, this embodiment compensates for the second quadrature component based on a preset quadrature component compensation coefficient to cancel out the contribution of the second equivalent capacitance C0 to the second quadrature component, thus obtaining the third quadrature component. At the resonant frequency of the quartz resonator 101, the third quadrature component is zero. The second in-phase component and the third quadrature component obtained through compensation are the compensated response signal.
[0081] The compensation phase angle and orthogonal compensation coefficient can be determined in advance through experimental data and burned into the memory of the controller 103 so that they can be called in real time during the operation of the digital quartz crystal temperature sensor, thereby enabling rapid and effective compensation of the response signal of the quartz resonator 101.
[0082] Traditional temperature sensors driven by analog methods for the quartz resonator 101 have poor compensability, requiring individual parameter fine-tuning of the compensation circuit for each temperature sensor, making batch compensation very difficult. In contrast, this embodiment only requires programming the compensation phase angle and quadrature compensation coefficients into the memory of the controller 103 to achieve compensation, greatly reducing the difficulty of compensating the drive signal and ensuring that the quartz resonator 101 oscillates at its resonant frequency throughout the entire temperature range.
[0083] In an exemplary embodiment, the data processing module 105 is specifically used for:
[0084] The first in-phase component, the first quadrature component, and the compensation phase angle are input into a preset in-phase compensation model to obtain the second in-phase component; wherein, the in-phase compensation model is used to characterize the first correspondence between the second in-phase component and the first in-phase component, the first quadrature component, and the compensation phase angle;
[0085] The first in-phase component, the first quadrature component, and the compensation phase angle are input into a preset quadrature compensation model to obtain the second quadrature component; wherein, the quadrature compensation model is used to characterize the second correspondence between the second quadrature component and the first in-phase component, the first quadrature component, and the compensation phase angle.
[0086] In this embodiment, the in-phase compensation model is used to characterize the first correspondence between the second in-phase component and the first in-phase component, the first quadrature component, and the compensation phase angle, and the quadrature compensation model is used to characterize the second correspondence between the second quadrature component and the first in-phase component, the first quadrature component, and the compensation phase angle. The first and second correspondences can be functional relationships. The in-phase compensation model and the quadrature compensation model can be pre-set and stored in the memory of the controller 103 so that they can be called in real time when performing phase angle compensation on the drive signal. As an optional implementation, the in-phase compensation model and the quadrature compensation model can be as shown in equations (1) and (2), respectively:
[0087] A2=A1*cos(Δθ)+B1*sin(Δθ) (1)
[0088] B2=B1*cos(Δθ)-A1*sin(Δθ) (2)
[0089] In the formula, A1 and B1 are the first in-phase component and the first quadrature component, respectively; A2 and B2 are the second in-phase component and the second quadrature component, respectively; and Δθ is the compensation phase angle.
[0090] During the phase angle compensation of the driving signal, the first in-phase component, the first quadrature component, and the preset compensation phase angle are input into the in-phase compensation model and the quadrature compensation model, respectively, to obtain the second in-phase component and the second quadrature component of the response signal. This enables the phase angle compensation of the response signal of the quartz resonator 101 to be performed quickly and effectively, further reducing the difficulty of compensating the driving signal.
[0091] In an exemplary embodiment, the data processing module 105 is specifically used for:
[0092] The phase of the compensated response signal is determined based on the second in-phase component and the third quadrature component;
[0093] The target frequency of the driving signal is determined based on the phase difference between the compensated response signal and the target phase.
[0094] In this embodiment, the second in-phase component and the third quadrature component are the in-phase component and quadrature component of the compensated response signal, respectively. Therefore, the phase of the compensated response signal can be determined based on the second in-phase component and the third quadrature component. For example, the phase of the compensated response signal can be obtained by calculating the arctangent of the ratio of the third quadrature component to the second in-phase component.
[0095] After obtaining the phase of the compensated response signal, the phase difference between the compensated response signal and the target phase can be calculated, and the target frequency of the driving signal can be determined based on this phase difference. For example, the target frequency of the driving signal can be determined using a PI (Proportional-Integral) control method based on this phase difference, thereby enabling rapid and accurate determination of the target frequency of the driving signal and further improving the accuracy and reliability of the temperature detection results. The target phase can be set to 0.
[0096] In an exemplary embodiment, such as Figure 3 As shown, the controller 103 also includes a gain control module 301. The input terminal of the gain control module 301 is connected to the data processing module 105 and the oscillation circuit 106 respectively, and the output terminal of the gain control module 301 is connected to the digital-to-analog conversion module 107.
[0097] The data processing module 105 is further configured to determine the gain coefficient of the driving signal based on the compensated response signal;
[0098] The gain control module 301 is used to adjust the amplitude of the sinusoidal signal based on the gain coefficient and then output it to the digital-to-analog converter module 107.
[0099] In this embodiment, the gain control module 301 can be an AGC (Automatic Gain Control) module. The input terminals of the gain control module 301 are electrically connected to the data processing module 105 and the oscillation circuit 106, respectively. It is used to receive the gain coefficient output by the data processing module 105 and the sinusoidal signal output by the oscillation circuit 106. Based on the gain coefficient, it adjusts the amplitude of the sinusoidal signal and outputs it to the digital-to-analog converter module 107. The digital-to-analog converter module 107 performs digital-to-analog conversion on the amplitude-adjusted drive signal and transmits it to the quartz resonator 101. This ensures that the amplitude of the drive signal output to the quartz resonator 101 remains constant or changes only slightly. That is, the oscillation circuit 106 can output a frequency-controllable and amplitude-stable drive signal to the quartz resonator 101, realizing closed-loop drive of the quartz resonator 101. This allows the quartz resonator 101 to oscillate stably at its resonant frequency across the entire temperature range, further improving the accuracy and reliability of the temperature detection results.
[0100] In an exemplary embodiment, the data processing module 105 is specifically used for:
[0101] The amplitude of the compensated response signal is determined based on the second in-phase component and the third quadrature component;
[0102] The gain coefficient of the driving signal is determined based on the difference between the amplitude of the compensated response signal and the target amplitude.
[0103] In this embodiment, the second in-phase component and the third quadrature component are the in-phase component and the quadrature component of the compensated response signal, respectively. Therefore, the amplitude of the compensated response signal can be determined based on the second in-phase component and the third quadrature component. For example, the amplitude of the compensated response signal can be obtained by performing a modulo operation on the second in-phase component and the third quadrature component in the complex plane.
[0104] After obtaining the amplitude of the compensated response signal, the amplitude difference between the compensated response signal amplitude and the target amplitude can be further calculated. Based on this amplitude difference, the gain coefficient of the driving signal is determined and output to the gain control module 301 to adjust the amplitude of the sinusoidal signal according to the gain coefficient. For example, based on this amplitude difference, the gain coefficient of the driving signal can be determined by a PI control method, thereby enabling the rapid and accurate determination of the gain coefficient of the driving signal and further improving the stability of the amplitude of the driving signal input to the quartz resonator 101.
[0105] In an exemplary embodiment, the data processing module 105 is specifically used for:
[0106] Based on the preset correspondence between the resonant frequency of the quartz resonator 101 and the temperature, the temperature corresponding to the target frequency is determined and used as the temperature detection value of the environment in which the quartz resonator 101 is located.
[0107] In this embodiment, the preset correspondence between the resonant frequency of the quartz resonator 101 and the temperature can be a functional relationship. This correspondence can be stored in the memory of the controller 103 in the form of a mathematical model or a graph, so that it can be called in real time during the temperature detection process.
[0108] Within the temperature range of -200 to 200℃, the resonant frequency and temperature characteristics of the quartz resonator 101 can be expressed as a third-order polynomial, as shown in equation (3):
[0109] f = f0[1 + α(T - T0) + β(T - T0)] 2 +γ(T-T0) 3 (3)
[0110] In the formula, f is the resonant frequency corresponding to the temperature point to be measured, in Hertz; f0 is the resonant frequency corresponding to the reference temperature point, in Hertz; T is the temperature point to be measured, in °C; T0 is the reference temperature point, in °C; α, β and γ are the first-order coefficients, second-order coefficients and third-order coefficients, respectively.
[0111] The relationship between the resonant frequency and temperature of the quartz resonator 101 is closely related to its cutting direction. A special cutting direction can be used to control the relationship between the resonant frequency and temperature of the quartz resonator 101 to be linear or nearly linear. In this embodiment, during the process of determining the relationship between the resonant frequency and temperature, the resonant frequencies corresponding to multiple different temperature points can be obtained. When the resonant frequency and temperature have a good linear relationship, the relationship between the resonant frequency and temperature can be fitted based on this linear relationship and equation (3), as shown in equation (4):
[0112] T = a2(f - f0) 2 +a1(f-f0)+T0 (4)
[0113] In the formula, a2 is the coefficient of the quadratic term of the fitting, and a1 is the coefficient of the linear term of the fitting.
[0114] The quartz crystal temperature sensor converts changes in ambient temperature into a shift in the resonant frequency of the quartz resonator 101. Accurate measurement of the ambient temperature can be achieved by detecting the resonant frequency. In this embodiment, due to compensation of the response signal, the phase difference between the response signal and the driving signal is 0° across the entire temperature range. Therefore, the target frequency of the driving signal is the resonant frequency of the quartz resonator 101. By inputting the target frequency of the driving signal into equation (4), the temperature detection value of the environment in which the quartz resonator 101 is located can be quickly and accurately determined. Simultaneously, the controller 103 can also transmit the temperature detection value and the resonant frequency via serial communication.
[0115] The working principle of the digital quartz crystal temperature sensor of the present invention will be described in detail below through an optional embodiment. Figure 4 As shown, the working principle of the digital quartz crystal temperature sensor of the present invention is as follows:
[0116] The response signal output by the quartz resonator 101 is converted into a digital signal by the signal amplification circuit 102 and the analog-to-digital converter 104, and then input to the data processing module 105. The oscillation circuit 106 outputs a sine signal and a cosine signal. The amplitude of the sine signal is adjusted by the gain control module 301, converted into an analog signal by the digital-to-analog converter 107, and amplified by the excitation amplification circuit to drive the quartz resonator 101. The data processing module 105 demodulates the response signal in phase with the sine signal and demodulates the response signal quadraturely with the cosine signal to obtain the in-phase and quadrature components of the response signal. The phase angle of the in-phase component is compensated, and the phase angle and C0 compensation (i.e., compensation is performed by the quadrature component compensation coefficient) are performed sequentially on the quadrature component to obtain the compensated in-phase and quadrature components. In the amplitude loop, amplitude calculation is performed based on the compensated in-phase and quadrature components to obtain the amplitude of the compensated response signal. The difference between the compensated response signal amplitude and the target amplitude is calculated, and a gain coefficient is obtained based on the amplitude difference using a PI control method. This gain coefficient is then input to the gain control module 301 to achieve closed-loop control of the drive signal amplitude. In the phase loop, phase calculation is performed based on the compensated in-phase and quadrature components to obtain the phase of the compensated response signal. The difference between the compensated response signal phase and the target phase is calculated, and a target frequency of the drive signal is obtained based on the phase difference using a PI control method. This target frequency is then input to the oscillation circuit 106 to achieve closed-loop control of the drive signal frequency.
[0117] The temperature detection method provided by this invention will be described below. This method is based on the digital quartz crystal temperature sensor described in any of the above embodiments, and can be referred to in correspondence with the digital quartz crystal temperature sensor described above. Figure 5 As shown, the temperature detection method of the present invention includes at least:
[0118] S501. Obtain the driving signal output by the oscillation circuit and the response signal output by the quartz resonator; wherein the driving signal is used to drive the quartz resonator.
[0119] S502. Demodulate the response signal based on the driving signal to obtain the demodulated signal of the response signal, and compensate the response signal based on the demodulated signal to obtain the compensated response signal.
[0120] S503. Determine the target frequency of the driving signal based on the compensated response signal, and the target frequency is used by the oscillation circuit to adjust the frequency of the driving signal;
[0121] S504. Determine the temperature detection value of the environment where the quartz resonator is located based on the target frequency.
[0122] In an exemplary embodiment, the driving signal includes a sine signal and a cosine signal, the frequency of the sine signal is the same as the frequency of the cosine signal, and the sine signal is used to drive the quartz resonator;
[0123] The compensated response signal includes:
[0124] Based on the sinusoidal signal and the cosine signal, the response signal is demodulated in phase and quadraturely to obtain the first in-phase component and the first quadrature component of the response signal, respectively.
[0125] The compensated response signal is determined based on the first in-phase component and the first quadrature component.
[0126] In an exemplary embodiment, the step of compensating the response signal based on the demodulated signal to obtain the compensated response signal includes:
[0127] Based on a preset compensation phase angle, the first in-phase component and the first quadrature component are phase angle compensated to obtain the second in-phase component and the second quadrature component of the response signal;
[0128] The second orthogonal component is compensated based on the preset orthogonal component compensation coefficient to obtain the third orthogonal component;
[0129] The second in-phase component and the third quadrature component are used to characterize the compensated response signal.
[0130] In an exemplary embodiment, the step of performing phase angle compensation on the first in-phase component and the first quadrature component based on a preset compensation phase angle to obtain the second in-phase component and the second quadrature component of the response signal includes:
[0131] The first in-phase component, the first quadrature component, and the compensation phase angle are input into a preset in-phase compensation model to obtain the second in-phase component; wherein, the in-phase compensation model is used to characterize the first correspondence between the second in-phase component and the first in-phase component, the first quadrature component, and the compensation phase angle;
[0132] The first in-phase component, the first quadrature component, and the compensation phase angle are input into a preset quadrature compensation model to obtain the second quadrature component; wherein, the quadrature compensation model is used to characterize the second correspondence between the second quadrature component and the first in-phase component, the first quadrature component, and the compensation phase angle.
[0133] In an exemplary embodiment, determining the target frequency of the driving signal based on the compensated response signal includes:
[0134] The phase of the compensated response signal is determined based on the second in-phase component and the third quadrature component;
[0135] The target frequency of the driving signal is determined based on the phase difference between the compensated response signal and the target phase.
[0136] In an exemplary embodiment, it also includes:
[0137] The gain coefficient of the driving signal is determined based on the compensated response signal;
[0138] The amplitude of the sinusoidal signal is adjusted based on the gain coefficient and then output to the digital-to-analog converter module.
[0139] In an exemplary embodiment, determining the gain coefficient of the driving signal based on the compensated response signal includes:
[0140] The amplitude of the compensated response signal is determined based on the second in-phase component and the third quadrature component;
[0141] The gain coefficient of the driving signal is determined based on the difference between the amplitude of the compensated response signal and the target amplitude.
[0142] In an exemplary embodiment, determining the temperature detection value of the environment in which the quartz resonator is located based on the target frequency includes:
[0143] Based on the preset correspondence between the resonant frequency and temperature of the quartz resonator, the temperature corresponding to the target frequency is determined and used as the temperature detection value of the environment in which the quartz resonator is located.
[0144] The following experiments will provide a detailed explanation of the effectiveness of the digital quartz crystal temperature sensor and temperature detection method of the present invention.
[0145] First, a frequency sweep test was conducted at the resonant frequency of the quartz resonator at ±25Hz. Based on the results of the room-temperature frequency sweep test of the digital quartz crystal temperature sensor, the optimal compensation phase angle and quadrature component compensation coefficients were calculated and programmed into the memory of the ARM main controller via host computer software to complete the compensation of the digital quartz crystal temperature sensor. Using the digital discrete form of the drive signal as the reference signal, in-phase demodulation and quadrature demodulation were performed on the response signal after analog-to-digital conversion. Figure 6 These are the measured data of the original in-phase and original quadrature components of a digital quartz crystal temperature sensor over 30 minutes at room temperature. Figure 6 It can be seen that the original in-phase component and the original quadrature component are basically the same in size.
[0146] Secondly, phase angle compensation is performed on the original in-phase component, and phase angle and C0 compensation are also performed on the original quadrature component to obtain the compensated in-phase and quadrature components, as detailed below. Figure 7 As shown. By Figure 7 It can be seen that the magnitude of the compensated in-phase component is 10^7, slightly larger than the original in-phase component. The compensated quadrature component fluctuates around 0, much smaller than the original quadrature component, proving the effectiveness of the compensation method of the present invention.
[0147] Next, the digital quartz crystal temperature sensor was placed in a temperature cycling environment for a temperature cycling test. Figure 8 This is a comparison chart of the frequency of the drive signal and the temperature detection results from the built-in temperature sensor of the ARM main controller during the temperature cycling test. Figure 8 It can be seen that, within the entire temperature range, the frequency of the driving signal has a negative linear relationship with the ambient temperature, and the ambient temperature value can be calculated from the frequency of the driving signal.
[0148] The above analysis shows that the resonant frequency of the quartz resonator in the digital quartz crystal temperature sensor exhibits a negative linear relationship with ambient temperature. Therefore, a fixed-point calibration test is required to establish a model of the resonant frequency versus ambient temperature. The calibration test involves collecting and storing the output data of the digital quartz crystal temperature sensor at N calibration temperature points T1, T2…TN (with a variation step of 10℃). The specific experimental steps are as follows:
[0149] 1) Place the digital quartz crystal temperature sensor in the temperature chamber and turn off the power. Then set the temperature of the temperature chamber to Ti (i = 1, 2...N) and wait for the internal ambient temperature of the temperature chamber to reach the set value.
[0150] 2) Power on the digital quartz crystal temperature sensor, collect data for 30 minutes, and then power off to complete the data acquisition of the Ti temperature point;
[0151] 3) Repeat steps 1) and 2) until test data are collected at N calibrated temperature points.
[0152] Using 0℃ as the reference temperature point, a2 and a1 in equation (4) can be calculated based on the experimental data from N calibrated temperature points. Based on the frequency data of the driving signals at 0℃, 10℃, and 20℃, and combined with a2 and a1, the offline fitted temperature data of the digital quartz crystal temperature sensor at the three temperature points of 0℃, 10℃, and 20℃ can be obtained, thereby determining whether the generated fitting coefficients a2 and a1 are accurate. Specifically, as follows... Figure 9 As shown.
[0153] The established resonant frequency-ambient temperature model was programmed into the digital quartz crystal temperature sensor, which was then placed in a temperature chamber. When the ambient temperature inside the chamber stabilized at 15°C, the digital quartz crystal temperature sensor was powered on, and its real-time output value was observed and collected over 300 seconds. Figure 10 The measured ambient temperature output from the digital quartz crystal temperature sensor is the actual temperature reading. Figure 10 The measured ambient temperature output online is obtained from real-time calculations based on the frequency by a digital quartz crystal temperature sensor. Figure 10 It can be seen that the online output temperature of the digital quartz crystal temperature sensor is around 15℃, indicating that the digital quartz crystal temperature sensor of the present invention can accurately measure the ambient temperature, thus proving the effectiveness of the resonant frequency-ambient temperature model established in the present invention.
[0154] Figure 11 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 11 As shown, the electronic device may include a processor 1101, a communication interface 1102, a memory 1103, and a communication bus 1104, wherein the processor 1101, the communication interface 1102, and the memory 1103 communicate with each other via the communication bus 1104. The processor 1101 can call logic instructions in the memory 1103 to execute a temperature detection method, which includes: acquiring a drive signal output by an oscillation circuit and a response signal output by a quartz resonator; wherein the drive signal is used to drive the quartz resonator.
[0155] The response signal is demodulated based on the driving signal to obtain the demodulated signal of the response signal, and the response signal is compensated based on the demodulated signal to obtain the compensated response signal.
[0156] The target frequency of the driving signal is determined based on the compensated response signal, and the target frequency is used by the oscillation circuit to adjust the frequency of the driving signal.
[0157] The temperature detection value of the environment in which the quartz resonator is located is determined based on the target frequency.
[0158] Furthermore, the logical instructions in the aforementioned memory 1103 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0159] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program that can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer is able to execute the temperature detection method provided by the above methods, the method including: acquiring a drive signal output by an oscillation circuit and a response signal output by a quartz resonator; wherein the drive signal is used to drive the quartz resonator;
[0160] The response signal is demodulated based on the driving signal to obtain the demodulated signal of the response signal, and the response signal is compensated based on the demodulated signal to obtain the compensated response signal.
[0161] The target frequency of the driving signal is determined based on the compensated response signal, and the target frequency is used by the oscillation circuit to adjust the frequency of the driving signal.
[0162] The temperature detection value of the environment in which the quartz resonator is located is determined based on the target frequency.
[0163] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the temperature detection method provided by the methods described above, the method comprising: acquiring a drive signal output by an oscillation circuit and a response signal output by a quartz resonator; wherein the drive signal is used to drive the quartz resonator;
[0164] The response signal is demodulated based on the driving signal to obtain the demodulated signal of the response signal, and the response signal is compensated based on the demodulated signal to obtain the compensated response signal.
[0165] The target frequency of the driving signal is determined based on the compensated response signal, and the target frequency is used by the oscillation circuit to adjust the frequency of the driving signal.
[0166] The temperature detection value of the environment in which the quartz resonator is located is determined based on the target frequency.
[0167] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0168] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0169] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A digital quartz crystal temperature sensor, characterized in that, include: Quartz resonators, signal amplification circuits, and controllers; The signal amplification circuit is connected to the quartz resonator and the controller respectively, and is used to convert the response signal output by the quartz resonator and transmit it to the controller. The controller includes an analog-to-digital converter module, a data processing module, an oscillation circuit, and a digital-to-analog converter module connected in sequence; the analog-to-digital converter module is connected to the signal amplification circuit, and the digital-to-analog converter module is connected to the quartz resonator; The oscillation circuit is used to output a drive signal to the digital-to-analog converter module and the data processing module; wherein, the drive signal is used to drive the quartz resonator; The data processing module is used to demodulate the response signal based on the driving signal to obtain a demodulated signal of the response signal, and to compensate the response signal based on the demodulated signal to obtain a compensated response signal; it is also used to determine the target frequency of the driving signal based on the compensated response signal and output it to the oscillation circuit, wherein the target frequency is used by the oscillation circuit to adjust the frequency of the driving signal; and it is also used to determine the temperature detection value of the environment in which the quartz resonator is located based on the target frequency. The driving signal includes a sine signal and a cosine signal, and the data processing module is used for: Based on the sinusoidal signal and the cosine signal, the response signal is demodulated in phase and quadraturely to obtain the first in-phase component and the first quadrature component of the response signal, respectively. Based on a preset compensation phase angle, phase angle compensation is performed on the first in-phase component and the first quadrature component to eliminate the mutual coupling between the first in-phase component and the first quadrature component, and to compensate for the phase difference between the response signal and the driving signal caused by software and hardware delay, so as to obtain the second in-phase component and the second quadrature component of the response signal. The second orthogonal component is compensated based on a preset orthogonal component compensation coefficient to offset the contribution of the static capacitance of the quartz resonator to the second orthogonal component, thereby obtaining the third orthogonal component; wherein, at the resonant frequency point of the quartz resonator, the third orthogonal component is 0. The second in-phase component and the third quadrature component are used to characterize the compensated response signal; Determining the phase of the compensated response signal based on the second in-phase component and the third quadrature component includes: calculating the arctangent of the ratio of the third quadrature component to the second in-phase component to obtain the phase of the compensated response signal; The target frequency of the driving signal is determined based on the phase difference between the compensated response signal and the target phase; wherein the target phase is 0.
2. The digital quartz crystal temperature sensor according to claim 1, characterized in that, The frequency of the sine signal is the same as the frequency of the cosine signal; The oscillation circuit is used to output the sine signal to the digital-to-analog converter module, and to output the sine signal and the cosine signal to the data processing module; The data processing module is used to determine the compensated response signal based on the first in-phase component and the first quadrature component.
3. The digital quartz crystal temperature sensor according to claim 2, characterized in that, The data processing module is specifically used for: The first in-phase component, the first quadrature component, and the compensation phase angle are input into a preset in-phase compensation model to obtain the second in-phase component; wherein, the in-phase compensation model is used to characterize the first correspondence between the second in-phase component and the first in-phase component, the first quadrature component, and the compensation phase angle; The first in-phase component, the first quadrature component, and the compensation phase angle are input into a preset quadrature compensation model to obtain the second quadrature component; wherein, the quadrature compensation model is used to characterize the second correspondence between the second quadrature component and the first in-phase component, the first quadrature component, and the compensation phase angle.
4. The digital quartz crystal temperature sensor according to claim 2, characterized in that, The controller further includes a gain control module, the input of which is connected to the data processing module and the oscillation circuit respectively, and the output of which is connected to the digital-to-analog conversion module. The data processing module is also used to determine the gain coefficient of the driving signal based on the compensated response signal; The gain control module is used to adjust the amplitude of the sinusoidal signal based on the gain coefficient and then output it to the digital-to-analog conversion module.
5. The digital quartz crystal temperature sensor according to claim 4, characterized in that, The data processing module is specifically used for: The amplitude of the compensated response signal is determined based on the second in-phase component and the third quadrature component; The gain coefficient of the driving signal is determined based on the difference between the amplitude of the compensated response signal and the target amplitude.
6. The digital quartz crystal temperature sensor according to any one of claims 1 to 5, characterized in that, The data processing module is specifically used for: Based on the preset correspondence between the resonant frequency and temperature of the quartz resonator, the temperature corresponding to the target frequency is determined and used as the temperature detection value of the environment in which the quartz resonator is located.
7. A temperature detection method, characterized in that, include: Acquire a drive signal output from an oscillation circuit and a response signal output from a quartz resonator; wherein the drive signal is used to drive the quartz resonator. The response signal is demodulated based on the driving signal to obtain the demodulated signal of the response signal, and the response signal is compensated based on the demodulated signal to obtain the compensated response signal. The target frequency of the driving signal is determined based on the compensated response signal, and the target frequency is used by the oscillation circuit to adjust the frequency of the driving signal. The temperature detection value of the environment in which the quartz resonator is located is determined based on the target frequency; The driving signal includes a sine signal and a cosine signal. Based on the sine signal and the cosine signal, the response signal is demodulated in phase and quadraturely, respectively, to obtain the first in-phase component and the first quadrature component of the response signal. Based on a preset compensation phase angle, phase angle compensation is performed on the first in-phase component and the first quadrature component to eliminate the mutual coupling between the first in-phase component and the first quadrature component, and to compensate for the phase difference between the response signal and the driving signal caused by software and hardware delay, so as to obtain the second in-phase component and the second quadrature component of the response signal. The second orthogonal component is compensated based on a preset orthogonal component compensation coefficient to offset the contribution of the static capacitance of the quartz resonator to the second orthogonal component, thereby obtaining the third orthogonal component; wherein, at the resonant frequency point of the quartz resonator, the third orthogonal component is 0. The second in-phase component and the third quadrature component are used to characterize the compensated response signal; Determining the phase of the compensated response signal based on the second in-phase component and the third quadrature component includes: calculating the arctangent of the ratio of the third quadrature component to the second in-phase component to obtain the phase of the compensated response signal; The target frequency of the driving signal is determined based on the phase difference between the compensated response signal and the target phase; wherein the target phase is 0.
8. 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 program, it implements the temperature detection method as described in claim 7.
Citation Information
Patent Citations
Digitalized detection method for temperature information of micromechanical quartz gyroscope sensitive device
CN102519617A
Digital drive loop control circuit for quartz tuning fork gyroscope
CN103697874A