CN114866033B - Crystal oscillator aging compensation method and system, terminal device and storage medium - Google Patents

Crystal oscillator aging compensation method and system, terminal device and storage medium Download PDF

Info

Publication number
CN114866033B
CN114866033B CN202210482751.6A CN202210482751A CN114866033B CN 114866033 B CN114866033 B CN 114866033B CN 202210482751 A CN202210482751 A CN 202210482751A CN 114866033 B CN114866033 B CN 114866033B
Authority
CN
China
Prior art keywords
crystal oscillator
aging
aging compensation
minute
compensation amount
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210482751.6A
Other languages
Chinese (zh)
Other versions
CN114866033A (en
Inventor
陈功
刘搏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Gencotech Communication Equipment Co ltd
Original Assignee
Shenzhen Gencotech Communication Equipment Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Gencotech Communication Equipment Co ltd filed Critical Shenzhen Gencotech Communication Equipment Co ltd
Priority to CN202210482751.6A priority Critical patent/CN114866033B/en
Publication of CN114866033A publication Critical patent/CN114866033A/en
Application granted granted Critical
Publication of CN114866033B publication Critical patent/CN114866033B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03BGENERATION OF OSCILLATIONS, DIRECTLY OR BY FREQUENCY-CHANGING, BY CIRCUITS EMPLOYING ACTIVE ELEMENTS WHICH OPERATE IN A NON-SWITCHING MANNER; GENERATION OF NOISE BY SUCH CIRCUITS
    • H03B5/00Generation of oscillations using amplifier with regenerative feedback from output to input
    • H03B5/02Details
    • H03B5/04Modifications of generator to compensate for variations in physical values, e.g. power supply, load, temperature
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R23/00Arrangements for measuring frequencies; Arrangements for analysing frequency spectra
    • G01R23/02Arrangements for measuring frequency, e.g. pulse repetition rate; Arrangements for measuring period of current or voltage
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/28Testing of electronic circuits, e.g. by signal tracer
    • G01R31/282Testing of electronic circuits specially adapted for particular applications not provided for elsewhere
    • G01R31/2822Testing of electronic circuits specially adapted for particular applications not provided for elsewhere of microwave or radiofrequency circuits
    • G01R31/2824Testing of electronic circuits specially adapted for particular applications not provided for elsewhere of microwave or radiofrequency circuits testing of oscillators or resonators

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Oscillators With Electromechanical Resonators (AREA)

Abstract

The application relates to a crystal oscillator aging compensation method, a crystal oscillator aging compensation system, terminal equipment and a storage medium, wherein the method comprises the following steps: acquiring test frequency data of the crystal oscillator based on a preset frequency sampling rule; calculating the test frequency data based on a least square method to obtain a daily aging rate value, and acquiring a daily aging compensation amount based on the daily aging rate value; acquiring program running times, and optimizing the daily aging compensation quantity based on the program running times to obtain a minute aging compensation quantity; and acquiring a minute compensation voltage based on the minute aging compensation amount, and executing aging compensation operation of the crystal oscillator based on the minute compensation voltage. The method and the device have the advantages that the accuracy of crystal oscillator aging compensation is improved, and the crystal oscillator outputs an accurate frequency value.

Description

Crystal oscillator aging compensation method and system, terminal device and storage medium
Technical Field
The present application relates to the field of crystal oscillator technologies, and in particular, to a method and a system for compensating aging of a crystal oscillator, a terminal device, and a storage medium.
Background
A crystal oscillator, which is generally called a crystal oscillator, has four pins and directions, power, mass and clock output pins, and contains a crystal and an oscillation circuit. The crystal oscillator can directly output frequency signals without inputting a signal source.
In the continuous use process of the crystal oscillator, the resonant frequency is influenced by aging of components and parts and changes of surrounding environment and load energy, the resonant frequency of the crystal generally tends to increase monotonically or gradually along with the increase of working time, and the rate of the change of the resonant frequency of the quartz crystal along with the change of the running time is called the aging of the crystal, namely the aging of the crystal oscillator.
In order to reduce the influence caused by the aging of the crystal oscillator, the aging compensation of the crystal oscillator is needed. The conventional method for aging compensation of the crystal oscillator comprises the following steps: after the crystal oscillator operates for a certain time, the aging rate of the crystal oscillator is measured, the compensation quantity is linearly derived according to the aging rate, and then the voltage-controlled end voltage of the crystal oscillator is directly adjusted (usually once a year) manually to perform aging compensation.
However, in the actual use process, the aging rate of the crystal oscillator changes nonlinearly, and the direct linear derivation by the compensation method in the prior art is not accurate enough, so that the problem of excessive compensation may exist, and even the state of the crystal oscillator deteriorates.
Disclosure of Invention
In order to improve the accuracy of crystal oscillator aging compensation and enable the crystal oscillator to output an accurate frequency value, the application provides a crystal oscillator aging compensation method, a crystal oscillator aging compensation system, a terminal device and a storage medium.
In a first aspect, the present application provides a crystal oscillator aging compensation method, which adopts the following technical scheme:
a crystal oscillator aging compensation method comprises the following steps:
acquiring test frequency data of the crystal oscillator based on a preset frequency sampling rule;
calculating the test frequency data based on a least square method to obtain a daily aging rate value, and acquiring a daily aging compensation amount based on the daily aging rate value;
acquiring the program running times, and optimizing the daily aging compensation quantity based on the program running times to obtain a minute aging compensation quantity;
and acquiring a minute compensation voltage based on the minute aging compensation amount, and executing aging compensation operation of the crystal oscillator based on the minute compensation voltage.
By adopting the technical scheme, the daily aging rate value is calculated by obtaining the recent test frequency data of the crystal oscillator to be subjected to aging compensation, the daily aging rate value is accurate, the daily aging compensation amount is obtained according to the daily aging rate value, the daily aging compensation amount is distributed to the minute aging compensation amount through further calculation and optimization, minute compensation voltage is obtained according to the minute aging compensation amount, and finally minute compensation voltage is output to the crystal oscillator to realize minute-level aging compensation of the crystal oscillator frequency value, so that the compensation process is more accurate and stable, and the crystal oscillator frequency value is more flexible.
Optionally, the preset frequency sampling rule includes sampling time, sampling times and a first-in first-out principle, and the obtaining of the test frequency data of the crystal oscillator based on the preset frequency sampling rule includes the following steps:
when the crystal oscillator operates stably, acquiring frequency sample data of the crystal oscillator from the 1 st day to the Nth day based on the sampling time and the sampling times, and taking all the frequency sample data as test frequency data;
when frequency sample data of the (N + 1) th day is obtained, iterating the test frequency data based on the first-in first-out principle, and taking the frequency sample data of the (2) th day to the (N + 1) th day as the test frequency data;
wherein N is an integer greater than or equal to 2.
By adopting the technical scheme, the recent frequency sample data is iteratively acquired as the test frequency data, and the daily aging compensation amount can be accurately deduced.
Optionally, the optimizing the daily aging compensation amount based on the program running times to obtain a minute aging compensation amount includes the following steps:
acquiring the running times of a program;
based on the program running times, the daily aging compensation amount is subjected to apportionment processing to obtain an hourly aging compensation amount;
a minute aging compensation amount is obtained based on the hour aging compensation amount.
By adopting the technical scheme, the daily aging compensation amount is distributed to the minute aging compensation amount, so that the possibility of excessive compensation is reduced.
Optionally, the performing aging compensation operation of the crystal oscillator based on the minute compensation voltage includes the following steps:
when N is less than or equal to 100, performing aging compensation operation of the crystal oscillator on the N +1 th day based on the minute compensation voltage;
and when N is more than 100 and less than or equal to 365, the minute compensation voltage is 0, and the aging compensation operation of the crystal oscillator is stopped.
By adopting the technical scheme, the aging compensation is carried out on the crystal oscillator in the previous 100 days in one year, and the possibility of excessive compensation can be further reduced.
In a second aspect, the present application further provides a crystal oscillator aging compensation system, which adopts the following technical scheme:
a crystal oscillator aging compensation system comprises an acquisition module, a calculation module, an optimization module and a compensation module, wherein the calculation module is connected with the acquisition module, the optimization module is connected with the calculation module, and the compensation module is connected with the optimization module;
the acquisition module is used for acquiring test frequency data of the crystal oscillator based on a preset frequency sampling rule;
the calculation module is used for calculating the test frequency data based on a least square method to obtain a daily aging rate value and acquiring a daily aging compensation amount based on the daily aging rate value;
the optimization module is used for acquiring program running times, and optimizing the daily aging compensation quantity based on the program running times to obtain minute aging compensation quantity;
and the compensation module is used for acquiring minute compensation voltage based on the minute aging compensation amount and executing aging compensation operation of the crystal oscillator based on the minute compensation voltage.
By adopting the technical scheme, the calculation module calculates the daily aging rate value through the recent test frequency data of the crystal oscillator to be aged and compensated, which is acquired by the acquisition module, the calculation module is more accurate, the optimization module obtains the daily aging compensation amount according to the daily aging rate value, the daily aging compensation amount is further calculated and optimized, the daily aging compensation amount is distributed to the minute aging compensation amount, minute compensation voltage is obtained according to the minute aging compensation amount, the minute-level aging compensation of the crystal oscillator frequency value is realized by outputting the minute compensation voltage to the crystal oscillator through the final compensation module, the compensation process is more accurate and stable, and the compensation process is more flexible.
Optionally, the preset frequency sampling rule includes sampling time, sampling times and a first-in first-out principle, the obtaining module includes an obtaining unit and an iteration unit, and the iteration unit is connected to the obtaining unit;
the acquisition unit is used for acquiring frequency sample data of the crystal oscillator from 1 st day to Nth day based on the sampling time and the sampling times after the crystal oscillator operates stably, and taking all the frequency sample data as test frequency data;
the iteration unit is used for iterating the test frequency data based on the first-in first-out principle when frequency sample data of the (N + 1) th day is obtained, and taking the frequency sample data of the (2) th day to the (N + 1) th day as the test frequency data;
wherein N is an integer greater than or equal to 2.
By adopting the technical scheme, the recent frequency sample data is iteratively acquired as the test frequency data, and the daily aging compensation amount can be accurately deduced.
Optionally, the optimization module includes an estimation unit, an hour unit and a minute unit, the hour unit is connected to the estimation unit, and the minute unit is connected to the hour unit;
the pre-estimation unit is used for acquiring the running times of the program;
the hour unit is used for allocating the daily aging compensation amount based on the program running times to obtain an hour aging compensation amount;
the minute unit is used for obtaining minute aging compensation amount based on the hour aging compensation amount.
By adopting the technical scheme, the daily aging compensation amount is shared to the minute aging compensation amount, and the possibility of excessive compensation is reduced.
In a third aspect, the present application provides a terminal device, which adopts the following technical solution:
a terminal device comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein when the processor loads and executes the computer program, the crystal oscillator aging compensation method is adopted.
By adopting the technical scheme, the computer program is generated by the crystal oscillator aging compensation method and stored in the memory so as to be loaded and executed by the processor, so that the terminal equipment is manufactured according to the memory and the processor, and the use is convenient.
In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solutions:
a computer-readable storage medium, in which a computer program is stored, which, when loaded and executed by a processor, implements a crystal aging compensation method as described above.
By adopting the technical scheme, the crystal oscillator aging compensation method generates the computer program, the computer program is stored in the computer readable storage medium to be loaded and executed by the processor, and the computer program can be conveniently read and stored through the computer readable storage medium.
Drawings
Fig. 1 is a schematic diagram of connection of peripheral devices according to an embodiment of the present application.
Fig. 2 is a schematic overall flowchart of a crystal aging compensation method according to an embodiment of the present disclosure.
Fig. 3 is a schematic flow chart illustrating steps S201 to S202 in a crystal aging compensation method according to an embodiment of the present application.
Fig. 4 is a schematic flow chart illustrating steps S301 to S303 in a crystal aging compensation method according to an embodiment of the present application.
Fig. 5 is a schematic flow chart illustrating steps S401 to S402 in a crystal aging compensation method according to an embodiment of the present application.
Fig. 6 is a schematic block diagram of a crystal aging compensation system according to an embodiment of the present application.
Description of reference numerals:
1. an acquisition module; 11. an acquisition unit; 12. an iteration unit; 2. a calculation module; 3. an optimization module; 31. a pre-estimation unit; 32. an hour unit; 33. a minute unit; 4. and a compensation module.
Detailed Description
The present application is described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, the present application relates to a peripheral device including: the crystal oscillator comprises a single chip microcomputer or an MCU, peripheral frequency testing equipment, upper computer software and a crystal oscillator with a pressure control frequency adjusting function, wherein the peripheral frequency testing equipment is used for obtaining testing frequency data of the crystal oscillator, the testing frequency data are uploaded to the single chip microcomputer through the upper computer, the daily aging rate value of the crystal oscillator is calculated based on the testing frequency data, the single chip microcomputer obtains aging compensation quantity based on the daily aging rate value, and compensation voltage is output through a digital-to-analog conversion unit of the single chip microcomputer to compensate a frequency difference value for the crystal oscillator.
The embodiment of the application discloses a crystal oscillator aging compensation method, which refers to fig. 2 and comprises the following steps:
s101, acquiring test frequency data of a crystal oscillator based on a preset frequency sampling rule;
s102, calculating the test frequency data based on a least square method to obtain a daily aging rate value, and acquiring a daily aging compensation amount based on the daily aging rate value;
s103, acquiring program running times, and optimizing a daily aging rate value based on the program running times to obtain a minute aging compensation amount;
and S104, acquiring a minute compensation voltage based on the minute aging compensation amount, and executing the aging compensation operation of the crystal oscillator based on the minute compensation voltage.
Step S101, firstly, initializing a singlechip pin and a crystal oscillator pin, and then acquiring test frequency data of the crystal oscillator according to a preset frequency sampling rule. In this embodiment, the peripheral frequency testing device is used to acquire frequency data of the crystal oscillator, and the acquired frequency data is transmitted to the computer end through the upper computer software and stored. The preset frequency sampling rule includes sampling time, sampling times and a first-in first-out principle, and referring to fig. 3, the step of specifically acquiring the test frequency data includes:
s201, when the crystal oscillator operates stably, obtaining frequency sample data of the crystal oscillator from the 1 st day to the Nth day based on sampling time and sampling times, and taking all the frequency sample data as test frequency data;
s202, when frequency sample data of the (N + 1) th day is obtained, iteration is carried out on the test frequency data on the basis of a first-in first-out principle, the frequency sample data of the (2) th day to the (N + 1) th day are used as the test frequency data, and N is an integer larger than or equal to 2.
Specifically, before obtaining the frequency sample data of the crystal oscillator, firstly, the crystal oscillator is ensured to operate continuously after a certain period of time, and unstable factors during initial operation of the crystal oscillator are eliminated, so that the obtained frequency sample data is relatively stable, and the frequency sample data acquisition operation is executed after the crystal oscillator operates continuously for 3 days.
After the crystal oscillator stably operates, obtaining frequency sample data from the 1 st day to the nth day of the crystal oscillator operation time, in this embodiment, setting N to be 7, setting the sampling time of the peripheral frequency testing device to be 10s/24h/7d, and setting the sampling frequency to be 168 times, specifically: the real-time frequency value of the crystal oscillator is obtained once per second, after 10 seconds, 10 real-time frequency values can be obtained, the average value of the 10 real-time frequency values is taken as current-period frequency sample data to form one-time sampling, the sampling period is set to be 1h, the frequency sample data can be obtained once per hour, namely 24 frequency sample data can be obtained in 24 periods in 1 day. When acquiring the test frequency data from day 1 to day 7, 168 frequency sample data are required to be continuously measured for 7 days as the test frequency data. The test frequency data of the 7 days are analyzed, so that a daily aging rate value can be accurately deduced, and the aging compensation amount of the 8 th day can be estimated.
When the frequency sample data of the 8 th day is obtained, 168 frequency sample data of 7 days from the 2 nd day to the 8 th day are selected according to the first-in first-out principle to be used as new test frequency data.
And step S102, after the test frequency data is obtained, calculating the test frequency to obtain the daily aging rate value of the crystal oscillator and reflect the aging condition of the crystal oscillator. In this embodiment, the daily aging rate value K of the crystal oscillator is calculated by using a least square method, and the basic formula is as follows:
Figure DEST_PATH_IMAGE001
n-number of measurements per day; n-number of samples: the crystal oscillator output frequency value measured at the fi-ti moment; ti-sampling time sequence, which is expressed by natural number sequence, and storing the calculated result into the FLASH FLASH memory of the single chip microcomputer.
Step S103, the daily aging compensation amount of the crystal oscillator can be obtained through the daily aging rate value, and in the prior art, the frequency compensation can be performed on the crystal oscillator according to the daily aging compensation amount. In this embodiment, in order to reduce the possibility of excessive compensation, the daily aging compensation amount is apportioned, and referring to fig. 4, the method includes the following steps:
s301, acquiring the running times of the program;
s302, carrying out apportionment processing on the daily aging compensation amount based on the program running times to obtain an hourly aging compensation amount;
s303, obtaining the minute aging compensation amount based on the hour aging compensation amount.
The number of times of program circulation operation within 24 hours can be accurately recorded through a timer in the single chip microcomputer, namely the program operation frequency A, and if the program operation frequency A is assumed to be operated 3 times every day from 1 st day to 7 th day, the program operation frequency A estimated on the 8 th day is also estimated to be operated 3 times.
In order to reduce the possibility of excessive compensation, a certain proportion of the daily aging compensation amount is divided by the program running times A and then divided by 24 hours to obtain an hour aging compensation amount B: b = daily aging offset/(24 × a). And (4) distributing the aging compensation amount corrected once per hour. In the embodiment, 1/2 of daily aging compensation amount is adopted for calculation, and in other embodiments, other proportions, such as 1/3, can be adopted according to actual conditions.
Further, in order to reduce the short-time stability effect, the embodiment further allocates the hourly aging compensation amount, and divides the hourly aging compensation amount by 30, so that the hourly aging compensation amount can be divided into minute aging compensation amounts C: c = B/30, i.e., the minute aging compensation amount is output every two minutes. The short stability is a measurement index of the frequency stability of the crystal oscillator, the industry generally describes that the crystal oscillator has the second stability, the 10 second stability and the 100 second stability, the frequency change of each second (10 seconds and 100 seconds) is represented, and the calculation is carried out by using an Allen variance formula.
And step S104, referring to the figure, after the minute aging compensation amount is determined, the single chip microcomputer obtains the minute aging compensation amount, a digital signal is converted into an analog minute compensation voltage according to the minute aging compensation amount through a digital-to-analog conversion function in the single chip microcomputer, the minute compensation voltage acts on a voltage control pin of the crystal oscillator after low-pass filtering, the output frequency of the crystal oscillator is adjusted, and the purpose of aging compensation is achieved.
Specifically, referring to fig. 5, step S104 further includes the steps of:
s401, when N is less than or equal to 100, executing aging compensation operation of the crystal oscillator in the (N + 1) th day based on the minute compensation voltage;
s402, when N is more than 100 and less than or equal to 365, the minute compensation voltage is 0, and the aging compensation operation of the crystal oscillator is stopped.
Generally, in the prior art, the age rate of the crystal oscillator is calculated to be 100 times of the daily aging rate, and when the daily aging rate is known, the age rate is 100 × the daily aging rate. Since the crystal oscillator is used initially, the early-stage aging is more obvious than the later-stage aging, the crystal oscillator changes rapidly in a short period, and the aging rate of the crystal oscillator gradually decreases with the passage of time and finally approaches to be stable, the embodiment sets the aging compensation operation on the crystal oscillator in the first 100 days of the first year. The crystal oscillator is compensated within 100 days, namely the annual aging rate of the crystal oscillator is compensated to a great extent, and the aging degree of the crystal oscillator is negligible within 101-365 days, so that the crystal oscillator is not compensated.
Specifically, when N is less than or equal to 100, the singlechip calculates the minute compensation voltage, and the minute compensation voltage is subjected to low-pass filtering and then acts on a voltage control pin of the crystal oscillator to perform frequency aging compensation on the crystal oscillator in operation, so that the normal output of the crystal oscillator is ensured. That is, in the process of crystal oscillator operation, minute compensation voltage is output to the crystal oscillator once every 2 minutes, so that minute-level aging compensation is realized. Compared with the prior art that the annual aging rate of the crystal oscillator is directly compensated mechanically, the method is more flexible and accurate, and meanwhile, relevant personnel can correct the crystal oscillator conveniently at any time, so that the working quality and efficiency of the crystal oscillator are improved.
And when N is more than 100 and less than or equal to 365, determining that the annual aging rate of the crystal oscillator is compensated, and not performing aging compensation.
More specifically, generally, the 10-year aging rate of the crystal oscillator is 4.6 times the daily aging rate, so it can be known from the above-described method for determining the annual aging rate value that the 10-year aging rate value only needs to be compensated for the annual aging rate of the previous 4.6 years.
The implementation principle of the crystal oscillator aging compensation method in the embodiment of the application is as follows: the daily aging rate value is calculated by acquiring the recent test frequency data of the crystal oscillator to be aged and compensated, the daily aging compensation amount is obtained according to the daily aging rate value, the daily aging compensation amount is shared to the minute aging compensation amount through further calculation and optimization, minute compensation voltage is obtained according to the minute aging compensation amount, minute-level aging compensation of the crystal oscillator frequency value is finally realized by outputting the minute compensation voltage to the crystal oscillator, the compensation process is more accurate and stable, and the crystal oscillator frequency value is more flexible.
The application further provides a crystal oscillator aging compensation system, which refers to fig. 6 and comprises an acquisition module 1, a calculation module 2, an optimization module 3 and a compensation module 4, wherein the calculation module 2 is connected with the acquisition module 1, the optimization module 3 is connected with the calculation module 2, and the compensation module 4 is connected with the optimization module 3.
Firstly, initializing a pin of a single chip microcomputer and a pin of a crystal oscillator, and then acquiring test frequency data of the crystal oscillator by an acquisition module 1 according to a preset frequency sampling rule.
Before obtaining the frequency sample data of the crystal oscillator, firstly, the continuous power-on operation of the crystal oscillator for a certain time is ensured, and the unstable factor during the initial operation of the crystal oscillator is eliminated, so that the obtained frequency sample data is relatively stable, and the frequency sample data acquisition work is executed after the continuous 3-day power-on operation of the crystal oscillator.
Specifically, the obtaining module 1 includes an obtaining unit 11 and an iteration unit 12, the iteration unit 12 is connected to the obtaining unit 11, the obtaining unit 11 is a peripheral frequency testing device, obtains frequency data of the crystal oscillator, and transmits the obtained frequency data to a computer end through upper computer software and stores the frequency data.
More specifically, the preset frequency sampling rule includes a sampling time, a sampling number and a first-in first-out principle. After the crystal oscillator stably operates, the obtaining unit 11 obtains frequency sample data of the crystal oscillator operating time from day 1 to day N, where N is set to be 7 in this embodiment, the sampling time of the peripheral frequency testing device is 10s/24h/7d, and the number of sampling times is set to be 168 times, specifically: the real-time frequency value of the crystal oscillator is obtained once per second, after 10 seconds, 10 real-time frequency values can be obtained, the average value of the 10 real-time frequency values is taken as current-period frequency sample data to form one-time sampling, the sampling period is set to be 1h, the frequency sample data can be obtained once per hour, namely 24 frequency sample data can be obtained in 24 periods in 1 day. When the test frequency data of the 1 st day to the 7 th day is acquired, 168 pieces of frequency sample data are required to be continuously measured for 7 days as the test frequency data. The test frequency data of the 7 days are analyzed, so that the daily aging rate value can be accurately deduced, and the aging compensation amount of the 8 th day can be estimated.
Specifically, when acquiring the frequency sample data of the 8 th day, the iteration unit 12 selects 168 frequency sample data of 7 days from the 2 nd day to the 8 th day as new test frequency data according to the first-in first-out principle.
The calculation module 2 is used for calculating the test frequency data based on a least square method to obtain a daily aging rate value, and obtaining a daily aging compensation amount based on the daily aging rate value.
Specifically, the calculation module 2 may be a single chip microcomputer, and after the test frequency data is obtained, the calculation module 2 calculates the test frequency to obtain the daily aging rate value of the crystal oscillator, so as to reflect the aging condition of the crystal oscillator. In this embodiment, the daily aging rate value K of the crystal oscillator is calculated by using a least square method, and the basic formula is as follows:
wherein n represents the number of measurements per day; n-number of samples: the crystal oscillator output frequency value measured at the fi-ti moment; and ti-sampling time sequence expressed by a natural number sequence, storing the daily aging rate value into a FLASH FLASH memory of the singlechip, and calculating to obtain the daily aging compensation quantity according to the daily aging rate value.
The optimization module 3 is configured to obtain the program running times, and optimize the daily aging compensation amount based on the program running times to obtain the minute aging compensation amount.
Specifically, the optimization module 3 includes an estimation unit 31, an hour unit 32 and a minute unit 33, where the hour unit 32 is connected to the estimation unit 31, the minute unit 33 is connected to the hour unit 32, and the estimation unit 31 is used to obtain the program running times; the hour unit 32 is configured to perform apportionment processing on the daily aging rate value based on the program running times to obtain an hour aging compensation amount; the minute unit 33 is used to derive a minute aging compensation amount based on the hour aging compensation amount.
More specifically, how many times the program runs in a circulating manner in 24 hours, that is, the program running time a, can be accurately recorded by a timer in the single chip microcomputer, and if the program runs 3 times each day from day 1 to day 7, the estimation unit 31 estimates that the program running time a on day 8 is also running 3 times.
More specifically, to reduce the likelihood of overcompensation, the hourly unit 32 divides the daily aging compensation by the number of program runs A by 24 hours to obtain an hourly aging compensation B: b = daily aging compensation amount/(24A), and is divided into aging compensation amounts corrected once per hour. In the embodiment, 1/2 of the daily aging compensation amount is adopted for calculation, and in other embodiments, other proportions, such as 1/3, can be adopted according to actual conditions.
More specifically, to reduce the effects of the transient, the hour unit 32 further apportions the hour aging compensation amount by dividing the hour aging compensation amount by 30, and the hour aging compensation amount can be divided into minute aging compensation amounts C: c = B/30, i.e., the minute aging offset is output every two minutes. The short stability is a measurement index of the frequency stability of the crystal oscillator, the industry generally describes that the crystal oscillator has the second stability, the 10 second stability and the 100 second stability, the frequency change of each second (10 seconds and 100 seconds) is represented, and the calculation is carried out by using an Allen variance formula.
After the minute aging compensation amount is determined, the compensation module 4 obtains the minute aging compensation amount through the single chip microcomputer, converts a digital signal into an analog minute compensation voltage according to the minute aging compensation amount through a digital-to-analog conversion function in the single chip microcomputer, and the minute compensation voltage acts on a voltage control pin of the crystal oscillator after low-pass filtering to adjust the output frequency of the crystal oscillator so as to achieve the purpose of aging compensation.
Generally, in the prior art, the age rate of the crystal oscillator is calculated to be 100 times of the daily aging rate, and when the daily aging rate is known, the age rate is 100 × the daily aging rate. Since the crystal oscillator has a large aging effect in a short period after initial use, the aging degree is more stable with use. The present embodiment sets the aging compensation operation of the crystal oscillator by the compensation module 4 on the first 100 days of the first year. The crystal oscillator is compensated within 100 days, namely the aging rate of the crystal oscillator is compensated to a great extent, and the aging rate of the crystal oscillator is negligible within 101-365 days, so that the crystal oscillator does not need to be compensated.
Specifically, when N is less than or equal to 100, the optimization module 3 calculates a minute compensation voltage, and the compensation module 4 performs low-pass filtering on the minute compensation voltage and then acts on a voltage-controlled pin of the crystal oscillator to perform frequency aging compensation on the crystal oscillator in operation, thereby ensuring normal output of the crystal oscillator. That is, in the process of crystal oscillator operation, minute compensation voltage is output to the crystal oscillator once every 2 minutes, thereby realizing minute-level aging compensation. Compared with the prior art that the mechanical compensation of the aging rate of the crystal oscillator is directly carried out, the method is more flexible and accurate, and meanwhile, relevant personnel can conveniently correct the crystal oscillator at any time, so that the working quality and efficiency of the crystal oscillator are improved.
And when N is more than 100 and less than or equal to 365, determining that the annual aging rate of the crystal oscillator is compensated, and not performing aging compensation.
More specifically, the 10-year-old rate of the crystal oscillator is generally 4.6 times the daily-old rate, and therefore, it can be known from the above-described determination method of the annual-old rate value that the 10-year-old rate value only needs to be compensated for the annual-old rate of the first 4.6 years.
The implementation principle of the crystal oscillator aging compensation system is as follows: the calculation module 2 calculates a daily aging rate value through the recent test frequency data of the crystal oscillator to be aged, which is acquired by the acquisition module 1, the calculation module is accurate, the optimization module 3 obtains a daily aging compensation amount according to the daily aging rate value, the daily aging compensation amount is distributed to a minute aging compensation amount through further calculation and optimization, minute compensation voltage is obtained according to the minute aging compensation amount, and finally the compensation module 4 realizes minute-level aging compensation of the crystal oscillator frequency value by outputting the minute compensation voltage to the crystal oscillator, so that the compensation process is more accurate and stable, and the compensation process is more flexible.
The embodiment of the application also discloses a terminal device, which comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein when the processor executes the computer program, the crystal oscillator aging compensation method in the embodiment is adopted.
The terminal device may adopt a computer device such as a desktop computer, a notebook computer, or a cloud server, and includes but is not limited to a processor and a memory, for example, the terminal device may further include an input/output device, a network access device, a bus, and the like.
The processor may be a Central Processing Unit (CPU), and of course, according to an actual use situation, other general processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), ready-made programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like may also be used, and the general processor may be a microprocessor or any conventional processor, and the application does not limit the present invention.
The memory may be an internal storage unit of the terminal device, for example, a hard disk or a memory of the terminal device, or an external storage device of the terminal device, for example, a plug-in hard disk, a Smart Memory Card (SMC), a secure digital card (SD) or a flash memory card (FC) equipped on the terminal device, and the memory may also be a combination of the internal storage unit of the terminal device and the external storage device, and the memory is used for storing a computer program and other programs and data required by the terminal device, and the memory may also be used for temporarily storing data that has been output or will be output, which is not limited in this application.
The crystal oscillator aging compensation method in the embodiment is stored in a memory of the terminal device through the terminal device, and is loaded and executed on a processor of the terminal device, so that the terminal device is convenient to use.
The embodiment of the application also discloses a computer readable storage medium, and the computer readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the crystal oscillator aging compensation method in the above embodiment is adopted.
The computer program may be stored in a computer readable medium, the computer program includes computer program code, the computer program code may be in a source code form, an object code form, an executable file or some intermediate form, and the like, the computer readable medium includes any entity or device capable of carrying the computer program code, a recording medium, a usb disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a Read Only Memory (ROM), a Random Access Memory (RAM), an electrical carrier signal, a telecommunication signal, a software distribution medium, and the like, and the computer readable medium includes but is not limited to the above components.
The crystal oscillator aging compensation method in the above embodiment is stored in a computer-readable storage medium through the computer-readable storage medium, and is loaded and executed on a processor, so as to facilitate storage and application of the method.
The above embodiments are preferred embodiments of the present application, and the protection scope of the present application is not limited by the above embodiments, so: equivalent changes in structure, shape and principle of the present application shall be covered by the protection scope of the present application.

Claims (4)

1. A crystal oscillator aging compensation method is characterized by comprising the following steps:
when the crystal oscillator operates stably, acquiring frequency sample data of the crystal oscillator from the 1 st day to the Nth day based on sampling time and sampling times, and taking all the frequency sample data as test frequency data;
when frequency sample data of the (N + 1) th day is obtained, iterating the test frequency data based on a first-in first-out principle, and taking the frequency sample data of the (2) th day to the (N + 1) th day as the test frequency data, wherein N is an integer greater than or equal to 2;
calculating the test frequency data based on a least square method to obtain a daily aging rate value, and acquiring a daily aging compensation amount based on the daily aging rate value;
acquiring the running times of a program;
based on the program running times, the daily aging compensation amount is subjected to apportionment processing to obtain an hourly aging compensation amount;
obtaining a minute aging compensation amount based on the hour aging compensation amount;
when N is less than or equal to 100, executing the aging compensation operation of the crystal oscillator on the N +1 th day based on the minute aging compensation amount;
and when N is more than 100 and less than or equal to 365, the minute aging compensation amount is 0, and the aging compensation operation of the crystal oscillator is stopped.
2. The crystal oscillator aging compensation system is characterized by comprising an acquisition module (1), a calculation module (2), an optimization module (3) and a compensation module (4), wherein the calculation module (2) is connected with the acquisition module (1), the optimization module (3) is connected with the calculation module (2), and the compensation module (4) is connected with the optimization module (3);
the acquisition module (1) is used for acquiring test frequency data of the crystal oscillator based on a preset frequency sampling rule;
the calculation module (2) is used for calculating the test frequency data based on a least square method to obtain a daily aging rate value, and acquiring a daily aging compensation amount based on the daily aging rate value;
the optimization module (3) is used for acquiring the program running times, and optimizing the daily aging compensation amount based on the program running times to obtain the minute aging compensation amount;
the compensation module (4) is used for acquiring a minute compensation voltage based on the minute aging compensation amount and executing aging compensation operation of the crystal oscillator based on the minute compensation voltage;
the preset frequency sampling rule comprises sampling time, sampling times and a first-in first-out principle, the acquisition module (1) comprises an acquisition unit (11) and an iteration unit (12), and the iteration unit (12) is connected with the acquisition unit (11);
the acquisition unit (11) is configured to acquire frequency sample data of the crystal oscillator from the 1 st day to the nth day based on the sampling time and the sampling times after the crystal oscillator operates stably, and use all the frequency sample data as test frequency data;
the iteration unit (12) is configured to iterate the test frequency data based on the first-in first-out principle when frequency sample data of the (N + 1) th day is obtained, and take the frequency sample data of the (2) th day to the (N + 1) th day as the test frequency data;
wherein N is an integer greater than or equal to 2;
the optimization module (3) comprises an estimation unit (31), an hour unit (32) and a minute unit (33), wherein the hour unit (32) is connected with the estimation unit (31), and the minute unit (33) is connected with the hour unit (32);
the pre-estimation unit (31) is used for acquiring the running times of the program;
the hour unit (32) is used for allocating the daily aging compensation amount based on the program running times to obtain an hour aging compensation amount;
the minute unit (33) is used for obtaining a minute aging compensation amount based on the hour aging compensation amount;
when N is less than or equal to 100, executing the aging compensation operation of the crystal oscillator on the (N + 1) th day based on the minute aging compensation amount;
and when N is more than 100 and less than or equal to 365, the minute aging compensation amount is 0, and the aging compensation operation of the crystal oscillator is stopped.
3. A terminal device comprising a memory, a processor and a computer program stored in the memory and being capable of running on the processor, characterized in that the method as claimed in claim 1 is applied when the processor loads and executes the computer program.
4. A computer-readable storage medium, in which a computer program is stored, which, when loaded and executed by a processor, carries out the method of claim 1.
CN202210482751.6A 2022-05-05 2022-05-05 Crystal oscillator aging compensation method and system, terminal device and storage medium Active CN114866033B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210482751.6A CN114866033B (en) 2022-05-05 2022-05-05 Crystal oscillator aging compensation method and system, terminal device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210482751.6A CN114866033B (en) 2022-05-05 2022-05-05 Crystal oscillator aging compensation method and system, terminal device and storage medium

Publications (2)

Publication Number Publication Date
CN114866033A CN114866033A (en) 2022-08-05
CN114866033B true CN114866033B (en) 2023-01-13

Family

ID=82634794

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210482751.6A Active CN114866033B (en) 2022-05-05 2022-05-05 Crystal oscillator aging compensation method and system, terminal device and storage medium

Country Status (1)

Country Link
CN (1) CN114866033B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5548252A (en) * 1993-12-07 1996-08-20 Kabushiki Kaisha Meidensha Digital temperature compensated crystal oscillator
EP2493078A1 (en) * 2011-02-28 2012-08-29 Nihon Dempa Kogyo Co., Ltd. Oscillation device
WO2014161360A1 (en) * 2013-08-13 2014-10-09 中兴通讯股份有限公司 Method, device, and computer storage medium for compensating for synchronization clock signal
CN106936425A (en) * 2015-12-29 2017-07-07 普天信息技术有限公司 Clock frequency keeping method and device
CN110113005A (en) * 2019-04-11 2019-08-09 深圳市金科泰通信设备有限公司 5G standard source high-frequency crystal oscillator circuit

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203340020U (en) * 2013-06-04 2013-12-11 京信通信技术(广州)有限公司 Crystal oscillator frequency temperature compensation device
US10310548B2 (en) * 2016-11-07 2019-06-04 Microsoft Technology Licensing, Llc Expected lifetime management

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5548252A (en) * 1993-12-07 1996-08-20 Kabushiki Kaisha Meidensha Digital temperature compensated crystal oscillator
EP2493078A1 (en) * 2011-02-28 2012-08-29 Nihon Dempa Kogyo Co., Ltd. Oscillation device
WO2014161360A1 (en) * 2013-08-13 2014-10-09 中兴通讯股份有限公司 Method, device, and computer storage medium for compensating for synchronization clock signal
CN106936425A (en) * 2015-12-29 2017-07-07 普天信息技术有限公司 Clock frequency keeping method and device
CN110113005A (en) * 2019-04-11 2019-08-09 深圳市金科泰通信设备有限公司 5G standard source high-frequency crystal oscillator circuit

Also Published As

Publication number Publication date
CN114866033A (en) 2022-08-05

Similar Documents

Publication Publication Date Title
CN109581856B (en) Time synchronization and time keeping method based on high-performance crystal oscillator frequency calibration
US20200328718A1 (en) Systems and methods for frequency compensation of real-time-clock systems
US9430346B2 (en) Processor power measurement
CN114647178B (en) Automatic atomic clock calibration method and system based on Beidou and ground reference transmission
CN114553192A (en) Clock chip frequency compensation method and device, electronic equipment and storage medium
CN114201001A (en) Compensation method and device of real-time clock, terminal equipment and medium
US20180372797A1 (en) Leakage power characterization at high temperatures for an integrated circuit
CN114866033B (en) Crystal oscillator aging compensation method and system, terminal device and storage medium
CN114499521A (en) Signal calibration method and device, computer equipment and storage medium
WO2020015828A1 (en) Method and apparatus for digital quartz temperature and drift compensation for a sleep timer of a nb-iot device
US11035902B2 (en) Advanced fuel gauge
CN112083226A (en) Frequency calibration method and device for electronic equipment, medium and electronic equipment
CN112444671A (en) Electric energy metering method and device of electric energy meter based on instantaneous power and storage medium
EP3355626A1 (en) Method and apparatus for digital quartz temperature and drift compensation for a sleep timer of a nb-iot device
CN111200467B (en) Calibration method and device for wireless parameters of chip and electronic equipment
CN108572345B (en) Oscilloscope, and method and system for correcting frequency accuracy based on undersampling
CN111415066A (en) Risk assessment method and device
CN111157788A (en) Voltage influence amount compensation method, apparatus and storage medium
CN111189471A (en) Correction method, correction device and computer storage medium
CN116185128B (en) MCU chip internal clock calibration method and circuit
CN116660752B (en) Battery interface reaction voltage correction method and device, readable medium and electronic equipment
CN117353732B (en) Constant-temperature crystal oscillator temperature compensation method and device
CN118130894A (en) Dual AD rapid electric energy metering method, device, equipment and medium
Zanobini et al. The evaluation of the combined standard uncertainty for nonlinear models
CN115955290A (en) Combined prediction method and system for time deviation of clock source of time setting network of power system

Legal Events

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