Background
A Temperature compensated crystal Oscillator (TCXO) is a crystal Oscillator which can work in a wide Temperature range and keep the output frequency of the crystal Oscillator within a certain precision range (10) by a certain compensation mode-6~10-7Magnitude) of the oscillator. It has low power and can be started upThe system has the characteristics of high stability and the like, and is widely applied to various communication, navigation, radars, satellite positioning systems, mobile communication, program-controlled telephone exchanges and various electronic measuring instruments.
A conventional temperature compensated crystal Oscillator is essentially a Voltage Controlled crystal Oscillator (VCXO) with a temperature compensation network and a temperature dependent compensation Voltage generated therefrom. The key device in the uncompensated voltage-controlled crystal oscillator is an AT-cut quartz crystal, and the temperature characteristic curve of the AT-cut quartz crystal is approximate to a cubic curve which can be expressed as:
f(T)=a3(T-T0)3+a1(T-T0)+a0 (1)
wherein, a3Is a cubic coefficient term, a1Is a first order coefficient term, a0Is at a reference temperature T0The oscillation frequency of the time.
The frequency linear gain characteristic for an existing voltage controlled crystal oscillator can be approximately expressed as follows:
f(VC)=-G(VC-VC0)+f0 (2)
where G is the gain of the voltage controlled crystal oscillator, VCIs the control voltage, V, of a voltage-controlled crystal oscillatorC0Is the initial input voltage of the voltage-controlled end of the voltage-controlled crystal oscillator, f0Is input as VC0The oscillation frequency of the time.
Then, the compensation voltage V is used as the compensation voltage for the temperature characteristic of the crystal oscillatorCThe equation of (T) can be expressed as:
VC(T)=A3(T-T0)3+A1(T-T0)+A0 (3)
at this time, A3=a3/G,A1=a1/G,A0Is at a temperature T0The compensation voltage of time.
In order to realize equation (3), a temperature compensation voltage is generated and applied to the vco for temperature compensation to offset the frequency-temperature characteristic, so as to obtain a stable frequency output in a wide temperature range, thereby achieving the purpose of temperature compensation.
At present, the digital temperature compensation for realizing the temperature compensation crystal oscillator, namely TCXO, mainly comprises the steps of carrying out data acquisition on a temperature sensor by a singlechip and outputting compensation voltage, and mainly comprises two modes at present:
the first is microprocessor-based temperature compensation. FIG. 1 is a block diagram of a temperature compensated crystal oscillator in a microprocessor based temperature compensation mode, which is an open loop temperature compensation architecture. As shown in fig. 1, it includes a temperature sensor and conditioning circuit 101, a microprocessor 102, a compensation network 103, and a voltage controlled crystal oscillator 104. The temperature T is acquired and conditioned by the temperature sensor and conditioning circuit 101, and then is sent to the microprocessor 102 to be looked up in the temperature-compensation voltage table according to the temperature to obtain a compensation voltage value, then the compensation network 103 converts the compensation voltage value into a compensation voltage, and the compensation voltage value is input to the voltage-controlled voltage control end of the voltage-controlled crystal oscillator 104, namely a varactor component therein, and when the compensation voltage changes, the capacitance value of the varactor component changes accordingly, so that the output frequency of the voltage-controlled crystal oscillator is changed to achieve the purpose of controlling the frequency. It can be seen that a compensation voltage related to temperature is directly inputted to the voltage-controlled voltage control terminal of the (to-be-compensated) vcxo 104 for temperature compensation. The temperature-compensation voltmeter is constructed by collecting voltages that need to be compensated for the voltage-controlled crystal oscillator 104 to maintain stable frequency at different temperatures in advance. The detailed description can be found in "Liuhaixia, Yangyu, Weiwei. novel microcomputer compensated crystal oscillator. Instrument and Meter journal.2002 (S3):135 one 136"
The second is mixing-based temperature compensation. Fig. 2 is a structural diagram of a temperature compensated crystal oscillator in a mixing-based temperature compensation mode, which is also an open-loop temperature compensation architecture. As shown in fig. 2, the temperature compensated crystal oscillator generates a compensated frequency signal with the same sign and opposite sign as the absolute value of the offset frequency generated by the crystal oscillator 204 to be compensated through the temperature sensor 201 and the compensation frequency generating circuit 202, the signal after the compensation frequency signal is adjusted by the wave adjusting circuit 203 and the uncompensated frequency signal output by the crystal oscillator 204 are mixed in the mixer 205 and output, and the compensated frequency signal is obtained through another filter 205, so as to achieve the purpose of temperature compensation. The compensation frequency signal generating circuit mainly comprises a temperature sensor, an ADC, a singlechip and a DAC. For a detailed description, see the chinese patent invention with publication number CN 100471035B, issued on the 18 th day on 03 th 2009: the invention discloses a temperature compensation method of a quartz crystal oscillator, which is characterized in that the invention is a quartz crystal oscillator with yellow nucleus, Ribes, Renwei and Tan-Feng, application number/authorization number: CN 200410022680.3'. This method is advantageous in terms of phase noise characteristics when realizing a TCXO that is a high-frequency temperature compensated crystal oscillator, but is relatively complicated in structure and has not been widely used at present.
In summary, in the conventional temperature compensation method for a crystal oscillator, an open-loop compensation framework is adopted, and a temperature sensor is used, the temperature sensor is located as close to the crystal resonator as possible on a circuit, and a resonant wafer of the crystal resonator is separately packaged in a closed space, so that temperature hysteresis is inevitably generated between the temperature sensor and the resonant wafer, and the frequency-temperature characteristic of the temperature compensated crystal oscillator, i.e., TCXO, is not broken through. Especially for the crystal oscillator with high frequency output signal, the temperature lag problem is more serious and the compensation precision is limited.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provide a stepping temperature compensation method for a crystal oscillator, so as to avoid the problem of output frequency error caused by the temperature hysteresis effect caused by a temperature sensor, namely the inconsistency between the acquisition temperature of the sensor and the real-time temperature of a resonant wafer.
In order to achieve the above object, the step temperature compensation method of the crystal oscillator of the present invention is characterized by comprising the following steps:
(1) determining a target frequency f0Corresponding binary code B0i
At normal temperature T
0For example, at 25 deg.C, the control voltage of the voltage-controlled crystal oscillator, i.e. VCXO voltage-controlled terminal, is adjusted
Make it output the target frequency f
0Then converted into the corresponding binary code B by an analog-to-digital converter
0iInput into a singlechip and carry out binary coding B
0iStoring for comparison and operation;
(2) determining the binary code corresponding to the frequency deviation delta f (T) at the current moment
The output frequency of a voltage controlled crystal oscillator, VCXO, is f (t) ═ f due to temperature variations0+ -. DELTA.f (T), where the frequency f (T) is the uncompensated real-time output frequency that needs to be compensated, f0Is the target frequency for which the vco output is desired, and Δ f (t) is the frequency offset due to temperature change, which is a function that changes with temperature, and if the output frequency increases, f (t) ═ f0+ Δ f (t), if the output frequency decreases, f (t) f0A frequency signal f (T) output by the voltage controlled crystal oscillator (VCXO) in real time is sent to the analog-to-digital converter to be converted into a corresponding binary code B1iIs sent into a singlechip to be mixed with B0iComparing and calculating, and initializing step number n as 0
(3) Judging the comparison result B0i-B1iWhether or not within the threshold range Δ B
Setting a threshold range delta B in a singlechip, and coding a binary code B0iAnd binary coding B1iAfter the comparison, the comparison result B is judged0i-B1iIf the current value is not within the threshold range delta B, if not, n is equal to n +1, and the step (4) is carried out; if so, outputting the binary code corresponding to the current f (T), namely f (T) f0The temperature compensation of the voltage-controlled crystal oscillator (VCXO) is realized;
(4) step-by-step output of the compensation voltage
When B is present0i-B1iIf the voltage value is larger than the threshold value range, outputting the binary code B corresponding to the compensation voltage valuev=B0i+n×B2i(ii) a When B is present0i-B1iIf the value is smaller than the threshold value range, outputting the binary code corresponding to the compensation voltage valueBv=B0i-n×B2iWherein B is2iStep binary coding;
binary code B of compensation voltage output by single chip microcomputer
0i+n×B
2iOr B
0i-n×B
2iConverted into a compensation voltage by a digital-to-analog converter
Or
And outputting the voltage-controlled crystal oscillator (VCXO) voltage-controlled end after being conditioned by the signal conditioning circuit, and then returning to the step (3), wherein delta V (T) is the compensation voltage variation.
The object of the invention is thus achieved.
The step temperature compensation method of the crystal oscillator adopts a closed loop feedback compensation framework. First, a target frequency f is determined0Corresponding binary code B0iAnd storing the data into a singlechip; secondly, when the temperature changes, the frequency signal f (T) is sent into the analog-to-digital converter to be converted into the corresponding binary code B1iThen sent to a singlechip to be neutralized with a target frequency f0Binary coding of B0iComparing, and judging a comparison result B according to a threshold value range delta B set in the singlechip0i-B1iWhether within a threshold range. If B is0i-B1iIf not, B is encoded in step binary2iCompensating, sending into the singlechip again after compensation and B0iPerforming comparison, and performing cyclic compensation until the comparison result B0i-B1iWithin the threshold value range, temperature compensation is finally achieved.
Compared with the existing temperature compensation crystal oscillator, the crystal oscillator has the following technical advantages:
1) the frequency change information of the VCXO to be compensated is directly obtained through the analog-to-digital converter and the single chip microcomputer in real time without a temperature sensor, and the target frequency is approached in a binary coding mode corresponding to the minimum stepping compensation voltage. The method can overcome the problem of temperature hysteresis caused by asynchronous temperature change of the wafer using the temperature sensor and the crystal resonator in the existing TCXO;
2) the invention adopts a closed-loop compensation framework, so that real-time high-precision compensation is easier to realize;
3) the compensation process is simple, the data of frequency temperature and compensation voltage do not need to be collected firstly like the traditional temperature compensation crystal oscillator of the principle, but binary codes corresponding to information needing to be compensated are directly converted into the compensation voltage, the structure of the invention is simpler, and the invention is easy to integrate and produce in batches;
4) the invention can be well suitable for crystal oscillators with various frequencies, and particularly has better compensation effect for the high-frequency crystal oscillator with poorer compensation effect in the prior art.
Detailed Description
The following description of the embodiments of the present invention is provided in order to better understand the present invention for those skilled in the art with reference to the accompanying drawings. It is to be expressly noted that in the following description, a detailed description of known functions and designs will be omitted when it may obscure the subject matter of the present invention.
FIG. 3 is a flowchart of an embodiment of a step temperature compensation method for a crystal oscillator according to the present invention.
In this embodiment, as shown in fig. 3, the step temperature compensation method of the crystal oscillator of the present invention includes the following steps:
step S1: determining a target frequency f0Corresponding binary code B0i
At normal temperature T
0For example, at 25 deg.C, the control voltage of the voltage-controlled crystal oscillator, i.e. VCXO voltage-controlled terminal, is adjusted
Make it output the target frequency f
0Then converted into corresponding binary codes B by an analog-to-digital converter
0iAnd the target frequency f is set
0Binary coding of B
0iStoring for comparison and operation;
step S2: determining the corresponding binary code when the frequency deviation delta f (T) of the current time
The output frequency of a voltage controlled crystal oscillator, VCXO, is f (t) ═ f due to temperature variations0+ -. DELTA.f (T), where the frequency f (T) is the uncompensated real-time output frequency that needs to be compensated, f0Is the target frequency for which the vco output is desired, and Δ f (t) is the frequency offset due to temperature change, which is a function that changes with temperature, and if the output frequency increases, f (t) ═ f0+ Δ f (t), if the output frequency decreases, f (t) f0A frequency signal f (T) output by the voltage controlled crystal oscillator (VCXO) in real time is sent to the analog-to-digital converter to be converted into a corresponding binary code B1iThen input into a singlechip to be mixed with B0iAnd (5) carrying out comparison and calculation, and initializing the step number n to be 0.
Step S3: judging the comparison result B0i-B1iWhether or not within the threshold range Δ B
Setting a threshold range delta B in a singlechip, and coding a binary code B0iAnd binary coding B1iAfter the comparison, the comparison result B is judged0i-B1iIf the current value is not within the threshold range delta B, if not, n is equal to n +1, and the step (4) is carried out; if so, outputting the binary code corresponding to the current f (T), namely f (T) f0The temperature compensation of the voltage-controlled crystal oscillator (VCXO) is realized;
step S4: step output compensation voltage
When B is present0i-B1iIf the voltage value is larger than the threshold value range, outputting the binary code B corresponding to the compensation voltage valuev=B0i+n×B2i(ii) a When B is present0i-B1iIf the voltage value is smaller than the threshold value range, outputting the binary code B corresponding to the compensation voltage valuev=B0i-n×B2iWherein B is2iStep binary coding;
binary code B of compensation voltage output by single chip microcomputer
0i+n×B
2iOr B
0i-n×B
2iConverted into a compensation voltage by a digital-to-analog converter
Or
And outputting the voltage-controlled crystal oscillator (VCXO) to a voltage control end of the VCXO after being conditioned by the signal conditioning circuit, and then returning to the step (3), wherein delta V (T) is the compensation voltage variation.
In this embodiment, a schematic block diagram of a hardware, i.e., a temperature compensated crystal oscillator, constructed according to the method of the present invention is shown in fig. 4, which includes: a voltage controlled crystal oscillator (VCXO 301), a
power divider 302, an analog-to-
digital converter 303, a
single chip microcomputer 304, a digital-to-
analog converter 305 and a signal conditioning circuit 306. The voltage controlled crystal oscillator,
VCXO 301, is mainly composed of a quartz resonator, a varactor and an oscillation circuit, and its operating principle is to change the capacitance of the varactor by controlling the voltage, thereby "pulling" the frequency of the quartz resonator to achieve the purpose of frequency adjustment. The
power divider 302 divides the output frequency signal of the
VCXO 301 into two paths, one of which is normally output, and the other of which is input to the analog-to-
digital converter 303; the analog-to-
digital converter 303 converts the output frequency signal of the
VCXO 301, which is a voltage controlled crystal oscillator, into a corresponding binary code. The
single chip microcomputer 304 performs binary code storage, frequency comparison and calculation to obtain a binary code B of the compensation voltage
0i+n×B
2iOr B
0i-n×B
2iNumber ofThe analog-to-
digital converter 305 encodes B a binary of the compensation voltage
0i+n×B
2iOr B
0i-n×B
2iConversion to compensation voltage
Or
And the output is regulated by the signal conditioning circuit 306 to the voltage control end of the voltage controlled crystal oscillator, namely
VCXO 301, so that the temperature compensation of the voltage controlled crystal oscillator, namely VCXO is realized.
Fig. 5 is a flowchart of the operation of the temperature compensated crystal oscillator shown in fig. 4. In this embodiment, it comprises the following steps:
the first step is as follows: input control voltage for VCXO at normal temp
Make it output the target frequency f
0Converting the binary code into corresponding binary code through an analog-to-digital converter, inputting the binary code into a singlechip, and converting f into binary code
0Binary coding of B
0iStoring for comparison and operation;
the second step is that: the output signal f (T) of VCXO is inputted into the single-chip processor through A/D converter, and f0Corresponding binary code B1iCalculating, and judging whether the result is in the threshold voltage range, when B is0i-B1iIf the voltage value is larger than the threshold value range, outputting the binary code B corresponding to the compensation voltage value0i+n×B2i(ii) a When B is present0i-B1iIf the voltage value is smaller than the threshold value range, outputting the binary code B corresponding to the compensation voltage value0i-n×B2i. On the contrary, when the comparison result B is obtained0i-B1iWithin the threshold value range, the current binary code B corresponding to f (T) is output1i. The programs of the processes are stored in the single chip microcomputer;
the third step: binary code B of compensation voltage output by single chip microcomputer
0i±n×B
2iConverted into a compensation voltage by a digital-to-analog converter
The fourth step: voltage signal output by D/A converter
The signal is processed by a signal conditioning circuit and output to a voltage control end of the VCXO, and finally f (T) is equal to f
0Temperature compensation of the VCXO is achieved.
According to the above description, the essence of the present invention is that the frequency change information of the VCXO to be compensated is directly passed through the analog-to-digital converter and the single chip to obtain the binary code of the compensation information, the target frequency is approached in the manner of the binary code corresponding to the minimum step compensation voltage, the frequency comparison is performed cyclically, and the compensated voltage controlled crystal oscillator outputs the target frequency signal f equal to the target frequency signal f expected to be obtained0Thereby achieving the purpose of temperature compensation.
Although illustrative embodiments of the present invention have been described above to facilitate the understanding of the present invention by those skilled in the art, it should be understood that the present invention is not limited to the scope of the embodiments, and various changes may be made apparent to those skilled in the art as long as they are within the spirit and scope of the present invention as defined and defined by the appended claims, and all matters of the invention which utilize the inventive concepts are protected.