Crystal oscillator temperature compensation method, device, storage medium and electronic device
By expanding the temperature frequency data of the crystal oscillator into three-dimensional data, fitting the three-dimensional surface equation, and reducing the dimension to the two-dimensional curve equation, the frequency instability problem caused by temperature changes of the crystal oscillator is solved, and the efficiency of temperature compensation is improved.
Patent Information
- Application Number
- CN202411183383.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2044-08-27
AI Technical Summary
The output frequency of the crystal oscillator is unstable when the temperature changes. The existing temperature compensation method requires measuring data from multiple sets of temperature points, resulting in high time cost and low efficiency.
By obtaining the first temperature frequency data of the target crystal oscillator, expanding it into three-dimensional data, fitting to obtain the three-dimensional surface equation, taking into account the influence of process deviation. Then, substitute the data of the crystal oscillator to be compensated and reduce the dimension to the two-dimensional curve equation of the temperature frequency to reduce the necessary temperature frequency data measurement.
It improves the efficiency of temperature compensation of crystal oscillator, reduces the number of measured data, shortens production time, and improves frequency stability.
Smart Images

Figure CN119171839B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of crystal oscillators, and particularly relates to a temperature compensation method, device, storage medium and electronic device for a crystal oscillator. Background Art
[0002] A crystal oscillator is an electronic oscillator circuit that uses the inverse piezoelectric effect. It utilizes the mechanical resonance of a quartz crystal to generate an electrical signal with a very precise frequency. Crystal oscillators are an indispensable component in many electronic devices, and their main function is to provide a stable clock signal. Due to their high stability and accuracy, crystal oscillators are widely used in various electronic devices, such as communication devices, computer systems, and other precision instruments. These devices have very high requirements for the accuracy and stability of the frequency, so the importance of crystal oscillators is self-evident.
[0003] In the actual production process, crystal oscillators are affected by factors such as temperature and process deviation, resulting in an offset of the output frequency and the problem of unstable output frequency. To solve this problem, the commonly used method is: based on the data of the change in the output frequency of the crystal oscillator with temperature obtained by fitting a two-dimensional curve equation, reasonable temperature compensation is performed on each produced crystal oscillator so that it can maintain high stability at various temperatures. Among them, temperature compensation refers to compensating for the frequency drift generated by the crystal oscillator under temperature changes. However, in actual application, this method requires measuring the output frequency data of a large number of temperature points to fit the corresponding two-dimensional curve equation of the crystal oscillator, increasing the time cost of crystal oscillator production and resulting in poor efficiency of temperature compensation for crystal oscillators. Summary of the Invention
[0004] To improve the efficiency of temperature compensation for crystal oscillators, this application provides a temperature compensation method, device, storage medium and electronic device for a crystal oscillator.
[0005] In the first aspect of this application, a temperature compensation method for a crystal oscillator is provided, which specifically includes:
[0006] Obtain 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 range and the output frequencies of the target crystal oscillator corresponding to different temperatures;
[0007] Based on the first temperature-frequency data of each of the target crystal oscillators, corresponding three-dimensional data is obtained, and based on each of the three-dimensional data, a three-dimensional surface equation is fitted. The three-dimensional data includes data in three dimensions of the temperature, the corresponding output frequency, and the process factor of the corresponding target crystal oscillator, and the process factor characterizes the influence degree of process deviation on the shift of the temperature-frequency characteristics of the target crystal oscillator;
[0008] At least one set of second temperature-frequency data of the crystal oscillator to be compensated is obtained. Based on each of the second temperature-frequency data and the three-dimensional surface equation, a temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated is obtained. 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. 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;
[0009] Based on the temperature-frequency two-dimensional curve equation, temperature compensation is performed on the crystal oscillator to be compensated.
[0010] By adopting the above technical solution, at least one set of first temperature-frequency data corresponding to the target crystal oscillator is obtained, and the data in the dimension of the corresponding process factor is incorporated into the first temperature-frequency data of each target crystal oscillator. The two-dimensional data of the output frequency and temperature is extended to three-dimensional data, and then a three-dimensional surface equation is fitted to the three-dimensional data, so as to better take into account the influence of process deviation on the shift of the output frequency. Further, the second temperature-frequency data of the crystal oscillator to be compensated is substituted into the three-dimensional surface equation, and it is reduced to a temperature-frequency two-dimensional curve equation. By reducing the dimension from the three-dimensional surface equation to the two-dimensional curve equation, it is only necessary to measure less temperature-frequency data of the crystal oscillator to be compensated, without measuring more temperature-frequency data, to determine the change curve of the output frequency of the crystal oscillator to be compensated with temperature, so that the output frequency of this crystal oscillator to be compensated at different temperatures can be accurately determined according to the temperature-frequency two-dimensional curve equation, and then a targeted temperature compensation process is made, thereby improving the efficiency of temperature compensation of the crystal oscillator.
[0011] Optionally, the obtaining of the corresponding three-dimensional data based on the first temperature-frequency data of each of the target crystal oscillators specifically includes:
[0012] According to the first temperature-frequency data of each target crystal oscillator, a corresponding first change curve is determined. The first change curve is the change curve of the output frequency of the corresponding target crystal oscillator with temperature;
[0013] Select a first target temperature range from the preset temperature range, and extract the slopes of the partial curves corresponding to the first target temperature range in each of the first change curves. The linearity of each first change curve in the first target temperature range is the highest;
[0014] Perform normalization processing on each of the slopes to obtain the first process factor of the corresponding target crystal oscillator;
[0015] Determine the different temperatures in the preset temperature range and the first process factor of each target crystal oscillator as independent variables, and determine the output frequencies of the corresponding target crystal oscillators at different temperatures as dependent variables to obtain corresponding three-dimensional data.
[0016] By adopting the above technical solution, in this first target temperature range, the linearity of the first change curve corresponding to each target crystal oscillator is the highest. The slope of the partial curve corresponding to the first target temperature range in each first change curve can more intuitively reflect the influence of process deviation on the temperature-frequency characteristics of each target crystal oscillator. Furthermore, the first process factor of each target crystal oscillator is determined according to the slope. Finally, the first process factor of each target crystal oscillator is incorporated into the two-dimensional data of the corresponding temperature frequency and extended to three-dimensional data, thus facilitating the subsequent determination of the three-dimensional surface equation.
[0017] Optionally, 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 includes:
[0018] Based on the least squares method, substitute each of the second temperature-frequency data into the three-dimensional surface equation to determine the target process factor corresponding to the crystal oscillator to be compensated;
[0019] Substitute the target process factor into the three-dimensional surface equation to obtain the temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated.
[0020] By adopting the above technical solution, substitute the second temperature-frequency data into the three-dimensional surface equation. At the same time, based on the least squares method, determine the target process factor corresponding to this crystal oscillator to be compensated, and then substitute this target process factor into the three-dimensional surface equation to obtain the reduced-dimensional temperature-frequency two-dimensional curve equation. Thus, by only measuring the output frequency data of fewer temperature points, the temperature-frequency two-dimensional curve equation of the crystal oscillator to be compensated can be quickly determined, which is convenient for subsequent temperature compensation more efficiently according to the temperature-frequency two-dimensional curve equation.
[0021] Optionally, the method further includes:
[0022] Obtain at least one set of third temperature-frequency data after temperature compensation of the crystal oscillator to be compensated;
[0023] Based on each set of the third temperature-frequency data, obtain the corresponding second change curve, and fit the second change curve with a preset reference change curve to obtain a first overall fitting rate. The reference change curve is a curve of the output frequency that meets the requirements of temperature compensation varying with temperature;
[0024] If the first overall fitting rate does not exceed a preset fitting rate threshold, select a second target temperature range and a third target temperature range from the preset temperature range. The temperature in the second target temperature range is lower than the temperature in the first target temperature range, and the temperature in the third target temperature range is higher than the first target temperature range;
[0025] 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-perform temperature compensation on the crystal oscillator to be compensated.
[0026] By adopting the above technical solution, if the first overall fitting rate does not exceed the fitting rate threshold, it indicates that the effect of temperature compensation for the crystal oscillator to be compensated according to the temperature-frequency two-dimensional curve equation is poor, and the deviation of the output frequency is still large. Further, determine the fitting rates of the reference change curve and the second change curve in the first target temperature range, the second target temperature range, and the third target temperature range, so as to reflect the temperature compensation effect of this temperature compensation in different temperature ranges. Finally, based on the first fitting rate, the second fitting rate, and the third fitting rate, adjust the three-dimensional surface equation to ensure that the compensation effect of the re-temperature compensation in each temperature range is better as much as possible.
[0027] Optionally, the adjusting the three-dimensional 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:
[0028] When both 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, determine a first weight and a second weight according to the proportional relationship between the second fitting rate and the third fitting rate. The sum of the weights of the first weight and the second weight is 1, and the larger the second fitting rate, the smaller the corresponding first weight;
[0029] For the same first change curve, determine the corresponding second process factor according to the corresponding partial curve in the second target temperature range, and determine the corresponding third process factor according to the corresponding partial curve in the third target temperature range;
[0030] Sum 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 perform a weighted sum on the weighted sum result and the first process factor of the same first change curve to obtain a new process factor for the corresponding target crystal oscillator;
[0031] Adjust the three-dimensional surface equation according to the new process factors of each target crystal oscillator.
[0032] By adopting the above technical solution, when both 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, it indicates that the accuracy and rationality of the first process factor determined by the partial curve in the first target temperature range are poor, and the first process factor needs to be adjusted. Then, determine the proportional relationship between the second fitting rate and the third fitting rate, so as to reflect the effect of the output frequency compensation of the crystal oscillator to be compensated in the second target temperature range and the third target temperature range when performing temperature compensation based on the three-dimensional surface equation. Further, perform a weighted sum on the second process factor and the third process factor through the first weight and the second weight to obtain a weighted sum result. Finally, perform a weighted sum on the first process factor of the same first change curve and the weighted sum result to obtain a new process factor for each target crystal oscillator, and adjust the three-dimensional surface equation, thereby ultimately improving the effect of re-temperature compensation.
[0033] Optionally, the method further includes:
[0034] Obtain at least one set of fourth temperature-frequency data after temperature compensation of the crystal oscillator to be compensated;
[0035] Based on each set of fourth temperature-frequency data, obtain a corresponding third change curve, and fit the third change curve with a preset reference change curve to obtain a second overall fitting rate, where the reference change curve is a curve of the output frequency that meets the requirements of temperature compensation changing with temperature;
[0036] If the second overall fitting rate does not exceed the preset fitting rate threshold, then determine at least one target output frequency based on the target partial curve in the third change curve, where the fitting rate of the target partial curve and the corresponding partial curve in the reference change curve exceeds the preset fitting rate threshold;
[0037] Based on each of the target output frequencies and the three-dimensional surface equation, re-perform temperature compensation on the crystal oscillator to be compensated.
[0038] By adopting the above technical solution, if the second overall fitting rate does not exceed the preset fitting rate threshold, it indicates that the similarity between the third change curve and the reference change curve is poor. Furthermore, it shows that the effect of temperature compensation for the crystal oscillator to be compensated according to the temperature-frequency two-dimensional curve equation is poor, and the offset of the output frequency is still large. Then, based on the target partial curve in the third change curve, determine at least one target output frequency, that is, the output frequency with a smaller offset. Finally, according to the target output frequency and the three-dimensional surface equation, accurately determine the change of the output frequency of the crystal oscillator to be compensated with temperature again, so as to achieve better temperature compensation.
[0039] Optionally, the re-performing temperature compensation on the crystal oscillator to be compensated based on each of the target output frequencies and the three-dimensional surface equation specifically includes:
[0040] Calculate the average of each of the target output frequencies to obtain a suitable output frequency, and substitute the suitable output frequency into the three-dimensional surface equation to obtain a target two-dimensional curve equation, where the target two-dimensional curve equation is the change curve of the process factor of the crystal oscillator to be compensated with temperature;
[0041] Perform linear fitting on the target two-dimensional curve to obtain a constant function parallel to the x-axis, and determine the corresponding final process factor of the crystal oscillator to be compensated according to the constant function;
[0042] Substitute the final process factor into the three-dimensional surface equation to obtain the corresponding final temperature-frequency two-dimensional curve equation of the crystal oscillator to be compensated;
[0043] Based on the final temperature-frequency two-dimensional curve equation, re-perform temperature compensation on the crystal oscillator to be compensated.
[0044] By adopting the above technical solution, substituting the appropriate output frequency into the three-dimensional surface equation, the target two-dimensional curve equation is obtained, that is, the curve of the process factor of the crystal oscillator to be compensated varying with temperature. Thus, the variation of the process factor of the crystal oscillator to be compensated with temperature is determined when the temperature compensation effect is good and the output frequency deviation is small. Further, linear fitting is performed on the target two-dimensional curve equation to obtain a constant function parallel to the x-axis, and thus the final process factor is finally determined, which helps to make the output frequency deviation of the crystal oscillator to be compensated small at more temperatures. Finally, substituting this final process factor into the three-dimensional surface equation, the two-dimensional curve equation of the final temperature-frequency corresponding to the crystal oscillator to be compensated is obtained by dimension reduction, that is, the curve of the output frequency of the crystal oscillator to be compensated varying with temperature. Further, based on this final two-dimensional temperature-frequency curve equation, temperature compensation is performed on the crystal oscillator to be compensated again to improve the temperature compensation effect.
[0045] In the second aspect of the present application, a crystal oscillator temperature compensation device is provided, which specifically includes:
[0046] A data acquisition module, 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 range and the output frequencies of the target crystal oscillators corresponding to different temperatures;
[0047] A surface fitting module, configured to obtain corresponding three-dimensional data based on the first temperature-frequency data of each target crystal oscillator, and fit a three-dimensional surface equation based on each three-dimensional data, where the three-dimensional data includes data in three dimensions of temperature, corresponding output frequency, and process factor of the corresponding target crystal oscillator, and the process factor characterizes the influence degree of process deviation on the deviation of the temperature-frequency characteristics of the target crystal oscillator;
[0048] A curve determination module, configured to acquire at least one set of second temperature-frequency data of the crystal oscillator to be compensated, and obtain the 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, where 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 two-dimensional temperature-frequency curve equation is temperature, and the dependent variable is the output frequency corresponding to the crystal oscillator to be compensated;
[0049] A temperature compensation module, configured to perform temperature compensation on the crystal oscillator to be compensated based on the two-dimensional temperature-frequency curve equation.
[0050] By adopting the above technical solution, the data acquisition module acquires the first temperature-frequency data of the target crystal oscillator. The surface fitting module fits a three-dimensional surface equation based on each piece of three-dimensional data. Then, the curve determination module obtains the temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated according to each piece of second temperature-frequency data and the three-dimensional surface equation. Finally, the temperature compensation module performs temperature compensation on the crystal oscillator to be compensated based on the temperature-frequency two-dimensional curve equation.
[0051] In the third aspect of the present application, a computer-readable storage medium is provided. A computer program is stored in the computer-readable storage medium. When the computer program is loaded and executed by a processor, the method steps described in any one of the first aspect are executed.
[0052] In the fourth aspect of the present application, an electronic device is provided, specifically including:
[0053] A processor, a memory, and a computer program stored in the memory and capable of running on the processor. The processor is used to load and execute the computer program stored in the memory so that the electronic device executes the method described in any one of the first aspect.
[0054] In summary, the present application includes at least one of the following beneficial technical effects: The data corresponding to the process factor dimension is incorporated into the first temperature-frequency data of each target crystal oscillator, expanding the two-dimensional data of the output frequency and temperature to three-dimensional data. Then, a three-dimensional surface equation is fitted to the three-dimensional data, thereby better considering the influence of process deviation on the output frequency offset. Further, the second temperature-frequency data of the crystal oscillator to be compensated is substituted into the three-dimensional surface equation, and it is reduced to a temperature-frequency two-dimensional curve equation. By reducing the three-dimensional surface equation to a two-dimensional curve equation, only a small amount of temperature-frequency data of the crystal oscillator to be compensated needs to be measured, without measuring a large amount of temperature-frequency data, to determine the curve of the output frequency of the crystal oscillator to be compensated changing with temperature. Subsequently, according to the temperature-frequency two-dimensional curve equation, the output frequency of this crystal oscillator to be compensated at different temperatures can be accurately determined, and then targeted temperature compensation processing can be performed, thereby improving the efficiency of temperature compensation of the crystal oscillator. Description of the Drawings
[0055] Figure 1 It is a schematic flowchart of a crystal oscillator temperature compensation method provided by an embodiment of the present application;
[0056] Figure 2 It is a schematic flowchart of another crystal oscillator temperature compensation method provided by an embodiment of the present application;
[0057] Figure 3It is a schematic structural diagram of a crystal oscillator temperature compensation device provided by an embodiment of the present application;
[0058] Figure 4 It is a schematic structural diagram of another crystal oscillator temperature compensation device provided by an embodiment of the present application.
[0059] Explanation of reference numerals: 11, data acquisition module; 12, surface fitting module; 13, curve determination module; 14, temperature compensation module; 15, first compensation module; 16, second compensation module. Specific embodiments
[0060] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments.
[0061] In the description of the embodiments of the present application, words such as "exemplary", "for example" or "for illustration" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplary", "for example" or "for illustration" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplary", "for example" or "for illustration" aims to present relevant concepts in a specific manner.
[0062] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and A and B exist simultaneously. In addition, unless otherwise specified, the meaning of the term "plurality" refers to two or more. For example, a plurality of systems refers to two or more systems, and a plurality of screen terminals refers to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the technical features indicated. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The terms "include", "comprise", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0063] See Figure 1 , the embodiments of the present application disclose a schematic flowchart of a crystal oscillator temperature compensation method, which can be implemented depending on a computer program or run on a crystal oscillator temperature compensation device based on the von Neumann architecture. This computer program can be integrated in an application or run as an independent tool class application, and specifically includes:
[0064] S101: Obtain first temperature-frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators.
[0065] Specifically, in the embodiment of the present application, the first temperature-frequency data refers to different temperatures in a preset temperature range and the output frequencies of a single target crystal oscillator at different temperatures. The output frequency of the target crystal oscillator refers to the frequency of the periodic clock signal it generates. Once the output frequency drifts, it will have various effects on the clock signal, resulting in poor system timing accuracy of the electronic system using the crystal oscillator when the crystal oscillator is used as the main clock source. The target crystal oscillator is a crystal oscillator randomly sampled from the crystal oscillators produced in the same production batch for measuring the output frequencies at different temperatures. Among them, the preset temperature range is -50°C to 100°C, and the different temperatures corresponding to the different output frequencies of the measured target crystal oscillator can be -50°C, 24°C, 26°C, 50°C, and 100°C. In other embodiments, it can also be other more temperatures.
[0066] A feasible way to obtain the first temperature-frequency data is: place the target crystal oscillator in an incubator, adjust the temperature of the incubator to different temperatures in the preset range respectively, and then through a frequency meter or oscilloscope connected to the target crystal oscillator, obtain the output frequencies corresponding to the target crystal oscillator at different temperatures in the preset temperature range. This is the prior art and will not be elaborated here.
[0067] S102: Based on the first temperature-frequency data of each target crystal oscillator, obtain corresponding three-dimensional data, and based on each three-dimensional data, fit to obtain a three-dimensional surface equation. The three-dimensional data includes data in three dimensions: the temperature corresponding to the target crystal oscillator, the corresponding output frequency, and the process factor.
[0068] Specifically, in the embodiments of the present application, the process factor characterizes the degree of influence of process deviation on the shift of the temperature-frequency characteristics of the target crystal oscillator. The process deviation refers to the AT cut angle deviation of the target crystal oscillator, that is, during the cutting process of the quartz crystal, the angle between its cutting surface and the crystal main axis deviates from the ideal standard angle of 35°15'. This deviation will have a significant impact on the performance of the target crystal oscillator, including the stability of the output frequency. In addition, the temperature-frequency characteristic refers to the characteristic that the output frequency of the crystal oscillator changes with the change of the ambient temperature. The larger the process factor, the greater the shift of the output frequency of the crystal oscillator when the temperature remains unchanged. After the first temperature-frequency data is determined, for a single target crystal oscillator, based on the corresponding first temperature-frequency data through a preset MATLAB tool, a corresponding first change curve is plotted. The first change curve is the change curve of the output frequency of the corresponding target crystal oscillator with temperature. Further, a first target temperature range is selected from the preset temperature range. The first target temperature range is 0~50°C, which characterizes the medium temperature range of the target crystal oscillator. In this first target temperature range, the linear degree of the first change curve corresponding to each target crystal oscillator is the highest, that is, the partial curve of the first change curve corresponding to each target crystal oscillator in this first target temperature range is closest to a straight line. Further, the first temperature-frequency data of each target crystal oscillator in this first target temperature range is selected, and data fitting is performed through two Python libraries, NumPy and SciPy, to obtain a first-order function of the output frequency of each target crystal oscillator changing with temperature in this first target temperature range. The k value in the first-order function is determined as the corresponding slope, that is, the slope of the partial curve corresponding to the first target temperature range in each first change curve, so as to more intuitively reflect the influence of process deviation on the temperature-frequency characteristics of each target crystal oscillator.
[0069] Further, the slopes of the partial curves in the first target temperature range of the first change curves of each target crystal oscillator are normalized to obtain the first process factor corresponding to each target crystal oscillator, thereby reducing the error of the process factor of each target crystal oscillator. A feasible normalization method is: normalize each slope through a preset OmicShareTools tool to finally obtain the corresponding first process factor. Finally, different temperatures in the preset temperature range (different temperatures in the first temperature-frequency data), the first process factor of each target crystal oscillator are determined as independent variables, the output frequencies of the corresponding target crystal oscillators at different temperatures are used as dependent variables, and the data of these three dimensions (temperature, corresponding output frequency, and process factor) are determined as the three-dimensional data of each target crystal oscillator, thereby realizing the expansion of the first temperature-frequency data (two-dimensional data) of each target crystal oscillator into three-dimensional data.
[0070] Further, based on the three-dimensional data of each target crystal oscillator, the corresponding three-dimensional surface equation is obtained by fitting through the curve fitting toolbox (cftool) in the MATLAB tool, so as to better describe the corresponding change of the output frequency of the crystal oscillator when the temperature and process factors change.
[0071] S103: Obtain at least one set of second temperature-frequency data of the crystal oscillator to be compensated. Based on each set of second temperature-frequency data and the three-dimensional surface equation, obtain the two-dimensional temperature-frequency curve equation corresponding to the crystal oscillator to be compensated.
[0072] Specifically, after the three-dimensional surface equation corresponding to the crystal oscillator is determined, obtain at least one set of second temperature-frequency data of the crystal oscillator to be compensated. The acquisition method can refer to step S101 and will not be elaborated here. Among them, the crystal oscillator to be compensated refers to the crystal oscillator that needs to be temperature-compensated currently. 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 at the single temperature. Further, substitute the second temperature-frequency data into the three-dimensional surface equation. At the same time, based on the least squares method, determine the target process factor corresponding to this crystal oscillator to be compensated, and then substitute this target process factor into the three-dimensional surface equation to obtain the two-dimensional temperature-frequency curve equation after dimension reduction, so that the two-dimensional temperature-frequency curve equation of the crystal oscillator to be compensated can be quickly determined only by measuring the output frequency data at fewer temperature points. Among them, the independent variable of the two-dimensional temperature-frequency curve equation is temperature, and the dependent variable is the output frequency corresponding to the crystal oscillator to be compensated. In addition, through the least squares method, the surface equation describing the three-dimensional space can be converted into a two-dimensional curve equation involving only two variables.
[0073] S104: Perform temperature compensation on the crystal oscillator to be compensated based on the two-dimensional temperature-frequency curve equation.
[0074] Specifically, after the two-dimensional temperature-frequency curve equation of the crystal oscillator to be compensated, obtain the current ambient temperature through a preset temperature sensor, and then substitute the current ambient temperature into the two-dimensional temperature-frequency curve equation to obtain the uncompensated actual output frequency of the crystal oscillator to be compensated. Then subtract the nominal frequency from the actual output frequency to obtain the frequency compensation value. Finally, write the frequency compensation value into the preset compensation register, so as to achieve the effect of temperature compensation for the crystal oscillator to be compensated. Among them, the compensation register is a storage unit built into the control circuit of the crystal oscillator to be compensated, which is used to store the frequency compensation value and adjust the output frequency to offset the influence brought by temperature change. This is the prior art and will not be elaborated here.
[0075] In other embodiments, at least one set of third temperature-frequency data after temperature compensation of the crystal oscillator to be compensated is obtained. The third temperature-frequency data includes a single temperature and the corresponding output frequency of the crystal oscillator to be compensated after temperature compensation in a preset temperature range. Through the MATLAB tool, based on each set of third temperature-frequency data, a corresponding second variation curve is plotted, that is, the curve of the output frequency of the crystal oscillator to be compensated after temperature compensation varying with temperature. Then, the second variation curve is fitted with a preset reference variation curve to obtain a first overall fitting rate. The reference variation curve is the curve of the output frequency with temperature change when the temperature compensation meets the requirements. If the first overall fitting rate does not exceed the fitting rate threshold, it indicates that the effect of temperature compensation for the crystal oscillator to be compensated according to the temperature-frequency two-dimensional curve equation is poor, and the offset of the output frequency is still large. Then, a second target temperature range and a third target temperature range are selected from the preset temperature range. The temperature in the second target temperature range is lower than the temperature in the first target temperature range, and the temperature in the third target temperature range is higher than the temperature in the first target temperature range. The second target temperature range is -50°C to -30°C, which can be understood as the low-temperature range of the crystal oscillator; the second target temperature range is 80°C to 100°C, which can be understood as the high-temperature range of the crystal oscillator.
[0076] Further, the first fitting rate of the curves of the reference variation curve and the second variation curve in the first target temperature range, the second fitting rate of the curves of the reference variation curve and the second variation curve in the second target temperature range, and the third fitting rate of the curves of the reference variation curve and the second variation curve in the third target temperature range are determined through the MATLAB tool. Then, according to the first fitting rate, the second fitting rate, and the third fitting rate, the three-dimensional surface equation is adjusted to re-perform temperature compensation on the crystal oscillator to be compensated. One achievable implementation is: compare the first fitting rate, the second fitting rate, and the third fitting rate with the fitting rate threshold respectively. When both 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, it indicates that the accuracy and rationality of the first process factor determined by the partial curve in the first target temperature range are poor, and the first process factor needs to be adjusted. Then, determine the proportional relationship between the second fitting rate and the third fitting rate, so as to reflect the effect of output frequency compensation for the crystal oscillator to be compensated in the second target temperature range and the third target temperature range when performing temperature compensation based on the three-dimensional surface equation. According to the proportional relationship, determine the first weight and the second weight. The larger the second fitting rate, the smaller the corresponding first weight; the larger the weight, the worse the corresponding output frequency compensation effect. The sum of the weights of the first weight and the second weight is 1. Exemplarily, if the proportional relationship is 3:2, then the first weight is 0.4 and the second weight is 0.6, indicating that the output frequency compensation effect in the second target temperature range is better than that in the third target temperature range.
[0077] Further, for the same first change curve, according to the partial curve in the second target temperature range, extract the corresponding slope and determine the corresponding second process factor; according to the partial curve in the third target temperature range, extract the corresponding slope and determine the corresponding third process factor. For details, refer to step S102 and will not be elaborated here. Further, sum 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 the weighted sum result. Further, perform weighted summation on the first process factor of the same first change curve and the weighted sum result. Among them, calculate the total first temperature difference between the second target temperature range and the third target temperature range, and determine the weights corresponding to the weighted sum result and the first process factor according to the ratio of the first temperature difference to the second temperature difference in the first target temperature range. The larger the first temperature difference, the larger the weight corresponding to the weighted sum result; the larger the second temperature difference, the larger the weight of the first process factor. Thus, the new process factor of the corresponding target crystal oscillator can be determined more accurately.
[0078] Further, determine different temperatures in the preset temperature range, the new process factor of each target crystal oscillator, and the output frequency of the corresponding target crystal oscillator at different temperatures as three-dimensional data, and re-fit to obtain a new three-dimensional surface equation to realize the adjustment of the three-dimensional surface equation. Finally, based on the new three-dimensional surface equation, obtain a new temperature-frequency two-dimensional curve equation, and re-perform temperature compensation on the crystal oscillator to be compensated. For details, refer to steps S103 - S104 and will not be elaborated here.
[0079] See Figure 2 , the embodiment of the present application discloses a flowchart of another crystal oscillator temperature compensation method, which can be implemented depending on a computer program or run on a crystal oscillator temperature compensation device based on the von Neumann architecture. This computer program can be integrated in an application or run as an independent tool-like application, and specifically includes:
[0080] S201: Obtain the first temperature-frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators.
[0081] S202: Based on the first temperature-frequency data of each target crystal oscillator, obtain the corresponding three-dimensional data, and based on each three-dimensional data, fit to obtain a three-dimensional surface equation. The three-dimensional data includes data in three dimensions: the temperature of the corresponding target crystal oscillator, the corresponding output frequency, and the process factor.
[0082] S203: Obtain at least one set of second temperature-frequency data of the crystal oscillator to be compensated, and based on each second temperature-frequency data and the three-dimensional surface equation, obtain the temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated.
[0083] S204: Perform temperature compensation on the crystal oscillator to be compensated based on the two-dimensional temperature-frequency curve equation.
[0084] Specifically, refer to steps S101 - S104, which will not be elaborated here.
[0085] S205: Obtain at least one set of fourth temperature-frequency data after temperature compensation of the crystal oscillator to be compensated.
[0086] S206: Based on each set of fourth temperature-frequency data, obtain the corresponding third change curve, and fit the third change curve with a preset reference change curve to obtain the second overall fitting rate. The reference change curve is the curve of the output frequency varying with temperature when the temperature compensation meets the requirements.
[0087] S207: If the second overall fitting rate does not exceed the preset fitting rate threshold, determine at least one target output frequency based on the target partial curve in the third change curve, where the fitting rate of the target partial curve and the corresponding partial curve in the reference change curve exceeds the preset fitting rate threshold.
[0088] S208: Perform temperature compensation on the crystal oscillator to be compensated again based on each target output frequency and the three-dimensional surface equation.
[0089] Specifically, obtain at least one set of fourth temperature-frequency data after temperature compensation of the crystal oscillator to be compensated. The obtaining method can refer to step S101, which will not be elaborated here. The fourth temperature-frequency data includes the single temperature and the corresponding output frequency of the crystal oscillator to be compensated after temperature compensation in the preset temperature range. Based on each set of fourth temperature-frequency data, perform curve fitting through the curve fitting toolbox (cftool) in the MATLAB tool to obtain the corresponding third change curve. The third change curve is the curve of the output frequency of the crystal oscillator to be compensated after temperature compensation varying with temperature. Further, fit the third change curve with the preset reference change curve through the MATLAB tool to obtain the second overall fitting rate, where the reference change curve is the curve of the output frequency varying with temperature when the temperature compensation meets the requirements, and where the temperature compensation meeting the requirements means that the output frequencies at each temperature in the preset temperature range after temperature compensation are all within a reasonable frequency range.
[0090] Furthermore, if the second overall fitting rate does not exceed the preset fitting rate threshold, it indicates that the similarity between the third change curve and the reference change curve is poor. Furthermore, it shows that the effect of temperature compensation for the crystal oscillator to be compensated according to the two-dimensional temperature-frequency curve equation is poor, and the offset of the output frequency is still large. Then, based on the target partial curve in the third change curve, at least one target output frequency is determined. A feasible determination method is as follows: The preset temperature range is divided into a preset number of sub-temperature ranges, and then the partial curves of the third change curve and the reference change curve in the same sub-temperature range are fitted. If the fitting rate exceeds the preset fitting rate threshold, it indicates that the output frequency offset of the crystal oscillator to be compensated in the corresponding sub-temperature range is small. Then, the partial curve of the third change curve in the corresponding sub-temperature range is determined as the target partial curve. Finally, at least one temperature point in the sub-temperature range corresponding to the target partial curve is input into the third change curve to obtain at least one target output frequency, that is, the output frequency with a small temperature offset.
[0091] Furthermore, the average of each target output frequency is calculated to obtain the appropriate output frequency. Then, the appropriate output frequency is substituted into the three-dimensional surface equation to obtain the target two-dimensional curve equation with only two variables, namely the process factor and temperature, that is, the change curve of the process factor of the crystal oscillator to be compensated with temperature. Thus, the change situation of the process factor of the crystal oscillator to be compensated with temperature is determined when the temperature compensation effect is good and the output frequency offset is small. Furthermore, the target two-dimensional curve equation is linearly fitted through the curve fitting toolbox (cftool) in MATLAB to obtain a constant function f(x) = c parallel to the x-axis, where c represents a constant. Exemplarily, the constant function can be f(x) = 20. Furthermore, the constant in the constant function is determined as the final process factor of the crystal oscillator to be compensated, that is, the value around which the process factor fluctuates when the output frequency offset is small. Determining it as the final process factor helps the crystal oscillator to be compensated to have a small output frequency offset at more temperatures. Finally, this final process factor is substituted into the three-dimensional surface equation again, and based on the least squares method, the final two-dimensional temperature-frequency curve equation corresponding to the crystal oscillator to be compensated is obtained by dimensionality reduction, that is, the change curve of the output frequency of the crystal oscillator to be compensated with temperature. Furthermore, based on this final two-dimensional temperature-frequency curve equation, the temperature compensation for the crystal oscillator to be compensated is performed again. For details, refer to step S104, which will not be elaborated here.
[0092] The implementation principle of the crystal oscillator temperature compensation method in the embodiments of the present application is as follows: The data of the corresponding process factor dimension is incorporated into the first temperature-frequency data of each target crystal oscillator, expanding the two-dimensional data of the output frequency and temperature to three-dimensional data. Then, a three-dimensional surface equation is obtained by fitting the three-dimensional data, thereby better taking into account the influence of process deviation on the output frequency offset. Further, the second temperature-frequency data of the crystal oscillator to be compensated is substituted into the three-dimensional surface equation, and it is reduced to a two-dimensional curve equation of temperature-frequency. By reducing the three-dimensional surface equation to a two-dimensional curve equation, only a small amount of temperature-frequency data of the crystal oscillator to be compensated needs to be measured, without measuring a large amount of temperature-frequency data, and the change curve of the output frequency of the crystal oscillator to be compensated with temperature can be determined. Subsequently, according to the two-dimensional curve equation of temperature-frequency, the output frequency of this crystal oscillator to be compensated at different temperatures can be accurately determined, and then targeted temperature compensation processing can be carried out, thereby improving the efficiency of crystal oscillator temperature compensation.
[0093] The following is an embodiment of the apparatus of the present application, which can be used to execute the method embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the method embodiment of the present application.
[0094] Please refer to Figure 3 , which is a schematic structural diagram of the crystal oscillator temperature compensation device provided by the embodiments of the present application. The device applied to the crystal oscillator temperature compensation can be implemented as all or part of the device through software, hardware, or a combination of both. The device includes a data acquisition module 11, a surface fitting module 12, a curve determination module 13, and a temperature compensation module 14.
[0095] 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. The first temperature-frequency data includes different temperatures in a preset temperature range and the output frequencies of the corresponding target crystal oscillators at different temperatures.
[0096] 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 a three-dimensional surface equation based on each three-dimensional data. The three-dimensional data includes data in three dimensions of the corresponding target crystal oscillator at temperature, the corresponding output frequency, and the process factor. The process factor characterizes the degree of influence of process deviation on the offset of the temperature-frequency characteristics of the target crystal oscillator.
[0097] The curve determination module 13 is configured to obtain at least one set of second temperature-frequency data of the crystal oscillator to be compensated, and based on each set of second temperature-frequency data and the three-dimensional surface equation, obtain the temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated. The second temperature-frequency data includes a single temperature in a preset temperature range 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.
[0098] The temperature compensation module 14 is configured to perform temperature compensation on the crystal oscillator to be compensated based on the temperature-frequency two-dimensional curve equation.
[0099] Optionally, the surface fitting module 12 is specifically configured to:
[0100] Determine the corresponding first change curve according to the first temperature-frequency data of each target crystal oscillator. The first change curve is the change curve of the output frequency of the corresponding target crystal oscillator with temperature.
[0101] Select a first target temperature range from the preset temperature range, and extract the slopes of the partial curves corresponding to the first target temperature range in each first change curve. The linearity of each first change curve in the first target temperature range is the highest.
[0102] Normalize each slope to obtain the first process factor of the corresponding target crystal oscillator.
[0103] 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 frequencies of the corresponding target crystal oscillators at different temperatures as dependent variables to obtain the corresponding three-dimensional data.
[0104] Optionally, the curve determination module 13 is specifically configured to:
[0105] Based on the least squares method, substitute each set of second temperature-frequency data into the three-dimensional surface equation to determine the target process factor corresponding to the crystal oscillator to be compensated.
[0106] Substitute the target process factor into the three-dimensional surface equation to obtain the temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated.
[0107] Optionally, as Figure 4 shown, the device further includes a first compensation module 15, which is specifically configured to:
[0108] Obtain at least one set of third temperature-frequency data after temperature compensation of the crystal oscillator to be compensated;
[0109] Based on each third temperature-frequency data, obtain the corresponding second change curve, and fit the second change curve with a preset reference change curve to obtain the first overall fitting rate. The reference change curve is the curve of the output frequency that meets the temperature compensation requirement changing with temperature;
[0110] If the first overall fitting rate does not exceed the preset fitting rate threshold, select a second target temperature range and a third target temperature range from the preset temperature range. The temperature in the second target temperature range is lower than the temperature in the first target temperature range, and the temperature in the third target temperature range is higher than the temperature in the first target temperature range;
[0111] Calculate the first fitting rate of the reference change curve and the second change curve in the first target temperature range, calculate the second fitting rate of the reference change curve and the second change curve in the second target temperature range, calculate the 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-perform temperature compensation on the crystal oscillator to be compensated.
[0112] Optionally, the first compensation module 15 is specifically configured to:
[0113] When both 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, determine the first weight and the second weight according to the proportional relationship between the second fitting rate and the third fitting rate. The sum of the weights of the first weight and the second weight is 1. The larger the second fitting rate, the smaller the corresponding first weight;
[0114] For the same first change curve, determine the corresponding second process factor according to the corresponding partial curve in the second target temperature range, and determine the corresponding third process factor according to the corresponding partial curve in the third target temperature range;
[0115] Sum 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 perform a weighted sum on the weighted sum result and the first process factor of the same first change curve to obtain the new process factor of the corresponding target crystal oscillator;
[0116] Adjust the three-dimensional surface equation according to the new process factors of each target crystal oscillator.
[0117] Optionally, the device further includes a second compensation module 16, which is specifically configured to:
[0118] Obtain at least one set of fourth temperature-frequency data after the temperature compensation of the crystal oscillator to be compensated;
[0119] Based on each fourth temperature-frequency data, a corresponding third change curve is obtained, and the third change curve is fitted with a preset reference change curve to obtain a second overall fitting rate. The reference change curve is a curve of the output frequency that meets the temperature compensation requirement varying with temperature;
[0120] If the second overall fitting rate does not exceed the preset fitting rate threshold, at least one target output frequency is determined based on the target partial curve in the third change curve, and the fitting rate of the target partial curve and the corresponding partial curve in the reference change curve exceeds the preset fitting rate threshold;
[0121] Based on each target output frequency and the three-dimensional surface equation, the crystal oscillator to be compensated is re-compensated for temperature.
[0122] Optionally, the second compensation module 16 is specifically configured to:
[0123] Average each target output frequency to obtain a suitable output frequency, and substitute the suitable output frequency into the three-dimensional surface equation to obtain a target two-dimensional curve equation. The target two-dimensional curve equation is a curve of the process factor of the crystal oscillator to be compensated varying with temperature;
[0124] Perform linear fitting on the target two-dimensional curve to obtain a constant function parallel to the x-axis, and determine the corresponding final process factor of the crystal oscillator to be compensated according to the constant function;
[0125] Substitute the final process factor into the three-dimensional surface equation to obtain the final temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated;
[0126] Based on the final temperature-frequency two-dimensional curve equation, the crystal oscillator to be compensated is re-compensated for temperature.
[0127] It should be noted that when the crystal oscillator temperature compensation device provided in the above embodiment executes the crystal oscillator temperature compensation method, only the above-mentioned division of each functional module is used for illustration. In actual application, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the crystal oscillator temperature compensation device and the crystal oscillator temperature compensation method embodiment provided in the above embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be elaborated here.
[0128] The embodiment of the present application also discloses a computer-readable storage medium, and the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the crystal oscillator temperature compensation method of the above embodiment is adopted.
[0129] Among them, the computer program can be stored in a computer-readable medium. The computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some middleware form, etc. The computer-readable medium includes any entity or device, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the computer-readable medium includes but is not limited to the above components.
[0130] Among them, through this computer-readable storage medium, a crystal oscillator temperature compensation method of the above embodiment is stored in the computer-readable storage medium, and is loaded and executed on the processor to facilitate the storage and application of the above method.
[0131] An embodiment of the present application also discloses an electronic device. When a computer program stored in a computer-readable storage medium is loaded and executed by a processor, the above crystal oscillator temperature compensation method is adopted.
[0132] Among them, the electronic device can be a desktop computer, a laptop computer, or a cloud server, etc. And the electronic device includes but is not limited to a processor and a memory. For example, the electronic device can also include input / output devices, network access devices, and a bus, etc.
[0133] Among them, the processor can adopt a central processing unit (CPU). Of course, according to the actual usage situation, other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be adopted. The general-purpose processor can adopt a microprocessor or any conventional processor, etc. The present application does not make any restrictions on this.
[0134] Among them, the memory can be an internal storage unit of the electronic device. For example, the hard disk or memory of the electronic device, or it can also be an external storage device of the electronic device. For example, a plug-in hard disk, a smart media card (SMC), a secure digital card (SD), or a flash card (FC), etc. equipped on the electronic device. And the memory can also be a combination of the internal storage unit and the external storage device of the electronic device. The memory is used to store the computer program and other programs and data required by the electronic device. The memory can also be used to temporarily store the data that has been output or will be output. The present application does not make any restrictions on this.
[0135] Among them, through this electronic device, a crystal oscillator temperature compensation method of the above embodiment is stored in the memory of the electronic device, and is loaded and executed on the processor of the electronic device, which is convenient for use.
[0136] The above are only exemplary embodiments of the present disclosure, and the scope of the present disclosure cannot be limited thereby. That is, any equivalent changes and modifications made according to the teachings of the present disclosure still fall within the scope covered by the present disclosure. Those skilled in the art will readily think of other embodiments of the present disclosure after considering the specification and practicing the disclosure herein. This application aims to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include the common general knowledge or conventional technical means in the technical field not recorded in the present disclosure. The specification and embodiments are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.
Claims
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. 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 includes: 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. 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. The crystal oscillator temperature compensation method according to claim 3, characterized in that: The adjusting 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 specifically includes: 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. 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. The crystal oscillator temperature compensation method according to claim 5, characterized in that: The re-performing temperature compensation on the crystal oscillator to be compensated based on each of the target output frequencies and the three-dimensional surface equation specifically includes: 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; 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. 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: include: 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; 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; 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; 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. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, characterized in that: 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. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor loads and executes the computer program, the method according to any one of claims 1 to 6 is adopted.
Citation Information
Patent Citations
Closed-loop temperature compensation method and device for clock crystal oscillator
CN102545778A
System and method for reducing temperature-dependent and process-dependent frequency variation of a crystal oscillator circuit
CN102868363A