CN115085721A - Temperature compensation method, device, equipment and storage medium based on crystal oscillator - Google Patents
Temperature compensation method, device, equipment and storage medium based on crystal oscillator Download PDFInfo
- Publication number
- CN115085721A CN115085721A CN202210850538.6A CN202210850538A CN115085721A CN 115085721 A CN115085721 A CN 115085721A CN 202210850538 A CN202210850538 A CN 202210850538A CN 115085721 A CN115085721 A CN 115085721A
- Authority
- CN
- China
- Prior art keywords
- compensation
- initial
- temperature
- frequency
- fixed coefficient
- 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.)
- Pending
Links
- 239000013078 crystal Substances 0.000 title claims abstract description 70
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000012360 testing method Methods 0.000 claims abstract description 108
- 238000010586 diagram Methods 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 239000010453 quartz Substances 0.000 description 4
- VYPSYNLAJGMNEJ-UHFFFAOYSA-N silicon dioxide Inorganic materials O=[Si]=O VYPSYNLAJGMNEJ-UHFFFAOYSA-N 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 239000003990 capacitor Substances 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000010355 oscillation Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000010835 comparative analysis Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000002277 temperature effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03L—AUTOMATIC CONTROL, STARTING, SYNCHRONISATION OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
- H03L1/00—Stabilisation of generator output against variations of physical values, e.g. power supply
- H03L1/02—Stabilisation of generator output against variations of physical values, e.g. power supply against variations of temperature only
- H03L1/022—Stabilisation of generator output against variations of physical values, e.g. power supply against variations of temperature only by indirect stabilisation, i.e. by generating an electrical correction signal which is a function of the temperature
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03H—IMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
- H03H9/00—Networks comprising electromechanical or electro-acoustic devices; Electromechanical resonators
- H03H9/15—Constructional features of resonators consisting of piezoelectric or electrostrictive material
- H03H9/17—Constructional features of resonators consisting of piezoelectric or electrostrictive material having a single resonator
- H03H9/19—Constructional features of resonators consisting of piezoelectric or electrostrictive material having a single resonator consisting of quartz
Landscapes
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Oscillators With Electromechanical Resonators (AREA)
Abstract
The invention belongs to the technical field of crystal oscillators, and discloses a temperature compensation method, device, equipment and storage medium based on a crystal oscillator. The method comprises the following steps: acquiring an initial non-fixed coefficient and an initial fixed coefficient, and establishing an initial theoretical compensation relation between the temperature and the frequency of the test target according to the initial non-fixed coefficient and the initial fixed coefficient; acquiring test data of a test target, and acquiring an actual compensation relation between temperature and frequency according to the test data and an initial fixed coefficient; determining a target fixed coefficient according to the initial theoretical compensation relation and the actual compensation relation; determining a target compensation relation between the temperature and the frequency according to the target fixed coefficient; and compensating the target to be compensated according to the target compensation relation between the temperature and the frequency. By the mode, the compatibility problem of the compensation algorithm is improved, automatic updating of different products is realized, the problem that a temperature compensation algorithm model is unstable in practical application is solved, and the frequency stability is improved.
Description
Technical Field
The invention relates to the technical field of crystal oscillators, in particular to a temperature compensation method, device, equipment and storage medium based on a crystal oscillator.
Background
With the development of electronic technology, the temperature compensation algorithm for quartz crystal oscillators is continuously optimized, and the mature temperature compensation algorithm comprises the following steps: analog compensation, digital compensation, and compensation controlled by a microprocessor. In the traditional analog compensation algorithm, compensation voltage generated by simulating each power circuit is input to a voltage-controlled crystal oscillator and is applied to a variable capacitor, so that the effect opposite to the temperature influence is generated on the frequency of crystal oscillation, and the output of high-frequency stability is realized. However, in application, due to process or design reasons, for crystal oscillators with different frequency points, different batches and similar chip designs, the compensation capability of the compensation algorithm is reduced more and more along with new products, so that each new product needs to adjust the parameters of the algorithm model to ensure the compensation capability, and the actual application effect is influenced.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a temperature compensation method, a temperature compensation device, temperature compensation equipment and a storage medium based on a crystal oscillator, and aims to solve the technical problems that in the prior art, a temperature compensation algorithm model cannot achieve accurate compensation aiming at different products, and is unstable in practical application.
In order to achieve the above object, the present invention provides a temperature compensation method based on a crystal oscillator, the method comprising the steps of:
acquiring an initial non-fixed coefficient and an initial fixed coefficient, and establishing an initial theoretical compensation relation between the temperature and the frequency of a test target according to the initial non-fixed coefficient and the initial fixed coefficient;
obtaining test data of the test target, and obtaining an actual compensation relation between the temperature and the frequency of the test target according to the test data and an initial fixed coefficient;
determining a target fixed coefficient according to the initial theoretical compensation relation and the actual compensation relation of the temperature and the frequency;
determining a target compensation relation between the temperature and the frequency according to the target fixed coefficient;
and compensating the target to be compensated according to the target compensation relation between the temperature and the frequency.
Optionally, the determining a target fixed coefficient according to the initial theoretical compensation relationship and the actual compensation relationship between the temperature and the frequency includes:
comparing the actual compensation relation with an initial theoretical compensation relation to determine whether the initial theoretical compensation relation accords with the actual compensation relation;
when the initial theoretical compensation relationship is coincident with the actual compensation relationship, determining that the initial theoretical compensation relationship conforms to the actual compensation relationship;
and determining a target fixed coefficient according to the initial fixed coefficient of the initial theoretical compensation relation.
Optionally, after comparing the actual compensation relationship with the initial theoretical compensation relationship and determining whether the initial theoretical compensation relationship conforms to the actual compensation relationship, the method further includes:
when the initial theoretical compensation relationship does not coincide with the actual compensation relationship, determining that the initial theoretical compensation relationship does not coincide with the actual compensation relationship;
updating the initial fixed coefficient according to the initial theoretical compensation relation and the actual compensation relation;
and according to the updated initial fixed coefficient, returning to execute the step of establishing the initial theoretical compensation relation between the temperature and the frequency of the test target according to the initial non-fixed coefficient and the initial fixed coefficient.
Optionally, the updating the initial fixed coefficient according to the initial theoretical compensation relationship and the actual compensation relationship includes:
acquiring an actual coefficient of an actual compensation relation of temperature and frequency;
obtaining a theoretical coefficient of an initial theoretical compensation relation of temperature and frequency;
obtaining the relation between the initial fixed coefficient and the actual coefficient and the theoretical coefficient;
obtaining a new fixed coefficient according to the relation, the fixed coefficient, the actual coefficient information and the theoretical coefficient information;
and updating the initial fixed coefficient according to the new fixed coefficient.
Optionally, the obtaining an initial non-fixed coefficient and an initial fixed coefficient, and establishing an initial theoretical compensation relationship between the temperature and the frequency of the test target according to the initial non-fixed coefficient and the initial fixed coefficient includes:
acquiring an initial non-fixed coefficient, and acquiring an initial theoretical relationship between temperature and frequency according to the initial non-fixed coefficient;
and acquiring an initial fixed coefficient, and acquiring an initial theoretical compensation relation of the temperature and the frequency of the test target according to the initial theoretical relation of the temperature and the frequency and the initial fixed coefficient.
Optionally, the obtaining the test data of the test target includes obtaining a test temperature data, a test frequency data, and a target frequency data, and obtaining an actual compensation relationship between the temperature and the frequency of the test target according to the test data and an initial fixed coefficient, including:
acquiring test temperature data, test frequency data and target frequency data of a test target;
obtaining the relation among the test temperature data, the test frequency data and the target frequency data;
obtaining an actual relation between the temperature and the frequency according to the test temperature data, the test frequency data, the target frequency data and the relation;
and obtaining the actual compensation relation of the temperature and the frequency according to the actual relation of the temperature and the frequency and the initial fixed coefficient.
Optionally, the determining a target compensation relationship between temperature and frequency according to the target fixed coefficient includes:
obtaining a target non-fixed coefficient according to the target fixed coefficient;
and obtaining a target compensation relation between the temperature and the frequency according to the target non-fixed coefficient.
In addition, in order to achieve the above object, the present invention further provides a temperature compensation device based on a crystal oscillator, including:
the acquisition module is used for acquiring an initial non-fixed coefficient and an initial fixed coefficient and establishing an initial theoretical compensation relation between the temperature and the frequency of the test target according to the initial non-fixed coefficient and the initial fixed coefficient;
the acquisition module is further used for acquiring the test data of the test target and obtaining the actual compensation relation between the temperature and the frequency of the test target according to the test data and the initial fixed coefficient;
the judging module is used for determining a target fixed coefficient according to the initial theoretical compensation relation and the actual compensation relation of the temperature and the frequency;
the judging module is also used for determining a target compensation relation between the temperature and the frequency according to the target fixed coefficient;
and the compensation module is used for compensating the target to be compensated according to the target compensation relation between the temperature and the frequency.
Furthermore, in order to achieve the above object, the present invention also provides a crystal oscillator-based temperature compensation apparatus, including: a memory, a processor, and a crystal oscillator based temperature compensation program stored on the memory and executable on the processor, the crystal oscillator based temperature compensation program configured to implement the steps of the crystal oscillator based temperature compensation method as described above.
Furthermore, to achieve the above object, the present invention further proposes a storage medium having stored thereon a crystal oscillator-based temperature compensation program, which when executed by a processor, implements the steps of the crystal oscillator-based temperature compensation method as described above.
According to the invention, an initial theoretical compensation relation of the temperature and the frequency of a test target is established according to an initial non-fixed coefficient and an initial fixed coefficient, an actual compensation relation of the temperature and the frequency is established according to test data and the initial fixed coefficient of the test target, and a target fixed coefficient is determined according to the initial theoretical compensation relation and the actual compensation relation of the temperature and the frequency, so that a target compensation relation of the temperature and the frequency is determined, and then the target to be compensated is compensated according to the target compensation relation of the temperature and the frequency. Compared with the prior art that each new product needs to adjust the compensation algorithm to ensure the stability of the compensation temperature-frequency characteristic, the temperature compensation algorithm model is divided into two independent parts: the compensation algorithm part and the compensation product part automatically update the compensation algorithm model aiming at different products before compensating products, and can effectively solve the technical problem that the compensation of the algorithm model is inaccurate in practical application, thereby perfecting the temperature compensation algorithm and further improving the frequency stability of the crystal oscillator in an analog compensation mode.
Drawings
FIG. 1 is a schematic diagram of a crystal oscillator-based temperature compensation device for a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a first embodiment of a temperature compensation method based on a crystal oscillator according to the present invention;
FIG. 3 is a schematic diagram of an analog compensation system according to an embodiment of the temperature compensation method of the present invention;
FIG. 4 is a schematic diagram of a frequency-temperature characteristic curve of an embodiment of a temperature compensation method based on a crystal oscillator according to the present invention;
FIG. 5 is a flow chart illustrating a second embodiment of a temperature compensation method based on a crystal oscillator according to the present invention;
FIG. 6 is a flow chart illustrating a third embodiment of a temperature compensation method based on a crystal oscillator according to the present invention;
FIG. 7 is a schematic flowchart illustrating an overall process of one embodiment of a temperature compensation method for a crystal oscillator according to the present invention;
fig. 8 is a block diagram of a first embodiment of a temperature compensation device based on a crystal oscillator according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a crystal oscillator-based temperature compensation device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the crystal oscillator-based temperature compensation apparatus may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to implement connection communication among these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
It will be appreciated by those skilled in the art that the configuration shown in figure 1 does not constitute a limitation of crystal oscillator-based temperature compensation devices and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a crystal oscillator-based temperature compensation program.
In the crystal oscillator-based temperature compensation apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 of the crystal oscillator-based temperature compensation device of the present invention may be disposed in a crystal oscillator-based temperature compensation device, which calls the crystal oscillator-based temperature compensation program stored in the memory 1005 through the processor 1001 and executes the crystal oscillator-based temperature compensation method provided by the embodiment of the present invention.
An embodiment of the present invention provides a temperature compensation method based on a crystal oscillator, and referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the temperature compensation method based on the crystal oscillator according to the present invention.
In this embodiment, the temperature compensation method based on the crystal oscillator includes the following steps:
step S10: and acquiring an initial non-fixed coefficient and an initial fixed coefficient, and establishing an initial theoretical compensation relation between the temperature and the frequency of the test target according to the initial non-fixed coefficient and the initial fixed coefficient.
It should be noted that the execution subject of the present embodiment is a computer, and may be any computer capable of running a temperature compensation program based on a crystal oscillator, and the present embodiment is not limited to this, and the temperature-frequency characteristic of the crystal oscillator is compensated by the temperature compensation program based on the crystal oscillator, which is provided in the computer.
It can be understood that the analog compensation is implemented by inputting compensation voltages generated by analog power circuits into the vcxo, and applying the compensation voltages to the variable capacitor to generate an opposite effect to the temperature effect, as shown in the schematic diagram of the analog compensation system shown in fig. 3, wherein SCLK is a clock signal pin, DIO is a data signal pin, cs (chip select) is enable, eeprom (electrically Erasable Programmable read only memory) is a digital control module, VDD is a power supply, VSS is a ground terminal, OUT is a waveform output, and XTAL1/2 is a quartz crystal pin. As shown in the frequency-temperature characteristic diagram of fig. 4, a high-frequency stable output can be realized by analog compensation.
In a specific implementation, since the fifth-order polynomial f-T curve and the quartz crystal oscillator f-T characteristic curve have high fitting degree, the frequency-temperature characteristic of the quartz crystal oscillator is approximated by the fifth-order polynomial, and the calculation expression is as follows:
in the formula, A 5 Is the coefficient of the fifth power, A 4 Is the coefficient of the fourth power, A 3 Is the coefficient of the third power, A 1 Is the first order coefficient, A 0 Is at a temperature T 0 Frequency of oscillation of time, T 0 The center temperature of the frequency-temperature characteristic curve of the crystal oscillator, T is the temperature value, f is the difference between the actual frequency and the target frequency 0 In the actual application process, each power coefficient is divided into a fixed coefficient and a non-fixed coefficient, the non-fixed coefficient is a value which can be written into an EEPROM and must be an integer, the fixed coefficient is a unit variable quantity component of the non-fixed coefficient, usually a decimal, which can not be written into the EEPROM and needs to be stored in a compensation algorithm model.
The step S10 includes: acquiring an initial non-fixed coefficient, acquiring an initial theoretical relationship between temperature and frequency according to the initial non-fixed coefficient, acquiring an initial fixed coefficient, and acquiring an initial theoretical compensation relationship between the temperature and the frequency of the test target according to the initial theoretical relationship between the temperature and the frequency and the initial fixed coefficient.
In this embodiment, the initial non-fixed coefficient is an initial value of a preset non-fixed coefficient, and is usually set to an intermediate value, for example: five times, four times, three times, one time and A 0 The initial values are set to 40, 0, and 80, respectively, which is not limited in this embodiment and can be flexibly adjusted according to actual situations. Substituting the initial non-fixed coefficient into a fifth-order polynomial to obtain a frequency-temperature characteristic theoretical curve, namely an initial theoretical relationship between temperature and frequency. The test targets are small batches of samples of the product, such as: 5 samples, this embodiment does not limit this, can adjust according to the actual conditions in a flexible way, the product is TCXO (temperature compensated crystal oscillator) of analog compensation type.The initial fixed coefficient is an initial value of a preset fixed coefficient, and since the frequency-temperature characteristic is a fifth-order polynomial, a test is performed for the case where each power coefficient changes individually, so that the initial fixed coefficient only compensates for a single coefficient, for example: the coefficient of the fifth time of the first sample is fixedly compensated by 10, the coefficient of the fourth time of the second sample is compensated by 10, and so on, and the method can be flexibly adjusted according to the actual situation, and the embodiment does not limit the method. According to the initial theoretical relationship between temperature and frequency and the initial fixed coefficient, an initial compensation algorithm model can be established, and a compensated initial theoretical frequency-temperature characteristic curve corresponding to each power coefficient, namely the initial theoretical compensation relationship between temperature and frequency, can be obtained.
Step S20: and acquiring test data of the test target, and acquiring an actual compensation relation between the temperature and the frequency of the test target according to the test data and the initial fixed coefficient.
It should be noted that the test data is obtained through a temperature test, and includes test temperature data, test frequency data, and target frequency data, and the temperature test is as follows: the samples were placed in a test environment capable of temperature change, typically requiring a range of-40 ℃ to 85 ℃, and then the frequency response curve was monitored as a function of temperature by connecting an external test system to the test panel.
The step S20 includes:
the method comprises the steps of obtaining test temperature data, test frequency data and target frequency data of a test target, and obtaining the relation among the temperature data, the test frequency data and the target frequency data.
It should be noted that the test temperature data is a temperature to be tested in a temperature test, the test frequency data is a frequency value corresponding to each test temperature, the target frequency data is a frequency value under an ideal condition, and frequency characteristic data corresponding to each test temperature is obtained according to the frequency data and the target frequency data, wherein a calculation expression of the frequency characteristic data is as follows:
frequency characteristic = (frequency measurement value-nominal frequency)/nominal frequency × 1000000
Where the nominal frequency is the target frequency data in ppm.
And obtaining the actual relation between the temperature and the frequency according to the temperature data, the test frequency data, the target frequency data and the relation.
In a specific implementation, an actual frequency-temperature characteristic curve, i.e., an actual relationship between temperature and frequency, may be obtained according to the test temperature data and the calculated frequency characteristic data.
And obtaining the actual compensation relation of the temperature and the frequency of the test target according to the actual relation of the temperature and the frequency and the initial fixed coefficient.
In this embodiment, when the initial fixed coefficient is used to compensate each power coefficient of the actual frequency-temperature characteristic curve, the initial fixed coefficient only compensates a single coefficient, so as to obtain the compensated actual frequency-temperature characteristic curve corresponding to each power coefficient, i.e. the actual compensation relationship between the temperature and the frequency.
Step S30: and determining a target fixed coefficient according to the initial theoretical compensation relation and the actual compensation relation of the temperature and the frequency.
It should be noted that the target fixed coefficients are respective power coefficient compensation amounts corresponding to the initial compensation algorithm model when the initial compensation algorithm model can be applied.
In the specific implementation, the compensated temperature test result is compared with the theoretical calculation result of the initial compensation algorithm model, that is, the compensated actual frequency-temperature characteristic curve is compared with the initial theoretical frequency-temperature characteristic curve, and whether the initial theoretical compensation model can be applied or not is judged according to the superposition condition of the theoretical characteristic curve and the actual characteristic curve. When the theoretical result curve is superposed with the actual result curve, the initial compensation algorithm model at the moment is proved to meet the actual application requirement and can be used for subsequent large-batch compensation, and the fixed coefficient of each power in the initial compensation algorithm model at the moment is the target fixed coefficient.
Step S40: and determining a target compensation relation between the temperature and the frequency according to the target fixed coefficient.
The step S40 includes: and obtaining a target non-fixed coefficient according to the target fixed coefficient, and obtaining a target compensation relation between the temperature and the frequency according to the target non-fixed coefficient.
It should be noted that the target non-fixed coefficient is each power coefficient value that needs to be written into the EEPROM of the product chip.
In the concrete implementation, after the target fixed coefficients of each power are determined, the target non-fixed coefficient value needing to be written into the EEPROM is calculated by using a least square method, and the target non-fixed coefficient is substituted into a fifth-order polynomial, so that the target compensation relation between the temperature and the frequency can be obtained, namely the finally needed compensation algorithm model. Different target fixed coefficients can be obtained by crystal oscillators designed at different frequency points, different batches and different chips, so that corresponding target non-fixed coefficients are obtained, and then compensation algorithm models corresponding to the crystal oscillators are generated, so that the accuracy of the compensation algorithm models in practical application is improved, and the compatibility of the algorithms is improved because products of similar chips only need one compensation algorithm model.
Step S50: and compensating the target to be compensated according to the target compensation relation between the temperature and the frequency.
It can be understood that the object to be compensated is a large batch of products corresponding to a small batch of samples to be compensated. And adjusting each power coefficient of a product frequency-temperature curve through the obtained compensation algorithm model, so that the product can output a more stable frequency.
In this example, a small sample lot is first taken for the fifth, fourth, third, first, A of the fifth polynomial 0 The method comprises the steps of setting an initial value according to an initial non-fixed coefficient, establishing a theoretical relation of temperature and frequency according to the initial non-fixed coefficient, obtaining temperature data and frequency data, establishing an actual relation of the temperature and the frequency, changing each order coefficient in the theoretical relation and the actual relation through the initially set fixed coefficient, realizing compensation on frequency characteristics, obtaining a theoretical compensation relation and an actual compensation relation of the temperature and the frequency, comparing the actual compensation relation with the theoretical compensation relation, and when the theoretical compensation relation and the actual compensation relation meet a coincidence standard, obtaining a current fixed compensation relation according to the current fixed coefficientAnd (4) calculating a fixed coefficient by using the coefficient, generating a compensation algorithm model, and applying the compensation algorithm model to other products for batch compensation. The present embodiment divides the temperature compensation algorithm model into two separate parts: the compensation algorithm part and the compensation product part automatically update the compensation algorithm model aiming at different products before compensating the products, thereby perfecting the temperature compensation algorithm and further improving the frequency stability of the crystal oscillator in the analog compensation mode.
Referring to fig. 5, fig. 5 is a flowchart illustrating a second embodiment of a temperature compensation method based on a crystal oscillator according to the present invention.
Based on the first embodiment, the step S30 includes:
step S301: and comparing the actual compensation relation with the initial theoretical compensation relation to determine whether the initial theoretical compensation relation accords with the actual compensation relation.
It should be noted that the actual compensation relationship is compared with the initial theoretical compensation relationship, that is, the calculation result of the theoretical model is compared with the actual result, that is, the compensated actual frequency-temperature characteristic curve is compared with the initial theoretical frequency-temperature characteristic curve, and the coincidence condition of the theoretical characteristic curve and the actual characteristic curve is determined.
Step S302: and when the initial theoretical compensation relationship is coincident with the actual compensation relationship, determining that the initial theoretical compensation relationship conforms to the actual compensation relationship.
In a specific implementation, the initial theoretical compensation relationship coincides with the actual compensation relationship, that is, the compensated actual frequency-temperature characteristic curve coincides with the initial theoretical frequency-temperature characteristic curve, and at this time, the initial theoretical compensation relationship is considered to conform to the actual compensation relationship.
Step S303: and determining a target fixed coefficient according to the initial fixed coefficient of the initial theoretical compensation relation.
It can be understood that when the initial theoretical compensation relationship conforms to the actual compensation relationship, the initial theoretical compensation model at the time is shown to meet the application requirement, and the fixed coefficient used at the time is used as the target fixed coefficient for calculating the target non-fixed coefficient.
In this embodiment, each power coefficient has a corresponding actual compensation relationship and an initial theoretical compensation relationship, so that the actual compensation relationship and the initial theoretical compensation relationship corresponding to each power coefficient are respectively compared, when the initial theoretical compensation relationship conforms to the actual compensation relationship, the fixed coefficient used at this time is determined as the target fixed coefficient, and after the target fixed coefficient of each power coefficient is determined, the target non-fixed coefficient written into the EEPROM can be calculated, and the target non-fixed coefficient can be applied to the compensation of the product, so that the frequency stability of the crystal oscillator can be improved.
Referring to fig. 6, fig. 6 is a flow chart illustrating a third embodiment of a temperature compensation method based on a crystal oscillator according to the present invention.
Based on the second embodiment, the step S301 includes:
step S3011: and when the initial theoretical compensation relationship is not coincident with the actual compensation relationship, determining that the initial theoretical compensation relationship is not coincident with the actual compensation relationship.
It should be noted that the initial theoretical compensation relationship does not coincide with the actual compensation relationship, that is, the compensated actual frequency-temperature characteristic curve does not coincide with the initial theoretical frequency-temperature characteristic curve, and at this time, it can be considered that the initial theoretical compensation relationship does not coincide with the actual compensation relationship.
Step S3012: and updating the initial fixed coefficient according to the initial theoretical compensation relation and the actual compensation relation.
The step S3012 includes:
and acquiring an actual coefficient of an actual compensation relation of the temperature and the frequency, and acquiring a theoretical coefficient of an initial theoretical compensation relation of the temperature and the frequency.
It is understood that the actual coefficient is a fitting coefficient of the actual frequency-temperature characteristic curve to each power, and the theoretical coefficient is a fitting coefficient of the initial theoretical frequency-temperature characteristic curve to each power.
And obtaining a relation between the initial fixed coefficient and the actual coefficient and the theoretical coefficient, and obtaining a new fixed coefficient according to the relation and the initial fixed coefficient, the actual coefficient information and the theoretical coefficient information.
It should be noted that the new fixed coefficient may be obtained by calculating according to the initial fixed coefficient, the actual coefficient information, and the theoretical coefficient information, and the calculation expression is as follows:
new fixed coefficient = initial fixed coefficient × power actual coefficient/power theoretical coefficient
And updating the initial fixed coefficient according to the new fixed coefficient.
It should be understood that the new fixed coefficients of each power are calculated separately, and after all new fixed coefficients are calculated, the initial compensation algorithm model is updated five times, four times, three times, one time, a 0 The initial fixed factor of (a).
Step S3013: and returning to the step S10 according to the updated initial fixed coefficient.
In a specific implementation, when the actual compensation relationship is not coincident with the initial theoretical compensation relationship, it is considered that the current initial compensation algorithm model cannot meet the actual requirement, the initial compensation algorithm model needs to be updated, and the algorithm model is automatically updated five times, four times, three times, one time and A times 0 And continuously compensating the actual relationship and the initial theoretical relationship of the temperature and the frequency by using the updated initial compensation algorithm model to obtain a new actual compensation relationship and an initial theoretical compensation relationship of the temperature and the frequency, and comparing the new actual compensation relationship and the initial theoretical compensation relationship until the actual compensation relationship is superposed with the initial theoretical compensation relationship.
As shown in FIG. 7, the overall flow chart of an embodiment is that a small batch of samples is first taken for quintic, quartic, tertiary, one-time, A of the quintic polynomial 0 The initial value is set for the non-fixed coefficient, the temperature test is carried out, the compensated temperature test result is compared with the theoretical calculation result of the initial algorithm model, and if the theoretical and the actual frequency-temperature characteristics do not coincide, the five times, the four times, the three times, the one time and the A time of the initial algorithm model are automatically updated 0 Comparing and analyzing the fixed coefficient with the temperature test result after compensation again until the frequency-temperature characteristic of the product meets the coincidence standard, and finally generating a new temperature compensation algorithm model to be applied to other products compensated in batches。
In this embodiment, through the comparative analysis of the theoretical calculation result and the actual result, when the coincidence criterion is not satisfied, the fixed coefficient is automatically updated until the compensation algorithm meets the application requirement. Because the traditional compensation algorithm model cannot solve the problem of product difference and cause inaccurate compensation of the algorithm model, the fixed coefficients are updated according to different batches of products, so that the non-fixed coefficients are calculated more accurately, the more accurate non-fixed coefficients are obtained and written into a chip, the product can output more stable frequency, the problem of inaccurate compensation of the algorithm model can be effectively solved, and the frequency stability of the crystal oscillator is improved.
Furthermore, an embodiment of the present invention further provides a storage medium, where the storage medium stores a temperature compensation program based on a crystal oscillator, and the temperature compensation program based on a crystal oscillator implements the steps of the temperature compensation method based on a crystal oscillator as described above when executed by a processor.
Referring to fig. 8, fig. 8 is a block diagram illustrating a first embodiment of a temperature compensation apparatus based on a crystal oscillator according to the present invention.
As shown in fig. 8, the temperature compensation apparatus based on a crystal oscillator according to an embodiment of the present invention includes:
the obtaining module 10 is configured to obtain an initial non-fixed coefficient and an initial fixed coefficient, and establish an initial theoretical compensation relationship between the temperature and the frequency of the test target according to the initial non-fixed coefficient and the initial fixed coefficient.
The obtaining module 10 is further configured to obtain test data of the test target, and obtain an actual compensation relationship between the temperature and the frequency of the test target according to the test data and the initial fixed coefficient.
And the judging module 20 is configured to determine a target fixed coefficient according to the initial theoretical compensation relationship and the actual compensation relationship between the temperature and the frequency.
The judging module 20 is further configured to determine a target compensation relationship between the temperature and the frequency according to the target fixed coefficient.
And the compensation module 30 is configured to compensate the target to be compensated according to the target compensation relationship between the temperature and the frequency.
In this embodiment, a theoretical relationship between temperature and frequency is established according to an initial non-fixed coefficient, temperature data and frequency data are obtained, an actual relationship between temperature and frequency is established, each order coefficient in the theoretical relationship and the actual relationship is changed through an initially set fixed coefficient, compensation for frequency characteristics is achieved, a theoretical compensation relationship and an actual compensation relationship between temperature and frequency are obtained, the actual compensation relationship and the theoretical compensation relationship are compared, when the theoretical compensation relationship and the actual compensation relationship meet a coincidence standard, a fixed coefficient is calculated according to a current fixed coefficient, a compensation algorithm model is generated, and the compensation algorithm model is applied to other products of batch compensation. The present embodiment divides the temperature compensation algorithm model into two separate parts: the compensation algorithm part and the compensation product part automatically update the compensation algorithm model aiming at different products before compensating the products, thereby perfecting the temperature compensation algorithm and further improving the frequency stability of the crystal oscillator in the analog compensation mode.
In an embodiment, the determining module 20 is further configured to compare the actual compensation relationship with an initial theoretical compensation relationship, and determine whether the initial theoretical compensation relationship conforms to the actual compensation relationship;
when the initial theoretical compensation relationship is coincident with the actual compensation relationship, determining that the initial theoretical compensation relationship conforms to the actual compensation relationship;
and determining a target fixed coefficient according to the initial fixed coefficient of the initial theoretical compensation relation.
In an embodiment, the determining module 20 is further configured to determine that the initial theoretical compensation relationship does not conform to the actual compensation relationship when the initial theoretical compensation relationship does not coincide with the actual compensation relationship;
updating the initial fixed coefficient according to the initial theoretical compensation relation and the actual compensation relation;
and according to the updated initial fixed coefficient, returning to execute the step of establishing the initial theoretical compensation relation between the temperature and the frequency of the test target according to the initial non-fixed coefficient and the initial fixed coefficient.
In an embodiment, the determining module 20 is further configured to obtain an actual coefficient of an actual compensation relationship between temperature and frequency;
obtaining a theoretical coefficient of an initial theoretical compensation relation of temperature and frequency;
obtaining the relation between the initial fixed coefficient and the actual coefficient and the theoretical coefficient;
obtaining a new fixed coefficient according to the relation, the fixed coefficient, the actual coefficient information and the theoretical coefficient information;
and updating the initial fixed coefficient according to the new fixed coefficient.
In an embodiment, the obtaining module 10 is further configured to obtain an initial non-fixed coefficient, and obtain an initial theoretical relationship between temperature and frequency according to the initial non-fixed coefficient;
and acquiring an initial fixed coefficient, and acquiring an initial theoretical compensation relation of the temperature and the frequency of the test target according to the initial theoretical relation of the temperature and the frequency and the initial fixed coefficient.
In an embodiment, the obtaining module 10 is further configured to obtain test temperature data, test frequency data, and target frequency data of a test target;
obtaining the relation among the test temperature data, the test frequency data and the target frequency data;
obtaining an actual relation between the temperature and the frequency according to the test temperature data, the test frequency data, the target frequency data and the relation;
and obtaining the actual compensation relation of the temperature and the frequency of the test target according to the actual relation of the temperature and the frequency and the initial fixed coefficient.
In an embodiment, the compensation module 30 is further configured to obtain a target non-fixed coefficient according to the target fixed coefficient;
and obtaining a target compensation relation between the temperature and the frequency according to the target non-fixed coefficient.
It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited thereto.
It should be noted that the above-mentioned work flows are only illustrative and do not limit the scope of the present invention, and in practical applications, those skilled in the art may select some or all of them according to actual needs to implement the purpose of the solution of the present embodiment, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment can be referred to the temperature compensation method based on the crystal oscillator provided in any embodiment of the present invention, and are not described herein again.
Further, it is to be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solution of the present invention or a part contributing to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A temperature compensation method based on a crystal oscillator is characterized by comprising the following steps:
acquiring an initial non-fixed coefficient and an initial fixed coefficient, and establishing an initial theoretical compensation relation between the temperature and the frequency of a test target according to the initial non-fixed coefficient and the initial fixed coefficient;
acquiring test data of the test target, and acquiring an actual compensation relation between the temperature and the frequency of the test target according to the test data and an initial fixed coefficient;
determining a target fixed coefficient according to the initial theoretical compensation relation and the actual compensation relation of the temperature and the frequency;
determining a target compensation relation between the temperature and the frequency according to the target fixed coefficient;
and compensating the target to be compensated according to the target compensation relation between the temperature and the frequency.
2. The method of claim 1, wherein determining a target fixed coefficient based on the initial theoretical compensation relationship and the actual compensation relationship for temperature and frequency comprises:
comparing the actual compensation relation with an initial theoretical compensation relation to determine whether the initial theoretical compensation relation accords with the actual compensation relation;
when the initial theoretical compensation relationship is coincident with the actual compensation relationship, determining that the initial theoretical compensation relationship conforms to the actual compensation relationship;
and determining a target fixed coefficient according to the initial fixed coefficient of the initial theoretical compensation relation.
3. The method of claim 2, wherein after comparing the actual compensation relationship to an initial theoretical compensation relationship and determining whether the initial theoretical compensation relationship conforms to the actual compensation relationship, further comprising:
when the initial theoretical compensation relationship does not coincide with the actual compensation relationship, determining that the initial theoretical compensation relationship does not coincide with the actual compensation relationship;
updating the initial fixed coefficient according to the initial theoretical compensation relation and the actual compensation relation;
and according to the updated initial fixed coefficient, returning to execute the step of establishing the initial theoretical compensation relation between the temperature and the frequency of the test target according to the initial non-fixed coefficient and the initial fixed coefficient.
4. The method of claim 3, wherein said updating the initial fixed coefficients based on the initial theoretical compensation relationship and the actual compensation relationship comprises:
acquiring an actual coefficient of an actual compensation relation of temperature and frequency;
obtaining a theoretical coefficient of an initial theoretical compensation relation of temperature and frequency;
obtaining the relation between the initial fixed coefficient and the actual coefficient and the theoretical coefficient;
obtaining a new fixed coefficient according to the relation, the fixed coefficient, the actual coefficient information and the theoretical coefficient information;
and updating the initial fixed coefficient according to the new fixed coefficient.
5. The method of claim 1, wherein the obtaining an initial non-fixed coefficient and an initial fixed coefficient, and establishing an initial theoretical compensation relationship between the temperature and the frequency of the test object according to the initial non-fixed coefficient and the initial fixed coefficient comprises:
acquiring an initial non-fixed coefficient, and acquiring an initial theoretical relationship between temperature and frequency according to the initial non-fixed coefficient;
and acquiring an initial fixed coefficient, and acquiring an initial theoretical compensation relation of the temperature and the frequency of the test target according to the initial theoretical relation of the temperature and the frequency and the initial fixed coefficient.
6. The method of claim 1, wherein the test data comprises test temperature data, test frequency data, and target frequency data, the obtaining of the test data of the test target, and the obtaining of the actual compensation relationship between the temperature and the frequency of the test target according to the test data and an initial fixed coefficient comprises:
acquiring test temperature data, test frequency data and target frequency data of a test target;
obtaining the relation among the test temperature data, the test frequency data and the target frequency data;
obtaining an actual relation between the temperature and the frequency according to the test temperature data, the test frequency data, the target frequency data and the relation;
and obtaining the actual compensation relation of the temperature and the frequency of the test target according to the actual relation of the temperature and the frequency and the initial fixed coefficient.
7. The method of any one of claims 1 to 6, wherein determining a target compensation relationship for temperature and frequency based on the target fixed coefficient comprises:
obtaining a target non-fixed coefficient according to the target fixed coefficient;
and obtaining a target compensation relation between the temperature and the frequency according to the target non-fixed coefficient.
8. A crystal oscillator-based temperature compensation apparatus, comprising:
the acquisition module is used for acquiring an initial non-fixed coefficient and an initial fixed coefficient and establishing an initial theoretical compensation relation between the temperature and the frequency of a test target according to the initial non-fixed coefficient and the initial fixed coefficient;
the acquisition module is further used for acquiring the test data of the test target and obtaining the actual compensation relation between the temperature and the frequency of the test target according to the test data and the initial fixed coefficient;
the judging module is used for determining a target fixed coefficient according to the initial theoretical compensation relation and the actual compensation relation of the temperature and the frequency;
the judging module is also used for determining a target compensation relation between the temperature and the frequency according to the target fixed coefficient;
and the compensation module is used for compensating the target to be compensated according to the target compensation relation between the temperature and the frequency.
9. A crystal oscillator-based temperature compensation apparatus, the apparatus comprising: a memory, a processor, and a crystal oscillator-based temperature compensation program stored on the memory and executable on the processor, the crystal oscillator-based temperature compensation program configured to implement the steps of the crystal oscillator-based temperature compensation method of any one of claims 1 to 7.
10. A storage medium having stored thereon a crystal oscillator-based temperature compensation program, the crystal oscillator-based temperature compensation program when executed by a processor implementing the steps of the crystal oscillator-based temperature compensation method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210850538.6A CN115085721A (en) | 2022-07-20 | 2022-07-20 | Temperature compensation method, device, equipment and storage medium based on crystal oscillator |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210850538.6A CN115085721A (en) | 2022-07-20 | 2022-07-20 | Temperature compensation method, device, equipment and storage medium based on crystal oscillator |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115085721A true CN115085721A (en) | 2022-09-20 |
Family
ID=83259478
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210850538.6A Pending CN115085721A (en) | 2022-07-20 | 2022-07-20 | Temperature compensation method, device, equipment and storage medium based on crystal oscillator |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115085721A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116223906A (en) * | 2022-12-30 | 2023-06-06 | 广东惠伦晶体科技股份有限公司 | Temperature compensation crystal oscillator test method, circuit and system capable of achieving frequency calibration |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005347929A (en) * | 2004-06-01 | 2005-12-15 | Matsushita Electric Ind Co Ltd | Temperature compensating crystal oscillator and its adjustment method |
CN101604970A (en) * | 2009-07-02 | 2009-12-16 | 广州市天马电讯科技有限公司 | Self-fitting digital temperature compensation crystal oscillistor and system thereof and implementation method |
CN105467242A (en) * | 2015-12-09 | 2016-04-06 | 张宇恒 | A production testing system of digital temperature compensated crystal oscillators and a debugging method thereof |
-
2022
- 2022-07-20 CN CN202210850538.6A patent/CN115085721A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005347929A (en) * | 2004-06-01 | 2005-12-15 | Matsushita Electric Ind Co Ltd | Temperature compensating crystal oscillator and its adjustment method |
CN101604970A (en) * | 2009-07-02 | 2009-12-16 | 广州市天马电讯科技有限公司 | Self-fitting digital temperature compensation crystal oscillistor and system thereof and implementation method |
CN105467242A (en) * | 2015-12-09 | 2016-04-06 | 张宇恒 | A production testing system of digital temperature compensated crystal oscillators and a debugging method thereof |
Non-Patent Citations (1)
Title |
---|
徐磊: "一种高精度温度补偿晶体振荡器的算法研究及电路实现", 《中国优秀硕士学位论文全文数据库》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116223906A (en) * | 2022-12-30 | 2023-06-06 | 广东惠伦晶体科技股份有限公司 | Temperature compensation crystal oscillator test method, circuit and system capable of achieving frequency calibration |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114928355B (en) | Voltage compensation method, device and equipment based on crystal oscillator and storage medium | |
TW525349B (en) | System and method for programming oscillators | |
US8471619B2 (en) | Circuit and method for generating a clock signal | |
KR100687230B1 (en) | Real time clock apparatus and the real time compensating method thereof | |
US20200328718A1 (en) | Systems and methods for frequency compensation of real-time-clock systems | |
CN101452307B (en) | System and method of calibrating real time clock | |
KR20050014666A (en) | Semiconductor integrated circuit | |
JPH0346014A (en) | Integrated circuit with microprocessor and programmable internal clock | |
CN106292839A (en) | Real-time clock compensates circuit and calibration steps, device | |
CN115085721A (en) | Temperature compensation method, device, equipment and storage medium based on crystal oscillator | |
CN104297716A (en) | Intelligent electric meter RTC calibrating method | |
US10914643B2 (en) | System and method for modeling and correcting frequency of quartz crystal oscillator | |
US8674780B2 (en) | Oscillator with frequency adjustment | |
US20030174587A1 (en) | Method of correcting a real-time clock of an electronic apparatus | |
JP2002076774A (en) | Method for regulating temperature compensated oscillator | |
CN112083226A (en) | Frequency calibration method and device for electronic equipment, medium and electronic equipment | |
JP2011103564A (en) | Temperature-compensated piezoelectric oscillator, and method of adjusting frequency for the same | |
CN115133924A (en) | Frequency compensation method, device, equipment and storage medium based on crystal oscillator | |
CN109410815B (en) | Display panel, method for generating gray scale voltage of display panel and computer readable storage medium | |
CN114641072A (en) | Frequency adjustment method, frequency adjustment device, storage medium and electronic equipment | |
CN112737574A (en) | Timing calibration method of chip internal clock source and related device | |
JP2006303764A (en) | Temperature compensation method of temperature compensation oscillation circuit, temperature compensation oscillation circuit, piezoelectric device, and electronic apparatus | |
CN114826155B (en) | Temperature compensation method, system and terminal equipment | |
CN111628835B (en) | Communication module correcting method | |
US9093985B2 (en) | Portable control apparatus and method thereof for calibrating an oscillating circuit |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220920 |
|
RJ01 | Rejection of invention patent application after publication |