PPS pulse-per-second clock calibration method, processor, storage medium and drone

By using PPS second pulses and high-precision timers in the UAV system, the problems of low GPS timing accuracy and time drift are solved, and the microsecond-level clock calibration is realized, which improves the consistency of the UAV formation clock. and flight safety.

CN112433536BActive Publication Date: 2024-12-27YIFEI INTELLIGENT CONTROL (HAINAN) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011163064.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-27
Publication Date
2024-12-27
Estimated Expiration
2040-10-27

AI Technical Summary

Technical Problem

The time calibration accuracy of GPS timing in existing drone systems can only reach second level, and the flight control system clock will drift when the GPS signal is lost, resulting in too large error in the drone formation clock, which may cause the bomb.

Method used

Using a clock calibration method combining PPS second pulses and high-precision timers, the GPS board emits PPS second pulses in the entire second, and the processor performs interrupt service to calibrate the system time, and switches to the timer to perform micro-micro Calibration in seconds to ensure clock accuracy.

Benefits of technology

The calibration accuracy of the drone system time is improved to microsecond level, reduce time drift errors, enhance the consistency of the drone formation clock, and ensure flight safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112433536B_ABST
    Figure CN112433536B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of unmanned aerial vehicle clock calibration, and discloses a PPS second pulse clock calibration method, a processor, a storage medium and an unmanned aerial vehicle. The PPS second pulse is emitted by a GPS board when the time is a whole second; the board second pulse pin is connected to the GPIO of the flight control system processor, and the processor GPIO triggers an interrupt when receiving the rising edge of the pulse; in the interrupt service function, the flight control system clock is set to a whole second, and then the number of seconds of the system time is added by 1, and this cycle continues; after calibration for a period of time, when the GPS signal is lost at a certain moment, the board no longer emits the PPS second pulse signal on time, and at this time, it switches to the timer for clock calibration. It has been found through testing that the calibration accuracy of the present invention can reach the microsecond level, and when the GPS signal is lost, it switches to the high-precision timer of the processor to complete the microsecond calibration, and the calibration accuracy depends on the accuracy of the processor crystal oscillator.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of unmanned aerial vehicle clock calibration, and in particular relates to a PPS pulse per second clock calibration method, a processor, a storage medium and a unmanned aerial vehicle. Background Art

[0002] At present, accurate clocks are needed in the navigation and control processes of drone formation flight to ensure the real-time performance of the algorithm. In addition, the clock consistency between different drones is particularly important during formation flight. If the clock error between different drones is too large during formation flight, it will directly lead to multiple drones colliding at the same time and causing the explosion of the drones.

[0003] Currently, GPS timing is mostly used for time calibration in drone systems. However, the accuracy of GPS timing can only reach the second level, which is relatively low. In addition, when the GPS signal is lost, the clock of the flight control system will drift.

[0004] Through the above analysis, the problems and defects of the existing technology are as follows: in the existing method of using GPS timing to realize time calibration of UAV system, the accuracy of GPS timing can only reach the second level, the accuracy is low, and when the GPS signal is lost, the clock of the flight control system will drift.

[0005] The significance of solving the above problems and defects is that after the PPS second pulse is used to calibrate the time of different unmanned systems, the system time error between different drones will be at the microsecond level, which will improve the consistency of different drones when they are in formation or working together. Summary of the invention

[0006] In view of the problems existing in the prior art, the present invention provides a PPS pulse per second clock calibration method, a processor, a storage medium and a drone.

[0007] The present invention is implemented as follows: a method for calibrating a PPS second pulse clock of an unmanned aerial vehicle, the method comprising the following steps:

[0008] Step 1: The flight control board receives GPS positioning information. When the number of GPS satellites is greater than 15, the flight control system is timed using the GPS UTC time with a time accuracy of seconds.

[0009] Step 2: The PPS second pulse is sent by the GPS board when the time is a whole second.

[0010] Step 3: Connect the second pulse pin of the board to the GPIO of the flight control system processor, and the processor GPIO triggers an interrupt when receiving the rising edge of the pulse.

[0011] Step 4. In the interrupt service function, read the milliseconds of the current system time and set the flight control system clock to whole seconds, that is, set the microseconds in the system time to zero. If the milliseconds of the current system time are greater than 500, add 1 to the seconds of the system time, and repeat this cycle continuously.

[0012] Step 5: After a period of calibration, if the GPS signal is lost at a certain moment, the board will no longer send out the PPS pulse signal on time, and the timer will be switched to perform clock calibration.

[0013] Furthermore, in step 2, the accuracy of the PPS second pulse is within 20ns.

[0014] Further, in step 4, the processing process of the interrupt service is:

[0015] (1) Calibration count accumulation;

[0016] (2) Record calibration timestamp;

[0017] (3) Clear the system time nanoseconds;

[0018] (4) If the total number of milliseconds of the current system time is greater than 500, the number of seconds of the system time increases by 1.

[0019] Further, in step 5, the timer clock calibration principle is as follows: start the timer and set the timer interrupt trigger period to 1s. Since the timer cannot be guaranteed to be started at the full second, when processing the PPS pulse signal, the microsecond offset when the interrupt is triggered is recorded. When the GPS signal is lost, the timer is used to write the previously recorded microsecond offset every 1s to calibrate the clock.

[0020] Further, the execution process of the timer clock calibration is:

[0021] (I) Determine whether the PPS calibration count is greater than 20.

[0022] (II) If the PPS calibration count is greater than 20, determine whether the PPS pulse has timed out; if the PPS calibration count is not greater than 20, end directly.

[0023] (III) If it is determined that the PPS pulse has timed out, the nanoseconds of the system time are set as the recorded value; if it is determined that the PPS pulse has not timed out, the nanoseconds of the current system time are recorded.

[0024] Another object of the present invention is to provide a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and when the computer program is executed by the processor, the processor performs the following steps:

[0025] The PPS second pulse is sent by the GPS board when the time is a whole second;

[0026] The flight control system processor GPIO connected to the board's second pulse pin triggers an interrupt when receiving the rising edge of the pulse;

[0027] In the interrupt service function, set the flight control system clock to whole seconds. If the current system time in milliseconds is greater than 500, add 1 to the system time in seconds, and repeat the cycle continuously.

[0028] When the GPS signal is lost at a certain moment after calibration for a period of time, the board no longer sends out the PPS second pulse signal on time and switches to the timer for clock calibration.

[0029] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the method.

[0030] Another object of the present invention is to provide a flight control system processor that implements the UAV PPS second pulse clock calibration method.

[0031] Another object of the present invention is to provide a drone for implementing the pulse-per-second clock calibration method.

[0032] Another object of the present invention is to provide an information data processing terminal, wherein the information data processing terminal is used to implement the second pulse clock calibration method.

[0033] Combining all the above technical solutions, the advantages and positive effects of the present invention are as follows: the UAV PPS second pulse clock calibration method provided by the present invention utilizes the PPS second pulse in the GPS board card and combines it with the high-precision timer in the processor to perform second pulse calibration on the UTC time in the flight control system. After testing, it was found that the calibration accuracy of the present invention can reach the microsecond level, and when the GPS signal is lost, it switches to the high-precision timer of the processor to complete the microsecond calibration, and the calibration accuracy depends on the accuracy of the processor crystal oscillator.

[0034] When the GPS signal is lost, the present invention uses a high-precision timer to simulate the PPS second pulse timing to calibrate the flight control system time, which can reduce the time drift error caused by long-term operation and improve the clock calibration accuracy of GPS satellite timing. After using the PPS second pulse calibration, when the GPS signal is lost, a high-precision timer is used to replace the second pulse to calibrate the flight control system clock by second, which can improve the calibration accuracy of the flight control system. During the formation flight of unmanned aerial vehicles, the clock error between different aircraft can be effectively reduced, thereby ensuring the clock consistency of different unmanned aerial vehicles during the formation flight. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a flow chart of the UAV PPS pulse-per-second clock calibration method provided by an embodiment of the present invention.

[0036] Figure 2 It is a schematic diagram of the processing process of the interrupt service provided by an embodiment of the present invention.

[0037] Figure 3 It is a schematic diagram of the execution flow of timer clock calibration provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. 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.

[0039] In view of the problems existing in the prior art, the present invention provides a method for calibrating a PPS pulse per second clock of a UAV, and the present invention is described in detail below with reference to the accompanying drawings.

[0040] The unmanned aerial vehicle PPS second pulse clock calibration method provided by the embodiment of the present invention uses the time in the GPS positioning message in the GPS board as the flight control system timing in seconds; the PPS second pulse is sent when the GPS board time is a whole second; the flight control system processor GPIO connected to the GPS board second pulse pin triggers an interrupt upon receiving the rising edge of the PPS second pulse; in the interrupt, the milliseconds of the current system time are obtained, and the flight control system clock is set to a whole second. If the obtained milliseconds of the current system time are greater than a certain value, the seconds of the system time are added by 1, otherwise, no processing is performed; the cycle is continuously repeated; after a period of processing, if the GPS signal is lost at a certain moment, the GPS board no longer sends the PPS second pulse signal on time, and switches to the timer for clock calibration.

[0041] Specifically, Figure 1 As shown, the UAV PPS pulse per second clock calibration method provided by the embodiment of the present invention includes the following steps:

[0042] S101, PPS second pulse is sent by the GPS board when the time is a whole second.

[0043] S102, the second pulse pin of the board is connected to the GPIO of the flight control system processor, and the processor GPIO triggers an interrupt when receiving the rising edge of the pulse.

[0044] S103, in the interrupt service function, the flight control system clock is set to the whole second, and then the number of seconds of the system time is increased by 1, and this cycle continues.

[0045] S104, when the GPS signal is lost at a certain moment after a period of calibration, the board no longer sends out the PPS second pulse signal on time, and the timer is switched to perform clock calibration.

[0046] The technical solution of the present invention is further described below in conjunction with embodiments.

[0047] 1. Purpose of the invention

[0048] The existing GPS timing has a timing accuracy of seconds, so the time accuracy of the flight control system can only reach the second level, and when there is no GPS signal, due to the clock accuracy of the system itself, the calibration accuracy is slightly lower than the PPS second pulse. To solve this problem, the present invention proposes a clock calibration solution combining the PPS second pulse and the processor high-precision timer.

[0049] 2. Invention Solution

[0050] (1) The PPS second pulse is emitted by the GPS board when the time is a whole second. The board used in this solution has been tested and the accuracy of the PPS second pulse is within 20ns.

[0051] (2) The second pulse pin of the board is connected to the GPIO of the flight control system processor. The processor GPIO triggers an interrupt when it receives the rising edge of the pulse. In the interrupt service function, the flight control system clock is set to the whole second, and then the second of the system time is increased by 1. This cycle continues. Since the PPS second pulse is sent at the whole second, after processing, the drift of the time error caused by the accuracy of the crystal oscillator during long-term operation can be effectively eliminated. The processing process of the interrupt service is as follows Figure 2 shown.

[0052] (3) After a period of calibration, if the GPS signal is lost at a certain moment, the board will no longer send out the PPS second pulse signal on time. At this time, switch to the timer for clock calibration. The principle of timer clock calibration is as follows: start the timer and set the timer interrupt trigger period to 1s. Since the timer cannot be guaranteed to start in full seconds when it is started, when processing the PPS pulse signal, record the microsecond offset when the interrupt is triggered. When the GPS signal is lost, use the timer to write the previously recorded microsecond offset every 1s to calibrate the clock. The specific execution process is as follows: Figure 3 shown.

[0053] The technical effects of the present invention are described in detail below in conjunction with experiments.

[0054] Experiment 1.

[0055] The comparison experiment between the two aircraft is divided into two steps:

[0056] Test whether there is a second-level delay in the time of different flight control systems. Print out the time of two identical flight control systems in full seconds and perform a long-term stress test to determine whether there is a second-level error between different aircraft. The experimental results show that after the PPS time calibration of this solution, there is no second-level delay in long-term operation.

[0057] The microsecond error of different flight control systems is tested as follows: poll the time in the flight control system. When the system time is equal to 500 milliseconds, pull up the test GPIO. When the system time is 700ms, pull down the test GPIO. Use an oscilloscope to capture the rising edge waveform of the test GPIO of the two flight control systems. The experimental results show that the error between different flight control systems is no more than 25.92us.

[0058] Experiment 2.

[0059] After losing the GPS signal, use the timer to simulate the PPS to calibrate the second pulse of the flight control system clock:

[0060] Step 1: Test whether there is a second-level error between different flight control systems by using a timer to simulate the PPS second pulse calibration. After losing the GPS second pulse signal, switch to the logic processing of the timing calibration, print out the time between two identical flight control systems in full seconds, and perform a long-term stress test. The experimental results show that after the timer simulates the PPS second pulse for clock calibration, there is no second-level delay between different aircraft during long-term operation.

[0061] Step 2: Test different flight control systems using timers to simulate PPS second pulse calibration, and see if there is a microsecond error in long-term operation. Since the timer cannot be started according to the whole second when the system starts, it is necessary to record the number of microseconds after the system whole second as the offset after receiving the PPS second pulse calibration system and when the timer whole second interrupt is triggered. After losing the PPS second pulse, the timer second interrupt uses the previously recorded offset to simulate the second pulse calibration. In this experiment, whether the offset of different flight control systems changes after running for a period of time can determine whether there is drift using the timer to simulate the second pulse calibration. The experimental results show that after different flight control systems have undergone timer simulation second pulse calibration, the error offset within a period of time is less than 4ms.

[0062] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A method for calibrating a UAV PPS pulse-per-second clock, characterized in that: The UAV PPS pulse-per-second clock calibration method comprises: The time in the GPS positioning message used in the GPS board is the second level for the flight control system; The PPS second pulse is emitted when the GPS board time is a whole second; The flight control system processor GPIO connected to the GPS board second pulse pin triggers an interrupt when receiving the rising edge of the PPS second pulse; In the interrupt, the milliseconds of the current system time are obtained, and the flight control system clock is set to the whole second. If the milliseconds of the current system time obtained are greater than a certain value, the seconds of the system time are added by 1, otherwise, no processing is performed; the cycle continues; After a period of processing, if the GPS signal is lost at a certain moment, the GPS board no longer sends out the PPS second pulse signal on time, and switches to the timer for clock calibration; When the GPS board is fixed and the number of satellites searched is greater than 15, the time in the GPS positioning message is used to synchronize the flight control system; The PPS second pulse is less than 20ns; The processing process of the interrupt service is as follows: (1) Calibration count accumulation; (2) Record the milliseconds of the current system time; (3) Clear the system time nanoseconds; (4) Determine whether the number of milliseconds of the recorded system time is greater than 500. If it is greater than 500, the number of seconds of the system time is increased by 1; otherwise, no processing is performed; The timer clock calibration method comprises: Start the timer and set the timer interrupt trigger period to 1s; Since the timer cannot be guaranteed to start at a full second, when processing the PPS pulse signal, the microsecond offset when the interrupt is triggered is recorded. When the GPS signal is lost, the timer is used to write the previously recorded microsecond offset every 1 second to calibrate the clock.

2. The UAV PPS pulse-per-second clock calibration method according to claim 1, characterized in that: The execution flow of the timer clock calibration is as follows: (I) Determine whether the PPS calibration count is greater than 20; (II) If the PPS calibration count is greater than 20, determine whether the PPS pulse has timed out; if the PPS calibration count is not greater than 20, terminate directly; (III) If it is determined that the PPS pulse has timed out, the nanoseconds of the system time are set as the recorded value; if it is determined that the PPS pulse has not timed out, the nanoseconds of the current system time are recorded.

3. A computer device, characterized in that: The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps: The PPS second pulse is sent by the GPS board when the time is a whole second; The flight control system processor GPIO connected to the board's second pulse pin triggers an interrupt when receiving the rising edge of the pulse; In the interrupt service function, record the milliseconds of the current system time, set the flight control system clock to whole seconds, and determine whether the recorded milliseconds are greater than 500. If it is greater than 500 milliseconds, add 1 to the seconds of the system time. Otherwise, do nothing and keep looping. When the GPS signal is lost at a certain moment after calibration for a period of time, the board no longer sends out the PPS second pulse signal on time and switches to the timer for clock calibration.

4. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the pulse-per-second clock calibration method according to any one of claims 1 to 3.

5. A flight control system processor that implements the UAV PPS pulse per second clock calibration method described in any one of claims 1 to 2.

6. An unmanned aerial vehicle implementing the pulse-per-second clock calibration method according to any one of claims 1 to 2.

7. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the pulse-per-second clock calibration method described in any one of claims 1 to 2.