[go: up one dir, main page]

CN119171839B - Crystal oscillator temperature compensation method and device, storage medium and electronic equipment - Google Patents

Crystal oscillator temperature compensation method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN119171839B
CN119171839B CN202411183383.0A CN202411183383A CN119171839B CN 119171839 B CN119171839 B CN 119171839B CN 202411183383 A CN202411183383 A CN 202411183383A CN 119171839 B CN119171839 B CN 119171839B
Authority
CN
China
Prior art keywords
temperature
crystal oscillator
target
curve
frequency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202411183383.0A
Other languages
Chinese (zh)
Other versions
CN119171839A (en
Inventor
顾明
马怀昌
冒鑫
黄达良
马斌
慈浩杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ruixing Microelectronics Technology Yangzhou Co ltd
Original Assignee
Ruixing Microelectronics Technology Yangzhou Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ruixing Microelectronics Technology Yangzhou Co ltd filed Critical Ruixing Microelectronics Technology Yangzhou Co ltd
Priority to CN202411183383.0A priority Critical patent/CN119171839B/en
Publication of CN119171839A publication Critical patent/CN119171839A/en
Application granted granted Critical
Publication of CN119171839B publication Critical patent/CN119171839B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03BGENERATION OF OSCILLATIONS, DIRECTLY OR BY FREQUENCY-CHANGING, BY CIRCUITS EMPLOYING ACTIVE ELEMENTS WHICH OPERATE IN A NON-SWITCHING MANNER; GENERATION OF NOISE BY SUCH CIRCUITS
    • H03B5/00Generation of oscillations using amplifier with regenerative feedback from output to input
    • H03B5/02Details
    • H03B5/04Modifications of generator to compensate for variations in physical values, e.g. power supply, load, temperature
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03BGENERATION OF OSCILLATIONS, DIRECTLY OR BY FREQUENCY-CHANGING, BY CIRCUITS EMPLOYING ACTIVE ELEMENTS WHICH OPERATE IN A NON-SWITCHING MANNER; GENERATION OF NOISE BY SUCH CIRCUITS
    • H03B5/00Generation of oscillations using amplifier with regenerative feedback from output to input
    • H03B5/30Generation of oscillations using amplifier with regenerative feedback from output to input with frequency-determining element being electromechanical resonator
    • H03B5/32Generation of oscillations using amplifier with regenerative feedback from output to input with frequency-determining element being electromechanical resonator being a piezoelectric resonator

Landscapes

  • Oscillators With Electromechanical Resonators (AREA)

Abstract

本申请涉及一种晶体振荡器温度补偿方法、装置、存储介质及电子设备,涉及晶体振荡器技术领域,其中方法包括:获取同一批次晶体振荡器中至少一个目标晶体振荡器对应的第一温度频率数据;基于各所述目标晶体振荡器的第一温度频率数据,得到对应的三维数据,并基于各所述三维数据,拟合得到三维曲面方程;获取待补偿晶体振荡器的至少一组第二温度频率数据,基于各所述第二温度频率数据和所述三维曲面方程,得到所述待补偿晶体振荡器对应的温度频率二维曲线方程;基于所述温度频率二维曲线方程,对所述待补偿晶体振荡器进行温度补偿。本申请具有提高晶体振荡器温度补偿的效率的效果。

The present application relates to a crystal oscillator temperature compensation method, device, storage medium and electronic device, and relates to the field of crystal oscillator technology, wherein the method comprises: obtaining first temperature frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators; obtaining corresponding three-dimensional data based on the first temperature frequency data of each target crystal oscillator, and fitting a three-dimensional surface equation based on each three-dimensional data; obtaining at least one set of second temperature frequency data of the crystal oscillator to be compensated, and obtaining a two-dimensional temperature frequency curve equation corresponding to the crystal oscillator to be compensated based on each second temperature frequency data and the three-dimensional surface equation; and performing temperature compensation on the crystal oscillator to be compensated based on the two-dimensional temperature frequency curve equation. The present application has the effect of improving the efficiency of temperature compensation of crystal oscillators.

Description

Crystal oscillator temperature compensation method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of crystal oscillators, and in particular, to a method and apparatus for compensating a temperature of a crystal oscillator, a storage medium, and an electronic device.
Background
A crystal oscillator is an electronic oscillator circuit using the inverse piezoelectric effect, which uses the mechanical resonance of a quartz crystal to generate an electrical signal having a very precise frequency. Crystal oscillators are an integral component of many electronic devices, whose primary function is to provide a stable clock signal. Because of its high stability and accuracy, crystal oscillators are widely used in a variety of electronic devices, such as communication devices, computer systems, and other precision instruments. These devices require very high accuracy and stability of frequency, and therefore the importance of crystal oscillators is self-evident.
In the actual production process, the crystal oscillator is affected by factors such as temperature and process deviation, so that the output frequency is deviated, and the problem of unstable output frequency occurs, and in order to solve the problem, the mode generally adopted is as follows: the method is characterized in that the temperature compensation is carried out on each produced crystal oscillator by reasonably carrying out temperature compensation on the change data of the output frequency of the crystal oscillator along with the temperature based on the two-dimensional curve equation fitting, so that the produced crystal oscillators can keep higher stability at all temperatures, wherein the temperature compensation refers to the compensation on the frequency drift generated by the crystal oscillator under the temperature change, but in the practical application, the two-dimensional curve equation of the corresponding crystal oscillator can be fitted only by measuring the output frequency data of more groups of temperature points, the time cost of the production of the crystal oscillator is increased, and the temperature compensation efficiency of the crystal oscillator is poor.
Disclosure of Invention
In order to improve the temperature compensation efficiency of a crystal oscillator, the application provides a temperature compensation method and device of the crystal oscillator, a storage medium and electronic equipment.
In a first aspect of the present application, a method for compensating the temperature of a crystal oscillator is provided, which specifically includes:
Acquiring first temperature frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators, wherein the first temperature frequency data comprises different temperatures in a preset temperature interval and output frequencies of the corresponding target crystal oscillators at the different temperatures;
Obtaining corresponding three-dimensional data based on the first temperature frequency data of each target crystal oscillator, and fitting to obtain a three-dimensional curved surface equation based on each three-dimensional data, wherein the three-dimensional data comprises data of the corresponding target crystal oscillator in three dimensions of temperature, corresponding output frequency and process factors, and the process factors represent the influence degree of process deviation on the temperature frequency characteristics of the target crystal oscillator;
acquiring at least one group of second temperature frequency data of the crystal oscillator to be compensated, and obtaining a temperature frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on the second temperature frequency data and the three-dimensional curve equation, wherein the second temperature frequency data comprise a single temperature in the preset temperature interval and the output frequency of the crystal oscillator to be compensated corresponding to the single temperature, the independent variable of the temperature frequency two-dimensional curve equation is temperature, and the dependent variable is the output frequency corresponding to the crystal oscillator to be compensated;
and carrying out temperature compensation on the crystal oscillator to be compensated based on the temperature frequency two-dimensional curve equation.
By adopting the technical scheme, the first temperature frequency data corresponding to at least one target crystal oscillator is acquired, the first temperature frequency data of each target crystal oscillator is fused into the corresponding process factor dimension data, the two-dimensional data of the output frequency and the temperature are expanded to the three-dimensional data, and then the three-dimensional data are fitted to obtain a three-dimensional curved surface equation, so that the influence of the process deviation on the output frequency deviation is taken into consideration. Further, the second temperature frequency data of the crystal oscillator to be compensated is substituted into the three-dimensional curved surface equation, the dimension is reduced to the temperature frequency two-dimensional curve equation, and the temperature compensation processing is performed specifically by means of reducing the dimension to the two-dimensional curve equation based on the three-dimensional curved surface equation, so that the change curve of the output frequency of the crystal oscillator to be compensated along with the temperature can be determined without measuring more temperature frequency data, the output frequency of the crystal oscillator to be compensated at different temperatures can be accurately determined according to the temperature frequency two-dimensional curve equation, and the temperature compensation processing is performed specifically, thereby improving the temperature compensation efficiency of the crystal oscillator.
Optionally, the obtaining corresponding three-dimensional data based on the first temperature frequency data of each target crystal oscillator specifically includes:
Determining a corresponding first change curve according to the first temperature frequency data of each target crystal oscillator, wherein the first change curve is a change curve of the output frequency of the corresponding target crystal oscillator along with the temperature;
Selecting a first target temperature interval from the preset temperature intervals, and extracting the slope of a part of curves corresponding to the first target temperature interval in each first change curve, wherein the linearity degree of each first change curve in the first target temperature interval is highest;
normalizing each slope to obtain a first process factor of a corresponding target crystal oscillator;
and determining different temperatures in the preset temperature interval and the first process factor of each target crystal oscillator as independent variables, and determining the output frequency of the corresponding target crystal oscillator at different temperatures as the dependent variables to obtain corresponding three-dimensional data.
By adopting the technical scheme, the first change curve corresponding to each target crystal oscillator in the first target temperature interval has the highest linearity, and the slope of the part curve corresponding to the first target temperature interval in each first change curve can intuitively reflect the influence of process deviation on the temperature frequency characteristic of each target crystal oscillator, so that the first process factor of each target crystal oscillator is determined according to the slope. And finally, the first process factor of each target crystal oscillator is fused into the two-dimensional data of the corresponding temperature frequency, and the two-dimensional data are expanded into three-dimensional data, so that the subsequent determination of a three-dimensional curved surface equation is facilitated.
Optionally, the obtaining a temperature frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on the second temperature frequency data and the three-dimensional curve equation specifically includes:
Substituting each second temperature frequency data into the three-dimensional curved surface equation based on a least square method, and determining a target process factor corresponding to the crystal oscillator to be compensated;
substituting the target process factor into the three-dimensional curved surface equation to obtain a temperature frequency two-dimensional curved surface equation corresponding to the crystal oscillator to be compensated.
By adopting the technical scheme, the second temperature frequency data is substituted into the three-dimensional curved surface equation, meanwhile, the target process factor corresponding to the crystal oscillator to be compensated is determined based on the least square method, and then the target process factor is substituted into the three-dimensional curved surface equation to obtain the temperature frequency two-dimensional curve equation after dimension reduction, so that the temperature frequency two-dimensional curve equation of the crystal oscillator to be compensated can be rapidly determined by measuring the output frequency data of fewer temperature points, and the subsequent temperature compensation can be conveniently and more efficiently performed according to the temperature frequency two-dimensional curve equation.
Optionally, the method further comprises:
Acquiring at least one group of third temperature frequency data after the temperature compensation of the crystal oscillator to be compensated;
Based on the third temperature frequency data, a corresponding second change curve is obtained, the second change curve is fitted with a preset reference change curve, and a first integral fitting rate is obtained, wherein the reference change curve is a curve of temperature-compensated output frequency changing along with temperature;
If the first overall fitting rate does not exceed a preset fitting rate threshold, selecting a second target temperature interval and a third target temperature interval from the preset temperature interval, wherein the temperature in the second target temperature interval is lower than the temperature in the first target temperature interval, and the temperature in the third target temperature interval is higher than the first target temperature interval;
Calculating a first fitting rate of the reference change curve and the second change curve in the first target temperature interval, calculating a second fitting rate of the reference change curve and the second change curve in the second target temperature interval, calculating a third fitting rate of the reference change curve and the second change curve in the third target temperature interval, and adjusting the three-dimensional curved equation according to the first fitting rate, the second fitting rate and the third fitting rate to re-perform temperature compensation on the crystal oscillator to be compensated.
By adopting the technical scheme, if the first integral fitting rate does not exceed the fitting rate threshold, the effect of temperature compensation of the crystal oscillator to be compensated is poor according to the temperature frequency two-dimensional curve equation, and the deviation of the output frequency is still larger. Further, the fitting rate of the reference change curve and the second change curve in the first target temperature interval, the second target temperature interval and the third target temperature interval is determined, so that the temperature compensation effect of the current temperature compensation in different temperature intervals is reflected. And finally, based on the first fitting rate, the second fitting rate and the third fitting rate, the three-dimensional curved surface equation is adjusted, so that the compensation effect of the re-temperature compensation in each temperature interval is ensured to be good as much as possible.
Optionally, the adjusting the three-dimensional curved surface equation according to the first fitting rate, the second fitting rate and the third fitting rate to re-perform temperature compensation on the crystal oscillator to be compensated specifically includes:
when the second fitting rate and the third fitting rate do not exceed the fitting rate threshold and the first fitting rate exceeds the fitting rate threshold, determining a first weight and a second weight according to the proportional relation between the second fitting rate and the third fitting rate, wherein the sum of the weights of the first weight and the second weight is 1, and the larger the second fitting rate is, the smaller the corresponding first weight is;
For the same first change curve, determining a corresponding second process factor according to a corresponding partial curve in the second target temperature interval, and determining a corresponding third process factor according to a corresponding partial curve in the third target temperature interval;
Summing the product of the first weight and the second process factor and the product of the second weight and the third process factor to obtain a weighted sum result, and performing weighted sum on the weighted sum result and the first process factor of the same first change curve to obtain a brand new process factor of the corresponding target crystal oscillator;
and adjusting the three-dimensional curved surface equation according to the brand new process factors of the target crystal oscillators.
By adopting the technical scheme, when the second fitting rate and the third fitting rate do not exceed the fitting rate threshold and the first fitting rate exceeds the fitting rate threshold, the fact that the determined first process factor is poor in accuracy and rationality by using part of curves of the first target temperature interval is explained, and the first process factor needs to be adjusted is needed, then the proportional relation between the second fitting rate and the third fitting rate is determined, so that the effect of compensating the output frequency of the crystal oscillator to be compensated in the second target temperature interval and the third target temperature interval is reflected when temperature compensation is carried out based on a three-dimensional curved surface equation, and further, the second process factor and the third process factor are weighted and summed through the first weight and the second weight, and a weighted summation result is obtained. And finally, carrying out weighted summation on the first process factors and weighted summation results of the same first change curve to obtain brand new process factors of each target crystal oscillator, and adjusting the three-dimensional curved surface equation so as to finally improve the effect of re-temperature compensation.
Optionally, the method further comprises:
acquiring at least one group of fourth temperature frequency data after the temperature compensation of the crystal oscillator to be compensated;
Based on the fourth temperature frequency data, a corresponding third change curve is obtained, the third change curve is fitted with a preset reference change curve, and a second overall fitting rate is obtained, wherein the reference change curve is a curve of temperature-dependent output frequency with temperature compensation meeting requirements;
If the second overall fitting rate does not exceed the preset fitting rate threshold, determining at least one target output frequency based on a target part curve in the third change curve, wherein the fitting rate of the target part curve and a corresponding part curve in the reference change curve exceeds the preset fitting rate threshold;
And carrying out temperature compensation on the crystal oscillator to be compensated again based on each target output frequency and the three-dimensional curved surface equation.
By adopting the technical scheme, if the second integral fitting rate does not exceed the preset fitting rate threshold value, the fact that the similarity between the third change curve and the reference change curve is poor is indicated, further, the fact that the effect of temperature compensation is carried out on the crystal oscillator to be compensated according to a temperature frequency two-dimensional curve equation is indicated to be poor, the deviation of output frequency is still large, then at least one target output frequency, namely the output frequency with small deviation, is determined based on a target part curve in the third change curve, finally, the change condition of the output frequency of the crystal oscillator to be compensated along with the temperature is determined again accurately according to the target output frequency and the three-dimensional curve equation, and further, the temperature compensation with better effect is achieved.
Optionally, the performing temperature compensation on the crystal oscillator to be compensated again based on each target output frequency and the three-dimensional curved surface equation specifically includes:
averaging the target output frequencies to obtain proper output frequencies, substituting the proper output frequencies into the three-dimensional curved surface equation to obtain a target two-dimensional curve equation, wherein the target two-dimensional curve equation is a curve of the process factor of the crystal oscillator to be compensated along with the temperature;
Performing linear fitting on the target two-dimensional curve to obtain a constant function parallel to an x-axis, and determining a final process factor corresponding to the crystal oscillator to be compensated according to the constant function;
substituting the final process factor into the three-dimensional curved surface equation to obtain a final temperature frequency two-dimensional curved surface equation corresponding to the crystal oscillator to be compensated;
And carrying out temperature compensation on the crystal oscillator to be compensated again based on the final temperature frequency two-dimensional curve equation.
By adopting the technical scheme, the proper output frequency is substituted into the three-dimensional curved surface equation to obtain the target two-dimensional curved surface equation, namely, the change curve of the process factor of the crystal oscillator to be compensated along with the temperature. Therefore, the change condition of the process factor of the crystal oscillator to be compensated along with the temperature is determined when the temperature compensation effect is good and the output frequency offset is small. Further, the target two-dimensional curve equation is subjected to linear fitting to obtain a constant function parallel to the x axis, so that the final process factor is finally determined, and the output frequency offset of the crystal oscillator to be compensated in more temperatures is smaller. And finally substituting the final process factor into a three-dimensional curved surface equation, and reducing the dimension to obtain a final temperature frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated, namely, a change curve of the output frequency of the crystal oscillator to be compensated along with the temperature. Further, based on the final temperature frequency two-dimensional curve equation, the temperature compensation is performed on the crystal oscillator to be compensated again, and the temperature compensation effect is improved.
In a second aspect of the present application, there is provided a crystal oscillator temperature compensation apparatus, comprising:
the data acquisition module is used for acquiring first temperature frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators, wherein the first temperature frequency data comprises different temperatures in a preset temperature interval and output frequencies of the corresponding target crystal oscillators at the different temperatures;
The curve fitting module is used for obtaining corresponding three-dimensional data based on the first temperature frequency data of each target crystal oscillator, fitting to obtain a three-dimensional curve equation based on each three-dimensional data, wherein the three-dimensional data comprises data of the corresponding target crystal oscillator in three dimensions of temperature, corresponding output frequency and process factors, and the process factors represent the influence degree of process deviation on the temperature frequency characteristics of the target crystal oscillator;
The curve determining module is used for obtaining at least one group of second temperature frequency data of the crystal oscillator to be compensated, obtaining a temperature frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on the second temperature frequency data and the three-dimensional curved surface equation, wherein the second temperature frequency data comprise a single temperature in the preset temperature interval and the output frequency of the crystal oscillator to be compensated corresponding to the single temperature, the independent variable of the temperature frequency two-dimensional curve equation is temperature, and the dependent variable is the output frequency corresponding to the crystal oscillator to be compensated;
And the temperature compensation module is used for carrying out temperature compensation on the crystal oscillator to be compensated based on the temperature frequency two-dimensional curve equation.
By adopting the technical scheme, the data acquisition module acquires the first temperature frequency data of the target crystal oscillator, the curve fitting module fits to obtain a three-dimensional curve equation based on each three-dimensional data, the curve determining module obtains a temperature frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated according to each second temperature frequency data and the three-dimensional curve equation, and finally the temperature compensation module compensates the temperature of the crystal oscillator to be compensated based on the temperature frequency two-dimensional curve equation.
In a third aspect of the application there is provided a computer readable storage medium having a computer program stored therein, which when loaded and executed by a processor performs the method steps of any of the first aspects.
In a fourth aspect of the present application, there is provided an electronic device, comprising:
A processor, a memory and a computer program stored in the memory and capable of running on the processor, the processor being configured to load and execute the computer program stored in the memory to cause the electronic device to perform the method according to any one of the first aspects.
In summary, the method has at least one of the following beneficial technical effects that the first temperature frequency data of each target crystal oscillator are fused into the corresponding process factor dimension data, the two-dimensional data of the output frequency and the temperature are expanded to three-dimensional data, and then the three-dimensional data are fitted to obtain a three-dimensional curved surface equation, so that the influence of process deviation on the output frequency deviation is taken into consideration better. Further, the second temperature frequency data of the crystal oscillator to be compensated is substituted into the three-dimensional curved surface equation, the dimension is reduced to the temperature frequency two-dimensional curve equation, and the temperature compensation processing is performed specifically by means of reducing the dimension to the two-dimensional curve equation based on the three-dimensional curved surface equation, so that the change curve of the output frequency of the crystal oscillator to be compensated along with the temperature can be determined without measuring more temperature frequency data, the output frequency of the crystal oscillator to be compensated at different temperatures can be accurately determined according to the temperature frequency two-dimensional curve equation, and the temperature compensation processing is performed specifically, thereby improving the temperature compensation efficiency of the crystal oscillator.
Drawings
FIG. 1 is a schematic flow chart of a temperature compensation method for a crystal oscillator according to an embodiment of the present application;
FIG. 2 is a flow chart of another method for temperature compensation of a crystal oscillator according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a temperature compensation device of a crystal oscillator according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of another crystal oscillator temperature compensation device according to an embodiment of the present application.
The reference numerals indicate that the system comprises 11 parts of a data acquisition module, 12 parts of a curve fitting module, 13 parts of a curve determining module, 14 parts of a temperature compensation module, 15 parts of a first compensation module, and 16 parts of a second compensation module.
Detailed Description
In order to make the technical solutions in the present specification better understood by those skilled in the art, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present application, not all embodiments.
In describing embodiments of the present application, words such as "exemplary," "such as" or "for example" are used to mean serving as examples, illustrations or explanations. Any embodiment or design described herein as "illustrative," "such as" or "for example" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "illustratively," "such as" or "for example," etc., is intended to present related concepts in a concrete fashion.
In the description of the embodiment of the present application, the term "and/or" is merely an association relationship describing the association object, and indicates that three relationships may exist, for example, a and/or B, and may indicate that a exists alone, B exists alone, and both a and B exist. In addition, unless otherwise indicated, the term "plurality" means two or more. For example, a plurality of systems means two or more systems, and a plurality of screen terminals means two or more screen terminals. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating an indicated technical feature. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
Referring to fig. 1, an embodiment of the present application discloses a flow chart of a method for compensating the temperature of a crystal oscillator, which can be implemented by a computer program or can be run on a crystal oscillator temperature compensation device based on von neumann system. The computer program can be integrated in an application or can be run as a stand-alone tool class application, and specifically comprises:
S101, acquiring first temperature frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators.
Specifically, in the embodiment of the present application, the first temperature frequency data refers to different temperatures in a preset temperature interval and output frequencies of a single target crystal oscillator at the different temperatures. The output frequency of the target crystal oscillator refers to the frequency of the periodic clock signal generated by the target crystal oscillator, and once the output frequency deviates, the output frequency can have various effects on the clock signal, so that when the crystal oscillator is used as a main clock source, the system time sequence accuracy of an electronic system applying the crystal oscillator is poor. The target crystal oscillator is a crystal oscillator which is randomly sampled in the crystal oscillators produced in the same production batch to measure the output frequency at different temperatures. The preset temperature interval is-50 ℃ to 100 ℃, and different temperatures corresponding to different output frequencies of the target crystal oscillator can be-50 ℃, 24 ℃, 26 ℃, 50 ℃ and 100 ℃, and in other embodiments, other more temperatures can be adopted.
One possible way to obtain the first temperature frequency data is to place the target crystal oscillators in an incubator, adjust the temperature of the incubator to different temperatures in a preset range interval, and then obtain the output frequencies corresponding to the target crystal oscillators at different temperatures in the preset temperature interval of each target crystal oscillator through a frequency meter or an oscilloscope connected with the target crystal oscillators. This is the prior art and will not be described in detail here.
S102, obtaining corresponding three-dimensional data based on first temperature frequency data of each target crystal oscillator, and fitting to obtain a three-dimensional curved surface equation based on each three-dimensional data, wherein the three-dimensional data comprises data of the corresponding target crystal oscillator in three dimensions of temperature, corresponding output frequency and process factors.
Specifically, in the embodiment of the application, the process factor characterizes the influence degree of the process deviation on the deviation of the temperature frequency characteristic of the target crystal oscillator, and the process deviation refers to the AT cut angle deviation of the target crystal oscillator, namely, the included angle between the cutting surface and the main axis of the quartz crystal deviates from the ideal standard angle of 35 degrees 15' in the cutting process. Such deviations can have a significant impact on the performance of the target crystal oscillator, including stability of the output frequency. The temperature frequency characteristic is a characteristic in which the output frequency of the crystal oscillator changes when the ambient temperature changes. The larger the process factor, the larger the offset in the crystal oscillator output frequency when the temperature remains unchanged. After the first temperature frequency data are determined, a corresponding first change curve is drawn by a preset MATLAB tool according to the single target crystal oscillator and based on the corresponding first temperature frequency data, wherein the first change curve is a change curve of the output frequency of the corresponding target crystal oscillator along with temperature. Further, a first target temperature interval is selected from the preset temperature interval, the first target temperature interval is 0-50 ℃, the intermediate temperature interval of the target crystal oscillators is represented, the linearity degree of the first change curve corresponding to each target crystal oscillator in the first target temperature interval is highest, namely, part of the curve of the first change curve corresponding to each target crystal oscillator in the first target temperature interval is closest to a straight line. Further, first temperature frequency data of each target crystal oscillator in the first target temperature interval are selected, data fitting is carried out through two Python libraries NumPy and SciPy, a first-order function of output frequency of each target crystal oscillator in the first target temperature interval along with temperature change is obtained, k values in the first-order function are determined to be corresponding slopes, namely slopes of partial curves corresponding to the first target temperature interval in each first change curve, and therefore influences of process deviation on temperature frequency characteristics of each target crystal oscillator are reflected intuitively.
Further, the slope of a part of curves in a first target temperature interval in the first change curve of each target crystal oscillator is normalized to obtain a first process factor corresponding to each target crystal oscillator, so that the error of the process factor of each target crystal oscillator is reduced. One possible normalization method is to normalize each slope by a preset OmicShare Tools tool to finally obtain a corresponding first process factor. Finally, determining different temperatures (different temperatures in the first temperature frequency data) in a preset temperature interval and the first process factor of each target crystal oscillator as independent variables, determining the output frequency of the corresponding target crystal oscillator at different temperatures as dependent variables, and determining the data of the three dimensions (temperature, corresponding output frequency and process factor) as three-dimensional data of each target crystal oscillator, so that the first temperature frequency data (two-dimensional data) of each target crystal oscillator is expanded into three-dimensional data.
Further, based on three-dimensional data of each target crystal oscillator, a corresponding three-dimensional curved surface equation is obtained through fitting by a curve fitting tool box (cftool) in a MATLAB tool, so that corresponding change conditions of output frequency of the crystal oscillator when temperature and process factors change are better described.
S103, at least one group of second temperature frequency data of the crystal oscillator to be compensated is obtained, and a temperature frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated is obtained based on the second temperature frequency data and the three-dimensional curve equation.
Specifically, after the three-dimensional curved surface equation corresponding to the crystal oscillator is determined, at least one set of second temperature frequency data of the crystal oscillator to be compensated is obtained, and the obtaining manner may refer to step S101, which is not described herein again. The crystal oscillator to be compensated refers to a crystal oscillator which needs to be subjected to temperature compensation at present, and the second temperature frequency data comprise a single temperature in a preset temperature interval and the output frequency of the crystal oscillator to be compensated at the single temperature. Further, substituting the second temperature frequency data into the three-dimensional curved surface equation, determining a target process factor corresponding to the crystal oscillator to be compensated based on a least square method, substituting the target process factor into the three-dimensional curved surface equation to obtain a temperature frequency two-dimensional curve equation after dimension reduction, and accordingly determining the temperature frequency two-dimensional curve equation of the crystal oscillator to be compensated rapidly by measuring output frequency data of fewer temperature points. The independent variable of the temperature frequency two-dimensional curve equation is temperature, and the dependent variable is output frequency corresponding to the crystal oscillator to be compensated. In addition, by the least square method, a curved surface equation describing a three-dimensional space can be converted into a two-dimensional curved surface equation involving only two variables.
And S104, carrying out temperature compensation on the crystal oscillator to be compensated based on a temperature frequency two-dimensional curve equation.
Specifically, after a temperature frequency two-dimensional curve equation of the crystal oscillator to be compensated is adopted, the current ambient temperature is obtained through a preset temperature sensor, then the current ambient temperature is substituted into the temperature frequency two-dimensional curve equation to obtain the uncompensated actual output frequency of the crystal oscillator to be compensated, then the nominal frequency is subtracted from the actual output frequency to obtain a frequency compensation value, and finally the frequency compensation value is written into a preset compensation register, so that the effect of temperature compensation of the crystal oscillator to be compensated is achieved. The compensation register is a storage unit which is built in the crystal oscillator control circuit to be compensated and is used for storing the frequency compensation value and adjusting the output frequency so as to counteract the influence caused by temperature change. This is the prior art and will not be described in detail here.
In other embodiments, at least one set of third temperature frequency data after temperature compensation of the crystal oscillator to be compensated is obtained, where the third temperature frequency data includes a single temperature of the crystal oscillator to be compensated after temperature compensation in a preset temperature interval and a corresponding output frequency. And drawing a corresponding second change curve, namely, a change curve of the output frequency of the crystal oscillator to be compensated with temperature after temperature compensation, based on the third temperature frequency data by using a MATLAB tool. And fitting the second change curve with a preset reference change curve to obtain a first integral fitting rate, wherein the reference change curve is a curve of which the output frequency meets the requirement of temperature compensation along with the temperature change. If the first overall fitting rate does not exceed the fitting rate threshold, which indicates that the effect of temperature compensation of the crystal oscillator to be compensated is poor according to the temperature frequency two-dimensional curve equation, and the deviation of the output frequency is still large, selecting a second target temperature interval and a third target temperature interval from preset temperature intervals, wherein the temperature in the second target temperature interval is lower than the temperature in the first target temperature interval, and the temperature in the third target temperature interval is higher than the first target temperature interval. The second target temperature range is-50 ℃ to-30 ℃ and can be understood as a low temperature range of the crystal oscillator, and the second target temperature range is 80 ℃ to 100 ℃ and can be understood as a high temperature range of the crystal oscillator.
Further, a first fitting rate of the reference change curve and the second change curve in the first target temperature interval, a second fitting rate of the reference change curve and the second change curve in the second target temperature interval, and a third fitting rate of the reference change curve and the second change curve in the third target temperature interval are determined through a MATLAB tool. And then, according to the first fitting rate, the second fitting rate and the third fitting rate, the three-dimensional curved surface equation is adjusted to carry out temperature compensation on the crystal oscillator to be compensated again, and one implementation mode is that the first fitting rate, the second fitting rate and the third fitting rate are respectively compared with a fitting rate threshold, when the second fitting rate and the third fitting rate do not exceed the fitting rate threshold and the first fitting rate exceeds the fitting rate threshold, the fact that a part of curves of a first target temperature interval are used is explained, the accuracy and the rationality of a determined first process factor are poor, the first process factor is required to be adjusted, and then the proportional relation between the second fitting rate and the third fitting rate is determined, so that the effect of compensating the output frequency of the crystal oscillator to be compensated in the second target temperature interval and the third target temperature interval is reflected when the temperature compensation is carried out based on the three-dimensional curved surface equation. According to the proportional relation, a first weight and a second weight are determined, the larger the second fitting rate is, the smaller the corresponding first weight is, and the larger the weight is, the worse the corresponding output frequency compensation effect is. The sum of the first weight and the second weight is 1, and the ratio relationship is 3:2, for example, the first weight is 0.4, and the second weight is 0.6, which indicates that the output frequency compensation effect of the second target temperature interval is better than the output frequency compensation effect of the third target temperature interval.
Further, for the same first change curve, according to the partial curve thereof in the second target temperature interval, the corresponding slope is extracted and the corresponding second process factor is determined, and according to the partial curve thereof in the third target temperature interval, the corresponding slope is extracted and the corresponding third process factor is determined, and the detailed description is omitted herein, referring to step S102. Further, the product of the first weight and the second process factor and the product of the second weight and the third process factor are summed to obtain a weighted summation result. Further, the first process factor and the weighted summation result of the same first variation curve are weighted summed. The method comprises the steps of calculating a total first temperature difference between a second target temperature interval and a third target temperature interval, determining weights corresponding to a weighted summation result and a first process factor according to the proportion of the first temperature difference to the second temperature difference between the first target temperature interval, wherein the larger the first temperature difference is, the larger the weight corresponding to the weighted summation result is, and the larger the second temperature difference is, the larger the weight of the first process factor is. Thus, the brand new process factors of the corresponding target crystal oscillators are determined more accurately.
Further, different temperatures in a preset temperature interval, brand-new process factors of each target crystal oscillator and output frequencies of the corresponding target crystal oscillators at different temperatures are determined to be three-dimensional data, and a brand-new three-dimensional curved surface equation is obtained by re-fitting, so that adjustment of the three-dimensional curved surface equation is realized. And finally, obtaining a brand-new temperature frequency two-dimensional curve equation based on the brand-new three-dimensional curve equation, and carrying out temperature compensation on the crystal oscillator to be compensated again. See steps S103-S104, and are not described in detail herein.
Referring to fig. 2, another embodiment of the present application discloses a flow chart of a method for temperature compensation of a crystal oscillator, which can be implemented by a computer program or can be run on a crystal oscillator temperature compensation device based on von neumann system. The computer program can be integrated in an application or can be run as a stand-alone tool class application, and specifically comprises:
S201, first temperature frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators is obtained.
S202, obtaining corresponding three-dimensional data based on first temperature frequency data of each target crystal oscillator, and fitting to obtain a three-dimensional curved surface equation based on each three-dimensional data, wherein the three-dimensional data comprises data of the corresponding target crystal oscillator in three dimensions of temperature, corresponding output frequency and process factors.
S203, at least one group of second temperature frequency data of the crystal oscillator to be compensated is obtained, and a temperature frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated is obtained based on the second temperature frequency data and the three-dimensional curve equation.
S204, carrying out temperature compensation on the crystal oscillator to be compensated based on a temperature frequency two-dimensional curve equation.
Specifically, refer to steps S101-S104, which are not described herein.
S205, at least one group of fourth temperature frequency data of the crystal oscillator to be compensated after temperature compensation is obtained.
S206, based on the fourth temperature frequency data, obtaining a corresponding third change curve, fitting the third change curve with a preset reference change curve to obtain a second integral fitting rate, wherein the reference change curve is a curve of the output frequency changing along with the temperature, and the temperature compensation of the curve meets the requirement.
S207, if the second overall fitting rate does not exceed the preset fitting rate threshold, determining at least one target output frequency based on the target part curve in the third change curve, wherein the fitting rate of the corresponding part curve in the target part curve and the reference change curve exceeds the preset fitting rate threshold.
And S208, carrying out temperature compensation on the crystal oscillator to be compensated again based on each target output frequency and the three-dimensional curved surface equation.
Specifically, at least one set of fourth temperature frequency data of the crystal oscillator to be compensated after temperature compensation is obtained, and the obtaining manner may refer to step S101, which is not described herein. The fourth temperature frequency data comprise the single temperature of the crystal oscillator to be compensated after temperature compensation in a preset temperature interval and the corresponding output frequency. And performing curve fitting through a curve fitting tool box (cftool) in the MATLAB tool based on the fourth temperature frequency data to obtain a corresponding third change curve, wherein the third change curve is a change curve of the output frequency of the crystal oscillator to be compensated after temperature compensation along with the temperature. Further, fitting the third change curve with a preset reference change curve through a MATLAB tool to obtain a second overall fitting rate, wherein the reference change curve is a curve of temperature-compensation-compliant output frequency changing along with temperature, and the temperature-compensation-compliant requirement means that the output frequency of each temperature in a preset temperature interval after temperature compensation is within a reasonable frequency range.
Further, if the second overall fitting rate does not exceed the preset fitting rate threshold value, it is indicated that the similarity between the third change curve and the reference change curve is poor, and further it is indicated that the effect of performing temperature compensation on the crystal oscillator to be compensated is poor and the deviation of the output frequency is still large according to the temperature frequency two-dimensional curve equation, then at least one target output frequency is determined based on the target partial curve in the third change curve. And finally, inputting at least one temperature point in the sub-temperature interval corresponding to the target part curve to a third change curve to obtain at least one target output frequency, namely, an output frequency which is smaller along with temperature deviation.
Further, the target output frequencies are averaged to obtain a proper output frequency, and then the proper output frequency is substituted into a three-dimensional curved surface equation to obtain a target two-dimensional curved surface equation with only two variables of a process factor and temperature, namely, a change curve of the process factor of the crystal oscillator to be compensated along with the temperature. Therefore, the change condition of the process factor of the crystal oscillator to be compensated along with the temperature is determined when the temperature compensation effect is good and the output frequency offset is small. Further, a linear fit is performed by a curve fitting tool box (cftool) in MATLAB to the target two-dimensional curve equation, resulting in a constant function f (x) =c parallel to the x-axis, c representing a constant, which may be f (x) =20, for example. Further, the constant value in the constant function is determined as the final process factor of the crystal oscillator to be compensated, i.e. the value around which the corresponding process factor fluctuates in case the output frequency offset is small. Determining it as the final process factor helps to make the output frequency offset of the crystal oscillator to be compensated smaller in more temperatures. And finally, substituting the final process factor into a three-dimensional curved surface equation, and reducing the dimension based on a least square method to obtain a final temperature frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated, namely, a curve of the output frequency of the crystal oscillator to be compensated along with the temperature. Further, based on the final temperature-frequency two-dimensional curve equation, the temperature compensation is performed on the crystal oscillator to be compensated again, and in particular, reference may be made to step S104, which is not described herein.
The implementation principle of the temperature compensation method of the crystal oscillator is that the first temperature frequency data of each target crystal oscillator are fused into corresponding process factor dimension data, two-dimensional data of output frequency and temperature are expanded into three-dimensional data, and then the three-dimensional data are fitted to obtain a three-dimensional curved surface equation, so that the influence of process deviation on output frequency deviation is taken into consideration. Further, the second temperature frequency data of the crystal oscillator to be compensated is substituted into the three-dimensional curved surface equation, the dimension is reduced to the temperature frequency two-dimensional curve equation, and the temperature compensation processing is performed specifically by means of reducing the dimension to the two-dimensional curve equation based on the three-dimensional curved surface equation, so that the change curve of the output frequency of the crystal oscillator to be compensated along with the temperature can be determined without measuring more temperature frequency data, the output frequency of the crystal oscillator to be compensated at different temperatures can be accurately determined according to the temperature frequency two-dimensional curve equation, and the temperature compensation processing is performed specifically, thereby improving the temperature compensation efficiency of the crystal oscillator.
The following are examples of the apparatus of the present application that may be used to perform the method embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the method of the present application.
Fig. 3 is a schematic structural diagram of a temperature compensation device for a crystal oscillator according to an embodiment of the application. The application to a crystal oscillator temperature compensation device may be implemented as all or part of the device by software, hardware, or a combination of both. The device comprises a data acquisition module 11, a curve fitting module 12, a curve determining module 13 and a temperature compensation module 14.
The data acquisition module 11 is configured to acquire first temperature frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators, where the first temperature frequency data includes different temperatures in a preset temperature interval and output frequencies of the target crystal oscillators corresponding to the different temperatures;
The surface fitting module 12 is configured to obtain corresponding three-dimensional data based on the first temperature frequency data of each target crystal oscillator, and fit to obtain a three-dimensional surface equation based on each three-dimensional data, where the three-dimensional data includes data of the corresponding target crystal oscillator in three dimensions of temperature, corresponding output frequency and process factors, and the process factors characterize the influence degree of process deviation on the temperature frequency characteristics of the target crystal oscillator;
The curve determining module 13 is configured to obtain at least one set of second temperature frequency data of the crystal oscillator to be compensated, and obtain a two-dimensional temperature frequency curve equation corresponding to the crystal oscillator to be compensated based on the second temperature frequency data and the three-dimensional curved surface equation, where the second temperature frequency data includes a single temperature in a preset temperature interval and an output frequency of the crystal oscillator to be compensated corresponding to the single temperature, an independent variable of the two-dimensional temperature frequency curve equation is temperature, and a dependent variable is an output frequency corresponding to the crystal oscillator to be compensated;
The temperature compensation module 14 is used for performing temperature compensation on the crystal oscillator to be compensated based on a temperature frequency two-dimensional curve equation.
Optionally, the surface fitting module 12 is specifically configured to:
Determining a corresponding first change curve according to the first temperature frequency data of each target crystal oscillator, wherein the first change curve is a change curve of the output frequency of the corresponding target crystal oscillator along with the temperature;
Selecting a first target temperature interval from preset temperature intervals, extracting the slope of a part of curves corresponding to the first target temperature interval in each first change curve, wherein the linearity degree of each first change curve in the first target temperature interval is highest;
Normalizing each slope to obtain a first process factor of a corresponding target crystal oscillator;
And determining different temperatures in a preset temperature interval and a first process factor of each target crystal oscillator as independent variables, and determining output frequencies of the corresponding target crystal oscillators at different temperatures as independent variables to obtain corresponding three-dimensional data.
Optionally, the curve determining module 13 is specifically configured to:
Substituting the second temperature frequency data into a three-dimensional curved surface equation based on a least square method, and determining a target process factor corresponding to the crystal oscillator to be compensated;
substituting the target process factors into the three-dimensional curved surface equation to obtain a temperature frequency two-dimensional curved surface equation corresponding to the crystal oscillator to be compensated.
Optionally, as shown in fig. 4, the apparatus further includes a first compensation module 15, specifically configured to:
Acquiring at least one group of third temperature frequency data of the crystal oscillator to be compensated after temperature compensation;
Based on the third temperature frequency data, a corresponding second change curve is obtained, the second change curve is fitted with a preset reference change curve, a first integral fitting rate is obtained, and the reference change curve is a curve of temperature-compensated output frequency changing along with temperature;
if the first overall fitting rate does not exceed the preset fitting rate threshold, selecting a second target temperature interval and a third target temperature interval from the preset temperature interval, wherein the temperature in the second target temperature interval is lower than the temperature in the first target temperature interval, and the temperature in the third target temperature interval is higher than the first target temperature interval;
Calculating a first fitting rate of the reference change curve and the second change curve in the first target temperature interval, calculating a second fitting rate of the reference change curve and the second change curve in the second target temperature interval, calculating a third fitting rate of the reference change curve and the second change curve in the third target temperature interval, and adjusting the three-dimensional curved surface equation according to the first fitting rate, the second fitting rate and the third fitting rate so as to re-compensate the temperature of the crystal oscillator to be compensated.
Optionally, the first compensation module 15 is specifically configured to:
When the second fitting rate and the third fitting rate do not exceed the fitting rate threshold and the first fitting rate exceeds the fitting rate threshold, determining a first weight and a second weight according to the proportional relation between the second fitting rate and the third fitting rate, wherein the sum of the weights of the first weight and the second weight is 1, and the larger the second fitting rate is, the smaller the corresponding first weight is;
For the same first change curve, determining a corresponding second process factor according to a corresponding partial curve in a second target temperature interval, and determining a corresponding third process factor according to a corresponding partial curve in a third target temperature interval;
Summing the product of the first weight and the second process factor and the product of the second weight and the third process factor to obtain a weighted sum result, and carrying out weighted sum on the weighted sum result and the first process factor of the same first change curve to obtain a brand new process factor of the corresponding target crystal oscillator;
and adjusting the three-dimensional curved surface equation according to the brand new process factors of each target crystal oscillator.
Optionally, the apparatus further comprises a second compensation module 16, in particular for:
acquiring at least one group of fourth temperature frequency data of the crystal oscillator to be compensated after temperature compensation;
Based on the fourth temperature frequency data, a corresponding third change curve is obtained, the third change curve is fitted with a preset reference change curve, a second overall fitting rate is obtained, and the reference change curve is a curve of temperature-compensated output frequency changing along with temperature;
If the second overall fitting rate does not exceed the preset fitting rate threshold, determining at least one target output frequency based on a target part curve in the third change curve, wherein the fitting rate of the target part curve and a corresponding part curve in the reference change curve exceeds the preset fitting rate threshold;
And re-performing temperature compensation on the crystal oscillator to be compensated based on each target output frequency and the three-dimensional curved surface equation.
Optionally, the second compensation module 16 is specifically configured to:
averaging the target output frequencies to obtain an appropriate output frequency, substituting the appropriate output frequency into a three-dimensional curved surface equation to obtain a target two-dimensional curve equation, wherein the target two-dimensional curve equation is a change curve of a process factor of the crystal oscillator to be compensated along with temperature;
performing linear fitting on the target two-dimensional curve to obtain a constant function parallel to the x-axis, and determining a final process factor corresponding to the crystal oscillator to be compensated according to the constant function;
substituting the final process factor into a three-dimensional curved surface equation to obtain a final temperature frequency two-dimensional curved surface equation corresponding to the crystal oscillator to be compensated;
and re-performing temperature compensation on the crystal oscillator to be compensated based on the final temperature frequency two-dimensional curve equation.
It should be noted that, when the crystal oscillator temperature compensation device provided in the above embodiment performs the crystal oscillator temperature compensation method, only the division of the above functional modules is used for illustration, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the embodiment of the present invention provides a crystal oscillator temperature compensation device and a crystal oscillator temperature compensation method, which belong to the same concept, and the implementation process is detailed in the method embodiment, and will not be described herein again.
The embodiment of the application also discloses a computer readable storage medium, and the computer readable storage medium stores a computer program, wherein the computer program adopts the crystal oscillator temperature compensation method of the embodiment when being executed by a processor.
The computer program may be stored in a computer readable medium, where the computer program includes computer program code, where the computer program code may be in a source code form, an object code form, an executable file form, or some middleware form, etc., and the computer readable medium includes any entity or device capable of carrying the computer program code, a recording medium, a usb disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a Random Access Memory (RAM), an electrical carrier signal, a telecommunication signal, a software distribution medium, etc., where the computer readable medium includes, but is not limited to, the above components.
The crystal oscillator temperature compensation method of the embodiment is stored in the computer readable storage medium through the computer readable storage medium, and is loaded and executed on a processor, so that the storage and the application of the method are convenient.
The embodiment of the application also discloses an electronic device, wherein a computer program is stored in a computer readable storage medium, and when the computer program is loaded and executed by a processor, the crystal oscillator temperature compensation method is adopted.
The electronic device may be an electronic device such as a desktop computer, a notebook computer, or a cloud server, and the electronic device includes, but is not limited to, a processor and a memory, for example, the electronic device may further include an input/output device, a network access device, a bus, and the like.
The processor may be a Central Processing Unit (CPU), or of course, according to actual use, other general purpose processors, digital Signal Processors (DSP), application Specific Integrated Circuits (ASIC), ready-made programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., and the general purpose processor may be a microprocessor or any conventional processor, etc., which is not limited in this respect.
The memory may be an internal storage unit of the electronic device, for example, a hard disk or a memory of the electronic device, or may be an external storage device of the electronic device, for example, a plug-in hard disk, a Smart Memory Card (SMC), a secure digital card (SD), or a flash memory card (FC) provided on the electronic device, or the like, and may be a combination of the internal storage unit of the electronic device and the external storage device, where the memory is used to store a computer program and other programs and data required by the electronic device, and the memory may be used to temporarily store data that has been output or is to be output, which is not limited by the present application.
The crystal oscillator temperature compensation method of the embodiment is stored in the memory of the electronic device through the electronic device, and is loaded and executed on the processor of the electronic device, so that the crystal oscillator temperature compensation method is convenient to use.
The foregoing is merely exemplary embodiments of the present disclosure and is not intended to limit the scope of the present disclosure. That is, equivalent changes and modifications are contemplated by the teachings of this disclosure, which fall within the scope of the present disclosure. Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a scope and spirit of the disclosure being indicated by the claims.

Claims (9)

1.一种晶体振荡器温度补偿方法,其特征在于,所述方法包括:1. A crystal oscillator temperature compensation method, characterized in that the method comprises: 获取同一批次晶体振荡器中至少一个目标晶体振荡器对应的第一温度频率数据,所述第一温度频率数据包括预设温度区间中不同温度以及不同温度下对应的目标晶体振荡器的输出频率;Acquire first temperature-frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators, wherein the first temperature-frequency data includes different temperatures in a preset temperature range and the output frequencies of the corresponding target crystal oscillators at the different temperatures; 基于各所述目标晶体振荡器的第一温度频率数据,得到对应的三维数据,并基于各所述三维数据,拟合得到三维曲面方程,所述三维数据包括对应的目标晶体振荡器在温度、对应的输出频率和工艺因子三个维度的数据,所述工艺因子表征工艺偏差对所述目标晶体振荡器的温度频率特征发生偏移的影响程度,其中,所述基于各所述目标晶体振荡器的第一温度频率数据,得到对应的三维数据,包括:Based on the first temperature-frequency data of each of the target crystal oscillators, corresponding three-dimensional data are obtained, and based on each of the three-dimensional data, a three-dimensional surface equation is fitted, wherein the three-dimensional data includes data of the corresponding target crystal oscillator in three dimensions: temperature, corresponding output frequency, and process factor, wherein the process factor characterizes the degree of influence of process deviation on the temperature-frequency characteristic of the target crystal oscillator. The corresponding three-dimensional data obtained based on the first temperature-frequency data of each of the target crystal oscillators includes: 根据每个所述目标晶体振荡器的第一温度频率数据,确定对应的第一变化曲线,所述第一变化曲线为对应的目标晶体振荡器的输出频率随温度的变化曲线;Determine a corresponding first variation curve according to the first temperature frequency data of each target crystal oscillator, wherein the first variation curve is a variation curve of the output frequency of the corresponding target crystal oscillator with temperature; 从所述预设温度区间中选取第一目标温度区间,并提取每个所述第一变化曲线中所述第一目标温度区间对应的部分曲线的斜率,每个所述第一变化曲线在所述第一目标温度区间的线性程度最高;Selecting a first target temperature interval from the preset temperature interval, and extracting the slope of a portion of each first change curve corresponding to the first target temperature interval, wherein each first change curve has the highest linearity in the first target temperature interval; 对各所述斜率进行归一化处理,得到对应的目标晶体振荡器的第一工艺因子;Normalizing each of the slopes to obtain a first process factor of a corresponding target crystal oscillator; 将所述预设温度区间中的不同温度、每个所述目标晶体振荡器的第一工艺因子确定为自变量,并将对应的目标晶体振荡器在不同温度下的输出频率确定为因变量,得到对应的三维数据;Determine different temperatures in the preset temperature range and the first process factor of each target crystal oscillator as independent variables, and determine the output frequency of the corresponding target crystal oscillator at different temperatures as a dependent variable, to obtain corresponding three-dimensional data; 获取待补偿晶体振荡器的至少一组第二温度频率数据,基于各所述第二温度频率数据和所述三维曲面方程,得到所述待补偿晶体振荡器对应的温度频率二维曲线方程,所述第二温度频率数据包括所述预设温度区间中单个温度以及所述单个温度下对应的待补偿晶体振荡器的输出频率,所述温度频率二维曲线方程的自变量为温度,因变量为所述待补偿晶体振荡器对应的输出频率;Acquire at least one set of second temperature-frequency data of the crystal oscillator to be compensated, and obtain a temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on each of the second temperature-frequency data and the three-dimensional surface equation, wherein the second temperature-frequency data includes a single temperature in the preset temperature range and the output frequency of the crystal oscillator to be compensated corresponding to the single temperature, and the independent variable of the temperature-frequency two-dimensional curve equation is the temperature, and the dependent variable is the output frequency corresponding to the crystal oscillator to be compensated; 基于所述温度频率二维曲线方程,对所述待补偿晶体振荡器进行温度补偿。Based on the temperature-frequency two-dimensional curve equation, temperature compensation is performed on the crystal oscillator to be compensated. 2.根据权利要求1所述的晶体振荡器温度补偿方法,其特征在于,所述基于各所述第二温度频率数据和所述三维曲面方程,得到所述待补偿晶体振荡器对应的温度频率二维曲线方程,具体包括:2. The crystal oscillator temperature compensation method according to claim 1, characterized in that the step of obtaining the temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on each of the second temperature-frequency data and the three-dimensional surface equation specifically comprises: 基于最小二乘法,将各所述第二温度频率数据代入至所述三维曲面方程,确定所述待补偿晶体振荡器对应的目标工艺因子;Based on the least squares method, each of the second temperature frequency data is substituted into the three-dimensional surface equation to determine the target process factor corresponding to the crystal oscillator to be compensated; 将所述目标工艺因子代入至所述三维曲面方程中,得到所述待补偿晶体振荡器对应的温度频率二维曲线方程。Substituting the target process factor into the three-dimensional surface equation, a two-dimensional temperature-frequency curve equation corresponding to the crystal oscillator to be compensated is obtained. 3.根据权利要求1所述的晶体振荡器温度补偿方法,其特征在于,所述方法还包括:3. The crystal oscillator temperature compensation method according to claim 1, characterized in that the method further comprises: 获取所述待补偿晶体振荡器温度补偿后的至少一组第三温度频率数据;Acquire at least one set of third temperature frequency data after temperature compensation of the crystal oscillator to be compensated; 基于各所述第三温度频率数据,得到对应的第二变化曲线,并将所述第二变化曲线与预设的参考变化曲线进行拟合,得到第一整体拟合率,所述参考变化曲线为温度补偿符合要求的输出频率随温度变化的曲线;Based on each of the third temperature-frequency data, a corresponding second variation curve is obtained, and the second variation curve is fitted with a preset reference variation curve to obtain a first overall fitting rate, wherein the reference variation curve is a curve of output frequency variation with temperature that meets the requirements of temperature compensation; 若所述第一整体拟合率未超过预设的拟合率阈值,则从所述预设温度区间选取为第二目标温度区间和第三目标温度区间,所述第二目标温度区间中温度低于所述第一目标温度区间中的温度,所述第三目标温度区间中的温度高于所述第一目标温度区间;If the first overall fitting rate does not exceed a preset fitting rate threshold, a second target temperature interval and a third target temperature interval are selected from the preset temperature interval, the temperature in the second target temperature interval is lower than the temperature in the first target temperature interval, and the temperature in the third target temperature interval is higher than the first target temperature interval; 计算所述第一目标温度区间中所述参考变化曲线和所述第二变化曲线的第一拟合率、计算所述第二目标温度区间中所述参考变化曲线和所述第二变化曲线的第二拟合率、计算所述第三目标温度区间中所述参考变化曲线和所述第二变化曲线的第三拟合率,并根据所述第一拟合率、所述第二拟合率和所述第三拟合率,对所述三维曲面方程进行调整以重新对所述待补偿晶体振荡器进行温度补偿。Calculate a first fitting rate of the reference change curve and the second change curve in the first target temperature range, calculate a second fitting rate of the reference change curve and the second change curve in the second target temperature range, calculate a third fitting rate of the reference change curve and the second change curve in the third target temperature range, and adjust the three-dimensional surface equation according to the first fitting rate, the second fitting rate and the third fitting rate to re-temperature compensate the crystal oscillator to be compensated. 4.根据权利要求3所述的晶体振荡器温度补偿方法,其特征在于,所述根据所述第一拟合率、所述第二拟合率和所述第三拟合率,对所述三维曲面方程进行调整以重新对所述待补偿晶体振荡器进行温度补偿,具体包括:4. The crystal oscillator temperature compensation method according to claim 3, characterized in that the three-dimensional surface equation is adjusted according to the first fitting rate, the second fitting rate and the third fitting rate to re-temperature compensate the crystal oscillator to be compensated, specifically comprising: 在所述第二拟合率和第三拟合率均未超过所述拟合率阈值且所述第一拟合率超过所述拟合率阈值时,根据所述第二拟合率和第三拟合率的比例关系,确定第一权重和第二权重,所述第一权重和所述第二权重的权重和为1,所述第二拟合率越大,对应的第一权重越小;When neither the second fitting rate nor the third fitting rate exceeds the fitting rate threshold and the first fitting rate exceeds the fitting rate threshold, determining a first weight and a second weight according to a proportional relationship between the second fitting rate and the third fitting rate, wherein the sum of the first weight and the second weight is 1, and the greater the second fitting rate, the smaller the corresponding first weight; 针对同一所述第一变化曲线,根据所述第二目标温度区间中对应的部分曲线,确定对应的第二工艺因子,并根据所述第三目标温度区间中对应的部分曲线,确定对应的第三工艺因子;For the same first variation curve, determining a corresponding second process factor according to a corresponding portion of the curve in the second target temperature interval, and determining a corresponding third process factor according to a corresponding portion of the curve in the third target temperature interval; 将所述第一权重与所述第二工艺因子的乘积、所述第二权重与所述第三工艺因子的乘积进行求和,得到加权求和结果,并对所述加权求和结果和同一所述第一变化曲线的第一工艺因子进行加权求和,得到对应的目标晶体振荡器的全新工艺因子;Summing the product of the first weight and the second process factor and the product of the second weight and the third process factor to obtain a weighted summation result, and performing weighted summation on the weighted summation result and the first process factor of the same first change curve to obtain a new process factor of the corresponding target crystal oscillator; 根据各所述目标晶体振荡器的全新工艺因子,对所述三维曲面方程进行调整。The three-dimensional surface equation is adjusted according to the new process factors of each target crystal oscillator. 5.根据权利要求1所述的晶体振荡器温度补偿方法,其特征在于,所述方法还包括:5. The crystal oscillator temperature compensation method according to claim 1, characterized in that the method further comprises: 获取所述待补偿晶体振荡器温度补偿后的至少一组第四温度频率数据;Acquire at least one set of fourth temperature frequency data after temperature compensation of the crystal oscillator to be compensated; 基于各所述第四温度频率数据,得到对应的第三变化曲线,并将所述第三变化曲线与预设的参考变化曲线进行拟合,得到第二整体拟合率,所述参考变化曲线为温度补偿符合要求的输出频率随温度变化的曲线;Based on each of the fourth temperature-frequency data, a corresponding third variation curve is obtained, and the third variation curve is fitted with a preset reference variation curve to obtain a second overall fitting rate, wherein the reference variation curve is a curve of the output frequency varying with temperature with the temperature compensation meeting the requirements; 若所述第二整体拟合率未超过预设的拟合率阈值,则基于所述第三变化曲线中目标部分曲线,确定至少一个目标输出频率,所述目标部分曲线与所述参考变化曲线中对应的部分曲线的拟合率超过预设的拟合率阈值;If the second overall fitting rate does not exceed a preset fitting rate threshold, determining at least one target output frequency based on a target partial curve in the third variation curve, wherein a fitting rate between the target partial curve and a corresponding partial curve in the reference variation curve exceeds a preset fitting rate threshold; 基于各所述目标输出频率和所述三维曲面方程,对所述待补偿晶体振荡器重新进行温度补偿。Based on each of the target output frequencies and the three-dimensional surface equation, the crystal oscillator to be compensated is temperature compensated again. 6.根据权利要求5所述的晶体振荡器温度补偿方法,其特征在于,所述基于各所述目标输出频率和所述三维曲面方程,对所述待补偿晶体振荡器重新进行温度补偿,具体包括:6. The crystal oscillator temperature compensation method according to claim 5, characterized in that the re-temperature compensation of the crystal oscillator to be compensated based on each of the target output frequencies and the three-dimensional surface equation specifically comprises: 对各所述目标输出频率求平均,得到适宜输出频率,并将所述适宜输出频率代入至所述三维曲面方程中,得到目标二维曲线方程,所述目标二维曲线方程为所述待补偿晶体振荡器的工艺因子随温度的变化曲线;Averaging the target output frequencies to obtain a suitable output frequency, and substituting the suitable output frequency into the three-dimensional surface equation to obtain a target two-dimensional curve equation, wherein the target two-dimensional curve equation is a curve showing a change in the process factor of the crystal oscillator to be compensated with temperature; 对所述目标二维曲线进行线性拟合,得到与x轴平行的常值函数,并根据所述常值函数,确定所述待补偿晶体振荡器对应的最终工艺因子;Performing linear fitting on the target two-dimensional curve to obtain a constant function parallel to the x-axis, and determining a final process factor corresponding to the crystal oscillator to be compensated according to the constant function; 将所述最终工艺因子代入至所述三维曲面方程中,得到所述待补偿晶体振荡器对应的最终温度频率二维曲线方程;Substituting the final process factor into the three-dimensional surface equation to obtain a final temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated; 基于所述最终温度频率二维曲线方程,对所述待补偿晶体振荡器重新进行温度补偿。Based on the final temperature-frequency two-dimensional curve equation, the crystal oscillator to be compensated is temperature compensated again. 7.一种晶体振荡器温度补偿装置,用于实现权利要求1到6任意一项所述的晶体振荡器温度补偿方法,其特征在于,包括:7. A crystal oscillator temperature compensation device, used to implement the crystal oscillator temperature compensation method according to any one of claims 1 to 6, characterized in that it comprises: 数据获取模块(11),用于获取同一批次晶体振荡器中至少一个目标晶体振荡器对应的第一温度频率数据,所述第一温度频率数据包括预设温度区间中不同温度以及不同温度下对应的目标晶体振荡器的输出频率;A data acquisition module (11) is used to acquire first temperature-frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators, wherein the first temperature-frequency data includes different temperatures in a preset temperature range and the output frequencies of the corresponding target crystal oscillators at the different temperatures; 曲面拟合模块(12),用于基于各所述目标晶体振荡器的第一温度频率数据,得到对应的三维数据,并基于各所述三维数据,拟合得到三维曲面方程,所述三维数据包括对应的目标晶体振荡器在温度、对应的输出频率和工艺因子三个维度的数据,所述工艺因子表征工艺偏差对所述目标晶体振荡器的温度频率特征发生偏移的影响程度;A surface fitting module (12) is used to obtain corresponding three-dimensional data based on the first temperature-frequency data of each target crystal oscillator, and to fit a three-dimensional surface equation based on each three-dimensional data, wherein the three-dimensional data includes data of the corresponding target crystal oscillator in three dimensions: temperature, corresponding output frequency and process factor, wherein the process factor represents the influence of process deviation on the deviation of the temperature-frequency characteristic of the target crystal oscillator; 曲线确定模块(13),用于获取待补偿晶体振荡器的至少一组第二温度频率数据,基于各所述第二温度频率数据和所述三维曲面方程,得到所述待补偿晶体振荡器对应的温度频率二维曲线方程,所述第二温度频率数据包括所述预设温度区间中单个温度以及所述单个温度下对应的待补偿晶体振荡器的输出频率,所述温度频率二维曲线方程的自变量为温度,因变量为所述待补偿晶体振荡器对应的输出频率;A curve determination module (13) is used to obtain at least one set of second temperature-frequency data of the crystal oscillator to be compensated, and based on each set of the second temperature-frequency data and the three-dimensional surface equation, obtain a temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated, wherein the second temperature-frequency data includes a single temperature in the preset temperature range and the output frequency of the crystal oscillator to be compensated corresponding to the single temperature, and the independent variable of the temperature-frequency two-dimensional curve equation is the temperature, and the dependent variable is the output frequency corresponding to the crystal oscillator to be compensated; 温度补偿模块(14),用于基于所述温度频率二维曲线方程,对所述待补偿晶体振荡器进行温度补偿。A temperature compensation module (14) is used to perform temperature compensation on the crystal oscillator to be compensated based on the temperature-frequency two-dimensional curve equation. 8.一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其特征在于,所述计算机程序被处理器加载并执行时,采用了权利要求1-6中任一项所述的方法。8. A computer-readable storage medium storing a computer program, wherein when the computer program is loaded and executed by a processor, the method according to any one of claims 1 to 6 is adopted. 9.一种电子设备,包括存储器、处理器及存储在存储器中并能够在处理器上运行的计算机程序,其特征在于,所述处理器加载并执行计算机程序时,采用了权利要求1-6中任一项所述的方法。9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor adopts the method described in any one of claims 1 to 6 when loading and executing the computer program.
CN202411183383.0A 2024-08-27 2024-08-27 Crystal oscillator temperature compensation method and device, storage medium and electronic equipment Active CN119171839B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411183383.0A CN119171839B (en) 2024-08-27 2024-08-27 Crystal oscillator temperature compensation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411183383.0A CN119171839B (en) 2024-08-27 2024-08-27 Crystal oscillator temperature compensation method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN119171839A CN119171839A (en) 2024-12-20
CN119171839B true CN119171839B (en) 2025-05-27

Family

ID=93887383

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411183383.0A Active CN119171839B (en) 2024-08-27 2024-08-27 Crystal oscillator temperature compensation method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN119171839B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102545778A (en) * 2010-12-30 2012-07-04 苏州银河龙芯科技有限公司 Closed-loop temperature compensation method and device for clock crystal oscillator
CN102868363A (en) * 2011-07-05 2013-01-09 富士通半导体股份有限公司 System and method for reducing temperature-dependent and process-dependent frequency variation of a crystal oscillator circuit

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103001583B (en) * 2012-12-17 2016-08-03 华为技术有限公司 Temperature compensation and crystal oscillator
CN115085721A (en) * 2022-07-20 2022-09-20 广东大普通信技术股份有限公司 Temperature compensation method, device, equipment and storage medium based on crystal oscillator
CN115133924B (en) * 2022-08-10 2025-05-16 广东大普通信技术股份有限公司 Frequency compensation method, device, equipment and storage medium based on crystal oscillator
CN116232229A (en) * 2022-09-08 2023-06-06 北京无线电计量测试研究所 Temperature compensation method of temperature compensation crystal oscillator and crystal oscillator

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102545778A (en) * 2010-12-30 2012-07-04 苏州银河龙芯科技有限公司 Closed-loop temperature compensation method and device for clock crystal oscillator
CN102868363A (en) * 2011-07-05 2013-01-09 富士通半导体股份有限公司 System and method for reducing temperature-dependent and process-dependent frequency variation of a crystal oscillator circuit

Also Published As

Publication number Publication date
CN119171839A (en) 2024-12-20

Similar Documents

Publication Publication Date Title
US11012032B2 (en) Systems and methods for frequency compensation of real-time-clock systems
US20090157905A1 (en) System and Method for Standardizing Clocks in a Heterogeneous Networked Environment
CN114201001B (en) A real-time clock compensation method, device, terminal equipment and medium
US11035902B2 (en) Advanced fuel gauge
CN115790665A (en) Gyro error compensation method and device, electronic equipment and storage medium
CN119171839B (en) Crystal oscillator temperature compensation method and device, storage medium and electronic equipment
CN109212560B (en) Method and apparatus for compensating frequency inaccuracy of frequency generator such as oscillator
CN114928355A (en) Voltage compensation method, device and equipment based on crystal oscillator and storage medium
CN114826155A (en) Temperature compensation method, system and terminal equipment
CN111711446B (en) Method, system and medium for taming crystal oscillator frequency by using GPS signal
JP2019039764A (en) Impedance estimation device
CN116909351B (en) Clock chip internal clock precision correction method
CN112083226A (en) Frequency calibration method, device, medium and electronic equipment for electronic equipment
CN111929585B (en) Battery charge state calculating device, method, server and medium
CN112292814B (en) Crystal determination method, device and storage medium
CN120045385B (en) A method and device for synchronizing RTC clock time on real-time operating system
CN119902091B (en) Battery model parameter identification method, device, equipment and vehicle
CN114866033B (en) Crystal oscillator aging compensation method and system, terminal device and storage medium
CN116338564B (en) Metering precision temperature compensation method and system based on intelligent fusion terminal
Surdu Variational method of calibration of impedance meters. Part 1. Basic assumptions
CN119689299A (en) Electric quantity estimation method and electric quantity meter chip
CN119225153A (en) Clock adjustment method, device, storage medium and electronic device for electronic device
CN119310377A (en) A method, device, electronic device and storage medium for determining the operating range of crystal oscillator operating parameters
Pashev Maintenance of the unit of frequency and the time scale by high-stability oscillators synchronized with radio signals from space navigation systems
CN116817758A (en) Laser line width determination method, device and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant