Embodiments of the present invention relate to controlling frequency in a system.
In wireless systems, a reference clock is used in the modulation and demodulation of transmit and receive signals for GSM, EDGE, WCDMA and other cellular standards. Many systems use an oscillator to generate the reference clock. The initial frequency can be initially off by as much as +/−30 PPM due to crystal variations, IC variations and board capacitance variations. Accordingly, many systems implement a calibration procedure to try to reduce this error.
Even after such calibration, during operation the frequency can still drift as a result of temperature, aging or other conditions. Systems often include some type of automatic frequency control (AFC) in an effort to reduce this frequency error. However, such systems suffer from extensive complexity, power consumption, and computation inefficiencies.
According to one aspect of the present invention, a method may be performed to converge a control value for controlling a controllable element to a desired tolerance in a relatively small number of algorithm iterations. In one such method, a frequency error value corresponding to an error of a reference clock may be received, and a control value for a capacitor array used to generate the reference clock may be determined within as few as two iterations of an algorithm. In this way, the control value may enable generation of the reference clock within a predetermined tolerance to a nominal value for the reference clock after execution of the method. If the control value and the reference clock frequency have a substantially linearized relationship rather than a linearized relationship, the control value may be determined in a number of iterations exceeding, but approaching two.
More generally, embodiments may be used to control a controllable element that has a nonlinear but monotonic relationship with a control value. In such embodiments, a system may perform control by receiving an error value corresponding to an error of an output signal from the controllable element, and determining the control value within two iterations of a Newton-Raphson algorithm, where the control value enables generation of the output signal within a predetermined tolerance to a nominal value for the control signal.
Yet another aspect of the present invention is directed to a system including a transceiver to transmit and receive radio frequency (RF) signals, where the transceiver includes an oscillator to generate a reference signal based on control of a controllable element of the transceiver. The system further includes a baseband processor coupled to the transceiver to provide a control signal to the transceiver to control a frequency of the reference signal, where the baseband processor includes a pre-distortion logic to receive a linearized control value determined according to a Newton iteration algorithm and to generate the control signal therefrom, where the pre-distortion logic is to apply the linearized control value to a predetermined function to predistort the linearized control value to linearize a relationship between the linearized control value and the reference signal frequency.
In various embodiments, an algorithm may be used to perform frequency control for a reference clock. The algorithm may be used to linearize a non-linear transfer characteristic, such as a frequency change to a digital control signal. That is, in some implementations a wireless system may include an oscillator such as a digitally controlled crystal oscillator (DCXO). The DCXO may include one or more capacitor arrays that are controlled by the digital control signal, which may be a plurality of bits, N, used to control switching of the capacitors of the array to adjust frequency of the resulting reference clock.
In some implementations, the algorithm may apply a Newton Raphson iteration to a resulting linearized characteristic. The first step of the Newton iteration utilizes a nominal value for the slope of the frequency characteristic. The second step utilizes the actual slope, computed from the frequency error measurements obtained based on a reference clock generated using digital control signals generated from the linearized values to obtain a final control value for control of the DCXO that generates the reference clock in close tolerance to a threshold level (e.g., within less than ±0.3 ppm). Furthermore, implementations may be performed with a very rapid convergence rate, e.g., 2 or less iterations.
Referring now to
Still referring to
Based on this frequency update, a first updated linearized control value may be computed (block 50). In one embodiment, this first updated linearized control value may be based on the initial linearized control value, the frequency update, and a nominal slope value. This nominal slope value may be a pre-computed slope value for a linearized frequency response corresponding to the linearized control value versus the frequency error information. From this first updated linearized control value, a first updated control value may be generated and used to control the capacitor array accordingly (block 60). At this generated frequency, another frequency update may be received (block 70). Then control passes to
Thus a second error may be generated based on a frequency update. From this frequency error (if the frequency has not converged within a predetermined amount from the threshold reference frequency), next an actual slope value may be determined (block 80). This actual slope value may be based on the linearized control values previously determined and the frequency updates. That is, because a linearized response exists, these two points (each consisting of a frequency error value and a linearized control value) may be used to generate the actual slope.
Based on this actual slope, a second updated linearized control value may be computed (block 90). More specifically, in one embodiment this value may be based on the first updated linearized control value, the frequency update and the actual slope. Finally, based on this updated linearized control value, a second (and finalized) updated control value may be generated and used to control the DCXO (block 95). Owing to the efficiency of the algorithm, the reference clock should be within the desired tolerance of the threshold reference clock and thus efficient calibration can be realized within two iterations. While described with this particular implementation in the embodiment of
Referring now to
In the flowchart of
A transceiver which is present in DUT 130 and which may be a handset or other wireless device, integrates the DCXO circuitry used to generate a precise system reference clock using only an external crystal resonator. The DCXO replaces the requirement for a discrete TC-VCXO module. The DCXO allows for the use of a standard 26 MHz crystal, which reduces both cost and area compared to using a TC-VCXO module. No external varactors or trim capacitors are required. This simplifies the design, programming, and manufacturing compared to less integrated solutions.
The DCXO uses the CDAC and CAFC arrays to correct for both static and dynamic frequency errors, respectively. An internal digitally programmable capacitor array (CDAC) provides a coarse method of adjusting the reference frequency in discrete steps. The CDAC[6:0] register can be programmed to compensate for static variations in PCB design, manufacturing, and crystal tolerance, and is typically set to center the oscillator frequency during IC production. A second capacitor array (CAFC) allows for fine and continuous dynamic adjustment of the reference frequency by a register setting. A baseband processor (herein baseband) determines the appropriate frequency adjustment based on the receipt of the FCCH burst. The baseband then adjusts the CAFC to correct the frequency errors. Based on typical variations expected in the PCB capacitance and crystal parameters, the CAFC capacitor array will be adequate to tune out all variations during the handset production and normal use. The CDAC array will be adjusted and held in on-chip NVRAM during IC production testing to center the DCXO with a nominal crystal and nominal PCB capacitances.
Different mechanisms may be used to perform frequency calibration. For example: the tester produces a fixed frequency signal (i.e. BCCH/FCH); and DUT transmits a signal and the tester measures the frequency error across 2 points.
We will not use any special calibration algorithm. Instead we will use the L1 Synchronization routine even in the factory calibration. In handset factory calibration, a preset [CDAC_VALUE], [AFC_VALUE], and [AFC_SLOPE] are loaded into the DUT. The tester produces a fixed frequency signal. The DUT measures the frequency error and stores [F_ERROR] in the NVRAM.
One global variable is used in the Layer1 context:
For programming a transceiver in accordance with an embodiment of the present invention, four more variables may be used. These are cdacValue, afcDacValue, fError and afcDacSlope. These values are mapped to the [CDAC_VALUE], [AFC_VALUE], [F_ERROR] and [AFC_SLOPE] values stored in NVRAM. The assumption is that the RF Driver will have access to these NVRAM values. If the nominal [AFC_SLOPE] and [AFC_VALUE] values can be pre-coded in the RF Driver, then these default values need not be stored in the NVRAM.
The block diagram of the AFC system is shown in
The digital control word N is in turn provided to a transceiver 210, which includes a non-volatile memory 215 such as a non-volatile random access memory. As shown, a predetermined number of digital control bits (e.g., 7 in the embodiment of
The L1 software 200 averages FCCH bursts and generates a frequency error output signal. The RF driver software 205 then updates the value of N to fine tune the DCXO to the desired frequency. The coarse tuning/calibration of the DCXO 220 is performed during IC manufacture and is stored as a 7 bit word in the transceiver chip. This stored CDAC setting centers the DCXO frequency to take out IC fabrication errors so that a nominal crystal and PCB board will yield the correct frequency. However, once the transceiver 210 is tested in the handset and during normal usage, the DCXO 220 will be tuned with the fine control capacitor array to remove the frequency errors due to crystal variations, PCB capacitance errors and temperature and aging effects.
The RF driver software 205 utilizes a Newton-Raphson iteration algorithm, which in some implementations may be a Secant form of the algorithm as described below, to drive the frequency error reported by the L1 software 200 to under ±0.3 PPM. Although the Newton-Raphson iteration will converge for well behaved nonlinear functions, convergence is faster if the function is linear. Since the AFC fine capacitor array has a nonlinear relationship between N and the DCXO output frequency, a linearization block (e.g., pre-distortion logic/software 209) is inserted so that the relationship between N′ and the output frequency is linearized. Ideally, this pre-distortion calculation is placed in the RF driver software 205; alternatively, it can be realized with digital logic on transceiver 210. The form of the pre-distortion equation [EQ. A] is set forth above.
At a given iteration in the Newton method, the value of the function is required as well as the derivative of the function. At the first iteration in the handset factory calibration, the derivative is simply the nominal value, [AFC_SLOPE], stored in NVRAM 215. At the second iteration, there are now two frequency error measurements and two N′ settings, so by using the Secant method (a specific form of Newton Raphson) we have a good estimate of the derivative of this particular DCXO, PCB and crystal combination. Since the N′ to frequency function is ideally linear, convergence to the desired frequency is possible in this second step, in theory to arbitrary accuracy. In practice, the final frequency accuracy is limited by the AFC's differential nonlinearity (DNL) and the degree to which the N′ to frequency curve is linearized. Note that linearization is imperfect since the K1, K2, K3 values in the above Equation A are based on all nominal parameters.
The global variables, [cdacValue], [afcDacValue], [ferror] and [afcDacSlope] are initialized with the corresponding contents of the NVRAM 215. The NVRAM 215 is filled with preset values. Once these values are filled from the NVRAM 215, these values may be stored at a non-volatile memory location that can be accessed by the RF driver on a burst by burst basis. Also, the RF Driver software 205 should be able to write to these memory locations.
Frequency errors (up to +−30 PPM) are sent to RF driver software 205. RF driver software 205 decides how many linear steps to change in the frequency control setting by using the Newton iteration and the nominal value of afcDacSlope which was read from the NVRAM 215. The software pre-distorts these linear steps to the nonlinear steps of the CAFC capacitor array. The RF driver 205 writes the updated N value to the transceiver 210.
A new (reduced) frequency error from L1 software 200 is received.
RF driver software 250 uses current and past frequency errors and the change in the linear steps to compute the actual slope in the linearized frequency control. The value of afcDacSlope is updated with the actual slope, as opposed to the nominal slope that was stored in NVRAM 215.
The Newton iteration is applied again and the number of linear steps (N′ variable) to eliminate the frequency error are computed and then predistorted (N variable) to the actual value driving the CAFC capacitor array. The final value of N is written to the transceiver 210.
Simulations over 100K trials (where random errors in crystal parameters, PCB capacitance, etc., were implemented) show that errors up to +/−30 PPM can all be corrected to within ±0.3 PPM in two steps. All random variables were uniformly distributed over the ranges shown below. The histogram in
Assumptions:
Crystal+/−10 PPM
C1+/−15%
C0+/−10%
CAFC array DNL<=0.5 LSB (random)
CAFC array total capacitance+/−5%
In one implementation, a DCXO is made of a Pierce crystal oscillator. The frequency of the crystal oscillator is adjusted by adding capacitance in parallel with the crystal. The change in amount of parallel capacitance results in pulling the frequency of the crystal oscillator. The caps are selected digitally, thus we call the crystal-oscillator a “Digital-Control Crystal Oscillator” (DCXO).
There are two capacitor digital-to-analog connectors (DACs) that exist in the DCXO. The first capacitor DAC is called CDAC which is a coarse DAC used in factory calibration to center the frequency of the DCXO. The second capacitor DAC is called AFC DAC, which is used for accurate frequency tracking of the DCXO. The AFC DAC is used to compensate for aging, temperature change, Doppler Effect and offset of CDAC.
The output frequency of the DCXO can be written as:
where the term
is called the “series resonate frequency of the crystal oscillator”. We adjust the resonate frequency of the crystal oscillator through adjusting CL. To linearize fo(CL) we start with series expansion of:
Thus an approximation to fo(CL) is:
To check how good the above approximation is let's use typical values for a crystal oscillator:
C1=3.557 fF fs=26 MHz L1=10.5 mH Co=988.7 fF CL=(4 pF . . . 12 pF)
x=2·(1+√{square root over (3−2·y)}) EQ(6)
and
x=2·(1−√{square root over (e−2·y)}) EQ(7)
Since CL is much larger than C1, then EQ(6) cannot provide a valid solution for CL. Thus we used EQ(7) as a solution for CL. Next, we can determine CL in terms of y as follows:
We are interested in CL as a function of change in y. Thus, let y be:
y=1+α EQ(9)
then CL in terms of α is:
A plot of fo as function of α is shown in
The problem with EQ(10) is that we are using square-root function which is an expensive function to be implemented in digital. Next we use Taylor expansion based on variable a:
In the above equation C1/4 is much less than Co and hence it can be ignored.
A comparison of approximation to CL versus exact calculation of CL is shown in
Next we need to decompose CL in terms of code at input of the AFC-DAC.
CL=CL
m
+M·ΔCL
M
+N·ΔCL
N EQ(12)
where CLm is the minimum value of CL, ΔCLM is the LSB capacitor value of the coarse DAC (CDAC), and ΔCLN is the LSB capacitor value of the fine DAC (AFC DAC). Then by combining EQ(11) and EQ(12) we get
In the above equation, for reasonable N value, a will have an offset. Thus we modify the above equation into:
Where α0 is the offset of α, and Δα represents variation in α. The above equation is not suitable for digital implementation since it needs floating point operation. Next we use a scale factor K to convert EQ(14) into an integer operation as shown in EQ. (15).
An example of equation for calculating N is given below. In this example we assume that the crystal oscillator has the following parameters:
CLm=5 pF Cdac=4 pF Cafc=2 pF C1=3.53 fF L1=1.06187 mH Co=1.02 pF
Then we have:
From EQ(11) we know that
For minimum CL and maximum CL we have:
αCL=8.98 pf=1.764094231109319613210−4 αCL=6.98 pf=2.204834917657541860110−4
Thus, we can write:
α0=1.7640942311110−4 Δα=0 . . . 4.40740687×10−5
Lets assume that we want Δα to be in range of (0,8191), then K must be
The terms in EQ(15) assuming M=63 are
Using the above values we obtain an expression for N, the input to AFC DAC, and input to algorithm, N′.
As long as M is correcting for Co and CLm of EQ. 15, the crystal oscillator will remain linear in frequency. However, let's assume C1 of the crystal oscillator changes due to process variation. Then M has to change in order to compensate for variation of C1. An example of C1 impact on the frequency of the crystal oscillator is shown in
Assume that we are still using EQ. 16, then, the output of the DCXO will show different slopes as shown in
Slope correction logic can be implemented to reduce the slope variation but such correction logic can be expensive, difficult to implement and require additional factory calibration. The preferred method is the embodiment here that uses the Secant method which dynamically computes the slope after the first N′ update.
A transceiver in accordance with an embodiment of the present invention can be implemented in many different systems. As one example, referring now to
Thus embodiments may greatly reduce the number of iterations required to converge to a low error level. If the original nonlinearity of the curve is exactly known, an algorithm in accordance with an embodiment of the present invention will guarantee that one can converge to arbitrary accuracy within 2 iterations. However, in practice the linearization process is not perfect and as such achieving full convergence within two iterations can be dependent on the initial error (e.g., ±30 PPM) and final accuracy required (e.g., under ±0.3 PPM).
While described herein as being applied to a system for cell phones, embodiments can be implemented in a wide range of systems, even outside the wireless arena. Further, although described in an implementation of tuning capacitors to change the frequency, other types of oscillators can be tuned by switching in binary weighted current sources or other controllable elements. For example, if the basic current to frequency characteristic of such current sources was monotonic but nonlinear, an algorithm in accordance with an embodiment of the present invention could be applied to such an oscillator.
In fact, the output variable does not even have to be frequency. Consider any analog output value (current, voltage, frequency, temperature, etc.) that has a nonlinear but monotonic relationship with a digital input control. The algorithm of linearization and the Newton (Secant) method can be used to converge to the desired output level in a relatively small number of iterations.
Attached hereto as Appendix A is example code for correcting slope to obtain a linear frequency characteristic, while Appendix B attached hereto is a theoretical background for and proof of an algorithm in accordance with an embodiment of the present invention.
While the present invention has been described with respect to a limited number of embodiments, those skilled in the art will appreciate numerous modifications and variations therefrom. It is intended that the appended claims cover all such modifications and variations as fall within the true spirit and scope of this present invention.
Two step approach:
where CO+CLM is fixed, let us call this CA
where N is output to AFC/DAC and AC is capacitance step size
Can we create a variable, say, N′, such that N=g(N′) and frequency, f, is linear with respect to N′?
i.e.:
As an approximation, let us assume C1<<CA+NΔC. Thus
then we are done.
Where K1 is a constant of our choice.
Where K2 is another constant of our choice.
Rearranging terms, we can evaluate N=g(N′)→
Going back to df/dN′,
How do we choose K1, K2?
Nε[0,N′max]
If we allow N′ε[0,N′max]
and a one-to-one mapping between N′ and N, we will be able to compute K1 and K2.
Then from [1],
Note, the above choices of K1 and K2 will only ensure that N′ has a wide range for a wide range of N. It will not affect the linearity of f as a function of N′.
Now that we have a variable N′ such that f is linear (more or less linear, even with variations in parameters. As parameters vary, the linearity will decrease. But still, at heart, the function is linear.) with N′, we do Newton iterations.
Let P α(ftarget−f) be the input to the transceiver from the baseband processor. We know the value of K such that P=K·(ftarget−f).
Thus the final two-step algorithm is as follows, where all terms in [ ] denote pre-computed values:
instead of using the pre-computed value. Then do the Newton iteration.
This algorithm is expected to converge to within ±0.3 ppm after step 7. What are the conditions under which the AFC algorithm will converge (in two steps)?
If frequency as a function of N′ is perfectly linear, the algorithm will converge in two steps irrespective of what the scope is, to infinite precision.
So the only cases where the algorithm might not converge in two steps is when the frequency vs. N′ is non-linear.
How much non-linearity can we tolerate?
Frequency, f, is a function of N′. It is very linear, but not perfectly linear.
should be a constant. Ideally, when there is no variation of parameters,
will be a constant by design. However, with variations between real and nominal values of C1, ΔC, CA, etc.,
will no longer be a constant. What is the maximum
that we can tolerate, such that the algorithm converges to within 0.3 ppm of the target frequency in two iterations?
So what is max
Such that P3<εmax (P3 should be 0 ideally, if all is perfect).
|P3| has to be <εmax
The slope, dP/dN′, at N′1+N′2/2 can be approximated as
[mean value theorem]
can also be approximated as
Now applying Taylor expansion for N′3 around
Inserting the value of N′3, i.e.,
, and ignoring higher order terms.
The final value, P3, is the error that remains after two steps.
Therefore, we can conclude that the algorithm will necessarily converge in two steps if:
Using some nominal values of 0.3 ppm, 26.0 MHz, and Pmax=8192, this comes to the requirement:
This application claims priority to U.S. Provisional Patent Application No. 60/846,609 filed on Sep. 22, 2006 in the name of Shouri Chatterjee, Aria Eshraghi and John Khoury, entitled PERFORMING AUTOMATIC FREQUENCY CONTROL.
Number | Date | Country | |
---|---|---|---|
60846609 | Sep 2006 | US |