Local time pulse signal maintenance method and system under reference loss of lock
By establishing a relationship model of the frequency control word and drift of the digital-to-analog converter, and using the Kalman filter to adjust the local clock source frequency, the problem of frequency drift when the reference signal is lost is solved, and high-precision time synchronization is achieved.
Patent Information
- Application Number
- CN202510473348.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-16
AI Technical Summary
The existing local clock source has severe output frequency drift when the reference signal is lost, and the existing compensation method is complex and time-consuming to operate, making it difficult to maintain high accuracy.
Establish a algorithm model for maintaining the relationship between the frequency control word and the drift amount of the digital-to-analog converter, use the Kalman filter to process the frequency drift amount, and adjust the output frequency of the local clock source through the frequency control word.
When the reference signal is lost, the model is maintained through frequency compensation to reduce data jitter, ensure the local clock source frequency output accuracy, and maintain high-precision time synchronization.
Smart Images

Figure CN120010220B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of timing systems, and particularly to a method and system for maintaining a local time pulse signal under reference loss of lock. Background Art
[0002] A timing card is a hardware device that can provide accurate time synchronization services for computer systems, network devices, etc. based on a high-precision clock source and a time synchronization protocol. It is usually connected to a computer in the form of interfaces such as PCI, PCIe, USB, etc. The timing card can receive external high-precision time source signals, such as GPS satellite signals, Beidou satellite signals, atomic clock signals, etc., and convert these signals into time information that can be recognized and processed by a computer, realizing high-precision synchronization of the computer system with the external standard time, and the precision can usually reach the nanosecond level or even higher.
[0003] To ensure the accuracy of the system time in the case of interruption or loss of the external time source signal, the timing card is usually equipped with a high-precision local clock source and a timekeeping circuit. During normal operation, the timing card continuously calibrates the local clock source to keep it synchronized with the external time source. When the external time source signal is interrupted, the local clock source continues to time using its own high-precision oscillator and fine-tunes the clock through the timekeeping circuit to minimize the accumulation of time errors.
[0004] When the reference signal loses lock, if no compensation measures are taken for the output frequency of the local clock source, the output frequency of the local clock source will drift severely, which is related to the temperature characteristics and aging characteristics of the clock source itself. To address this problem, a frequency-temperature prediction model and a frequency-aging prediction model are usually established. This method is relatively mature and has obvious effects, but to determine the values of the relevant parameters in the model, it requires high requirements for experimental equipment, complex experimental operations, and is very time-consuming. Summary of the Invention
[0005] The main objective of the present invention is to propose a method and system for maintaining a local time pulse signal under reference loss of lock, aiming to solve the technical problem that the existing compensation method for the output frequency of the local clock source is complex and time-consuming.
[0006] To solve the above technical problem, in the first aspect of the present invention, a method for maintaining a local time pulse signal under reference loss of lock is provided. The method includes:
[0007] Establish a holding algorithm model for the relationship between the frequency control words and the drift amount of two digital-to-analog converters;
[0008] When it is monitored that the second pulse signal of the reference source is in a loss-of-lock state, collect the sum of the frequency control words of the two digital-to-analog converters in this round;
[0009] Input the frequency control word and into the hold algorithm model to obtain the new round of frequency control words F of the two digital-to-analog converters w1 (i) and F w0 (i); the formula of the hold algorithm model is as follows:
[0010] f(x, y) = f0 - (k1 × F w1 + k0 × F w0 ) (1)
[0011] F W1 (i) = F W1 (i - 1) ± f(x, y) / k1 (2)
[0012] F W0 (i) = F W0 (i - 1) ± f(x, y) / k0 (3)
[0013] Among them, f(x, y) is the change amount of frequency, also called the drift amount, f0 is a constant; k1 is the coefficient corresponding to the frequency control word of one of the digital-to-analog converters; k0 is the coefficient corresponding to the frequency control word of the other digital-to-analog converter.
[0014] Further, the situation that the second pulse signal of the reference source is detected to be in a locked state specifically includes:
[0015] It is impossible to obtain the new round of time difference data and frequency data between the second pulse signal of the reference source and the second pulse signal of the local clock source.
[0016] Further, before it is detected that the second pulse signal of the reference source is in a locked state, the method includes:
[0017] Taking the second pulse signal of the reference source as a reference, using a time-to-digital converter to measure the time difference data between the second pulse signal of the reference source and the second pulse signal of the local clock source, converting it into a frequency control word through the corresponding conversion relationship, and using two digital-to-analog converters to output voltage adjustment amounts respectively, so as to adjust the output frequency of the local clock source.
[0018] Further, the input of the frequency control word and into the hold algorithm model specifically includes:
[0019] Substitute the frequency control words of this round of the two digital-to-analog converters and into formula (1) to obtain the drift amount f(x, y); use a Kalman filter to perform filtering processing on the drift amount f(x, y).
[0020] Further, input the frequency control word and into the hold algorithm model to obtain the new round of frequency control words F of the two digital-to-analog converters w1 (i) and F w0(i) is as follows:
[0021] When f(x, y) ≥ k1, then F W1 (i) = F W1 (i - 1) ± f(x, y) / k1, F W0 (i) = F W0 ;
[0022] When k0 < f(x, y) < k1, then F W1 (i) = F W1 , F W0 (i) = F W0 (i - 1) ± f(x, y) / k0;
[0023] When f(x, y) ≤ k0, then F W1 (i) = F W1 , F W0 (i) = F v0 ;
[0024] Repeat the above calculations to continuously update the frequency control words F w1 (i) and F w0 (i) of the new round of the two digital - to - analog converters, so as to adjust the output frequency of the local clock source.
[0025] Further, the filtering process of the drift amount f(x, y) by using the Kalman filter includes:
[0026] Assume that the system is at the k - th moment, let the control matrix B = 0, according to the system prediction model, the predicted value at the k - th moment is:
[0027] x(k, k - 1) = Ax(k - 1, k - 1)+ω(k - 1) (4)
[0028] where x(k,k - 1) is the predicted value at the k - th moment, x(k - 1,k - 1) is the optimal estimated value at the (k - 1) - th moment, and w(k - 1) is the process noise;
[0029] The system covariance is expressed as:
[0030] p(k,k - 1) = Ap(k - 1, k - 1))A T +Q (5)
[0031] where p(k,k - 1) is the covariance of x(k,k - 1), p(k - 1,k - 1) is the covariance of x(k - 1,k - 1), AT is the transpose matrix of A, and Q is the covariance matrix of the system excitation noise;
[0032] Combining the predicted value and the observed value to obtain the optimal estimated value x(k, k) at the k - th moment:
[0033] x(k, k) = x(k, k - 1) + Kg(k)[z(k) - Hx(k, k - 1)] (6)
[0034] Kg(k) = p(k, k - 1)H T [Hp(k, k - 1)H T + R] -1 (7)
[0035] p(k, k) = [E - Kg(k)H]p(k, k - 1) (8)
[0036] Where z(k) is the observed value, H is the observation matrix, Kg(k) is the Kalman gain at time k, and E is the identity matrix;
[0037] Let the state matrix A = 1, the observation matrix H = 1, and ignore the process noise and the observation noise, then the above formula is further optimized as:
[0038] x(k, k - 1) = x(k - 1, k - 1) (9)
[0039] p(k, k - 1) = p(k - 1, k - 1) + Q (10)
[0040] x(k, k) = x(k, k - 1) + Kg(k)[z(k) - x(k, k - 1)] (11)
[0041] Kg(k) = p(k, k - 1)[p(k, k - 1) + R] -1 (12)
[0042] p(k, k) = [E - Kg(k)]p(k, k - 1) (13)
[0043] Where Q and R are constants, which are the prediction and observation state covariance matrices respectively;
[0044] Thus, by determining the values of Q and R and given the initial state estimate value x(0, 0) and the initial covariance p(0, 0) value, the predicted value x(k, k - 1) and the optimal estimate value x(k, k) of the time difference data are obtained.
[0045] Furthermore, before using the Kalman filter to filter the drift amount f(x, y), the method includes:
[0046] Before the second pulse signal of the reference source is out of lock, use the time-to-digital converter to measure the time difference data between the second pulse signal of the reference source and the second pulse signal of the local clock source; Let z(k, k) be the observed value at time k, and obtain the initial state estimate value x(0, 0) and the initial covariance p(0, 0) value:
[0047] x(0, 0) = E[z(k, k)] (39)
[0048] p(0, 0) = E[(z(0, 0) - x(0, 0))(z(0, 0) - x(0, 0)) T (40)
[0049] Meanwhile, determine that the ratio of R to Q is set to 1000 - 10000.
[0050] Furthermore, before the second pulse signal of the reference source is in a locked - out state, after measuring the time - difference data between the second pulse signal of the reference source and the second pulse signal of the local clock source using a time - to - digital converter, it further includes:
[0051] Pre - process the time - difference data using the method of 3σ principle and moving average filtering.
[0052] Based on the same inventive concept, a second aspect of the present invention provides a local time pulse signal holding system under reference locked - out, which includes:
[0053] A compensation algorithm module, used to establish a holding algorithm model for the relationship between the frequency control words of two digital - to - analog converters and the drift amount; when it is monitored that the second pulse signal of the reference source is in a locked - out state, collect the frequency control words F w1 and F w0 of this round of the two digital - to - analog converters; input the frequency control words F w1 and F w0 into the holding algorithm model to obtain the new - round frequency control words F w1 (i) and F w0 (i) of the two digital - to - analog converters;
[0054] A frequency control quantity generation module, used to establish a relationship model between the frequency difference and the frequency control word, so as to adjust the output frequency of the second pulse signal of the local clock source;
[0055] A phase control quantity generation module, used to establish a relationship model between the phase difference and the phase control word, so as to adjust the phase of the second pulse signal of the local clock source;
[0056] A digital - to - analog converter conversion module, used to convert the frequency control word into a voltage adjustment quantity, so as to adjust the output frequency of the local clock source;
[0057] A frequency divider module, used to divide the system clock according to the phase control word output by the phase control quantity generation module to obtain the corresponding second pulse signal;
[0058] A selector module, used to select and control the output of a 2 - bit valid gating signal.
[0059] Further, the system further includes:
[0060] A GPS receiver module, configured to receive GPS satellite signals through the antenna of the GPS receiver, decode the GPS satellite signals, and output message information, a 10 MHz signal, and a second pulse signal;
[0061] A monitoring module, configured to monitor the 10 MHz and second pulse signals output by the GPS receiver module;
[0062] A local clock source module, configured to provide a 10 MHz frequency signal for the hardware of the system to maintain;
[0063] A time interval measurement module, configured to measure the time difference data between the second pulse signal of the reference source and the second pulse signal of the local clock source;
[0064] A filter module, configured to perform filtering processing on the time difference data output by the time interval measurement module; thereby removing outliers from the time difference data and reducing the jitter of the time difference data.
[0065] Advantages of the technical solution of the present invention:
[0066] The method and system for maintaining the local time pulse signal under reference loss lock according to the embodiments of the present invention, when the reference signal is lost lock, a new round of time difference data and frequency data between the second pulse signal of the reference source and the second pulse signal of the local clock source cannot be obtained. The system is in the hold mode, and the Kalman filtering method is used to reduce data jitter. By analyzing the frequency drift characteristics of the local clock source, a relationship model between the frequency control word of the dual digital-to-analog converter and the frequency drift amount and a frequency compensation model are established. By compensating the output frequency of the local clock source, the frequency drift caused by factors such as temperature and aging of the local clock source is improved, so that the system can still maintain a high frequency output accuracy within a certain period of time. Description of the Drawings
[0067] The implementation, functional features, and advantages of the objectives of the present invention will be further described in conjunction with the embodiments with reference to the drawings.
[0068] Figure 1 It is a flowchart of the method for maintaining the local time pulse signal under reference loss lock according to the embodiments of the present invention;
[0069] Figure 2 It is a Kalman filtering prediction diagram (R = 0.001, Q = 1) according to the embodiments of the present invention;
[0070] Figure 3 It is a Kalman filtering prediction diagram (R = 1, Q = 0.001) according to the embodiments of the present invention;
[0071] Figure 4Kalman filter prediction diagram (R = 1, Q = 1) for the embodiments of the present invention;
[0072] Figure 5 Flowchart of the holding algorithm for the embodiments of the present invention;
[0073] Figure 6 Block diagram of the local time pulse signal holding system under reference loss of lock for the embodiments of the present invention;
[0074] Figure 7 Time difference data diagram before filtering for the embodiments of the present invention;
[0075] Figure 8 Time difference data diagram after filtering by the method of Lida for the embodiments of the present invention;
[0076] Figure 9 Time difference data diagram after filtering by moving average for the embodiments of the present invention. Detailed implementation manners
[0077] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0078] Embodiment 1
[0079] As Figure 1 shown, the embodiments of the present invention provide a method for holding a local time pulse signal under reference loss of lock, and the method includes:
[0080] S101. Establish a holding algorithm model for the relationship between the frequency control words and the drift amount of two digital-to-analog converters (DACs);
[0081] S102. When it is detected that the second pulse signal of the reference source is in a loss-of-lock state, collect the frequency control words F w1 and F w0 of the current round of the two digital-to-analog converters (DACs);
[0082] S103. Input the frequency control words F w1 and F w0 into the holding algorithm model to obtain the frequency control words F w1 (i) and F w0 (i) of the new round of the two digital-to-analog converters; the formula of the holding algorithm model is as follows:
[0083] f(x, y) = f0 - (k1 × F w1 + k0 × F w0 ) (1)
[0084] F W1 (i) = F W1 (i - 1) ± f(x, y) / k1 (2)
[0085] F W0 (i) = F W0 (i - 1) ± f(x, y) / k0 (3)
[0086] Where f(x, y) is the change in frequency, also known as the drift, f0 is a constant; k1 is the coefficient corresponding to the frequency control word of one of the digital - to - analog converters; k0 is the coefficient corresponding to the frequency control word of the other digital - to - analog converter. Additionally, the above constants or coefficients can be obtained through testing.
[0087] Specifically, the situation that the second - pulse signal of the reference source is detected to be in a locked - out state specifically includes:
[0088] It is impossible to obtain the new round of time - difference data and frequency data between the 1PPS second - pulse signal of the reference source and the 1PPS second - pulse signal of the local clock source.
[0089] Optionally, before it is detected that the second - pulse signal of the reference source is in a locked - out state, the method includes:
[0090] Taking the second - pulse signal of the reference source as a reference, using a time - to - digital converter TDC to measure the time - difference data between the second - pulse signal of the reference source and the second - pulse signal of the local clock source, converting it into a frequency control word through the corresponding conversion relationship, and using two digital - to - analog converters to output voltage adjustment amounts respectively, thereby adjusting the output frequency of the local clock source. As Figure 5 shown, the frequency control word F w1 and F w0 input into the hold - algorithm model specifically includes:
[0091] Bringing the frequency control words F w1 and F w0 of this round of the two digital - to - analog converters into formula (1) to obtain the drift f(x, y); using a Kalman filter to filter the drift f(x, y).
[0092] Specifically, the frequency control words F w1 and F w0 input into the hold - algorithm model to obtain the new - round frequency control words F w1 (i) and F w0 (i) include:
[0093] When f(x, y) ≥ k1, then F W1 (i) = F W1 (i - 1) ± f(x, y) / k1, F W0 (i) = F W0 ;
[0094] When k0 < f(x, y) < k1, then F W1 (i) = F W1 , F W0 (i) = F W0 (i - 1) ± f(x, y) / k0;
[0095] When f(x, y) ≤ k0, then F W1 (i) = F W1 , F W0 (i) = F W0 ;
[0096] Repeat the above calculations to continuously update the frequency control words F w1 (i) and F w0 (i) of the new round of the two digital - to - analog converters, so as to adjust the output frequency of the local clock source.
[0097] Specifically, the filtering process of the drift f(x, y) by using the Kalman filter includes:
[0098] Assume that the system is at time k, let the control matrix B = 0, according to the system prediction model, the predicted value at time k is:
[0099] x(k, k - 1) = Ax(k - 1, k - 1)+ω(k - 1) (4)
[0100] Where x(k, k - 1) is the predicted value at time k, x(k - 1, k - 1) is the optimal estimated value at time k - 1, and w(k - 1) is the process noise;
[0101] The system covariance is expressed as:
[0102] p(k, k - 1) = Ap(k - 1, k - 1)A T +Q (5)
[0103] Where p(k, k - 1) is the covariance of x(k, k - 1), p(k - 1, k - 1) is the covariance of x(k - 1, k - 1), AT is the transpose matrix of A, and Q is the covariance matrix of the system excitation noise;
[0104] Combining the predicted value and the observed value to obtain the optimal estimated value x(k, k) at time k:
[0105] x(k, k) = x(k, k - 1)+Kg(k)[z(k)-Hx(k, k - 1)] (6)
[0106] Kg(k) = p(k, k - 1)H T [Hp(k, k - 1)H T +R] -1 (7)
[0107] p(k, k) = [E - Kg(k)H]p(k, k - 1) (8)
[0108] where z(k) is the observed value, H is the observation matrix, Kg(k) is the Kalman gain at time k, and E is the identity matrix;
[0109] Let the state matrix A = 1, the observation matrix H = 1, and ignore the process noise and the observation noise, then the above formula is further optimized as:
[0110] x(k, k - 1) = x(k - 1, k - 1) (9)
[0111] p(k, k - 1) = p(k - 1, k - 1) + Q (10)
[0112] (k, k) = (k,k - 1) + kg(k)[z(k) - x(k, k - 1)] (11)
[0113] Kg(k) = p(k, k - 1)[p(k, k - 1) + R] -1 (12)
[0114] p(k, k) = [E - Kg(k)]p(k, k - 1) (13)
[0115] where Q and R are constants, which are the prediction and observation state covariance matrices respectively;
[0116] Thus, by determining the values of Q and R and given the initial state estimate value x(0, 0) and the initial covariance p(0, 0) values, the predicted value x(k,k - 1) and the optimal estimate value x(k, k) of the time difference data are obtained.
[0117] Among them, the Kalman filter completes the optimal estimation of the system state through two stages: the state and the prediction. The basic system prediction model of the Kalman filter is as follows:
[0118] Suppose the model of the discrete linear system is as shown in Equation (14) and Equation (15):
[0119] x k = Ax k-1 + Bu k + ω k-1 (14)
[0120] z k = Hx k + v k (15)
[0121] where X k is the system state matrix at time k; Zk is the observed value of the state matrix at time k; A is the state transition matrix; B is the control input matrix; H is the state observation matrix, representing the linear relationship between the state matrix and the observation matrix; ω k-1 is the process noise, V k is the system noise, and both noises are Gaussian white noises; assuming the covariance matrices are Q and R respectively, then we have:
[0122] p(ω) ∈ N(0, Q), p(v) ∈ N(0, R);
[0123] Derive the Kalman filter formula through the established discrete linear system model: Let be the state prediction value, be the optimal estimation value, X k be the true value, and the state estimation covariance matrix is u k , and the Kalman gain is K: From equation (14), the predicted value of the state can be obtained
[0124]
[0125] From equation (15), the optimal estimated value of the state can be obtained
[0126]
[0127] From the above equation, it can be seen that the Kalman gain K represents the ratio of the model prediction error to the measurement error, so the value range of K is [0, 1]; where the prediction error is denoted as K err , and the measurement error is denoted as M err ; K can be expressed in the following form:
[0128] K = K err / (K err + M err ) (18)
[0129] When K = 0, the state of the system is determined by the predicted value, and when K = 1, the state of the system is determined by the observed value; and assume:
[0130] p k = E[e k · e k T (22)
[0131] Among them, is the error between the true value and the predicted value; e k is the error between the true value and the optimal estimated value; is the covariance between the true value and the predicted value; Pk is the covariance between the true value and the optimal estimate;
[0132] From equations (15) and (17), we can obtain:
[0133]
[0134] By performing polynomial operations on the above two equations, we can obtain:
[0135]
[0136] From equations (19) and (20), we can obtain:
[0137]
[0138] Substituting the above equation into equation (22), we can obtain equation (27), and after expansion, we can obtain equation (28):
[0139]
[0140] The above equation is the formula for the covariance of the optimal state estimate, and the estimation principle of the Kalman filter is to minimize the covariance of the optimal state estimate. Therefore, the objective function can be expressed as:
[0141]
[0142] Taking the partial derivative of the Kalman gain matrix K, we can obtain:
[0143]
[0144] From the above equation, the Kalman gain matrix K under the optimal estimation condition can be obtained as:
[0145]
[0146] Combining equations (25) and (28), we can obtain the covariance of the optimal state estimate:
[0147]
[0148] From equation (19), we know that:
[0149]
[0150] Simplifying the above equation, we can obtain:
[0151]
[0152] From equation (21), we can deduce:
[0153]
[0154] The predicted covariance matrix is obtained from the above formula as follows:
[0155]
[0156] In order to unify the time of the formula, the above formula is rewritten as:
[0157]
[0158] The above formulas (16), (17), (31), (32) and (38) are five important formulas of the system prediction basic model of Kalman filtering.
[0159] Specifically, before filtering the drift amount f(x, y) using the Kalman filter, the method includes:
[0160] Before the second pulse signal of the reference source is in the unlocked state, the time difference data between the second pulse signal of the reference source and the second pulse signal of the local clock source is measured by the time-to-digital converter TDC and input. Let z(k, k) be the observed value at time k, and the initial state estimate value x(0, 0) and the initial covariance p(0, 0) values are obtained:
[0161] x(0, 0) = E[z(k, k)] (39)
[0162] p(0, 0) = E[(z(0, 0) - x(0, 0))(z(0, 0) - x(0, 0)) T (40)
[0163] At the same time, determine that the ratio of R to Q is set to 1000 - 10000.
[0164] Specifically, the process of determining the values of R and Q is as follows:
[0165] Take three groups of values of R = 0.001, Q = 1; R = 1, Q = 0.001; and R = 1, Q = 1, and observe the influence of different R / Q values on Kalman filtering.
[0166] From Figure 2 it can be seen that when R = 0.001 and Q = 1, the prediction noise is large, resulting in the observed value being submerged. Therefore, at this time, more trust should be placed in the observed value.
[0167] From Figure 3 it can be seen that when R = 1 and Q = 0.001, the data filtering effect is significant and the predicted value is smoother. Therefore, at this time, more trust should be placed in the predicted value.
[0168] From Figure 4 it can be seen that when R = 1 and Q = 1, at this time, the predicted value and the observed value are not much different.
[0169] Therefore, when using Kalman filtering, the value of R / Q should be set slightly larger. If the value of R / Q is too small, the filtering effect will not be achieved; if the value of R / Q is too large, the original variation characteristics of the data will be lost. Therefore, usually, the ratio of R to Q can be set to 1000 - 10000, which can effectively filter out jitter and make the data smoother.
[0170] Optionally, before the second pulse signal of the reference source is in a locked - out state, after measuring the time - difference data between the second pulse signal of the reference source and the second pulse signal of the local clock source using a time - digital converter (TDC), the following steps are further included:
[0171] Pre - process the time - difference data using the method of Lida's rule and moving average filtering.
[0172] (1) Moving average filtering method
[0173] Moving average filtering takes the average of the sampled values within a period of time and uses the average value as the output value at the current moment. The calculation of this average value can be done using arithmetic mean, weighted mean, exponential mean, etc. The window size of moving average filtering determines the length of time for taking the average. The larger the window, the smoother the filtered signal, but the slower the response speed to signal changes, and vice versa.
[0174] When programming using FPGA (Field - Programmable Gate Array), the value of N is generally a power of 2. For example, when N = 8, the expression of moving average filtering is as follows:
[0175]
[0176] (2) Lida's rule
[0177] Lida's rule is also known as the 3δ method for removing outliers. It takes 3 times the mean of a set of data as the standard. When the next value arrives, it is compared with this 3 - times mean. If it is larger than the 3 - times mean, the data is discarded; otherwise, it is retained. Then, the data mean is recalculated, and the above - mentioned rule is continued to be used for judgment. The confidence probability given by this criterion is 99.73%, which is suitable for the case where the number of data measurements is greater than 50 times. The arithmetic expression is: If then Xi is a gross error value and should be discarded; if then Xi is a normal value and should be retained. Where X is the arithmetic mean of the data, Xi is the new data, and δ is the standard deviation.
[0178] Embodiment 2
[0179] Such as Figure 6As shown in the figure, an embodiment of the present invention further provides a local time pulse signal holding system 100 under reference loss of lock. The system 100 includes:
[0180] A compensation algorithm module 110, configured to establish a holding algorithm model for the relationship between the frequency control words of two digital-to-analog converters (DACs) and the drift amount; when it is detected that the second pulse signal of the reference source is in a loss-of-lock state, collect the frequency control words F w1 and F w0 of this round of the two digital-to-analog converters; input the frequency control words F w1 and F w0 into the holding algorithm model to obtain the new round of frequency control words F w1 (i) and F w0 (i) of the two digital-to-analog converters;
[0181] A frequency control quantity generation module 120, configured to establish a relationship model between the frequency difference and the frequency control word, so as to adjust the output frequency of the second pulse signal of the local clock source;
[0182] A phase control quantity generation module 130, configured to establish a relationship model between the phase difference and the phase control word, so as to adjust the phase of the second pulse signal of the local clock source;
[0183] A digital-to-analog converter (DAC) conversion module 140, configured to convert the frequency control word into a voltage adjustment quantity, so as to adjust the output frequency of the local clock source;
[0184] A frequency divider module 150, configured to divide the system clock according to the phase control word output by the phase control quantity generation module to obtain the corresponding second pulse signal;
[0185] A selector module 160, configured to select and control the output of a 2-bit valid gating signal.
[0186] Specifically, the gating signal is composed of a "monitoring signal + channel signal", which are provided by the monitoring module 170 and the host computer respectively. When the gating signal is "10", the output channel of the reference source is opened; when the gating signal is "11", both the output channels of the reference source and the local clock source are opened; when the gating signal is "01", the output channel of the local clock source is opened; when the gating signal is "00", both the output channels of the reference source and the local clock source are closed.
[0187] The system further includes:
[0188] A GPS receiver module 180, configured to receive GPS satellite signals through the antenna of the GPS receiver, decode the GPS satellite signals, and then output message information, a 10 MHz signal, a 1PPS signal, etc.; usually, the 1PPS signal output by the GPS receiver module contains noise.
[0189] The monitoring module 170 is used to monitor the 10MHz and 1PPS signals output by the GPS receiver module 180. If the GPS signal is locked, the monitoring signal outputs "1", otherwise, the monitoring signal outputs "0".
[0190] The local clock source module 190 is used to provide a 10MHz frequency signal for the hardware to maintain the system;
[0191] The time interval measurement module 1100 is used to measure the time difference data between the second pulse signal of the reference source and the second pulse signal of the local clock source;
[0192] The filter module 1110 is used to filter the time difference data output by the time interval measurement module 1100, so as to remove the outliers of the time difference data and reduce the jitter of the time difference data.
[0193] Specifically, the local clock source module 190 of this system uses an oven controlled crystal oscillator (OCXO). The OCXO can minimize the influence of the surrounding environment temperature, and its performance is better than other quartz crystal oscillators. The frequency drift of the crystal oscillator is mainly caused by the aging characteristics, and within a certain period of time, there is a linear relationship between the crystal oscillator frequency and the aging characteristics, and the compensation amount of the crystal oscillator frequency is determined by the frequency control word.
[0194] This system is based on the GPS1PPS signal output by the GPS timing receiver chip. It uses a time to digital convertor (TDC) module to measure the time difference between GPS1PPS and the local OCXO 1PPS, converts it into a frequency control word through the corresponding conversion relationship, and uses a digital to analog convertor (DAC) module to output a voltage adjustment amount, so as to adjust the output frequency of the local crystal oscillator.
[0195] In order to improve the accuracy of the time difference data, the processing of the data adopts the method of the 3-sigma principle, the moving average filtering method and the Kalman filtering method, mainly to remove the outliers of the data and reduce the data jitter; when the reference signal is locked, a frequency modulation and phase modulation hold algorithm model is established. Since the signal output by GPS has long-term stability, but its short-term effect is average, while the short-term stability of the crystal oscillator is better, especially the oven controlled crystal oscillator (OCXO), and the short-term stability can reach 10 -7 -10 -9, and considering its low cost, high precision, and good stability, the system adopts the combination of "FPGA + host computer", which is mainly divided into the FPGA hardware part and the host computer program part. The hardware part is mainly responsible for time difference measurement, data processing, implementation of the taming algorithm, and the hold algorithm, etc., while the host computer program part is mainly responsible for message parsing and display, data storage, and positioning display, etc. When the reference signal is locked, the system is in the taming mode, and the local OCXO is tamed with the GPS1PPS signal to make its output 1PPS and 10MHz signals with the same frequency and phase as the GPS; when the reference signal is unlocked, the system is in the hold mode, and through the hold model and compensation algorithm, the output frequency of the local OCXO is continuously tamed, thus ensuring the high precision and high stability of the output of the local OCXO.
[0196] Often triggered by the rising edge of the GPS1PPS signal to generate the local 1PPS signal, so as to control the initial time difference between the two within about 1 clock cycle. Moreover, the higher the frequency of the local OCXO, the smaller the initial time difference between the two, but a higher crystal oscillator frequency will increase the circuit burden and power consumption. In addition, when measuring the time difference between the GPS1PPS signal and the local 1PPS signal, the rising edge of the GPS1PPS signal is often used as the opening signal, and the rising edge of the local 1PPS signal is used as the closing signal. However, the signal jitter of GPS 1PPS may be about 5ns - 8ns, which will cause the opening signal and the closing signal to be constantly changing, increasing the burden on the time difference measurement module. Therefore, in this embodiment, the system clock of the FPGA is 100MHz after being frequency-multiplied by the clock source. Triggered by the rising edge of the GPS1PPS signal and waiting for 100ms, the local 1PPS signal is regenerated. This can not only avoid the above problems, but also is conducive to later test observation. If it is found during the test that the initial time difference between the reference 1PPS signal and the local 1PPS signal is about 100ms, it proves that the measurement module of the hold system is working properly, otherwise, each module needs to be checked again.
[0197] It can be seen that the accuracy of the time difference data directly affects the hold precision. Therefore, it is very necessary to preprocess the time difference data. Considering that the preprocessing of the data is mainly implemented in the FPGA, the method of the 3-sigma rule and moving average filtering is selected.
[0198] The specific implementation is as follows: When the GPS1PPS signal and the local OCXO 1PPS signal enter the time-to-digital converter TDC measurement module, the time difference data between the two can be obtained after processing. Among them, the time difference data is divided into the time difference data during frequency modulation and the time difference data during phase modulation. For the time difference data during frequency modulation, since the local OCXO 1PPS signal is triggered by the rising edge of the GPS1PPS signal and generated after waiting for 100ms, this time difference data is an unsigned number, that is, the data is non-negative.
[0199] When the time difference data is negative, it indicates that the count value at this time exceeds the measurement bit width of the time-to-digital converter TDC, and 224 needs to be added to this count value. Thus, a gate threshold is set: the maximum value is 300 ms and the minimum value is 0 s.
[0200] For the time difference data during phase modulation, since this data is a signed number, that is, it can be positive or negative, but the initial time difference before adjustment is about 100 ms. Thus, a gate threshold is set: the maximum value is 300 ms and the minimum value is -300 ms. The gate threshold method can first filter out some gross errors during measurement, and then input the time difference data filtered by the gate threshold into the filter module for data preprocessing.
[0201] It should be noted that: when using the 3σ principle for signed numbers, the data needs to be taken the absolute value first, and then the mean value is calculated and compared.
[0202] As Figure 7 , 8 shown, the horizontal axis is time (unit: s), and the vertical axis is the time difference data (unit: ps). Among them, Figure 7 is the time difference data before filtering by the 3σ principle. As Figure 7 can be seen, there are some outliers in the time difference data, which results in the mean value of the whole group of time difference data being: 1.0011×10^11 ps, and the standard deviation being: 6.4752×10^9 ps. After filtering by the 3σ principle, the time difference data is as Figure 8 shown. As Figure 8 can be seen, the outliers in the data are filtered out, making the mean value of the whole group of time difference data drop to: 1.00002427×10^11 ps, and the standard deviation drop to: 2.1278×10^3 ps. Thus, it can be seen that the 3σ principle has a significant effect on removing outliers, but the data jitter is still very large, which is not conducive to the subsequent tame and hold processing. Therefore, the time difference data filtered by the 3σ principle is further subjected to moving average filtering, and the sliding window is generally taken as the nth power of 2. In this embodiment, the sliding window of the moving average filtering is selected as 8, and the time difference after sliding filtering is as Figure 9 shown.
[0203] Figure 9 The horizontal axis is time, the unit is s, and the vertical axis is the time difference data, the unit is ps. Compared with the data without sliding filtering, the mean value of the filtered time difference data drops to: 1.00002425×10^11 ps, and the standard deviation drops to: 1.5856×10^3 ps. It can be seen that after the moving average filtering, although the mean value of the time difference data does not change much, the time difference data is much smoother, which is beneficial to the subsequent tame and hold adjustment.
[0204] The method and system for maintaining the local time pulse signal under reference loss of lock according to the embodiments of the present invention. When the reference signal loses lock, new time difference data and frequency data between the second pulse signal of the reference source and the second pulse signal of the local clock source cannot be obtained. When the system is in the hold mode, the Kalman filtering method is used to reduce data jitter. By analyzing the frequency drift characteristics of the local clock source, a relationship model between the frequency control word of the dual digital-to-analog converter and the frequency drift amount and a compensation model for frequency are established. By compensating the output frequency of the local clock source, the frequency drift caused by factors such as temperature and aging of the local clock source is improved, so that the system can still maintain a high frequency output accuracy within a certain period of time.
[0205] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present invention.
Claims
1. A method for maintaining a local time pulse signal under reference loss of lock, characterized in that The method includes: Establishing a holding algorithm model for the relationship between the frequency control words and the drift amount of two digital-to-analog converters; the formula of the holding algorithm model is as follows: f(x,y) = f0 - (k1×F w1 + k0×F w0 ) (1) F W1 F(i) = F W1 F(i - 1) ± f(x, y) / k1 (2) F W0 F(i) = F W0 F(i - 1) ± f(x, y) / k0 (3) Where f(x,y) is the change in frequency, also called the drift amount, f0 is a constant; k1 is the coefficient corresponding to the frequency control word of one of the digital-to-analog converters; k0 is the coefficient corresponding to the frequency control word of the other digital-to-analog converter; When it is detected that the second pulse signal of the reference source is in a locked - out state, collect the frequency control words F w1 and F w0 ; According to the frequency control word F w1 and F w0 Combined with the holding algorithm model, two new round frequency control words F w1 (i) and F w0 (i) are obtained; specifically as follows: When f(x, y) ≥ k1, then F W1 (i) = F W1 (i - 1) ± f(x, y) / k1, F W0 (i) = F W0 ; When k0 < (x, y) < k1, then F W1 (i) = F W1 , F W0 (i) = F W0 (i - 1) ± f(x, y) / k0; When f(x, y) ≤ k0, then F W1 (i) = F W1 , F W0 (i) = F W0 ; Repeat the above calculation to continuously update the frequency control words F w1 (i) and F w0 (i) of the new round of the two digital-to-analog converters, so as to adjust the output frequency of the local clock source.
2. The method for maintaining the local time pulse signal under reference loss of lock according to claim 1, wherein The situation that the second pulse signal of the reference source is monitored to be in an unlocked state specifically includes: Unable to obtain new time difference data and frequency data between the second pulse signal of the reference source and the second pulse signal of the local clock source.
3. The method for maintaining the local time pulse signal under reference loss of lock according to claim 1, wherein Before it is monitored that the second pulse signal of the reference source is in an unlocked state, the method includes: Taking the second pulse signal of the reference source as a reference, using a time-to-digital converter to measure the time difference data between the second pulse signal of the reference source and the second pulse signal of the local clock source, converting it into a frequency control word through the corresponding conversion relationship, and using two digital-to-analog converters to respectively output voltage adjustment amounts, so as to adjust the output frequency of the local clock source.
4. The method for maintaining the local time pulse signal under the reference lock loss according to claim 1, characterized in that The frequency control word F w1 and F w0 Input to the holding algorithm model specifically includes: Substitute the frequency control words F of this round of the two digital-to-analog converters w1 and F w0 into formula (1) to obtain the drift amount f(x, y); use a Kalman filter to perform filtering processing on the drift amount f(x, y).
5. The method for maintaining the local time pulse signal under reference loss of lock according to claim 4, characterized in that, The filtering process of the drift amount f(x,y) using a Kalman filter includes: Assume that the system is at time k, let the control matrix B = 0, according to the system prediction model, the predicted value at time k is: x(k,k - 1) = Ax(k - 1,k - 1) + ω(k - 1) (4) Where x(k,k - 1) is the predicted value at time k, x(k - 1,k - 1) is the optimal estimated value at time k - 1, and w(k - 1) is the process noise; The system covariance is expressed as: p(k,k - 1)=Ap(k - 1,k - 1)A T +Q (5) where p(k,k - 1) is the covariance of x(k,k - 1), p(k - 1,k - 1) is the covariance of x(k - 1,k - 1), A T is the transpose matrix of A, and Q is the covariance matrix of the system excitation noise; Combining the predicted value and the observed value to obtain the optimal estimated value x(k,k) at time k: x(k,k) = x(k,k - 1) + Kg(k)[z(k) - Hx(k,k - 1)] (6) Kg(k) = p(k,k - 1)H T [Hp(k,k - 1)H T +R] -1 (7) p(k,k) = [E - Kg(k)H]p(k,k - 1) (8) Where z(k) is the observed value, H is the observation matrix, Kg(k) is the Kalman gain at time k, and E is the identity matrix; Let the state matrix A = 1, the observation matrix H = 1, ignoring the process noise and the observation noise, then the above formula is further optimized as: x(k,k - 1) = x(k - 1,k - 1) (9) p(k,k - 1) = p(k - 1,k - 1) + Q (10) x(k,k) = x(k,k - 1) + Kg(k)[z(k) - x(k,k - 1)] (11) Kg(k) = p(k,k - 1)[p(k,k - 1)+R] -1 (12) p(k,k) = [E - Kg(k)]p(k,k - 1) (13) Where Q and R are constants, which are the prediction and observation state covariance matrices respectively; Thus, determining the values of Q and R and the values of the initial state estimate x(0,0) and the initial covariance p(0,0), and obtaining the predicted value x(k,k - 1) and the optimal estimated value x(k,k) of the time difference data.
6. The method for maintaining the local time pulse signal under reference loss of lock according to claim 5, wherein Before the filtering process of the drift amount f(x,y) using a Kalman filter, the method includes: Before the second pulse signal of the reference source is in a locked - out state, use a time - to - digital converter to measure the time - difference data between the second pulse signal of the reference source and the second pulse signal of the local clock source; let z(k,k) be the observed value at time k, and obtain the initial state estimate value x(0,0) and the value of the initial covariance p(0,0): x(0,0)=E[z(k,k)] (39) p(0,0) = E[(z(0,0) - x(0,0))(z(0,0) - x(0,0)) T (40) At the same time, determine that the ratio of R and Q is set to 1000 - 10000.
7. The method for maintaining the local time pulse signal under the reference loss of lock according to claim 3, characterized in that Before the second pulse signal of the reference source is in a locked - out state, after using a time - to - digital converter to measure the time - difference data between the second pulse signal of the reference source and the second pulse signal of the local clock source, it further includes: Pre - process the time - difference data using the method of 3σ criterion and moving average filtering.
8. A local time pulse signal holding system under reference loss of lock, characterized in that, The system includes: A compensation algorithm module is used to establish a hold algorithm model for the relationship between the frequency control words and the drift amounts of two digital-to-analog converters; when it is detected that the second pulse signal of the reference source is in an unlocked state, the frequency control words F w1 and F w0 of this round of the two digital-to-analog converters are collected; The formula of the hold algorithm model is as follows: f(x,y) = f0 - (k1×F w1 + k0×F w0 ) (1) F W1 F(i) = W1 F(i - 1) ± f(x, y) / k1 (2) F W0 F(i) = F W0 F(i - 1) ± f(x, y) / k0 (3) Among them, f(x,y) is the change in frequency, also called the drift, f0 is a constant; k1 is the coefficient corresponding to the frequency control word of one of the digital - to - analog converters; k0 is the coefficient corresponding to the frequency control word of the other digital - to - analog converter; According to the frequency control word F w1 and F w0 Combined with the holding algorithm model, the new round of frequency control words F w1 (i) and F w0 (i) are obtained, specifically as follows: When f(x,y)≥k1, then F W1 (i) = F W1 ((i - 1) ± f(x,y) / k1, F W0 (i) = F W0 ; When k0 < f(x, y) < k1, then F W1 (i) = F W1 , F W0 (i) = F W0 (i - 1) ± f(x, y) / k0; When f(x,y) ≤ k0, then F W1 (i) = F W1 , F W0 (i) = F W0 ; Repeat the above calculations to continuously update the frequency control words F w1 (i) and F w0 (i) of the new round of the two digital-to-analog converters, so as to adjust the output frequency of the local clock source; A frequency control quantity generation module, used to establish a relationship model between the frequency difference and the frequency control word, so as to adjust the output frequency of the second pulse signal of the local clock source; A phase control quantity generation module, used to establish a relationship model between the phase difference and the phase control word, so as to adjust the phase of the second pulse signal of the local clock source; A digital - to - analog converter conversion module, used to convert the frequency control word into a voltage adjustment quantity, so as to adjust the output frequency of the local clock source; A frequency divider module, used to divide the system clock according to the phase control word output by the phase control quantity generation module to obtain the corresponding second pulse signal; A selector module, used to select and control the output of a 2 - bit valid gating signal.
9. The local time pulse signal holding system under reference loss of lock according to claim 8, characterized in that, The system further includes: A GPS receiver module, used to receive GPS satellite signals through the antenna of the GPS receiver, decode the GPS satellite signals, and output message information, a 10MHz signal, and a second pulse signal; A monitoring module, used to monitor the 10MHz and second pulse signals output by the GPS receiver module; A local clock source module, used to provide a 10MHz frequency signal for the hardware of the hold system; A time - interval measurement module, used to measure the time - difference data between the second pulse signal of the reference source and the second pulse signal of the local clock source; A filter module, used to filter the time - difference data output by the time - interval measurement module.
Citation Information
Patent Citations
Backup clock calibrated by GPS
CN101799658A
Satellite receiver second pulse signal frequency stabilization and phase correction device and method
CN106209338A