Bidirectional time comparison method and system based on USRP 1PPS trigger error correction

By generating a 1PPS signal inside the USRP, comparing it with an external PPS signal, and compensating for it in the solution model, the problem of nanosecond-level deviation affecting pseudorange calculation in the existing technology is solved, and efficient improvement of time comparison accuracy is achieved.

CN121907384APending Publication Date: 2026-04-21BEIJING INST OF RADIO METROLOGY & MEASUREMENT
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING INST OF RADIO METROLOGY & MEASUREMENT
Filing Date
2026-01-13
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing time comparison and timing systems rely on an external 10MHz reference and PPS signal, resulting in nanosecond-level deviations that affect the accuracy of pseudorange calculations. Furthermore, the PPS_OUT interface of general-purpose software-defined radios such as USRP cannot reflect internal clock errors. Existing calibration methods are complex, costly, and lack versatility.

Method used

By generating a 1PPS signal based on the USRP's internal clock at the software level, comparing it with an external PPS, calculating the trigger error, and compensating for it in the pseudorange and time calculation model, hardware modifications and FPGA development are avoided.

Benefits of technology

It enables the acquisition of real triggering errors at the software level, significantly reducing the engineering implementation threshold and cost, and directly incorporates them into the pseudorange and time calculation model for error correction, thereby improving the accuracy of time comparison.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121907384A_ABST
    Figure CN121907384A_ABST
Patent Text Reader

Abstract

The invention provides a bidirectional time comparison method for USRP 1PPS trigger error correction, and the method comprises the steps: determining the stable state of a USRP internal clock according to a preset clock source parameter, a preset time source parameter and preset time; the method comprises the following steps: establishing a unified time reference, periodically reading the internal time of the USRP based on the unified time reference, presetting two GPIO (General Purpose Input / Output) control timing commands by utilizing a timing command interface of the USRP at each whole second moment about to arrive, and generating an internal 1PPS signal taking an internal door control clock as a reference; generating a first trigger error estimation value and a second trigger error estimation value according to the internal 1PPS signal, the external 1PPS signal and the information of the two stations; and introducing a compensation item into a bidirectional time comparison solution model, generating a pseudo-range and time solution model, substituting the first trigger error estimation value and the second trigger error estimation value into the pseudo-range and time solution model, and generating error correction of bidirectional time comparison. The problem that the current USRP time synchronization precision is not high is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wireless communication, specifically to a bidirectional time comparison method and system based on USRP 1PPS trigger error correction. Background Technology

[0002] Existing time comparison and synchronization systems typically rely on an external 10MHz reference and a PPS (Pulse-Per-Second) signal for synchronization, resulting in a nanosecond-level deviation between the internal reference clock and the external PPS. This deviation directly degrades the accuracy of pseudorange calculation and timing, especially in high-precision comparisons at the nanosecond level. Current calibration methods mostly focus on hardware link delay compensation or cable length correction, lacking measurement trigger error, thus limiting the calibration effectiveness.

[0003] Furthermore, most general-purpose software-defined radio devices, such as the USRP, although they have a PPS_OUT interface for outputting PPS, are not directly generated by the internal clock, but rather are delayed forwards of external PPS, which cannot reflect the true triggering error of the device's internal clock. To obtain the true error, a common approach is to carry out FPGA-level development to count and compare the input / output PPS in hardware, but this is complex to implement, costly, and lacks versatility.

[0004] Therefore, the PPS trigger calibration method proposed in this paper does not rely on complex hardware modifications, can obtain the PPS based on the internal clock at the software level and accurately compare it with the external PPS, and then directly use the measured trigger error for pseudorange numerical compensation, so as to balance the implementation complexity and time comparison accuracy. Summary of the Invention

[0005] To address the issue of low time synchronization accuracy of USRP 1PPS in practical applications, this application provides a bidirectional time comparison method and system based on USRP 1PPS trigger error correction.

[0006] The first aspect of this application provides a bidirectional time comparison method based on USRP1PPS trigger error correction, comprising: The internal clock stability state of the USRP is determined based on the preset clock source parameters, preset time source parameters, and preset time. Construct a unified time reference, and periodically read the internal time of the USRP based on the unified time reference. At each integer second that is about to arrive, use the timing command interface of the USRP to preset two GPIO control timing commands to generate an internal 1PPS signal based on the internal door control clock. Based on the internal 1PPS signal, the external 1PPS signal, and the information from the two stations, a first trigger error estimate and a second trigger error estimate are generated. A compensation term is introduced into the bidirectional time comparison solution model to generate a pseudorange and time solution model. The first trigger error estimate and the second trigger error estimate are substituted into the pseudorange and time solution model to generate the error correction for bidirectional time comparison.

[0007] In a possible implementation, determining the stable state of the USRP's internal clock based on preset clock source parameters, preset time source parameters, and preset time includes: The internal control clock of the USRP is set according to the preset clock source parameters and the preset time source parameters to generate the USRP phase-locked loop state; The internal gate control clock frequency and phase stability are determined based on the phase-locked loop state, thus determining the stable state of the USRP internal clock.

[0008] In a possible implementation, the construction of a unified time base includes: Get the current system time and calculate the next full second. The next full second is set as the absolute time that the USRP's internal time should align with when the next external second pulse signal arrives, thus establishing a unified time reference.

[0009] In a possible implementation, obtaining the current system time and calculating the next full second includes: Obtain the current system time, and round the system time to obtain the current whole second. Calculate the next whole second based on the current whole second.

[0010] In a possible implementation, the step of using the USRP's timing command interface to preset two GPIO control timing commands to generate an internal 1PPS signal based on the internal departmental clock includes: Read the internal real-time time of the USRP according to the preset cycle; When the internal real-time time approaches the next full second, the first command is preset through the timer command interface, and the GPIO pin is set to a high level at the next full second. The GPIO pin is restored to a low level based on the integer second and the preset pulse width, generating an internal 1PPS signal.

[0011] In a possible implementation, determining the preset pulse width includes: Based on the obtained resolution, determine the minimum value of the preset pulse width; Based on the signal recognition requirements, the final value of the preset pulse width is limited to a preset range.

[0012] In a possible implementation, generating a first trigger error estimate and a second trigger error estimate based on the internal 1PPS signal, the external 1PPS signal, and the information from the two stations includes: Collect the rising edge timestamps of the internal 1PPS signal and the external 1PPS signal of the first station, and record the arrival time of the internal 1PPS signal and the arrival time of the external 1PPS signal in the nth cycle; Calculate the arrival time difference based on the arrival time of the internal 1PPS signal and the arrival time of the external 1PPS signal; Collect n arrival time differences for n consecutive periods, and generate a first station sequence based on the n arrival time differences; Based on the first site sequence, a first trigger error estimate is generated; By combining the above steps with the second site, a second trigger error estimate is obtained.

[0013] In a possible implementation, generating a first trigger error estimate based on the first site sequence includes: Calculate the linear trend coefficient based on the first station sequence; A fitted curve is generated based on the linear trend coefficient; The arithmetic mean of the multiple periodic fitting values ​​of the fitted curve is taken to generate the first trigger error estimate.

[0014] In a possible implementation, the introduction of a compensation term into the bidirectional time-comparison solution model includes: Compensate the original pseudoranges of the first station and the original pseudoranges of the second station to generate the first compensated pseudorange and the second compensated pseudorange. Based on the first compensated pseudorange and the second compensated pseudorange combined with the clock error formula, the first clock error and the second clock error are generated.

[0015] A second aspect of this application provides a bidirectional time comparison system for USRP 1PPS triggered error correction, characterized in that the system comprises: The parameter module is used to determine the stable state of the USRP's internal clock based on preset clock source parameters, preset time source parameters, and preset time. The internal signal generation module is used to construct a unified time base. Based on the unified time base, it periodically reads the internal time of the USRP. At each integer second that is about to arrive, it uses the timing command interface of the USRP to preset two GPIO control timing commands to generate an internal 1PPS signal based on the internal door control clock. The estimation value generation module is used to generate a first trigger error estimate and a second trigger error estimate based on the internal 1PPS signal, the external 1PPS signal and the information of the two stations. The correction module is used to introduce a compensation term into the bidirectional time comparison solution model, generate a pseudorange and time solution model, and substitute the first trigger error estimate and the second trigger error estimate into the pseudorange and time solution model to generate the error correction for bidirectional time comparison.

[0016] As can be seen from the above technical solution, this application requires no hardware modification and is simple to implement. This invention is entirely based on the existing software interface and GPIO capabilities of the USRP, generating an internal 1PPS and measuring the trigger error through software. It requires no secondary development of the USRP's internal FPGA logic or modification of the existing hardware links, significantly reducing the engineering implementation threshold and development cost. Furthermore, this application can directly obtain the true internal trigger error. Since the internal 1PPS is driven by an internal gate-controlled clock for timing output, rather than a delayed forwarding of the external PPS, the measured time difference truly reflects the trigger error of the USRP's internal clock relative to the external PPS, compensating for the deficiency of the PPSOUT interface in characterizing internal errors. Finally, the trigger error estimate calculated by this application can be directly incorporated into the pseudorange and time calculation model. This invention explicitly models the trigger error as... and through The method directly compensates for the pseudorange and time comparison results, so that the error correction is not only limited to the link calibration level, but also enters the final measurement and calculation model, and the calibration effect can be quantified. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the internal 1PPS calibration principle of the GPIO output of the USRP in the embodiments of this application.

[0019] Figure 2 This is a diagram of a bidirectional time comparison system in an embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] It should be noted that USRP stands for Universal Software Radio Peripheral, which in this application has functions such as external reference clock access, PPS signal input / output, GPIO pin control, and signal transmission and reception. It can achieve internal 1PPS generation and timestamp recording through software driver without modification, and is the hardware core of bidirectional time comparison. GPIO stands for General Purpose Input / Output, which is the native hardware interface of USRP. It can be configured as input or output mode through software. In this application, the GPIO pin of USRP is configured as output mode for software to generate internal 1PPS signals based on the internal gate clock. It is the key interface to achieve no hardware modification. FPGA stands for Field-Programmable Gate Array, which is a semiconductor chip whose logic functions can be customized through hardware description language. It is one of the core hardware components of USRP. Traditional solutions require low-level FPGA development to implement PPS counting and comparison. This application avoids secondary development of the FPGA by controlling GPIO and timing interfaces through software, thus lowering the engineering threshold. 1PPS stands for Pulse-Per-Second, which is an electrical signal that outputs one pulse per second periodically. Its core feature is that the rising edge of the pulse precisely corresponds to the whole second. This application uses two types of 1PPS: one is an external 1PPS, derived from high-precision sources such as atomic clocks and GPS, serving as a time reference; the other is an internal 1PPS, generated by GPIO software, reflecting the state of the USRP's internal gate clock. The comparison between the two is used to measure trigger error.

[0022] It should be noted that this application uses a USRP device, such as a USRPX310, an external 10MHz and 1PPS reference source, such as a hydrogen clock, a host computer, and a time interval counter, such as a KEYSIGHT53230A, to form the experimental platform. Figure 1 As shown, the external 10MHz and 1PPS clocks are connected to the USRP reference clock input port and PPS input port, respectively. The host computer communicates with the USRP via Ethernet and uses a pin of the USRP's front panel GPIO as the internal 1PPS output port. The time interval counter receives both the external 1PPS and the USRP's internal 1PPS clocks and measures the time difference between them.

[0023] Based on this, this application provides an implementation method for a bidirectional time comparison method based on USRP 1PPS trigger error correction, comprising: S101 determines the stable state of the USRP's internal clock based on preset clock source parameters, preset time source parameters, and preset time.

[0024] S102, construct a unified time reference, periodically read the internal time of the USRP based on the unified time reference, and at each integer second that is about to arrive, use the timing command interface of the USRP to pre-set two GPIO control timing commands to generate an internal 1PPS signal based on the internal gate control clock.

[0025] S103, based on the internal 1PPS signal, the external 1PPS signal and the information of the two stations, generate a first trigger error estimate and a second trigger error estimate.

[0026] S104, Introduce a compensation term into the bidirectional time comparison solution model to generate a pseudorange and time solution model. Substitute the first trigger error estimate and the second trigger error estimate into the pseudorange and time solution model to generate the error correction for bidirectional time comparison.

[0027] It should be noted that in S101, the external 10MHz clock source parameter is used to provide a frequency reference for the USRP device, and the external 1PPS time source parameter is used to provide a second pulse reference for the USRP device. Furthermore, this application includes at least two USRP devices, a host computer connected to each USRP device, a time interval counter, and a signal interaction link. Each USRP device is configured with GPIO pins for generating an internal 1PPS signal and supports locking the external clock source and time source, as well as internal time alignment. The host computer is used to control the USRP devices to complete reference configuration, internal time alignment, internal 1PPS generation, and data processing. The time interval counter is used to simultaneously receive the internal 1PPS signal and the external 1PPS signal output by the USRP device and measure their time difference. The signal interaction link is used for time comparison signal transmission between the two stations, realizing bidirectional timestamp recording and calculation.

[0028] This application requires no hardware modification and is simple to implement. Based entirely on the existing software interface and GPIO capabilities of the USRP, it generates an internal 1PPS and measures the trigger error through software. No secondary development of the USRP's internal FPGA logic or modification of the existing hardware links is required, significantly reducing the engineering threshold and development cost. Furthermore, this application can directly obtain the true internal trigger error. Since the internal 1PPS is driven by an internal gate-controlled clock for timing output, rather than a delayed forwarding of the external PPS, the measured time difference truly reflects the trigger error of the USRP's internal clock relative to the external PPS, compensating for the PPSOUT interface's inability to characterize internal errors. Finally, the trigger error estimate calculated in this application can be directly incorporated into the pseudorange and time calculation model. This invention explicitly models the trigger error as... and through The method directly compensates for the pseudorange and time comparison results, so that the error correction is not only limited to the link calibration level, but also enters the final measurement and calculation model, and the calibration effect can be quantified.

[0029] In one embodiment that can be implemented in this application, determining the stable state of the USRP's internal clock based on preset clock source parameters, preset time source parameters, and preset time includes: S201, Set the internal control clock of the USRP according to the preset clock source parameters and the preset time source parameters to generate the USRP phase-locked loop state; S202, determine the stability of the internal gate control clock frequency and phase based on the phase-locked loop state, and determine the stable state of the USRP internal clock.

[0030] For example, the reference clock source parameter of the USRP is set to an external 10MHz, and the time source parameter is set to an external 1PPS, so that the internal gate clock of the USRP is locked to the external parameters in terms of frequency and second pulse. To ensure the stability of the phase-locked loop, the locking status of the internal phase-locked loop of the USRP is then monitored. After the phase-locked loop outputs a locking signal, it continues to maintain a waiting state for 1-5 minutes to confirm that the frequency and phase of the internal gate clock are stable, thus completing the internal clock stabilization process.

[0031] For example, the closed-loop regulation of a phase-locked loop (PLL) needs to undergo a dynamic convergence process. When it is first locked, the VCO control voltage output by the loop filter is not yet completely stable and still has slight ripples, causing the internal gate clock output of the VCO to have phase differences. Short-term fluctuations are mitigated by the PLL outputting a lock signal and maintaining a waiting state for 1-5 minutes. This sufficiently long waiting time allows the VCO control voltage to stabilize, reducing ripple to within ±1ns. The frequency / phase of the internal gate control clock is entirely based on an external 10MHz reference, ultimately achieving long-term stability. Too short a preset time will result in residual fluctuations, while too long a time will reduce efficiency.

[0032] In one embodiment that can be implemented in this application, the construction of a unified time base includes: S301, obtain the current system time and calculate the next full second; S302 sets the next whole second as the absolute time that the USRP's internal time should align with when the next external second pulse signal arrives, thus establishing a unified time reference.

[0033] For example, in the USRP internal time alignment and initialization, the host computer obtains the current system time, calculates the next whole second, and sets the next whole second as the absolute time that the USRP internal time should be aligned with when the next external PPS arrives through the USRP driver interface, so that the USRP internal time completes whole second alignment at the trigger edge of the external PPS and establishes a unified time reference.

[0034] In one embodiment that can be implemented in this application, obtaining the current system time and calculating the next whole second includes: S401, Obtain the current system time, and perform a rounding operation on the system time to obtain the current whole second; S402, calculate the next whole second based on the current whole second.

[0035] For example, the host computer obtains the current system time through a local clock module or an interface synchronized with an external time base. ,right Perform a rounding operation to obtain the current whole second. Calculate the next full second. ; via the USRP driver interface Writing to the USRP's time configuration register triggers the USRP's internal time at the rising edge of the external PPS. Alignment.

[0036] In one embodiment of this application, the step of using the USRP's timing command interface to preset two GPIO control timing commands to generate an internal 1PPS signal based on the internal door control clock includes: S501 reads the real-time time inside the USRP according to a preset cycle; When the internal real-time time approaches the next full second, the S502 presets the first command through the timer command interface and sets the GPIO pin to a high level at the next full second. S503 restores the GPIO pin to a low level according to the whole second and the preset pulse width, generating an internal 1PPS signal.

[0037] For example, select one of the GPIO pin groups on the front panel of the USRP as the internal 1PPS output pin. Send a command through the GPIO configuration interface of the UHD driver to configure the direction register of the selected pin to output mode and initialize it to low level. The host computer reads the internal real-time time of the USRP at a period of 0.1-0.5 seconds. ,when Approaching the next full second At that time, the first command is preset through the timed command interface: Always keep the GPIO pin high to preset the second command: Always restore the GPIO pin to a low level, where The preset pulse width is used to generate an internal 1PPS signal.

[0038] In one embodiment that can be implemented in this application, determining the preset pulse width includes: S601, Based on the acquired resolution, determine the minimum value of the preset pulse width; S602, in accordance with signal recognition requirements, limits the final value of the preset pulse width to a preset range.

[0039] For example, the measurement resolution of the time interval counter is obtained. According to resolution Sure The minimum value of satisfies In combination with signal recognition requirements, The final value is limited to the range of 0.1-0.5s; the higher the resolution, the better. The closer the value is to the minimum value.

[0040] In one embodiment of this application, generating a first trigger error estimate and a second trigger error estimate based on the internal 1PPS signal, the external 1PPS signal, and the information from the two stations includes: S701, collect the rising edge timestamps of the internal 1PPS signal and the external 1PPS signal of the first station, and record the arrival time of the internal 1PPS signal and the arrival time of the external 1PPS signal in the nth cycle; S702, calculate the arrival time difference based on the arrival time of the internal 1PPS signal and the arrival time of the external 1PPS signal; S703, Collect n arrival time differences for n consecutive periods, and generate a first station sequence based on the n arrival time differences; S704, Generate a first trigger error estimate based on the first station sequence; S705, combine the second station with the above steps to obtain the second trigger error estimate.

[0041] For example, the internal 1PPS signal output from the USRPGPIO and the external 1PPS signal are simultaneously connected to a time interval counter or an equivalent high-resolution measurement device. The time difference between the rising edge of the internal 1PPS signal and the rising edge of the external 1PPS signal in each cycle is measured to obtain the sequence: ,in, The arrival time of 1PPS within the USRP. This refers to the arrival time of the external input 1PPS. Generally, the external 1PPS should be earlier, so... Less than ,at this time It is a negative value. To suppress short-term jitter, it can be... The sequence is processed by moving average, filtering, or fitting to obtain an estimate of the trigger error: .

[0042] It should be noted that the choice of sequence processing method depends on the jitter characteristics and processing accuracy requirements of the actual application scenario. When the short-term jitter of the sequence is small, a simple moving average method is used. If the sequence contains random noise, a filtering method with stronger anti-interference capabilities is used, such as Kalman filtering, which is suitable for dynamic small-amplitude jitter, and sliding window filtering, which is suitable for static sudden jitter. If the sequence has a slowly changing trend deviation, a fitting method that can fit the trend is used, such as one that is caused by temperature drift inside the USRP. Slow offsetting allows for the extraction of a stable error baseline through mathematical models.

[0043] In one embodiment that can be implemented in this application, generating a first trigger error estimate based on the first site sequence includes: S801, Calculate the linear trend coefficient based on the first station sequence; S802, Generate a fitted curve based on the linear trend coefficient; S803, take the arithmetic mean of multiple periodic fitting values ​​of the fitted curve to generate a first trigger error estimate.

[0044] For example, this application calculates the first trigger error estimate by means of fitting processing. It should be noted that the second trigger error estimate is calculated in the same way as the first trigger error estimate.

[0045] Linear fitting hypothesis The period number n, n=1,2,...,N, representing the 1st to Nth measurement period, satisfies a linear relationship: Among them, the independent variable The period number reflects the chronological order of time and indirectly corresponds to the measurement time; the dependent variable... The original time difference for the nth period; 'a' is the slope, reflecting... The trend of change with the cycle, such as a>0 indicates It increases slowly over time; b is the intercept, reflecting... The base offset.

[0046] Input data preparation: Organize the collected N sets of data: ,in This indicates that the periodic index is continuous. The coefficients a and b are solved using the least squares method. The core of the least squares method is to minimize the sum of squared deviations between the fitted line and all original data points. a and b are calculated using the following formulas. First, the basic statistics are calculated: Periodic index mean: Mean of original time difference: Covariance between sequence number and time difference: Variance of the serial number: Solve for the linear trend coefficient: slope ,intercept To generate a linear fitting curve, substitute the solutions a and b into the linear equation. ,in, This curve represents the fitting time difference for the nth period. It smooths out short-term jitter in the original sequence and reflects Δt. n The linear trend of change.

[0047] Calculate the trigger error estimate Fitted values ​​for N periods of the fitted curve The arithmetic mean is taken as the final estimate of the trigger error: Since the mean of the linear fitting curve is consistent with the trend of the original sequence, this mean can eliminate short-term jitter and reflect the stable trigger error level of USRP.

[0048] In one embodiment that can be implemented in this application, the introduction of a compensation term in the bidirectional time comparison solution model includes: S901, Compensate the original pseudoranges of the first station and the original pseudoranges of the second station to generate the first compensated pseudorange and the second compensated pseudorange. S902, based on the first compensated pseudorange and the second compensated pseudorange combined with the clock error formula, generate the first clock error and the second clock error.

[0049] It should be noted that stations A and B ensure consistent 1PPS generation cycles within both stations via a signal exchange link, and station A obtains its own triggering error. Station B obtains its own trigger error Station A measures the original pseudorange After compensation, pseudorange Station B measures the original pseudorange After compensation, pseudorange Substitute into the bistation clock error calculation formula The corrected clock difference between the two stations was obtained.

[0050] In addition, the signal reception time of extraction station A and launch time All data are extracted from the signal reception time of station B based on the clock records after the USRP has stabilized internally. and launch time All are based on the clock records after the USRP has stabilized internally. , Substituting into the formula and expanding the calculation yields... There is no need to transmit the triggering error of the other party via message; only local measurements are used. , Complete the clock difference calculation and output the final time comparison result.

[0051] Both stations independently calculate local trigger error estimates and independently complete pseudorange compensation. They only need to synchronize the timing and transmission timestamps via the signal interaction link, without relying on the central station to distribute error data. Even if communication at one station is briefly interrupted, it can still be recalculated based on the local error data after recovery. Furthermore, if the comparison is extended to three stations, this process only needs to be executed between each pair, such as AB, AC, and BC, without modifying the core logic. Each comparison link uses local error self-compensation, making it highly scalable.

[0052] In a second aspect, this application includes a bidirectional time alignment system with USRP 1PPS triggered error correction, the system comprising: The parameter module is used to determine the stable state of the USRP's internal clock based on preset clock source parameters, preset time source parameters, and preset time. The internal signal generation module is used to construct a unified time base. Based on the unified time base, it periodically reads the internal time of the USRP. At each integer second that is about to arrive, it uses the timing command interface of the USRP to preset two GPIO control timing commands to generate an internal 1PPS signal based on the internal door control clock. The estimation value generation module is used to generate a first trigger error estimate and a second trigger error estimate based on the internal 1PPS signal, the external 1PPS signal and the information of the two stations. The correction module is used to introduce a compensation term into the bidirectional time comparison solution model, generate a pseudorange and time solution model, and substitute the first trigger error estimate and the second trigger error estimate into the pseudorange and time solution model to generate the error correction for bidirectional time comparison.

[0053] It should be noted that this application also includes at least two USRP devices, a host computer connected to each USRP device, a time interval counter, and a signal interaction link. Each USRP device is configured with GPIO pins for generating an internal 1PPS signal and supports locking of an external clock source and time source, as well as internal time alignment. The host computer is used to control the USRP devices to complete reference configuration, internal time alignment, internal 1PPS generation, and data processing. The time interval counter is used to simultaneously receive the internal 1PPS signal and the external 1PPS signal output by the USRP device and measure the time difference between them. The signal interaction link is used for time comparison signal transmission between the two stations to achieve bidirectional timestamp recording and calculation.

[0054] like Figure 2 As shown, for example, two remote stations are used to complete bidirectional time comparison between the two remote stations, with Software-Defined Radio (USRP) as the core, atomic clock as the reference, and microwave link as the interaction carrier. This is applicable to high-precision scenarios such as satellite ground station clock calibration and cross-regional communication network time and frequency synchronization verification.

[0055] Each site is independently equipped with a complete set of core equipment, and the hardware specifications are consistent to ensure the uniformity of the comparison benchmark. The USRP X310 is selected as the core for signal transmission and processing at each site. It should be noted that the USRPX310's external clock interface supports the connection of external time and frequency references, locking its own transmission and reception timing based on external signals to avoid local clock drift interfering with measurement accuracy. The local control computer is equipped with a 10 Gigabit Ethernet network card, establishing a high-speed data link with the local USRPX310 via a 10 Gigabit Ethernet cable. It is mainly responsible for issuing signal configuration commands to the USRP and receiving the raw received signal data from the USRP. Subsequently, time comparison algorithms can be run on the computer, measurement data can be stored, and the results can be visualized. A high-precision atomic clock provides a 10MHz frequency reference signal and a 1PPS time reference signal, connected to the external frequency interface and external pulse interface of the local USRP X310 respectively via a dedicated low-noise clock cable. Serving as the time and frequency reference point for the entire site, it provides a unified and stable time and frequency reference for USRP signal transmission and reception, which is the core foundation for ensuring high accuracy in time comparison. The microwave antenna is equipped with a directional high-gain microwave antenna that matches the microwave transmission frequency band and is connected to the local USRPX310 RF port via an RF cable. The antenna adopts a directional design to improve signal gain during long-distance transmission and reduce signal attenuation and interference in long-distance links.

[0056] Two remote sites achieve high-precision measurement through a two-way microwave transmission link and time comparison logic: First, both USRP X310 units at both sites connect to the local atomic clock's 10MHz and 1PPS signals to lock onto their own time-frequency references, ensuring that the transmission and reception timing of the two USRPs is initially synchronized with the atomic clock's accuracy. Then, computers A and B send time comparison signal configurations with the same parameters to their local USRP X310 units; both USRPs synchronously transmit time comparison signals to their local microwave antennas according to a preset timing sequence. Subsequently, the signal transmitted by the first site is transmitted via antenna A and the microwave link to antenna B at the second site, where it is received by the second site's USRP X310; simultaneously, the signal transmitted by the second site is transmitted in reverse via the local antenna and the microwave link, and received by the first site's USRP X310, achieving bidirectional parallel signal interaction. Computers A and B extract the arrival timestamps of the signals received by their local USRPs, and calculate the time deviation between the two sites using a two-way time comparison algorithm, completing the high-precision time comparison measurement.

[0057] It is understood that the technical effect of the bidirectional time comparison system based on USRP 1PPS trigger error correction provided in this disclosure is consistent with the technical effect of the method embodiment in the foregoing embodiments, and this disclosure will not elaborate on this.

[0058] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A bidirectional time alignment method based on USRP 1PPS trigger error correction, characterized in that, include: The internal clock stability state of the USRP is determined based on the preset clock source parameters, preset time source parameters, and preset time. Construct a unified time reference, and periodically read the internal time of the USRP based on the unified time reference. At each integer second that is about to arrive, use the timing command interface of the USRP to preset two GPIO control timing commands to generate an internal 1PPS signal based on the internal door control clock. Based on the internal 1PPS signal, the external 1PPS signal, and the information from the two stations, a first trigger error estimate and a second trigger error estimate are generated. A compensation term is introduced into the bidirectional time comparison solution model to generate a pseudorange and time solution model. The first trigger error estimate and the second trigger error estimate are substituted into the pseudorange and time solution model to generate the error correction for bidirectional time comparison.

2. The bidirectional time comparison method based on USRP 1PPS trigger error correction according to claim 1, characterized in that, The process of determining the stable state of the USRP's internal clock based on preset clock source parameters, preset time source parameters, and preset time includes: The internal control clock of the USRP is set according to the preset clock source parameters and the preset time source parameters to generate the USRP phase-locked loop state; The internal gate control clock frequency and phase stability are determined based on the phase-locked loop state, thus determining the stable state of the USRP internal clock.

3. The bidirectional time comparison method based on USRP 1PPS trigger error correction according to claim 1, characterized in that, The construction of a unified time base includes: Get the current system time and calculate the next full second. The next full second is set as the absolute time that the USRP's internal time should align with when the next external second pulse signal arrives, thus establishing a unified time reference.

4. The bidirectional time comparison method for USRP 1PPS trigger error correction according to claim 3, characterized in that, The step of obtaining the current system time and calculating the next full second includes: Obtain the current system time, and round the system time to obtain the current whole second. Calculate the next whole second based on the current whole second.

5. The bidirectional time comparison method for USRP 1PPS trigger error correction according to claim 1, characterized in that, The method of using the USRP's timing command interface to preset two GPIO control timing commands to generate an internal 1PPS signal based on the internal door control clock includes: Read the internal real-time time of the USRP according to the preset cycle; When the internal real-time time approaches the next full second, the first command is preset through the timer command interface, and the GPIO pin is set to a high level at the next full second. The GPIO pin is restored to a low level based on the integer second and the preset pulse width, generating an internal 1PPS signal.

6. The bidirectional time comparison method for USRP 1PPS trigger error correction according to claim 5, characterized in that, Determining the preset pulse width includes: Based on the obtained resolution, determine the minimum value of the preset pulse width; Based on the signal recognition requirements, the final value of the preset pulse width is limited to a preset range.

7. The bidirectional time comparison method for USRP 1PPS trigger error correction according to claim 1, characterized in that, The step of generating the first trigger error estimate and the second trigger error estimate based on the internal 1PPS signal, the external 1PPS signal, and the information from the two stations includes: Collect the rising edge timestamps of the internal 1PPS signal and the external 1PPS signal of the first station, and record the arrival time of the internal 1PPS signal and the arrival time of the external 1PPS signal in the nth cycle; Calculate the arrival time difference based on the arrival time of the internal 1PPS signal and the arrival time of the external 1PPS signal; Collect n arrival time differences for n consecutive periods, and generate a first station sequence based on the n arrival time differences; Based on the first site sequence, a first trigger error estimate is generated; By combining the above steps with the second site, a second trigger error estimate is obtained.

8. The bidirectional time comparison method for USRP 1PPS trigger error correction according to claim 7, characterized in that, The step of generating the first trigger error estimate based on the first site sequence includes: Calculate the linear trend coefficient based on the first station sequence; A fitted curve is generated based on the linear trend coefficient; The arithmetic mean of the multiple periodic fitting values ​​of the fitted curve is taken to generate the first trigger error estimate.

9. A bidirectional time comparison method for USRP 1PPS trigger error correction according to claim 1, characterized in that, The compensation term introduced into the bidirectional time comparison solution model includes: Compensate the original pseudoranges of the first station and the original pseudoranges of the second station to generate the first compensated pseudorange and the second compensated pseudorange. Based on the first compensated pseudorange and the second compensated pseudorange combined with the clock error formula, the first clock error and the second clock error are generated.

10. A bidirectional time comparison system with USRP 1PPS triggered error correction, characterized in that, The system includes: The parameter module is used to determine the stable state of the USRP's internal clock based on preset clock source parameters, preset time source parameters, and preset time. The internal signal generation module is used to construct a unified time base. Based on the unified time base, it periodically reads the internal time of the USRP. At each integer second that is about to arrive, it uses the timing command interface of the USRP to preset two GPIO control timing commands to generate an internal 1PPS signal based on the internal door control clock. The estimation value generation module is used to generate a first trigger error estimate and a second trigger error estimate based on the internal 1PPS signal, the external 1PPS signal and the information of the two stations. The correction module is used to introduce a compensation term into the bidirectional time comparison solution model, generate a pseudorange and time solution model, and substitute the first trigger error estimate and the second trigger error estimate into the pseudorange and time solution model to generate the error correction for bidirectional time comparison.