An injector time calibration method, apparatus, equipment and medium

By detecting the PPS IN signal to obtain the error coefficient and compensating for it, the problem of insufficient RTC time synchronization accuracy in new UAVs was solved, and higher time calibration accuracy was achieved.

CN120143582BActive Publication Date: 2025-12-02SICHUAN HAOHAN YUANCHENG TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510443274.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-12-02
Estimated Expiration
2045-04-10

AI Technical Summary

Technical Problem

In new types of drones, the random number update cycle is shorter. How can we improve the time synchronization and timing accuracy of the timekeeping chip RTC?

Method used

By detecting the PPS IN signal, the error coefficient is obtained, the total error time to be compensated is calculated, and a compensation mechanism is executed, including periodic compensation and digital smoothing calibration, to improve synchronization accuracy.

Benefits of technology

It improves the time synchronization and running accuracy of drones, and enhances the accuracy of time calibration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120143582B_ABST
    Figure CN120143582B_ABST
Patent Text Reader

Abstract

This invention relates to the field of unmanned aerial vehicle (UAV) control technology, and in particular to an injector time calibration method, apparatus, device, and medium. The method is applied to the MCU of the injector and includes: detecting the presence of a PPS IN signal and obtaining a detection result; determining the timing status based on the detection result; obtaining an error coefficient, which is the first time difference amplified by the device every second; calculating the total error time to be compensated based on the error coefficient and the timing status; and executing a compensation mechanism based on the total error time, thereby improving the synchronization accuracy and timekeeping accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of unmanned aerial vehicle (UAV) control technology, and in particular to an injector time calibration method, apparatus, device, and medium. Background Technology

[0002] Introducing external time reference signals into the hardware interface and processing mechanisms of a drone's control system requires an injector. In newer drones, the random numbers stored in this injector correspond to time intervals of hundreds of milliseconds. Therefore, the update cycle of random numbers in actual use is also hundreds of milliseconds, which is shorter than the update cycle of random numbers in previous drones, placing higher demands on time accuracy. Thus, improving the time synchronization and timing accuracy of the timekeeping chip (RTC) is a pressing technical problem that needs to be solved. Summary of the Invention

[0003] In view of the above problems, the present invention provides an injector timing calibration method, apparatus, device and medium that overcomes or at least partially solves the above problems.

[0004] In a first aspect, the present invention provides an injector timing calibration method, applied in an injector's MCU, comprising:

[0005] The presence of the PPS IN signal is detected to obtain the detection result.

[0006] Based on the test results, the timing status is determined;

[0007] Obtain the error coefficient, which is the first time difference that the device expands every second;

[0008] Based on the aforementioned error coefficients and timing conditions, calculate the total error time that needs to be compensated.

[0009] A compensation mechanism is executed based on the total error time.

[0010] Preferably, the detection of the presence of the PPS IN signal to obtain the detection result includes:

[0011] The reference variable, upper threshold, and lower threshold of the PPS IN signal are preset;

[0012] When a PPS IN signal interruption is detected, the reference variable is incremented by 2; when an interruption of one second is detected, the reference variable is decremented by 1 to obtain the calculation result of the reference variable.

[0013] The presence of the PPS IN signal is detected based on the calculation results of the baseline variable, the upper threshold, and the lower threshold.

[0014] Preferably, the presence of the PPS IN signal is detected based on the results of the benchmark variable, the upper threshold, and the lower threshold, including:

[0015] When the calculated result of the benchmark variable is close to the upper threshold, the detection result is that a PPS IN signal is present.

[0016] When the calculated result of the benchmark variable is close to the lower threshold, the detection result is that the PPS IN signal does not exist.

[0017] Preferably, determining the timing based on the detection results includes:

[0018] When the detection result indicates the presence of the PPS IN signal, calculate the second time difference between the PPS IN signal and the PPS OUT signal, wherein the edge of the PPS OUT signal is at the same moment as the second interruption;

[0019] Based on the second time difference, the timing is determined.

[0020] Preferably, determining the timing based on the detection results includes:

[0021] When the detection result indicates that the PPS IN signal is absent, the timing of the second interrupt of the timekeeping chip is obtained;

[0022] The timing status is determined based on the second interrupt of the timekeeping chip.

[0023] Preferably, based on the total error time, a compensation mechanism is executed, including:

[0024] During periodic compensation, it is determined whether the total error time is greater than 1 second;

[0025] If so, the total error time is rounded down to the nearest second to obtain the first duration to be compensated;

[0026] Based on the first duration, modify the time of the timekeeping chip;

[0027] Based on the total error time and the first duration, a second duration that needs to be compensated is determined, wherein the second duration is in the millisecond range;

[0028] Based on the second duration, a shift function is used for compensation.

[0029] Preferably, the compensation mechanism, based on the total error time, further includes:

[0030] Based on the total error time, the first duration, and the second duration, a third duration that needs to be compensated is determined, wherein the third duration is in the microsecond range;

[0031] Based on the aforementioned third duration, a digital smoothing calibration function is used for correction.

[0032] Secondly, the present invention also provides an injector timing calibration device, applied in the MCU of the injector, comprising:

[0033] The detection module is used to detect the presence of the PPS IN signal and obtain the detection result.

[0034] The determination module is used to determine the timing based on the detection results;

[0035] The acquisition module is used to acquire the error coefficient, which is the first time difference that the device expands every second;

[0036] The calculation module is used to calculate the total error time that needs to be compensated based on the error coefficient and timing conditions.

[0037] The compensation module is used to execute a compensation mechanism based on the total error time.

[0038] Thirdly, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect.

[0039] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0040] One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:

[0041] This invention provides an injector time calibration method, applied in the MCU of the injector, comprising: detecting the presence of a PPSIN signal and obtaining a detection result; determining the timing status based on the detection result; if so, obtaining an error coefficient, which is the first time difference amplified by the device every second; calculating the total error time to be compensated based on the error coefficient and the timing status; and executing a compensation mechanism based on the total error time, thereby improving the synchronization accuracy and timekeeping accuracy. Attached Figure Description

[0042] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0043] Figure 1 A flowchart illustrating the steps of the injector time calibration method in an embodiment of the present invention is shown.

[0044] Figure 2This diagram illustrates the pre-processing of the MCU for the injector in an embodiment of the present invention;

[0045] Figure 3 A schematic diagram of the injector time calibration device in an embodiment of the present invention is shown;

[0046] Figure 4 A schematic diagram of the structure of a computer device implementing the injector time calibration method in an embodiment of the present invention is shown. Detailed Implementation

[0047] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the invention and to fully convey the scope of the invention to those skilled in the art.

[0048] Example 1:

[0049] Embodiments of the present invention provide an injector timing calibration method, applied to the MCU of the injector, such as... Figure 1 As shown, it includes:

[0050] S101, detect the presence of the PPS IN signal and obtain the detection result;

[0051] S102, Based on the detection results, determine the timing status;

[0052] S103, obtain the error coefficient, which is the first time difference that the device expands every second;

[0053] S104, Calculate the total error time to be compensated based on the error coefficient and timing conditions;

[0054] S105, based on the total error time, execute the compensation mechanism.

[0055] First, before executing this injector timing calibration method, pre-processing is performed on the injector's MCU, such as... Figure 2 As shown, the PPS IN signal generated by the Beidou satellite navigation terminal is input to the MCU; a host computer or terminal is set up to respond to the time acquisition request issued by the device; a temperature-compensated crystal oscillator is used to provide a 32.768KHz clock signal to the MCU's RTC for temperature compensation; and an oscilloscope is set up to acquire the PPS OUT signal output by the MCU.

[0056] Since the presence of the PPS IN signal generated by the BeiDou satellite navigation terminal is uncertain in practical applications, this invention requires first detecting the PPS IN signal to determine its presence or absence. S101, Detect the presence of the PPS IN signal and obtain the detection result.

[0057] The specific testing process is as follows:

[0058] The reference variable, upper threshold, and lower threshold of the PPS IN signal are preset;

[0059] When a PPS IN signal interruption is detected, the reference variable is incremented by 2. When an interruption of one second is detected, the reference variable is decremented by 1 to obtain the calculation result of the reference variable. Based on the calculation result of the reference variable, the upper threshold, and the lower threshold, the presence of the PPS IN signal is detected.

[0060] Specifically, when the calculated result of the benchmark variable is close to the upper threshold, the detection result is that the PPS IN signal exists; when the calculated result of the benchmark variable is close to the lower threshold, the detection result is that the PPS IN signal does not exist.

[0061] In a specific implementation, the PPS IN signal is introduced into the GPIO pin of the MCU. This GPIO pin is configured to be triggered by the rising edge of an external interrupt. The MCU's RTC (timekeeping chip) calibration output signal is output as the PPS OUT signal, with a signal frequency of 1Hz.

[0062] The presence of a PPS IN signal indicates that the PPS IN signal generated by the BeiDou satellite navigation terminal can be received. In this case, step S102 is executed to determine the timing based on the detection results.

[0063] Specifically, when the detection result indicates the presence of the PPS IN signal, the second time difference between the PPS IN signal and the PPS OUT signal is calculated. Based on the second time difference, the timing is determined, and the edge of the PPS OUT signal coincides with the second interruption.

[0064] When a PPS IN signal is present, there are two scenarios: power-on calibration timing and periodic calibration timing.

[0065] Upon power-on, the last calibration time (the last moment) is read from the register and compared with the current time of the timekeeping chip (RTC). This comparison yields the time difference between the last calibration and the current power-on calibration, which is the total duration. The timekeeping chip's second interrupt counts after the device powers on; specifically, this counting can be performed using a counter.

[0066] During periodic calibration timing, when the detection result shows the presence of the PPS IN signal, the second time difference between the PPS IN signal and the PPS OUT signal is calculated; based on the second time difference, the timing status is determined.

[0067] When there is no PPS IN signal, that is, when the detection result indicates that the PPS IN signal is not present, the timing of the second interrupt of the timekeeping chip is obtained; based on the timing of the second interrupt of the timekeeping chip, the timing status is determined.

[0068] Specifically, the second interrupt uses the alarm interrupt of the timekeeping chip to simulate the second interrupt of the timekeeping chip. When configuring the alarm, all matching fields are disabled, the alarm interrupt is enabled, and the timekeeping chip's alarm is activated. Because all matching fields of the alarm are disabled, an alarm interrupt is generated every second, which is then used as the second interrupt of the timekeeping chip.

[0069] PPS OUT signal: Utilizing the calibration output function of the timer chip, when enabled, it can output a calibrated pulse signal from a designated PC13 port. The frequency can be configured. When configured to 1Hz, it can be used as the PPS OUT signal.

[0070] The PPS OUT signal output by the timekeeping chip and the alarm interrupt are aligned internally within the timekeeping chip, so the edge of the PPS OUT signal and the alarm interrupt time can be considered to be at the same moment.

[0071] Next, execute S103 to obtain the error coefficient.

[0072] Specifically, the error coefficient is the error value per second between the RTC signal and the reference PPS IN signal of the Beidou satellite. This error coefficient determines the accuracy of the device's timekeeping and the error time of subsequent calibration functions. This error coefficient is stored in SD NAND FLASH, ensuring that it will not be lost after a power outage, and it is read from this SD NAND FLASH when the device is powered on.

[0073] For example, the device's RTC uses the 32.768kHz output clock of the INS5699 chip as its clock source. The INS5699 chip's internal crystal oscillator has temperature compensation, with a maximum accuracy error of 5ppm. The timing error can be controlled to around 0.3 to 0.5ppm.

[0074] When a PPS IN signal is present, each PPS IN interrupt records the current system time as the latest PPS IN signal time. Similarly, each PPS OUT signal interrupt of the timekeeping chip records the current system time as the latest PPS OUT signal time. After obtaining the PPS OUT signal time in the timekeeping chip's second interrupt, the PPS IN signal time is subtracted from the current PPS OUT signal time to obtain the time difference. If this time difference exceeds the cycle time (e.g., 3600 seconds for one hour), an error time threshold of one hour is determined based on the error coefficient per second.

[0075] Next, we will proceed with the specific compensation process.

[0076] Execute S104 to calculate the total error time that needs to be compensated based on the error coefficient and timing conditions.

[0077] Specifically, the error coefficient is multiplied by the timing information to calculate the total error time that needs to be compensated.

[0078] Therefore, in S105, a compensation mechanism is executed based on the total error time. Specifically, if the total error time exceeds one hour, compensation can be performed according to the one-hour error time threshold, while for smaller error times, compensation needs to be performed through other means.

[0079] After the total error time is compensated according to the error time threshold of 1 hour, that is, when performing periodic compensation, it is calculated whether the remaining error time is greater than 1 second.

[0080] If so, round the total error time to the nearest second to obtain the first duration that needs to be compensated;

[0081] Based on the first duration, modify the time of the timekeeping chip;

[0082] Based on the total error time and the first duration, a second duration that needs to be compensated is determined, and the second duration is in the millisecond range.

[0083] Based on the second duration, a shift function is used for compensation.

[0084] Specifically, the timekeeping chip has a sub-second error with a higher-precision clock. This error can be eliminated through a shift function. The sub-second of the timekeeping chip is displayed in binary and decreases during operation. The sub-second register RTC_SS is read-only. This shift function can delay or advance the arrival time of the next second by increasing the value of SFS[14:0] in the RTC_SHIFCTL register to the value of the RTC_SS synchronous prescaler counter SFS[15:0], or by increasing the value of SFS[14:0] to the synchronous prescaler counter SFS[15:0] and simultaneously setting bit A15.

[0085] The maximum value of the subsecond register RTC_SS depends on the value of FACTOR_S in the RTC_PSC register. The larger the value of FACTOR_S, the higher the adjustment precision. Currently, the default value of FACTOR_S is 0xFF, therefore, the precision that can be adjusted through the shift function is approximately 1 / 255*1000 ≈ 3.922ms.

[0086] After the shift function is adjusted, the following steps are also taken: based on the total error time, the first duration, and the second duration, a third duration that needs to be compensated is determined, with the third duration being in the microsecond range; based on the third duration, a digital smoothing calibration function is used for correction.

[0087] The digital smoothing calibration function is a method for calibrating the RTC frequency, which is specifically calibrated by adjusting the number of clock pulses of the timekeeping chip within the cycle.

[0088] Completing one digital smoothing calibration is equivalent to increasing or decreasing the number of clock pulses on the timekeeping chip by a certain number within a calibration cycle. This calibration has a resolution of approximately 0.954 ppm, ranging from -487.1 ppm to +488.5 ppm. The specific calibration cycle can be configured up to 2... 20 2 19 Or 2 18 If the input frequency of the timekeeping chip is 32.768 kHz, these calibration cycle times correspond to 32 seconds, 16 seconds, and 8 seconds, respectively.

[0089] The high-precision frequency compensation register (RTC_HRFC) specifies the number of timekeeping chip clocks to be masked during the calibration period. The CMSK[8:0] bits can mask 0 to 511 timekeeping chip clocks, thus reducing the frequency of the timekeeping chip by up to 487.1ppm.

[0090] To improve the timekeeping chip's performance, the FREQI bit can be set. If the FREQI bit is set, 512 additional timekeeping chip cycles will be added to the calibration cycle (32 seconds, 16 seconds, or 8 seconds). This means that every 2 11 2 10 Or 2 9 The clock is inserted by one clock cycle of the timekeeping chip. Therefore, using FREQI can increase the RTC frequency by 488.5 ppm. When using FREQI and CMSK simultaneously, each cycle can adjust from -511 to +512 clock cycles of the timekeeping chip, so at a resolution of 0.954 ppm, the adjustment range is from -487.1 ppm to +488.5 ppm.

[0091] In addition to the periodic compensation mentioned above, compensation can also be performed when the device is powered on. The compensation principle can follow the periodic compensation principle, with the only trigger condition being power-on. The timekeeping chip time compensation mechanism used in power-on calibration is mainly to correct for excessive time discrepancies between the device's timekeeping and the standard time after a long period of shutdown.

[0092] One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:

[0093] This invention provides an injector time calibration method, applied in the MCU of the injector, comprising: detecting the presence of a PPSIN signal and obtaining a detection result; determining the timing status based on the detection result; if so, obtaining an error coefficient, which is the first time difference amplified by the device every second; calculating the total error time to be compensated based on the error coefficient and the timing status; and executing a compensation mechanism based on the total error time, thereby improving the synchronization accuracy and timekeeping accuracy.

[0094] Example 2:

[0095] Based on the same inventive concept, embodiments of the present invention also provide an injector timing calibration device, applied in the MCU of the injector, such as... Figure 3 As shown, it includes:

[0096] Detection module 301 is used to detect the presence of PPS IN signal and obtain the detection result;

[0097] The determination module 302 is used to determine the timing based on the detection results;

[0098] The acquisition module 303 is used to acquire the error coefficient, which is the first time difference that the device expands every second;

[0099] Calculation module 304 is used to calculate the total error time to be compensated based on the error coefficient and timing conditions;

[0100] The compensation module 305 is used to execute a compensation mechanism based on the total error time.

[0101] In one optional implementation, the detection module 301 is used for:

[0102] The reference variable, upper threshold, and lower threshold of the PPS IN signal are preset;

[0103] When a PPS IN signal interruption is detected, the reference variable is incremented by 2; when an interruption of one second is detected, the reference variable is decremented by 1 to obtain the calculation result of the reference variable.

[0104] The presence of the PPS IN signal is detected based on the calculation results of the baseline variable, the upper threshold, and the lower threshold.

[0105] In an optional implementation, the detection module 301 is further configured to:

[0106] When the calculated result of the benchmark variable is close to the upper threshold, the detection result is that a PPS IN signal is present.

[0107] When the calculated result of the benchmark variable is close to the lower threshold, the detection result is that the PPS IN signal does not exist.

[0108] In one alternative implementation, the determining module 302 is configured to:

[0109] When the detection result indicates the presence of the PPS IN signal, calculate the second time difference between the PPS IN signal and the PPS OUT signal. The edge of the PPS OUT signal coincides with the second interruption.

[0110] Based on the second time difference, the timing is determined.

[0111] In one alternative implementation, the determining module 302 is configured to:

[0112] When the detection result indicates that the PPS IN signal is absent, the timing of the second interrupt of the timekeeping chip is obtained;

[0113] The timing status is determined based on the second interrupt of the timekeeping chip.

[0114] In one alternative implementation, the compensation module 305 is used for:

[0115] During periodic compensation, it is determined whether the total error time is greater than 1 second;

[0116] If so, the total error time is rounded down to the nearest second to obtain the first duration to be compensated;

[0117] Based on the first duration, modify the time of the timekeeping chip;

[0118] Based on the total error time and the first duration, a second duration that needs to be compensated is determined, wherein the second duration is in the millisecond range;

[0119] Based on the second duration, a shift function is used for compensation.

[0120] In an optional implementation, the compensation module 305 is further configured to:

[0121] Based on the total error time, the first duration, and the second duration, a third duration that needs to be compensated is determined, wherein the third duration is in the microsecond range;

[0122] Based on the aforementioned third duration, a digital smoothing calibration function is used for correction.

[0123] Example 3:

[0124] Based on the same inventive concept, embodiments of the present invention provide a computer device, such as... Figure 4 As shown, it includes a memory 404, a processor 402, and a computer program stored in the memory 404 and executable on the processor 402. When the processor 402 executes the program, it implements the above-described injector time calibration steps.

[0125] Among them, Figure 4 In this document, a bus architecture (represented by bus 400) is used. Bus 400 may include any number of interconnected buses and bridges, linking various circuits including one or more processors represented by processor 402 and memory represented by memory 404. Bus 400 may also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 406 provides an interface between bus 400 and receiver 401 and transmitter 403. Receiver 401 and transmitter 403 may be the same element, i.e., a transceiver, providing a unit for communicating with various other devices over a transmission medium. Processor 402 is responsible for managing bus 400 and general processing, while memory 404 can be used to store data used by processor 402 during operation.

[0126] Example 4:

[0127] Based on the same inventive concept, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described injector time calibration method.

[0128] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0129] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0130] Similarly, it should be understood that, in order to simplify the invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are explicitly recited in each embodiment. Rather, as reflected in each embodiment, inventive aspects lie in fewer than all features of the single foregoing disclosed embodiment. Therefore, the claims, following the detailed description, are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.

[0131] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0132] Furthermore, those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the specific implementation, any of the claimed embodiments can be used in any combination.

[0133] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the injector timing calibration device or computer device according to embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such programs implementing the present invention can be stored on a computer-readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0134] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

Claims

1. An injector timing calibration method, applied in the MCU of the injector, characterized in that, include: The presence of the PPS IN signal is detected, and the detection results are obtained, including: The reference variable, upper threshold, and lower threshold of the PPS IN signal are preset; When a PPS IN signal interruption is detected, the reference variable is incremented by 2; when an interruption of one second is detected, the reference variable is decremented by 1 to obtain the calculation result of the reference variable. Based on the calculation results of the baseline variable, the upper threshold, and the lower threshold, the presence of the PPS IN signal is detected, including: When the calculated result of the benchmark variable is close to the upper threshold, the detection result is that a PPS IN signal is present; When the calculated result of the benchmark variable is close to the lower threshold, the detection result is that the PPS IN signal does not exist; Based on the test results, the timing status is determined; Obtain the error coefficient, which is the first time difference that the device expands every second; Based on the aforementioned error coefficients and timing conditions, calculate the total error time that needs to be compensated. Based on the total error time, a compensation mechanism is implemented, including: During periodic compensation, it is determined whether the total error time is greater than 1 second; If so, the total error time is rounded down to the nearest second to obtain the first duration to be compensated; Based on the first duration, modify the time of the timekeeping chip; Based on the total error time and the first duration, a second duration that needs to be compensated is determined, wherein the second duration is in the millisecond range; Based on the second duration, a shift function is used for compensation; Based on the total error time, the first duration, and the second duration, a third duration that needs to be compensated is determined, wherein the third duration is in the microsecond range; Based on the aforementioned third duration, a digital smoothing calibration function is used for correction.

2. The method as described in claim 1, characterized in that, Based on the detection results, the timing is determined, including: When the detection result indicates the presence of the PPS IN signal, calculate the second time difference between the PPS IN signal and the PPS OUT signal, wherein the edge of the PPS OUT signal is at the same moment as the second interruption; Based on the second time difference, the timing is determined.

3. The method as described in claim 1, characterized in that, Based on the detection results, the timing is determined, including: When the detection result indicates that the PPS IN signal is absent, the timing of the second interrupt of the timekeeping chip is obtained; The timing status is determined based on the second interrupt of the timekeeping chip.

4. An injector timing calibration device, applied in the MCU of an injector, characterized in that, include: The detection module is used to detect the presence of the PPS IN signal and obtain the detection result. The detection module is used for: The reference variable, upper threshold, and lower threshold of the PPS IN signal are preset; When a PPS IN signal interruption is detected, the reference variable is incremented by 2; when an interruption of one second is detected, the reference variable is decremented by 1 to obtain the calculation result of the reference variable. The presence of the PPS IN signal is detected based on the calculation results of the baseline variable, the upper threshold, and the lower threshold. The detection module is also used for: When the calculated result of the benchmark variable is close to the upper threshold, the detection result is that a PPS IN signal is present; When the calculated result of the benchmark variable is close to the lower threshold, the detection result is that the PPS IN signal does not exist; The determination module is used to determine the timing based on the detection results; The acquisition module is used to acquire the error coefficient, which is the first time difference that the device expands every second; The calculation module is used to calculate the total error time that needs to be compensated based on the error coefficient and timing conditions. The compensation module is used to execute a compensation mechanism based on the total error time. The compensation module is used to: During periodic compensation, it is determined whether the total error time is greater than 1 second; If so, the total error time is rounded down to the nearest second to obtain the first duration to be compensated; Based on the first duration, modify the time of the timekeeping chip; Based on the total error time and the first duration, a second duration that needs to be compensated is determined, wherein the second duration is in the millisecond range; Based on the second duration, a shift function is used for compensation; The compensation module is also used for: Based on the total error time, the first duration, and the second duration, a third duration that needs to be compensated is determined, wherein the third duration is in the microsecond range; Based on the aforementioned third duration, a digital smoothing calibration function is used for correction.

5. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • PPS second pulse clock calibration method, processor, storage medium and unmanned aerial vehicle

    CN112433536A