Abstract:
A low cost automatic frequency control system measures short duration radio frequencies with high a degree of accuracy within 0.5 MHz. The system is programmable to allow applicability over a wide range of frequencies within the required accuracy and various signal durations. The system includes circuits to digitize the source signal to a digital pulse train and asynchronously sample the pulse train to obtain a count of the positive edges of the pulses over a sufficient number of samples. A microprocessor computes the statistical average of the count and accurately determines the frequency of the source signal. The system further includes a feedback path to implement correction to the source signal based on the measured frequency.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to circuits and methods for automatically controlling the frequency of a signal in a system such as a radar in which the frequency must be maintained with a high degree of accuracy. 
     To date, analog instrumentation, generally featuring variations of a phase-lock-loop (PLL) device, has been used to control frequency drifts in a signal. Although devices based on analog circuitry provide adequate performance, they are often too restrictive to a particular application, and, therefore, offer little or no flexibility when the source signal to be controlled takes on a new frequency band. In a related issue, analog devices are often too costly to implement and difficult to maintain at optimum performance on a long-term basis. 
     A continuing need exists for improvements in the area of frequency control, particularly in the radar applications in which the primary considerations include flexibility, accuracy and low cost. 
     SUMMARY OF THE INVENTION 
     The automatic frequency control (AFC) system of the present invention measures a frequency of a source signal, such as a short duration pulsed intermediate frequency (IF) of a radar signal, and determines a frequency compensation in the event the source signal drifts. In a preferred embodiment, a radio frequency (RF) burst from a radar transmitter is modulated with a modulating frequency from a local oscillator to produce the desired IF. In the preferred embodiment the AFC system operates in two modes. In a system calibration mode, the frequencies of the source and a highly stable calibration signals are digitally measured in sequence, and their difference is stored as a reference. In a normal operation mode, the subsequent measured differences between the two signals are compared to the stored reference to determine compensation. 
     The AFC system includes a comparator circuit for digitizing a source signal. The digitized source signal is passed to a sampling unit to be sampled. The sampling unit includes a gate generator circuit for generating sampling pulses, and a window generator circuit for generating a window during which the gate generator circuit repeatedly passes a predefined number of sampling pulses. The gate generator circuit is asynchronously driven with respect to the signal at a predefined sampling frequency. The difference in synchronization allows a random opening effect of the sampling pulses with respect to the source signal. The AFC system further includes a source counter to count the leading edges of the digitized source signal. 
     The AFC system further includes a calibration circuit which includes an oscillator for producing the calibration frequency. During operation, each sampling of the digitized source sinal is followed by a sampling of a digitized calibration frequency. A count for the calibration frequency is stored in a calibration counter. 
     In the system calibration mode, the counts for both signals over a predefined number of previous window periods are passed to a processor which maintains a running total for each signal and computes a statistical average over the total count. The difference in the averages of the two signals is stored as a reference. In the normal operation mode, at each window period, again an average for each signal count is computed over the running total. The subsequent difference between the averaged counts of the two signals are compared to the stored reference from the calibration mode to compute frequency compensation. 
     In the preferred embodiment, the AFC system further includes a detector circuit for detecting any missed RF burst during the measurement process, and maintaining the pulse count accumulated just prior to such RF failure until the radar restores the RF. 
     The above and other features of the invention, including various novel details of construction and combinations of parts, will now be more particularly described with reference to the accompanying drawings and pointed out in the claims. It will be understood that the particular methods and devices embodying the invention is shown by way of illustration only and not as a limitation of the invention. The principles and features of this invention may be employed in varied and numerous embodiments without departing from the scope of the invention. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a schematic diagram of a preferred automatic frequency control system in accordance with the present invention. 
     FIG. 2 is a timing diagram illustrating the timing signals of the sampling process. 
     FIG. 3 is a flow diagram detailing the preferred sampling process of an IF in accordance with the present invention. 
     FIG. 4 is a flow diagram describing the system communication sequence in accordance with the present invention. 
     FIG. 5 is a flow diagram describing the data processing and the control loop sequence of the automatic frequency control system of the present invention. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     The present invention takes advantage of high speed digital circuitry to measure and control frequencies in continuous wave mode or in short pulse durations. In particular, the invention includes digital sampling methods processed by a microprocessor to accurately determine source frequencies of short &#34;look&#34; durations. In a preferred embodiment, a feedback control loop is implemented to provide correction to the source as needed for source frequency drifts. 
     Referring now to FIGS. 1 and 2 of the drawings, FIG. 1 is a schematic diagram of a preferred automatic frequency control (AFC) system 10, and FIG. 2 illustrates the signal timing sequence involved in the frequency measurement process of the present invention. The embodiment shown in FIG. 1 is illustrated as an AFC system 10 within a modulator transmitter/receiver (MTR) unit 100 of a radar system. The unit 100 comprises a trigger generator (T) 11 which activates a radio frequency (RF) transmitter 12 with a trigger pulse PTRIG 50 (see FIG. 2), such as a magnetron, of a radar. The RF is modulated at mixer 13 by a local oscillator signal generated by voltage controlled oscillator (VCO) 42 to produce a desired intermediate frequency (IF) signal 14 (shown as IF 52 in FIG. 2). Typically, the RF and IF signals are generated in short duration bursts. The RF operates in the range of 9.375 to 9.390 Ghz, and the IF in the range of 45 to 75 Mhz. In the preferred embodiment, the AFC system operates in the range of 25 Mhz to 120 MHz. 
     As previously indicated, the preferred AFC system operates in two modes. In the system calibration mode, the frequencies of the source and a highly stable calibration signals are digitized and sampled in sequence, and their difference is stored as a reference. In the normal operation mode, the subsequent differences between the two signals are compared to the stored reference generated from the calibration mode to determine frequency compensation, if any is needed. The two modes differ only in the final processing stage of the two sampled data. The digitizing and sampling procedures common to both modes of operation are first described below. 
     The preferred AFC system 10 includes an analog multiplexer (MUX) 18 for receiving two input signals, the IF signal 14 and a calibration signal 15 from a calibration logic circuit 16. The calibration circuit 16 includes a crystal oscillator (CO) to provide a highly stable frequency (C) 15 which is used as a reference. The multiplexer 18 switches the two signals in sequence to a comparator circuit 20. During operation, the multiplexer 18 first passes the source signal and then the calibration signal to the comparator circuit 20. The comparator circuit 20 converts each signal in the same sequence to a corresponding digital pulse train (Q) at 21. 
     In FIG. 2, for example, the digitized IF signal 52 is shown as QCOMP 56. The comparator circuit 20 compares the magnitude of the source IF 14 to a crossing threshold to determine the direction of each pulse edge. For example, in FIG. 2, as the magnitude of IF signal 52 rises and crosses a preset crossing threshold, the comparator circuit 20 generates a leading edge and begins to generate the output pulse train QCOMP 56. As the IF signal 52 declines in magnitude and crosses the threshold in the other direction, the pulse edge is dropped until another positive crossing occurs. Similarly, the calibration frequency is digitized. 
     Preferably, the comparator 20 provides adjustable crossing threshold control to allow fine tuning as necessary. In the embodiment of FIG. 1, for example, the preferred crossing threshold ranges from 50 to 150 mv. 
     Each of the digitized signals 21 from the comparator circuit 20 is passed in sequence to a pulse sampling unit 22 of the AFC system for sampling over a predetermined period. The pulse sampling unit 22 includes a window generator logic 24 and gate generator logic 26 circuits. When the RF trigger 19 occurs (see e.g., PTRIG 50 in FIG. 2), the window generator logic circuit anticipates an incoming IF pulse train and opens a &#34;window&#34; or predefined duration (see e.g., WINDOW 54 in FIG. 2), during which sampling of the digitized IF pulses is performed. 
     The window is defined by a predefined number of sampling pulses or &#34;looks&#34; the system passes to determine the frequency of a digital signal. Each look is enabled by a gate pulse which is generated by the gate generator logic circuit 26. The gate and window sizes vary according to the radar&#39;s Pulse Width Mode of operation. For example, in a preferred setting, for a short IF pulse, which is available only for about 40 nanoseconds, the gate size is set to 20 nanoseconds and the window size to 1000 looks. A preferred sampling setting for various IF signals are given as follows: 
     
         ______________________________________Pulse Width Mode         Look/Gate (ns)                    Window (# of Looks)______________________________________Short         20         1000Medium        100        400Long          400        100______________________________________ 
    
     These numbers are derived such that, for short pulse duration signals, a relatively larger window size and higher gate resolution (i.e., narrow sampling width) are required to ensure a sufficient count of the source. For larger pulse durations, a less gate resolution (i.e., wider sampling width) and less total looks (window) are allowed. 
     In the preferred embodiment, the sampling unit 22 is programmable and is asyncronously driven by a digital clock 28 at a predefined sampling frequency (see e.g., 50 MHz clock 58 in FIG. 2). The clock 28 of the preferred embodiment is activated to run freely such that the opening of a gate occurs at random with respect to the IF pulse. The randomness causes IF pulse count to vary slightly from one look to the next. 
     For example, in FIG. 2, a portion of the sampling sequence of an IF source signal is illustrated by way of a timing diagram. PTRIG 50 is the RF trigger signal 11 which fires an RF burst and alerts the window 24 and gate 26 generator logic circuits to a standby. Accordingly, WINDOW 54 is set to high (open). Also, shortly following the trigger signal 11, a 60 MHz short duration IF pulse 52 passes through the multiplexer 18 (see FIG. 1) to the comparator circuit 20. The comparator circuit 20 converts the analog IF pulse 52 to a digital pulse train QCOMP 56. As noted, the sampling unit 22 is driven by a free-running 50 MHz clock signal 58 (the clock itself is shown as ASYNC 28 in FIG. 1). PWINDOW 60 and PTRIGEN 62 are internally generated signals of the gate generator logic circuit 26. PWINDOW 60 is triggered on at the opening of WINDOW high 68 to signal the gate generator logic that WINDOW is open. PTRIGEN 62 is triggered on at the opening of QCOMP 70 to signal that the IF pulse is present. When both PWINDOW and PTRIGEN are high, GATE 64 opens at the next leading edge 72 of the clock pulse 58 to begin a look. For the GATE duration (dotted), COUNT 66 traces QCOMP 56 to count the leading edges of the IF pulse train. The effect is that, depending on the timing of the clock&#39;s leading edge 72 within PTRIGEN, each count of QCOMP varies slightly at random. Following a single look of an IF pulse, the system similarly samples the calibration frequency, and the process is repeated for subsequent pairs of IF and calibration signals until WINDOW terminates. 
     As each signal is sampled separately in sequence, each is counted and stored by one of two 12-bit counters 32 and 34 as shown in FIG. 1. In the preferred embodiment, the first counter 32 counts the IF pulses and the second counter 34 counts the calibration pulses. 
     FIG. 3 describes the preferred manner in which the AFC system arranges the two counts to occur. The RF trigger signal at 110 engages the window generator logic circuit 24 (see FIG. 1) to open a window at 112. At the same time, at 112, the trigger at 110 causes an internal toggle command &#34;GATESEL&#34; to set the mutiplexer 18 (see FIG. 1) to first pass an IF pulse (i.e., GATESEL=IF). The &#34;GATESEL&#34; signal is part of the programmable logic of the gate generator logic circuit 26 and is sent through a command path 27 (see FIG. 1) to the multiplexer 18. 
     At 114, the gate generator logic circuit waits for the IF to occur, and, at 116 opens a sampling gate (IF gate) to begin the IF pulse count sequence. An IF count from a single sampling gate is stored in the IF counter 32 (FIG. 1) at 118. The IF gate is closed at 120, and, at 122, the toggle command, GATESEL, switches to set the multiplexer to pass a calibration signal (i.e., GATESEL=CAL). In accordance with this command, at 124, a &#34;SYNTHETIC TRIGGER&#34; generated by the gate generator logic 26 is sent through a command path 29 (see FIG. 1) to cause the calibration circuit 16 to fire a calibration signal. 
     At 126, the gate generator circuit 26 waits for an incoming calibration pulse train. A CAL gate opens at 128 and begins sampling the calibration pulse train. At 130, the resulting count is stored by the calibration counter 34 (see FIG. 1). As the CAL gate closes at 132, the GATESEL command toggles back to receive another IF signal at 134. 
     Upon completing a single look of both signals the gate generator logic circuit checks at 136 to see if the window is still open, if so, the process is repeated 137 to continue sampling. At the close of the window, at 138, each counter is ready to forward count data to a processor 36 (see FIG. 1) for further processing. 
     In the preferred embodiment, as shown in FIG. 1, the AFC system 10 includes a microprocessor 36 to process the count data from the two counters 32 and 34. FIG. 4 describes the interrupt and delay sequence detailing the timing of the IF and calibration pulse count process, and the manner in which the microprocessor receives the count data. As described above, the IF and calibration signals are sampled in sequence. In FIG. 4, between the sampling of an IF pulse, at 150, and a calibration pulse, at 154, a delay of 0.5 to 1.5 μsec is provided at 152 by the gate generator logic circuit 26 to allow the multiplexer 18 to settle. As a single window of sampling terminates at 156, each signal counter sends an interrupt request (IRQ) in sequence to the microprocessor to initiate data processing. 
     In the preferred embodiment, the IF counter 32 issues the first IRQ at 158. A delay of 1 to 3 μsec is provided at 160 to allow the microprocessor to respond and read the IF count data. An IRQ by the calibration counter 34 follows the IF interrupt at 162. At 164, when both counts are made available, the microprocessor 36 begins processing the two counts. 
     The pulse sampling unit 22 will not initiate another count sequence until the microprocessor has responded to and processed both IRQ&#39;s in accordance with the detailed logical flow depicted in FIG. 5. The microprocessor includes a buffer to maintain a running total of a plurality of window counts for each signal. Preferably, no fewer than eight window counts are available to the microprocessor at any given time. In the preferred embodiment, at 172, at the termination of each window count, a statistical average is computed over the eight previous window counts, which include the present window count, for each signal. The averages of the two counts are compared, and the difference between the two averages are further processed according to the mode of operation. 
     As previously indicated the preferred AFC system mode of operation includes system calibration and normal operation modes. The calibration mode takes into account any temperature or voltage variations that may effect the results of the AFC circuitry, such as the comparator 20 and the sampling unit 22 as shown in FIG. 1. 
     Referring back to FIG. 5, at 173, if the system is engaged in the calibration mode, the microprocessor 36 stores in memory, at 174, the difference of the two signal count averages as a reference. Preferably, in the calibration mode, the source IF is tuned to its maximum sensitivity and performance such that the resulting reference takes into account such desired IF performance. 
     In the normal operation mode, at 176, the microprocessor compares a subsequent count difference of the two signals to the stored reference obtained from the calibration mode. The microprocessor 36 then computes an error or correction value as the deviation between the subsequent count difference of the two signals and the stored reference. At 178 to 180, the microprocessor 36 passes the correction value in hexadecimal, to a digital-to-analog converter (DAC) 40 (see FIG. 1). At 180, the DAC produces a corresponding voltage 41, as shown in FIG. 1, to appropriately compensate the voltage controlled local oscillator (LO) 42 of the radar unit. Again, referring to both FIG. 1 and FIG. 5, the corrected carrier frequency from LO closes the control loop 43 of the AFC system 10 and modulates, at 184, the high frequency RF source at mixer 13. 
     Referring back to FIG. 1, the preferred AFC system further includes a detection logic circuit 30 for monitoring any missed RF pulse from the RF source 12 during an active window. The detection of missed RF is realized when, following an RF trigger 19, no IF pulse is realized at the multiplexer 18. In such an event, the gate generator logic circuit 26 sends a signal to the detection logic circuit 30 to hold the current counts in both counters 32, 34 until the RF is restored. 
     Storing intermediate results, system parameters, and executable code are handled by a memory module included in the AFC system 10. The module includes both volatile and non-volatile memory. Executable code and system parameters are stored in non-volatile memory, while the intermediate results relating to sampling and count are stored in volatile memory. The AFC further provides a &#34;Boot-Up&#34; code, stored in non-volatile memory, which allows the system to begin functioning immediately following a &#34;Power-up&#34; or &#34;Reset&#34; condition. 
     The code for implementing the logic for generating the sampling gate pulse and the window size is provided in the Appendix. 
     Equivalents 
     Those skilled in the art will know, or be able to ascertain using no more than routine experimentation, many equivalents to the specific embodiments of the invention described herein. These and all other equivalents are intended to be encompassed by the following claims. 
     
         __________________________________________________________________________APPENDIX© RAYTHEON MARINE COMPANY &#34;1996&#34;__________________________________________________________________________module pwgatei2title &#39; Mark J. DonovanRaytheon Marine CompanyPulse window generator for gating AFC Comparator outputs&#39; &#34; using this one on Prototype Measuremetn Breadboard 10/7/94pwgatei2 DEVICE P22V10&#39;;&#34;inputCLK50M pin 1; &#34;State Machine ClockQCOMP  pin 2; &#34;Output from Zero Crossing Detector. The IF signalPWSEL0 pin 3; &#34;Mode select bitPWSEL1 pin 4; &#34;Mode select bitSRESETN  pin 5; &#34;Reset signalPTRIG  pin 6; &#34;Trigger pulse from radar that indicates the start of a new  PRIIFHIGH pin 7; &#34;Output of Window detector, signifing IF signal has started  highIFLOW  pin 8; &#34;Output of Window detector, signifing IF signal has started  low&#34;outputPWINDOW pin 19 istype com&#39;; &#34;Used internally to indicate start of windowPTRIGEN pin 14 istype com&#39;; &#34;Used internally to indicate start of IF   pulsed dataGATE    pin 17 istype com&#39;; &#34;Used to clock intermmediate Flip/Flop &amp;   counterIFOKAY  pin 16 isiype com&#39;; &#34;Internally used to indicate start of IR   pusled dataSM4     pin 18 istype reg&#39;; &#34;The remaining bits are state bitsSM3     pin 21 istype reg&#39;;SM2     pin 20 istype reg&#39;;SM1     pin 23 istype reg&#39;;SM0     pin 22 istype reg&#39;;&#34;EQUATESH,L,X,CK,Z =1,0,.X.,.C.,.Z.;SMSTATE   =[SM4,SM3,SM2,SM1,SM0];S0    =[0,0,0,0,0];S1    =[0,0,0,0,1];S2    =[0,0,0,1,0];S3    =[0,0,0,1,1];S4    =[0,0,1,0,0];S5    =[0,0,1,0,1];S6    =[0,0,1,1,0];S7    =[0,0,1,1,1];S8    =[0,1,0,0,0];S9    =[0,1,0,0,1];S10   =[0,1,0,1,0];S11   =[0,1,0,1,1];S12   =[0,1,1,0,0];S13   =[0,1,1,0,1];S14   =[0,1,1,1,0];S15   =[1,0,1,0,0];S16   =[1,0,0,0,0];S17   =[1,0,0,0,1];S18   =[1,0,0,1,0];S19   =[1,0,0,1,1];S20   =[1,0,1,0,0];S21   =[1,0,1,0,1];S22   =[1,0,1,1,0];S23   =[1,0,1,1,1];S24   =[1,1,0,0,0];S25   =[1,1,0,0,1];S26   =[1,1,0,1,0];S27   =[1,1,0,1,1];S28   =[1,1,1,0,0];S29   =[1,1,1,0,1];S30   =[1,1,1,1,0];S31   =[1,1,1,1,1]PW40  =!PWSEL1 &amp; PWSEL0;PW100 =PWSEL1 &amp; !PWSEL0;PW400 =PWSEL1 &amp; PWSEL0;equations[SM4.C,SM3.C,SM2.C,SM1.C,SM0.C] = CLK50M;[SM4.SP,SM3.SP,SM2.SP,SM1.SP,SM0.SP] = !SRESETN;PTRIGEN = ((IFOKAY &amp; (SMSTATE.FB=S0) &amp; !PTRIGEN &amp; !PTRIG &amp; PWINDOW)#(PTRIGEN &amp; (SMSTATE.FB=S0)));PWINDOW = (PTRIG&amp;!PWINDOW)#(PWINDOW&amp;(SMSTATE.FB=S0))#(PWINDOW&amp;(SMSTATE.FB=S1));IFOKAY = IFHIGH &amp; SRESETN#IFLOW &amp; SRESETN#(IFOKAY &amp; !(SMSTATE.FB=S31) &amp; SRESETN);GATE = (QCOMP &amp; PW40 &amp; (SMSTATE.FB=S1))#(QCOMP &amp; PW100 &amp; !(SMSTATE.FB=S0) &amp; !(SMSTATE.FB=S1)&amp; !(SMSTATE.FB=S2) &amp; !(SMSTATE.FB=S3) &amp; !(SMSTATE.FB=S4)&amp; !(SMSTATE.FB=S10) &amp; !(SMSTATE.FB=S31))#(QCOMP &amp; PW400 &amp; !(SMSTATE.FB=S0) &amp; !(SMSTATE.FB=S1)&amp; !(SMSTATE.FB=S2) &amp; !(SMSTATE.FB=S3) &amp; !(SMSTATE.FB=S4)&amp; !(SMSTATE.FB=S25) &amp; !(SMSTATE.FB=31));state.sub.-- diagram SMSTATEstate S0:IF (PTRIGEN &amp; SRESETN) THEN S1ELSE S0;state S1:GOTO S2;state S2:GOTO S3;state S3:GOTO S4;state S4:IF (PW40=1) THEN S31;ELSE S5;state S5:GOTO S6;state S6:GOTO S7;state S7:GOTO S8;state S8:GOTO S9;state S9:GOTO S10;state S10:IF (PW100=1) THEN S31;ELSE S11;state S11:GOTO S12;state S12:GOTO S13;state S13:GOTO S14;state S14:GOTO S15;state S15:GOTO S16;state S16:GOTO S17;state S17:GOTO S18;state S18:GOTO S19;state S19:GOTO S20;state S20:GOTO S21;state S21:GOTO S22;state S22:GOTO S23;state S23:GOTO S24;state S24:GOTO S25;state S25:IF (PW400=1) THEN S31;ELSE S0;state S26:GOTO S0;state S27:GOTO S0;state S28:GOTO S0;state S29:GOTO S0;state S30:GOTO S0;state S31:GOTO S0;test.sub.-- vectors([PWSEL0]-&gt;[GATE]);[0]-&gt;[X];end pwgatei2__________________________________________________________________________