Injector time calibration method, device, equipment and medium

By detecting PPS IN signals and performing compensation mechanisms, the problem of improved time synchronization and travel accuracy requirements in new drones is solved, and higher time accuracy is achieved.

CN120143582AActive Publication Date: 2025-06-13SICHUAN HAOHAN YUANCHENG TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In new drones, the update cycle of random numbers is shorter and the accuracy of time is higher. How to improve the accuracy of time synchronization and time travel accuracy of punctual chip RTC is an urgent problem.

Method used

By detecting whether the PPS IN signal exists, determining the timing, obtaining the error coefficient, calculating the total error time to be compensated, and performing a compensation mechanism, including periodic compensation and digital smoothing calibration functions, we can improve time synchronization and time travel accuracy.

Benefits of technology

This method can improve the time synchronization accuracy and time travel accuracy of the drone, and meet higher time accuracy requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120143582A_ABST
    Figure CN120143582A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of unmanned aerial vehicle control, in particular to an injector time calibration method, device and equipment and a medium, the method is applied to an MCU of an injector, and the method comprises the steps that whether a PPS IN signal exists or not is detected, and a detection result is obtained; based on a detection result, determining a timing condition; obtaining an error coefficient, wherein the error coefficient is a first time difference expanded by the equipment per second; based on the error coefficient and the timing condition, total error time needing to be compensated is calculated; and based on the total error time, a compensation mechanism is executed, so that the synchronization precision and the travel time precision can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of UAV control, and particularly to a method, device, equipment and medium for calibrating the time of an injector. Background Art

[0002] An injector is required to import an external time reference signal into the hardware interface and supporting processing mechanism of the control system of a UAV. In a new type of UAV, the time interval corresponding to the random number stored in the injector is several hundred milliseconds. Therefore, in actual use, the update period of the random number is several hundred milliseconds, which is shorter than that of the previously used UAVs, and the requirement for time accuracy is higher. Therefore, how to improve the time synchronization accuracy and running time accuracy of the timekeeping chip RTC is a technical problem to be solved urgently at present. Summary of the Invention

[0003] In view of the above problems, the present invention provides an injector time calibration method, device, equipment and medium that overcome the above problems or at least partially solve the above problems.

[0004] In a first aspect, the present invention provides an injector time calibration method, which is applied to the MCU of an injector and includes:

[0005] Detect whether a PPS IN signal exists to obtain a detection result;

[0006] Based on the detection result, determine the timing situation;

[0007] Obtain an error coefficient, where the error coefficient is the first time difference expanded by the device per second;

[0008] Based on the error coefficient and the timing situation, calculate the total error time to be compensated;

[0009] Based on the total error time, execute a compensation mechanism.

[0010] Preferably, detecting whether a PPS IN signal exists to obtain a detection result includes:

[0011] Pass a reference variable, an upper threshold, and a lower threshold of a preset PPS IN signal;

[0012] When a PPS IN signal interruption is detected, add 2 to the reference variable, and when a second interruption is detected, subtract 1 from the reference variable to obtain a calculation result of the reference variable;

[0013] Based on the calculation result of the reference variable, the upper threshold, and the lower threshold, detect whether a PPS IN signal exists.

[0014] Preferably, detecting whether a PPS IN signal exists based on the result of the reference variable, the upper threshold, and the lower threshold includes:

[0015] When the calculation result of the reference variable is close to the upper threshold, the detection result is that the PPS IN signal exists;

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

[0017] Preferably, based on the detection result, the timing situation is determined, including:

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

[0019] Based on the second time difference, determine the timing situation.

[0020] Preferably, based on the detection result, the timing situation is determined, including:

[0021] When the detection result is that the PPS IN signal does not exist, obtain the timing of the second interruption of the timing chip;

[0022] Based on the timing of the second interruption of the timing chip, determine the timing situation.

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

[0024] During cycle compensation, determine whether the total error time is greater than 1 s;

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

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

[0027] Based on the total error time and the first duration, determine the second duration to be compensated, and the second duration is in milliseconds;

[0028] Based on the second duration, perform compensation using the shift function.

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

[0030] Based on the total error time, the first duration, and the second duration, determine the third duration to be compensated, and the third duration is in microseconds;

[0031] Based on the third duration, perform correction using the digital smoothing calibration function.

[0032] In a second aspect, the present invention further provides an injector time calibration device, which is applied to the MCU of an injector and includes:

[0033] A detection module, configured to detect whether a PPS IN signal exists and obtain a detection result;

[0034] A determination module, configured to determine the timing situation based on the detection result;

[0035] An acquisition module, configured to acquire an error coefficient, where the error coefficient is the first time difference expanded by the device per second;

[0036] A calculation module, configured to calculate the total error time to be compensated based on the error coefficient and the timing situation;

[0037] A compensation module, configured to execute a compensation mechanism based on the total error time.

[0038] In a third aspect, the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the method described in the first aspect is implemented.

[0039] In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.

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

[0041] The present invention provides an injector time calibration method, which is applied to the MCU of an injector and includes: detecting whether a PPS IN signal exists and obtaining a detection result; determining the timing situation based on the detection result; if so, acquiring an error coefficient, where the error coefficient is the first time difference expanded by the device per second; calculating the total error time to be compensated based on the error coefficient and the timing situation; and executing a compensation mechanism based on the total error time, thereby improving the synchronization accuracy and the running time accuracy. Description of the Drawings

[0042] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0043] Figure 1 Shows the step flow diagram of the injector time calibration method in the embodiments of the present invention;

[0044] Figure 2Shows a schematic diagram of preparing the MCU of the injector in advance in an embodiment of the present invention;

[0045] Figure 3 Shows a schematic structural diagram of the injector time calibration device in an embodiment of the present invention;

[0046] Figure 4 Shows a schematic structural diagram of a computer device for implementing the injector time calibration method in an embodiment of the present invention. Detailed implementation manners

[0047] Hereinafter, exemplary embodiments of the present invention will be described in more detail with reference to the drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present invention can be more thoroughly understood and the scope of the present invention can be fully conveyed to those skilled in the art.

[0048] Embodiment 1:

[0049] An embodiment of the present invention provides an injector time calibration method, which is applied to the MCU of the injector. As Figure 1 shown, it includes:

[0050] S101, detecting whether the PPS IN signal exists to obtain a detection result;

[0051] S102, determining the timing situation based on the detection result;

[0052] S103, obtaining an error coefficient, where the error coefficient is the first time difference expanded by the device per second;

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

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

[0055] First, before executing this injector time calibration method, prepare the MCU of the injector in advance. As Figure 2 shown, input the PPS IN signal generated by the Beidou satellite navigation terminal into the MCU; set the upper computer or terminal to respond to the time acquisition request sent by the device; use the temperature-compensated crystal oscillator to provide a 32.768 KHz clock signal for the RTC of the MCU for temperature compensation; set the oscilloscope to obtain the PPS OUT signal output by the MCU.

[0056] Since in practical applications, it is uncertain whether the PPS IN signal generated by the Beidou satellite navigation terminal exists. Therefore, in the present invention, it is necessary to first detect the PPS IN signal to determine its existence. S101, detect whether the PPS IN signal exists to obtain a detection result.

[0057] The specific detection process is as follows:

[0058] By presetting the reference variable, upper threshold, and lower threshold of the PPS IN signal;

[0059] When a PPS IN signal interruption is detected, add 2 to the reference variable. When a second interruption is detected, subtract 1 from the reference variable 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, detect whether the PPS IN signal exists.

[0060] Among them, when the calculation result of the reference variable is close to the upper threshold, the detection result is that the PPS IN signal exists; when the calculation result of the reference variable is close to the lower threshold, the detection result is that the PPS IN signal does not exist.

[0061] In a specific implementation manner, introduce the PPS IN signal into the GPIO pin of the MCU. This GPIO pin is configured in the external interrupt rising edge trigger mode, and the calibration output signal of the MCU's RTC (real-time clock chip) is output as the PPS OUT signal, and the signal frequency is 1 Hz.

[0062] When there is a PPS IN signal, it means that the PPS IN signal generated by the Beidou satellite navigation terminal can be received. In this case, execute S102, and based on the detection result, determine the timing situation.

[0063] Specifically, when the detection result is that the PPS IN signal exists, calculate the second time difference between the PPS IN signal and the PPS OUT signal. Based on the second time difference, determine the timing situation. The edge of the PPS OUT signal is at the same moment as the second interruption.

[0064] When there is a PPS IN signal, it is divided into two cases: calibration timing at startup and periodic calibration timing:

[0065] At startup, read the last calibrated moment from the register, that is, the last moment, and compare it with the current moment of the real-time clock chip (RTC) to calculate the time difference elapsed from the last calibration to the current startup calibration, which is the total timing duration. After the device is powered on, count in the second interruption of the real-time clock chip. Specifically, it can be counted by a counter.

[0066] When performing cycle calibration timing, 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; based on the second time difference, determine the timing situation.

[0067] When there is no PPS IN signal, that is, when the detection result indicates the absence of the PPS IN signal, obtain the timing of the second interruption of the timekeeping chip; based on the timing of the second interruption of the timekeeping chip, determine the timing situation.

[0068] Among them, for the second interruption: use the alarm interruption of the timekeeping chip to simulate the second interruption of the timekeeping chip. When setting the alarm configuration, mask all matching fields, turn on the alarm interruption, and enable the timekeeping chip alarm. Since all matching fields of the alarm are masked, an alarm interruption will be generated every second and used as the second interruption of the timekeeping chip.

[0069] PPS OUT signal: Use the calibration output function of the timekeeping chip. After enabling, a calibrated pulse signal can be output at the specified PC13 port, and the frequency can be configured. After configuring it to 1Hz, it can be used as the PPS OUT signal.

[0070] The PPS OUT signal output by the timekeeping chip and the alarm interruption are aligned inside the timekeeping chip. It can be considered that the edge of the PPS OUT signal and the alarm interruption are at the same moment in time.

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

[0072] Specifically, the error coefficient is the error value between the RTC signal per second 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 the subsequent calibration function. This error coefficient is stored in the SD NAND FLASH to ensure that it will not be lost after a complete power-off. When the device is powered on, it reads and uses the error coefficient from this SD NAND FLASH.

[0073] For example, the RTC of the device uses the 32.768KHz output clock of the INS5699 chip as the clock source. The crystal oscillator inside the INS5699 chip has a temperature compensation function, and the maximum accuracy error is 5ppm. The timekeeping error can be controlled at about 0.3 - 0.5ppm.

[0074] When there is a PPS IN signal, each PPS IN interruption records the current system time as the latest PPS IN signal time, and each PPS OUT signal interruption 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 second interruption of the timekeeping chip, subtract the PPS IN signal time from the PPS OUT signal time at this time to get the time difference. If this time difference exceeds the cycle time, taking 1 hour as an example, that is 3600 seconds. According to the error coefficient per second, the error time threshold for 1 hour is thus determined.

[0075] Next, a specific compensation process is carried out.

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

[0077] Specifically, multiply the error coefficient by the timing situation to calculate the total error time that needs to be compensated.

[0078] Therefore, in S105, based on the total error time, a compensation mechanism is executed. Specifically, when the total error time exceeds 1 hour, it can be compensated according to the error time threshold for 1 hour, while for smaller error times, some means are needed for compensation.

[0079] After the total error time is compensated according to the error time threshold for 1 hour, that is, when performing cycle compensation, calculate whether the remaining error time is greater than 1s;

[0080] If so, round the total error time to the nearest second to obtain the first duration 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, determine the second duration to be compensated, and the second duration is in milliseconds;

[0083] Based on the second duration, perform compensation using the shift function.

[0084] Specifically, there is a sub-second error between the timekeeping chip and a higher-precision clock, and this error can be eliminated through the 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] of the RTC_SHIFCTL register to the synchronous prescaler counter value SFS[15:0], or by increasing the value of SFS[14:0] to the synchronous prescaler counter SFS[15:0] and simultaneously setting the A15 bit, respectively, to achieve the shift function.

[0085] The maximum value of the sub - second 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 1 / 255 * 1000 ≈ 3.922ms.

[0086] After the adjustment by the shift function, it further includes: determining a third duration to be compensated, which is at the micro - second level, based on the total error time, the first duration, and the second duration; and correcting it using the digital smoothing calibration function based on the third duration.

[0087] The digital smoothing calibration function is a method for calibrating the RTC frequency. Specifically, it is calibrated by adjusting the number of clock pulses of the time - keeping chip within a period.

[0088] Completing one digital smoothing calibration is equivalent to increasing or decreasing the number of clock pulses of the time - keeping chip clock by a certain number within one calibration period. The resolution of this calibration is approximately 0.954ppm, and the range is from - 487.1ppm to + 488.5ppm. The specific calibration period can be configured to 2 20 、2 19 or 2 18 . If the input frequency of the time - keeping chip is 32.768KHz, these calibration period times correspond to 32 seconds, 16 seconds, and 8 seconds respectively.

[0089] The number of time - keeping chip clocks to be masked by the high - precision frequency compensation register (RTC_HRFC) within the calibration period. The CMSK[8:0] bits can mask 0 to 511 time - keeping chip clocks. In this way, the frequency of the time - keeping chip can be reduced by up to 487.1ppm.

[0090] To improve the time - keeping chip, the FREQI bit can be set. If the RREQI bit is set, 512 additional time - keeping chip cycles will be added to the calibration period (32 seconds, 16 seconds, or 8 seconds). This means that one time - keeping chip clock cycle is inserted every 2 11 、2 10 or 2 9 clock cycles. Therefore, using FREQI can increase the RTC frequency by 488.5ppm. When using FREQI and CMSK simultaneously, - 511 to + 512 time - keeping chip clock cycles can be adjusted in each period. Therefore, in the case of a 0.954ppm resolution, the adjustment range is from - 487.1ppm to + 488.5ppm.

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

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

[0093] The present invention provides an injector time calibration method, which is applied to the MCU of the injector and includes: detecting whether the PPSIN signal exists to obtain a detection result; determining the timing situation based on the detection result; if so, obtaining an error coefficient, where the error coefficient is the first time difference expanded by the device per second; calculating the total error time to be compensated based on the error coefficient and the timing situation; and performing a compensation mechanism based on the total error time, thereby improving the synchronization accuracy and timekeeping accuracy.

[0094] Embodiment 2:

[0095] Based on the same inventive concept, the embodiment of the present invention also provides an injector time calibration device, which is applied to the MCU of the injector, as Figure 3 shown, and includes:

[0096] A detection module 301, configured to detect whether the PPS IN signal exists to obtain a detection result;

[0097] A determination module 302, configured to determine the timing situation based on the detection result;

[0098] An acquisition module 303, configured to acquire an error coefficient, where the error coefficient is the first time difference expanded by the device per second;

[0099] A calculation module 304, configured to calculate the total error time to be compensated based on the error coefficient and the timing situation;

[0100] A compensation module 305, configured to perform a compensation mechanism based on the total error time.

[0101] In an optional implementation manner, the detection module 301 is configured to:

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

[0103] When a PPS IN signal interruption is detected, add 2 to the reference variable, and when a second interruption is detected, subtract 1 from the reference variable to obtain the calculation result of the reference variable;

[0104] Detect whether the PPS IN signal exists based on the calculation result of the reference variable, the upper threshold, and the lower threshold.

[0105] In an alternative embodiment, the detection module 301 is further configured to:

[0106] When the calculation result of the reference variable is close to the upper threshold, obtain a detection result that the PPS IN signal exists;

[0107] When the calculation result of the reference variable is close to the lower threshold, obtain a detection result that the PPS IN signal does not exist.

[0108] In an alternative embodiment, the determination module 302 is configured to:

[0109] When the detection result is that the PPS IN signal exists, calculate a second time difference between the PPS IN signal and the PPS OUT signal, and the edge of the PPS OUT signal is at the same moment as the second interrupt;

[0110] Based on the second time difference, determine the timing situation.

[0111] In an alternative embodiment, the determination module 302 is configured to:

[0112] When the detection result is that the PPS IN signal does not exist, obtain the timing of the second interrupt of the timing chip;

[0113] Based on the timing of the second interrupt of the timing chip, determine the timing situation.

[0114] In an alternative embodiment, the compensation module 305 is configured to:

[0115] During cycle compensation, determine whether the total error time is greater than 1 s;

[0116] If so, round the total error time to the nearest second to obtain a first duration to be compensated;

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

[0118] Based on the total error time and the first duration, determine a second duration to be compensated, and the second duration is in milliseconds;

[0119] Based on the second duration, perform compensation using the shift function.

[0120] In an alternative embodiment, the compensation module 305 is further configured to:

[0121] Based on the total error time, the first duration, and the second duration, determine a third duration to be compensated, and the third duration is in microseconds;

[0122] Based on the third duration, perform correction using the digital smoothing calibration function.

[0123] Embodiment 3:

[0124] Based on the same inventive concept, an embodiment of the present invention provides a computer device, as Figure 4 shown, including a memory 404, a processor 402, and a computer program stored on the memory 404 and executable on the processor 402. When the processor 402 executes the program, the steps of the above injector time calibration are implemented.

[0125] Among them, in Figure 4 , the bus architecture (represented by bus 400), bus 400 may include any number of interconnected buses and bridges. Bus 400 links various circuits including one or more processors represented by processor 402 and a memory represented by memory 404 together. 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. Therefore, they will not be further described 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 on the transmission medium. Processor 402 is responsible for managing bus 400 and general processing, while memory 404 may be used to store data used by processor 402 when performing operations.

[0126] Embodiment 4:

[0127] Based on the same inventive concept, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the above injector time calibration method are implemented.

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

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

[0130] Similarly, it should be understood that, for the purpose of streamlining the present invention and assisting in the understanding of one or more of the various aspects of the invention, in the above description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each embodiment. Rather, as reflected in each embodiment, the inventive aspect lies in less than all the features of the single embodiment previously disclosed. Thus, the claims following the detailed description are hereby expressly incorporated into the detailed description, where each claim itself serves as a separate embodiment of the present invention.

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

[0132] In addition, those skilled in the art can understand that although some of the embodiments herein include certain features included in other embodiments but not others, the combination of the features of different embodiments means that it is within the scope of the present invention and forms different embodiments. For example, in the detailed description, any one of the claimed embodiments can be used in any combination.

[0133] Each component embodiment of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components of the injector time calibration device and the computer device according to the embodiments of the present invention. The present invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing part or all of the methods described herein. Such a program 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, or provided on a carrier signal, or in any other form.

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

Claims

1. A method for time calibration of an injector, applied to the MCU of the injector, characterized in that: include: Detect whether the PPS IN signal exists and obtain the detection result; Based on the test results, determine the timing situation; Obtaining an error coefficient, where the error coefficient is the first time difference expanded by the device every second; Based on the error coefficient and the timing situation, calculate the total error time to be compensated; Based on the total error time, a compensation mechanism is performed.

2. The method according to claim 1, characterized in that The detecting whether the PPS IN signal exists and obtaining the detection result includes: By presetting the reference variable, upper threshold and lower threshold of the PPS IN signal; When a PPS IN signal interruption is detected, the baseline variable is increased by 2, and when a second interruption is detected, the baseline variable is decreased by 1 to obtain the calculation result of the baseline variable; Based on the calculation result of the reference variable, the upper threshold and the lower threshold, it is detected whether the PPS IN signal exists.

3. The method according to claim 2, characterized in that Based on the results of the reference variable, the upper threshold and the lower threshold, the presence of the PPS IN signal is detected, including: When the calculation result of the reference variable is close to the upper threshold, the detection result is that the PPS IN signal exists; When the calculation result of the reference variable is close to the lower threshold, the detection result is that the PPS IN signal does not exist.

4. The method according to claim 3, characterized in that Based on the test results, determine the timing situation, including: When the detection result is that the PPS IN signal exists, a second time difference between the PPS IN signal and the PPS OUT signal is calculated, and the edge of the PPS OUT signal and the second interrupt are at the same time; Based on the second time difference, a timing condition is determined.

5. The method according to claim 3, characterized in that Based on the test results, determine the timing situation, including: When the detection result is that the PPS IN signal does not exist, the timing of the second interrupt of the timekeeping chip is obtained; The timing situation is determined based on the timing of the second interrupt of the timekeeping chip.

6. The method according to claim 1, characterized in that Based on the total error time, a compensation mechanism is executed, including: During periodic compensation, determine whether the total error time is greater than 1s; If yes, the total error time is rounded to the integer of seconds to obtain the first duration to be compensated; Based on the first duration, modify the time of the timekeeping chip; Determine a second time duration to be compensated based on the total error time and the first time duration, where the second time duration is in milliseconds; Based on the second duration, a shift function is used for compensation.

7. The method according to claim 6, characterized in that Based on the total error time, executing a compensation mechanism further includes: Based on the total error time, the first duration and the second duration, determining a third duration to be compensated, wherein the third duration is in microseconds; Based on the third duration, a digital smoothing calibration function is used for correction.

8. An injector time calibration device, applied to the MCU of the injector, characterized in that: include: A detection module is used to detect whether a PPS IN signal exists and obtain a detection result; A determination module, used to determine the timing situation based on the detection result; An acquisition module, used for acquiring an error coefficient, where the error coefficient is the first time difference expanded by the device every second; A calculation module, used for calculating the total error time to be compensated based on the error coefficient and the timing condition; The compensation module is used to execute a compensation mechanism based on the total error time.

9. 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, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Time update method, device and movable platform

    CN109154796A

  • Method for creating a primary reference clock by tracking Beidou-1 satellite signals using a crystal oscillator

    CN111903245B

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

    CN112433536A

  • Reference pulse correction apparatus and reference pulse correction method

    JP2023122681A

  • Real time clock device for vehicle and operating method thereof

    US20200159282A1