Traveling wave sampling frequency clock correction method and system based on kalman filter
By combining Kalman filtering and PID controller with voltage-controlled temperature-compensated crystal oscillator, the crystal oscillator and GPS/BeiDou errors in the traveling wave sampling system are eliminated, achieving high-precision sampling timestamp calibration and solving the problem of difficult error elimination in existing technologies.
Patent Information
- Application Number
- CN202510915541.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-07-03
AI Technical Summary
In existing technologies, the timestamp marking error of traveling wave sampling is mainly caused by crystal oscillator error, GPS/BeiDou second pulse error and software acquisition error, which is particularly difficult to eliminate in cable positioning.
A Kalman filter-based method is adopted. By calculating the phase difference and sampling frequency difference between the GPS/BeiDou second pulse signal and the local second pulse signal, a negative feedback loop is formed using a Kalman filter and a PID controller. Combined with a voltage-controlled temperature-compensated crystal oscillator, crystal oscillator error and GPS/BeiDou error are eliminated, thereby achieving sampling frequency correction.
High-precision calibration of traveling wave sampling timestamps was achieved, eliminating crystal oscillator and GPS/BeiDou second pulse errors and improving the accuracy of sampling timestamps.
Smart Images

Figure CN120768350B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of power system automation and protection control technology, and in particular to a traveling wave sampling frequency clock correction method and system based on Kalman filtering. BACKGROUND
[0002] Currently, the traveling wave ranging of the distribution network is to determine the fault position by judging the fault time of the traveling wave mutation point collected at the installation position, so the accuracy of the time stamp of the traveling wave sampling is extremely high, especially in cable positioning, it is required to minimize the sampling time stamp marking error.
[0003] The current general method is to provide a second pulse signal through the GPS / Beidou global synchronous timing system to realize the marking of the sampling time stamp of each traveling wave collection terminal. One method is to use FPGA+DSP / MCU scheme, which completes the adc collection, second pulse signal processing and time stamp marking by FPGA; another method is to use sampling MCU scheme, which completes the adc collection, second pulse signal processing and time stamp marking by MCU. In these two collection systems, the sampling time stamp marking error mainly comes from three aspects: 1. the inherent error of the sampling frequency caused by the system crystal oscillator; 2. the random error caused by the GPS / Beidou second pulse; 3. the error caused by software collection. Generally, the time stamp error caused by software collection can be completely eliminated by improving the algorithm or improving the hardware performance, but the crystal oscillator error and the second pulse error cannot be eliminated by general methods. SUMMARY
[0004] The present application provides a traveling wave sampling frequency clock correction method and system based on Kalman filtering to eliminate the crystal oscillator error and the second pulse error.
[0005] To solve the above problems, one of the technical solutions of the present application is realized by the following method: a traveling wave sampling frequency clock correction method based on Kalman filtering, comprising:
[0006] outputting a GPS / Beidou second pulse signal and a local second pulse signal;
[0007] calculating the phase difference and the sampling frequency difference between the GPS / Beidou second pulse signal and the local second pulse signal;
[0008] filtering and correcting the phase difference and the sampling frequency difference by a Kalman filter to obtain a corrected sampling frequency difference, and outputting a digital signal to a voltage-controlled oscillator after processing by a PID controller;
[0009] the voltage-controlled oscillator adjusts by negative feedback according to the digital signal to output a compensated crystal oscillator clock signal;
[0010] generating a local second pulse signal according to the compensated crystal oscillator clock signal;
[0011] The above steps are repeated for a plurality of times through a negative feedback adjustment loop until the phase difference is adjusted to zero.
[0012] The phase difference between the GPS / Beidou second pulse signal and the local second pulse signal and the sampling frequency difference are calculated, including,
[0013] The hardware timer 1 and timer 2 are set, and the timer 1 and timer 2 are set in master-slave mode and are started synchronously.
[0014] The timer 1 is set in capture mode, the GPS / Beidou second pulse signal is captured, and the count value of the kth input pulse signal is recorded as ;
[0015] The timer 2 generates the local second pulse signal, and the kth pulse signal is recorded as ;
[0016] The phase difference between the kth GPS / Beidou second pulse signal and the local second pulse signal and the sampling frequency are calculated by the following formula:
[0017] ,
[0018] ,
[0019] ,
[0020] wherein, represents the phase difference between the kth GPS / Beidou positioning output second pulse and the local clock output second pulse, represents the kth calculated sampling frequency difference, represents the set sampling frequency, represents the kth measured sampling frequency.
[0021] The phase difference and the sampling frequency difference are filtered and corrected by the Kalman filter, including,
[0022] A first-order state transition equation, a first-order measurement equation and a Kalman filtering equation are used for filtering:
[0023] wherein, the first-order state transition equation is as follows:
[0024] ,
[0025] In the formula, represents the phase difference between the kth GPS / Beidou positioning output second pulse and the local clock output second pulse, represents the kth measured sampling frequency, represents the sampling time length, K-1 represents the k-1th PID output control amount, B represents a quantitative relationship between the PID control amount and the phase difference, and is a constant;
[0026] The first-order measurement equation is as follows:
[0027]
[0028]
[0029] In the formula, represents a measurement matrix in Kalman filtering, and is a linear relationship;
[0030] The Kalman filtering equation is as follows:
[0031]
[0032] In the formula, represents a state estimation value, and is composed of , represents a state transition matrix, and is composed of , is a control input matrix, is a prior covariance matrix, is a process noise covariance, is a Kalman coefficient calculated each time, is an observation matrix, is an observation noise covariance, is an identity matrix, represents a measurement matrix, and is composed of , is a covariance, is a posterior state estimation, that is, a filtering output.
[0033] The voltage-controlled oscillator is adjusted by negative feedback according to the digital signal, and outputs a compensated crystal oscillator clock signal, comprising a digital-to-analog converter for converting a voltage digital signal output by the PID controller into an analog signal and outputting the analog signal to the voltage-controlled temperature compensation crystal oscillator; the voltage-controlled temperature compensation crystal oscillator adjusts the crystal oscillator frequency according to the received analog signal, and outputs a compensated crystal oscillator clock signal, so as to ensure that the local clock is synchronized with the GPS / Beidou second pulse.
[0034] The second technical scheme of the present application is realized by the following way: a traveling wave sampling frequency clock correction system based on Kalman filtering, comprising an MCU internal phase-locked loop unit, a GPS / Beidou second pulse unit, a local clock unit and a digital phase-locked loop unit; wherein the digital phase-locked loop unit comprises a frequency discriminator, a filter unit and a voltage-controlled oscillator;
[0035] GPS / BeiDou second pulse unit, outputs GPS / BeiDou second pulse signal;
[0036] The local clock unit outputs a local second pulse signal;
[0037] The frequency and phase detector calculates the phase difference and sampling frequency difference between the GPS / BeiDou second pulse signal and the local second pulse signal;
[0038] The filtering unit uses a Kalman filter to filter and correct the phase difference and sampling frequency difference, obtains the corrected sampling frequency difference, and then outputs a digital signal to the voltage-controlled oscillator after processing by a PID controller.
[0039] The voltage-controlled oscillator performs negative feedback adjustment based on the digital signal and outputs a compensated crystal clock signal.
[0040] The MCU's internal phase-locked loop unit generates a local second pulse signal based on the compensated crystal oscillator clock signal.
[0041] The aforementioned filtering unit also includes a loop filter for suppressing sampling noise.
[0042] The aforementioned voltage-controlled oscillator includes a digital-to-analog converter and a voltage-controlled temperature-compensated crystal oscillator. The digital-to-analog converter is used to convert the voltage digital signal output by the PID controller into an analog signal and output the analog signal to the voltage-controlled temperature-compensated crystal oscillator. The voltage-controlled temperature-compensated crystal oscillator finely adjusts the crystal oscillator frequency according to the received analog signal and outputs the compensated crystal oscillator clock signal to ensure that the local clock is synchronized with the GPS / BeiDou second pulse.
[0043] The entire system of this invention constitutes a negative feedback regulation loop. It is adjusted in real time by a voltage-controlled temperature-compensated crystal oscillator to make the local clock completely synchronized with the GPS / BeiDou clock, i.e., the phase difference is zero. At the same time, the Kalman filter outputs the final frequency and phase information to accurately calibrate the ADC sampling timestamp in the phase-locked loop unit inside the MCU.
[0044] This invention simultaneously inputs the GPS / BeiDou second pulse signal and the local second pulse signal, and through the cooperation of two timers, measures the phase difference and sampling frequency difference between the GPS / BeiDou and local clocks, thus eliminating the measurement error caused by the internal phase-locked loop unit of the MCU. Furthermore, this invention uses a Kalman filter to suppress the white noise of the GPS / BeiDou second pulse signal in the traveling wave acquisition system. By adding a voltage-controlled temperature-compensated crystal oscillator and using a PID controller to form a negative feedback loop, the fixed noise of the crystal oscillator is suppressed. Thus, the Kalman filter and the PID controller are used together in the traveling wave acquisition system to perform mutual correction of crystal oscillator error and GPS / BeiDou error, obtaining the corrected sampling frequency. Attached Figure Description
[0045] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
[0046] Figure 1 Flow chart for the method of embodiment 1 of the present application.
[0047] Figure 2 System circuit block diagram for embodiment 2 of the present application.
[0048] Figure 3 Circuit diagram for the internal phase-locked loop unit of the MCU in embodiment 2 of the present application.
[0049] Figure 4 Circuit diagram for the voltage-controlled temperature compensation crystal oscillator in embodiment 2 of the present application.
[0050] Figure 5 Circuit diagram for the GPS second pulse unit in embodiment 2 of the present application. DETAILED DESCRIPTION
[0051] The present application is not limited by the following embodiments, and the specific implementation can be determined according to the technical solutions of the present application and the actual situation.
[0052] Embodiment 1: As described above, the embodiment of the present application discloses a traveling wave sampling frequency clock correction method based on Kalman filtering, which comprises: Figure 1
[0053] S101, outputting a GPS / Beidou second pulse signal and a local second pulse signal;
[0054] S102, calculating the phase difference and the sampling frequency difference between the GPS / Beidou second pulse signal and the local second pulse signal;
[0055] S103, filtering and correcting the phase difference and the sampling frequency difference by a Kalman filter, obtaining the corrected sampling frequency difference, and outputting a digital signal to a voltage-controlled oscillator after processing by a PID controller;
[0056] S104, the voltage-controlled oscillator adjusts by negative feedback according to the digital signal, and outputs a compensated crystal oscillator clock signal;
[0057] S105, generating a local second pulse signal according to the compensated crystal oscillator clock signal;
[0058] S106, repeatedly performing the above steps, and passing through a negative feedback adjustment loop until the phase difference is zero.
[0059] In the above step S102, the phase difference and the sampling frequency difference between the GPS / Beidou second pulse signal and the local second pulse signal are calculated, comprising,
[0060] Setting a hardware timer 1 and a timer 2, the timer 1 and the timer 2 are set in master-slave mode and are started synchronously;
[0061] Timer 1 sets the capture mode, captures the GPS / Beidou second pulse signal, and records the count value of the kth input pulse signal as
[0062] Timer 2 generates a local second pulse signal, and records the kth pulse signal as
[0063] The phase difference between the kth GPS / Beidou second pulse signal and the local second pulse signal is calculated by the following formula and the sampling frequency :
[0064] ,
[0065] ,
[0066] ,
[0067] wherein represents the phase difference between the kth GPS / Beidou positioning output second pulse and the local clock output second pulse, represents the kth calculated sampling frequency difference, represents the set sampling frequency, represents the kth measured sampling frequency.
[0068] wherein, in specific use:
[0069] 1) Timer 1 sets the count step to 10 ns and the count period to 500 ns, i.e. every 10 ns, the timer counter is incremented by 1, and when accumulated to 500 ns, the count is reset to zero. At the same time, the timer sets the capture mode to capture the second pulse signal, and controls the MCU integrated with the ADC chip to perform high-frequency sampling at 2 MHz;
[0070] 2) Timer 2 sets the count step to 500 ns and the count period to 2000000 ns, i.e. every 500 ns, the timer counter is incremented by 1, and when accumulated to 1 s, the count is reset to zero. The local second pulse signal is generated when the counter is reset to zero;
[0071] Timer 1 is set to capture mode to capture the second pulse IO port of the MCU. Once the input second pulse input signal is detected, the current count value of timer 1 stored in the capture register is , and a DMA conversion event is triggered to store the current count value of timer 2 in RAM as ; when the next second pulse signal is captured, the above steps are repeated, and the current count value of timer 1 stored in the capture register is recorded as And trigger the DMA conversion event, the current count value of timer 2 is stored in RAM as .
[0072] In step S103, the phase difference and the sampling frequency difference are filtered and corrected by the Kalman filter, including,
[0073] The first-order state transition equation, the first-order measurement equation and the Kalman filtering equation are used for filtering:
[0074] The first-order state transition equation is as follows:
[0075] ,
[0076] In the formula, represents the phase difference between the second pulse output by the kth GPS / Beidou positioning and the second pulse output by the local clock, represents the measured sampling frequency, represents the sampling time length, represents the PID output control amount of the k-1th time, and B represents the quantitative relationship between the PID control amount and the phase difference, which is a constant;
[0077] The first-order measurement equation is as follows:
[0078] ,
[0079] ,
[0080] In the formula, represents the measurement matrix in the Kalman filtering, and is a linear relationship;
[0081] The Kalman filtering equation is as follows:
[0082] ,
[0083] In the formula, represents the state estimation value, which is composed of , represents the state transition matrix, which is composed of , is a control input matrix, is an a priori covariance matrix, is a process noise covariance, is a Kalman coefficient calculated each time, is an observation matrix, is an observation noise covariance, is an identity matrix, represents that the measurement matrix is composed of , It is covariance. It is the posterior state estimate, i.e., the filtered output.
[0084] The Kalman filter receives the measured phase difference and the sampling frequency difference, performs filtering, and outputs the estimated phase error and the current operating frequency. To improve accuracy, the Kalman filter uses floating-point calculations, as described above.
[0085] In step S104 above, the voltage-controlled oscillator (VCO) performs negative feedback adjustment based on the digital signal and outputs a compensated crystal clock signal. This includes the VCO consisting of a digital-to-analog converter (DAC) and a temperature-compensated voltage-controlled crystal oscillator (TCC-C) forming a negative feedback adjustment loop. The DAC converts the voltage digital signal output by the PID controller into an analog signal and outputs the analog signal to the TCC-C. The TCC-C fine-tunes the crystal frequency based on the received analog signal and outputs a compensated crystal clock signal to ensure that the local clock is synchronized with the GPS / BeiDou second pulse.
[0086] Example 2: Figure 2 As shown, this embodiment of the invention discloses a traveling wave sampling frequency clock correction system based on Kalman filtering, including an internal phase-locked loop unit of an MCU, a GPS / BeiDou second pulse unit, a local clock unit, and a digital phase-locked loop unit; wherein, the digital phase-locked loop unit includes a frequency and phase detector, a filtering unit, and a voltage-controlled oscillator;
[0087] GPS / BeiDou second pulse unit, outputs GPS / BeiDou second pulse signal;
[0088] The local clock unit outputs a local second pulse signal;
[0089] The frequency and phase detector calculates the phase difference and sampling frequency difference between the GPS / BeiDou second pulse signal and the local second pulse signal;
[0090] The filtering unit uses a Kalman filter to filter and correct the phase difference and sampling frequency difference, obtains the corrected sampling frequency difference, and outputs a digital signal to the voltage-controlled oscillator after processing by a PID controller.
[0091] The voltage-controlled oscillator performs negative feedback adjustment based on the digital signal and outputs a compensated crystal clock signal.
[0092] The MCU's internal phase-locked loop unit generates a local second pulse signal based on the compensated crystal oscillator clock signal.
[0093] The filtering unit also includes a loop filter to suppress sampling noise. The loop filter has a cutoff frequency of approximately 8 Hz and a damping ratio of 0.707.
[0094] The voltage-controlled oscillator comprises a digital-to-analog converter (DAC) and a voltage-controlled temperature compensation crystal oscillator; the digital-to-analog converter is used for converting a voltage digital signal output by a PID controller into an analog signal and outputting the analog signal to the voltage-controlled temperature compensation crystal oscillator; the voltage-controlled temperature compensation crystal oscillator, as shown in a principle diagram thereof, is used for fine-tuning a crystal oscillator frequency according to the received analog signal and outputting a compensated crystal oscillator clock signal, so as to ensure that a local clock is synchronized with a GPS / Beidou second pulse. Figure 4
[0095] As shown in the figure, Figure 3 The MCU internal phase-locked loop unit is internally integrated with an ADC chip, and the MCU internal phase-locked loop unit controls the input voltage of the voltage-controlled temperature compensation crystal oscillator through the digital-to-analog converter to fine-tune the crystal oscillator sampling frequency; a principle diagram of the GPS / Beidou second pulse unit is shown in the figure, Figure 5 The second pulse IO port and the MCU internal phase-locked loop unit are connected through a serial port IO port to provide a second pulse signal and GPS / Beidou time.
[0096] The above also comprises a multiplexer, which is convenient for selecting the filtered phase difference and sampling frequency difference signals output by the loop filter and the Kalman filter, and according to the selected signals, the phase difference signal can be used as an input signal of the PID controller.
[0097] In summary, in the working process of the application, the GPS / Beidou second pulse unit generates a GPS / Beidou second pulse (PPS) signal, and the local clock unit generates a local second pulse signal; both signals are connected to the digital phase-locked loop unit; first, the phase difference and the sampling frequency difference between the current GPS / Beidou second pulse signal and the local second pulse signal are measured through a frequency discriminator and a phase discriminator; then, the measured sampling frequency difference and phase difference are filtered through the loop filter and the Kalman filter; the filtered signals are output to the PID controller; after the PID controller processes the signals, the processed digital signals are output; the digital-to-analog converter converts the digital signals into analog signals; the voltage-controlled temperature compensation crystal oscillator fine-tunes the crystal oscillator frequency through the input control voltage and outputs the compensated crystal oscillator clock signal; and the compensated clock signal generates the MCU local clock through the MCU internal phase-locked loop unit.
[0098] In summary, the application inputs the GPS / Beidou second pulse signal and the local second pulse signal at the same time, measures the phase difference between the GPS / Beidou and the local clock and the sampling frequency difference through the cooperation of two timers, and eliminates the measurement error caused by the phase-locked loop unit in the MCU; and the Kalman filter is used in the application to suppress the white noise of the GPS / Beidou second pulse signal of the traveling wave acquisition system, a voltage-controlled temperature compensation crystal oscillator is added, a PID controller is used to form a negative feedback loop to suppress the fixed noise of the crystal oscillator, and thus the Kalman filter and the PID controller are used in combination in the traveling wave acquisition system to mutually correct the crystal oscillator error and the GPS / Beidou error, so that the corrected sampling frequency is obtained.
[0099] Embodiment 3: The embodiment of the application discloses a storage medium, wherein the storage medium stores a computer program readable by a computer, and the computer program is configured to execute a Kalman filter-based traveling wave sampling frequency clock correction method when running.
[0100] The storage medium can include but is not limited to a U disk, a read-only memory, a mobile hard disk, a magnetic disk or an optical disk, and various storage media that can store a computer program.
[0101] Embodiment 4: The embodiment of the application discloses a terminal, which comprises a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program comprises instructions for executing steps in the Kalman filter-based traveling wave sampling frequency clock correction method.
[0102] Embodiment 5: The embodiment of the application discloses an electronic device, which comprises a processor and a memory, and the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the Kalman filter-based traveling wave sampling frequency clock correction method.
[0103] The electronic device further comprises a transmission device and an input / output device, wherein the transmission device and the input / output device are connected with the processor.
[0104] The processor can be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an ASIC, an FPGA or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logical blocks, modules and circuits described in combination with the disclosure. It can also be a combination of computing functions, such as one or more microprocessor combinations, DSP and microprocessor combinations, etc. The memory can include but is not limited to a U disk, a read-only memory, a mobile hard disk, a magnetic disk or an optical disk, and various storage media that can store a computer program.
[0105] Those skilled in the art will appreciate that embodiments of the application can be provided as methods, systems, or computer program products. Accordingly, the application can be embodied in a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the application can be embodied in a computer program product on one or more computer readable storage media (including, but not limited to, disk memory, CD-ROM, optical storage media, etc.) having computer usable program code embodied thereon. The aspects of the embodiments of the application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript, etc.
[0106] The application is described with reference to the accompanying drawings, which show embodiments of the application. In the drawings: the application is described with reference to the accompanying drawings, which show embodiments of the application. In the drawings: Figure 1 one or more processes and / or blocks Figure 1 means for carrying out the function specified by the block or blocks.
[0107] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the Figure 1 one or more processes and / or blocks Figure 1 means for carrying out the function specified by the block or blocks.
[0108] The embodiments of the application also provide a computer program product. The computer program product includes a non-transitory computer readable medium storing the computer program. The computer program can be operable to cause a computer to implement some or all of the steps of any of the methods described in the above method embodiments. The computer program product can be a software installation package, and the computer can include an electronic device.
Claims
1. A method for correcting the clock frequency of a traveling wave based on Kalman filtering, characterized in that, include: Outputs GPS / BeiDou second pulse signals and local second pulse signals; Calculate the phase difference and sampling frequency difference between the GPS / BeiDou second pulse signal and the local second pulse signal; The phase difference and sampling frequency difference are filtered and corrected by a Kalman filter to obtain the corrected sampling frequency difference, which is then processed by a PID controller and output as a digital signal to the voltage-controlled oscillator. The voltage-controlled oscillator performs negative feedback adjustment based on the digital signal and outputs a compensated crystal clock signal. A local second pulse signal is generated based on the compensated crystal oscillator clock signal; Repeat the above steps multiple times, through the negative feedback adjustment loop, until the phase difference is zero; The calculation of the phase difference and sampling frequency difference between the GPS / BeiDou second pulse signal and the local second pulse signal includes, Configure hardware timer 1 and timer 2, set timer 1 and timer 2 to master-slave mode, and start synchronously; Timer 1 is set to capture mode to capture GPS / BeiDou second pulse signals, and the count value of the kth input pulse signal is recorded as... ; Timer 2 generates a local second pulse signal, and records the k-th pulse signal as... ; The phase difference between the k-th GPS / BeiDou second pulse signal and the local second pulse signal is calculated using the following formula. and sampling frequency : in, This represents the phase difference between the second pulse output by the GPS / BeiDou positioning system during the k-th iteration and the second pulse output by the local clock. This represents the sampling frequency difference obtained in the k-th calculation. This indicates the set sampling frequency. This represents the sampling frequency measured in the kth measurement.
2. The traveling wave sampling frequency clock correction method based on Kalman filtering according to claim 1, characterized in that, The filtering and correction of phase difference and sampling frequency difference by the Kalman filter includes, Filtering is performed using the first-order state transition equation, the first-order measurement equation, and the Kalman filter equation: The first-order state transition equation is as follows: In the formula, This represents the phase difference between the second pulse output by the GPS / BeiDou positioning system during the k-th iteration and the second pulse output by the local clock. This represents the sampling frequency measured in the kth measurement. Indicates the sampling duration. This represents the magnitude of the PID output control quantity in the (k-1)th iteration, and B represents the quantitative relationship between the PID control quantity and the phase difference, which is a constant. The first-order measurement equation is as follows: In the formula, This represents the measurement matrix in Kalman filtering, and... It is a linear relationship; The Kalman filter equation is as follows: in, The state estimate is composed of , The state transition matrix is composed of , It is a control input matrix. It is the prior covariance matrix. It is the process noise covariance. These are the Kalman coefficients calculated each time. It is the observation matrix. It is the observation noise covariance. It is a unit array. The measurement matrix is composed of , It is covariance. It is the posterior state estimate, i.e., the filtered output.
3. The traveling wave sampling frequency clock correction method based on Kalman filtering according to claim 1, characterized in that, The voltage-controlled oscillator performs negative feedback adjustment based on the digital signal and outputs a compensated crystal clock signal. It includes a digital-to-analog converter for converting the voltage digital signal output by the PID controller into an analog signal and outputting the analog signal to the voltage-controlled temperature-compensated crystal oscillator; the voltage-controlled temperature-compensated crystal oscillator finely adjusts the crystal frequency according to the received analog signal and outputs a compensated crystal clock signal to ensure that the local clock is synchronized with the GPS / BeiDou second pulse.
4. A traveling wave sampling frequency clock correction system based on Kalman filtering, characterized in that, It includes an internal phase-locked loop (PLL) unit for the MCU, a GPS / BeiDou second pulse unit, a local clock unit, and a digital PLL unit; among which, the digital PLL unit includes a frequency and phase detector, a filtering unit, and a voltage-controlled oscillator. GPS / BeiDou second pulse unit, outputs GPS / BeiDou second pulse signal; The local clock unit outputs a local second pulse signal; The frequency and phase detector calculates the phase difference and sampling frequency difference between the GPS / BeiDou second pulse signal and the local second pulse signal; The filtering unit uses a Kalman filter to filter and correct the phase difference and sampling frequency difference, obtains the corrected sampling frequency difference, and outputs a digital signal to the voltage-controlled oscillator after processing by a PID controller. The voltage-controlled oscillator performs negative feedback adjustment based on the digital signal and outputs a compensated crystal clock signal. The MCU's internal phase-locked loop unit generates a local second pulse signal based on the compensated crystal oscillator clock signal; The frequency and phase detector calculates the phase difference and sampling frequency difference between the GPS / BeiDou second pulse signal and the local second pulse signal, including: Configure hardware timer 1 and timer 2, set timer 1 and timer 2 to master-slave mode, and start synchronously; Timer 1 is set to capture mode to capture GPS / BeiDou second pulse signals, and the count value of the kth input pulse signal is recorded as... ; Timer 2 generates a local second pulse signal, and records the k-th pulse signal as... ; The phase difference between the k-th GPS / BeiDou second pulse signal and the local second pulse signal is calculated using the following formula. and sampling frequency : in, This represents the phase difference between the second pulse output by the GPS / BeiDou positioning system during the k-th iteration and the second pulse output by the local clock. This represents the sampling frequency difference obtained in the k-th calculation. This indicates the set sampling frequency. This represents the sampling frequency measured in the kth measurement.
5. The traveling wave sampling frequency clock correction system based on Kalman filtering according to claim 4, characterized in that, The filtering unit also includes a loop filter to suppress sampling noise.
6. The traveling wave sampling frequency clock correction system based on Kalman filtering according to claim 4, characterized in that, The voltage-controlled oscillator includes a digital-to-analog converter and a voltage-controlled temperature-compensated crystal oscillator. The digital-to-analog converter is used to convert the voltage digital signal output by the PID controller into an analog signal and output the analog signal to the voltage-controlled temperature-compensated crystal oscillator. The voltage-controlled temperature-compensated crystal oscillator finely adjusts the crystal oscillator frequency according to the received analog signal and outputs the compensated crystal oscillator clock signal to ensure that the local clock is synchronized with the GPS / BeiDou second pulse.
7. A storage medium, characterized in that, The storage medium stores a computer program that can be read by a computer, and the computer program is configured to execute the traveling wave sampling frequency clock correction method based on Kalman filtering as described in any one of claims 1 to 3 when it runs.
8. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, which is loaded and executed by the processor to implement the traveling wave sampling frequency clock correction method based on Kalman filtering as described in any one of claims 1 to 3.
Citation Information
Patent Citations
A generation method and device of highly stable local reference signal for TDD shift frequency repeater
CN101106413A
Photovoltaic short-term output prediction method based on improved Gaussian process regression
CN105701572A