Method and device for realizing precise timing

By introducing reference frequency modules, frequency sampling modules and clock modules into the timing system, combined with constant temperature control and clock self-correction technical means, the problem of achieving precision timing without increasing costs is solved, and the precision and stability of timing is achieved.

CN119916666APending Publication Date: 2025-05-02QINGDAO NOVELBEAM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510162508.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

How to achieve precision timing without automatic calibration with national standard time without increasing costs.

Method used

By introducing reference frequency modules, frequency sampling modules and clock modules into the timing system, combined with constant temperature control and clock self-correction technical means, temperature correction and clock correction are automatically performed to ensure the stability and accuracy of reference frequency.

Benefits of technology

It is achieved to ensure the precision and stability of timing without increasing costs, and to avoid the accumulation of clock errors due to temperature changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119916666A_ABST
    Figure CN119916666A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for realizing precise timing, and belongs to the field of precise timing. Timing deviation caused by the change of the environment temperature is corrected by the control system in time. The implementation method comprises the following steps: (1) constant temperature control: if the temperature is lower than a set temperature value, a control system can automatically finish temperature compensation so as to ensure stable output of a reference frequency; (2) frequency sampling: the control system regularly completes sampling of reference frequency, calculates a difference value between sampling data and standard data, and stores the difference value in a register; and (3) clock self-correction: when the accumulative error is greater than or equal to 1 second, the control system automatically completes the correction of the current clock, meanwhile, the memory is updated, and the corrected residual pulse number is stored. Through a temperature compensation mode, the stability and accuracy of the reference frequency module are ensured, and through real-time detection of software and automatic correction of the RTC chip, the precision of the clock is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of precision timing, and in particular to a method and device for realizing precision timing. Background Art

[0002] At present, most electronic devices use RTC chips for timing. Due to the influence of ambient temperature, the oscillator will produce different degrees of frequency deviation, which will cause clock errors. If you want to keep accurate time, you can only calibrate it with the national standard time or use expensive crystal oscillators. Summary of the invention

[0003] The technical problem to be solved by the present invention is to ensure precise timing without significantly increasing the cost even if the conditions for automatic calibration with the national standard time are not met.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is to provide a method for realizing precise timing, and the specific solution is as follows:

[0005] A method for achieving precision timing, characterized by comprising the following steps:

[0006] S1. According to the ambient temperature when the clock module is working normally, set the ambient temperature ModeF_T0 of the reference frequency module, and read the preset value in the memory at the same time to obtain the reference pulse number Num0 per unit time, the pulse deviation number T_Num per second, and the temperature error ΔModeF_T0;

[0007] S2, constant temperature control: obtain the current ambient temperature ModeF_T of the reference frequency module, and determine whether the constant temperature requirement is met according to the temperature difference ΔT=ModeF_T0-ModeF_T. If so, jump to step S3. If not, perform temperature correction.

[0008] S3, frequency sampling: read the current time of RTC, determine whether the frequency sampling condition is met, if so, start collecting the pulse number Num of the reference frequency, save the reference pulse number difference per unit time ΔNum=Num-Num0 in the memory, and save the positive and negative polarity of ΔNum;

[0009] S4, clock self-correction: read the current time of RTC, determine whether it is time for clock correction, if it is, calculate the cumulative sum Sum of the difference in the number of reference pulses per unit time, and determine whether the conditions for clock correction are met, if so, perform time correction first, and then return to step S2, if not, directly return to step S2.

[0010] Furthermore, the constant temperature control of step S2 includes the following steps:

[0011] S21, obtaining the current ambient temperature value ModeF_T of the reference frequency module, and calculating the temperature difference ΔT=ModeF_T0-ModeF_T;

[0012] S22, if the current temperature difference ΔT>ΔModeF_T0 / 2, jump to step S23, otherwise turn off the heating actuator and jump to step S3;

[0013] S23, turn on the heating actuator to make it work in PWM mode, and jump to step S21.

[0014] Furthermore, the frequency sampling of S3 includes the following steps:

[0015] S31, get the current time of RTC, determine whether it is the frequency sampling time, if it is the frequency sampling time, jump to step S32, if it is not the frequency sampling time, jump to step S4;

[0016] S32, start timing and sampling the pulse number Num of the reference frequency, and after completing the frequency sampling, calculate the reference pulse number difference ΔNum=Num-Num0 per unit time;

[0017] S33, storing the reference pulse number difference ΔNum within a unit time and the positive and negative polarities in a memory.

[0018] Furthermore, the clock self-correction of S4 includes the following steps:

[0019] S41, get the current time of RTC, determine whether it is time to calibrate the clock, if it is time to calibrate the clock, jump to step S42, if it is not time to calibrate the clock, jump to step S2;

[0020] S42, determine whether the correction condition is met: calculate the cumulative sum of the reference pulse number difference ΔNum, Sum = ΔNum1 + ΔNum2 + ... ΔNum n If Sum≥T_Num or Sum≤-T_Num, the correction condition is met, and the process jumps to step S43; if the correction condition is not met, the process jumps to step S44;

[0021] S43, the value of Sum / T_Num is rounded to Count_Sec, if Sum≥T_Num, the time of the current clock is slowed down by Count_Sec seconds, and the number of remaining pulses after correction is Count_Num=Sum-Count_Sec*T_Num; if Sum≤-T_Num, the time of the current clock is fastened by Count_Sec seconds, and the number of remaining pulses after correction is Count_Num=Sum+Count_Sec*T_Num, and jump to step S45;

[0022] S44, remaining pulse assignment: Count_Num = Sum;

[0023] S45, clear all calculated reference pulse number differences in the register, and save the remaining pulse number as the first reference pulse number difference ΔNum1 = Count_Num.

[0024] The present invention also provides a device for realizing precise timing, characterized in that it comprises a control system, a frequency sampling module, a reference frequency module, and a clock module; the frequency sampling module, the reference frequency module, and the clock module are respectively connected to the control system; and the reference frequency module is connected to the frequency sampling module;

[0025] The control system includes an embedded control system and a memory; the frequency sampling module includes a Schmitt trigger, a frequency divider and a counter. The frequency sampling module shapes the reference frequency output by the reference frequency module through a Schmitt trigger, divides the reference frequency through a frequency divider, and then accumulates the number of pulses per unit time through a counter, and finally the control system obtains the number of pulses; the clock module is composed of a high-precision crystal oscillator and an RTC clock chip, and the control system can obtain the current real-time clock at any time; the reference frequency module includes a high-precision reference crystal oscillator, a reference frequency generator, a temperature sensor, a heating actuator and a thermos bottle. The high-precision reference crystal oscillator, the reference frequency generator, the temperature sensor and the heating actuator are all placed in a sealed double-layer vacuum thermos bottle, which ensures that the ambient temperature of the reference frequency generator is constant. Even if the temperature changes, the temperature correction can be completed through the temperature sensor and the heating actuator.

[0026] Furthermore, the thermos bottle is double-layered, with a vacuum state between the two layers. The material can be glass or other poor heat conductors. The vacuum state can reduce heat conduction and convection. The inner layer can be coated with a layer of silver or emissive material to block heat radiation, thereby achieving the purpose of heat preservation.

[0027] The beneficial effect of the present invention is that when using the RTC chip to time, a certain error will accumulate over time, and this error is mainly caused by temperature changes. The control system automatically completes the temperature correction by controlling the reference frequency module, the frequency sampling module and the clock module, so that the reference frequency is output stably, and then the clock self-correction is completed in real time, which greatly improves the accuracy and stability of timing; BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A flowchart of a method for implementing precise timing provided by an embodiment of the present invention;

[0029] Figure 2 A schematic diagram of a device structure for achieving precise timing provided by an embodiment of the present invention;

[0030] Figure 3 A schematic diagram of the structure of a reference frequency module provided by an embodiment of the present invention.

[0031] Description of labels:

[0032] 1. Control system; 2. Reference frequency module; 3. Frequency sampling module; 4. Clock module.

[0033] 30. Thermos flask outer layer; 31. Thermos flask middle vacuum layer; 32. Thermos flask inner layer; 33. Thermos flask cap DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the described embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] Unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0036] In order to keep the following description of the embodiments of the present invention clear and concise, the present invention omits detailed descriptions of some known functions and known components.

[0037] Please refer to the figure, the first embodiment of the present invention is:

[0038] Attached Figure 2The control system 1 adopts an embedded system, and the functions of acquiring the real-time clock, correcting the temperature, sampling the reference frequency and correcting the clock are all completed by the embedded system; the frequency sampling module 3 connects the reference frequency module 2 and the control system 1, and the reference frequency module 2 provides a square wave of the standard frequency required for sampling, which is first shaped by the Schmitt trigger in the frequency sampling module 3, and then sent to the frequency divider to divide the frequency, and finally the counter starts sampling the standard waveform after the frequency division, and the control system 1 obtains the number of collected pulses in real time and performs calculation processing, and saves the processed data to the memory; the reference frequency module 2 is connected to the control system 1 at the same time, and the control of the heating actuator and the temperature sensor are all completed by the control system 1 to meet the constant temperature requirements of the reference frequency module. Even if the temperature changes, the control system 1 will automatically perform temperature correction immediately to ensure the stable output of the reference frequency; the clock module 4 is directly connected to the control system 1, and once a timing deviation occurs, the control system 1 will automatically perform clock correction.

[0039] The steps of the control process and method for achieving precise timing include:

[0040] Step S1: Determine the preset value, the memory is used to store the ambient temperature ModeF_T0 of the reference frequency module, the reference pulse number Num0 per unit time, the temperature error ΔModeF_T0 range, and the pulse deviation number per second. These parameters are mainly used to automatically complete the temperature correction and clock calibration.

[0041] Step S2: Constant temperature control of the reference frequency module. The control system reads the ambient temperature of the reference frequency module and calculates the difference ΔT from the preset temperature. If the temperature difference ΔT>ΔModeF_TO / 2, the control system turns on the heating actuator and works in PWM mode until the allowed constant temperature environment is restored, turns off the heating actuator, and jumps to step S3; if the temperature difference ΔT<ΔModeF_TO / 2, jumps directly to step S3.

[0042] Step S3: sampling of the reference frequency. Under the premise of ensuring that the reference frequency module works in a preset temperature environment, the frequency sampling module samples the reference frequency output by the reference frequency module, and the control system calculates the difference ΔNum between the collected pulse number and the standard pulse number.

[0043] If ΔNum ≥ 0, the polarity state is recorded as P, and the polarity state value and ΔNum value are saved to the register;

[0044] If ΔNum<0, the polarity state is recorded as N, and the polarity state value and ΔNum value are saved in the register.

[0045] Step S4: Clock correction, read the register, obtain all pulse differences ΔNum and the positive and negative polarities corresponding to each ΔNum, as well as the pulse deviation number T_Num corresponding to a deviation of 1 second, and calculate the sum of the collected pulse differences, that is: Sum = ΔNum1 + ΔNum2 + ... + ΔNum n , calculate the clock time deviation: Count = Int (Sum / T_Num).

[0046] S4.1, if Sum≥T_Num, slow down the current clock time by Count_Sec seconds, assign the corrected remaining pulse number: Count_Num=Sum-Count_Sec*T_Num, and jump to step S4.4;

[0047] S4.2, if Sum≤-T_Num, adjust the current clock time forward by Count_Sec seconds, assign the corrected remaining pulse number: Count_Num=Sum+Count_Sec*T_Num, and jump to step S4.4;

[0048] S4.3, if -T_Num<Sum<-T_Num, the remaining pulse number is assigned: Count_Num=Sum;

[0049] S4.4, if Count_Num≥0, the polarity state is recorded as P; if Count_Num<0, the polarity state is recorded as N. Clear the values ​​of each reference pulse number difference ΔNum in the register, and save the remaining pulse number as the first reference pulse number difference ΔNum1=Count_Num, and save the polarity state value and ΔNum1 value to the register.

[0050] Step S5: Complete the temperature and clock calibration and return to step S2.

[0051] To summarize, the control system controls and coordinates the reference frequency module, and the sampling temperature compensation method ensures the stability and accuracy of the reference frequency module output; the reference frequency is sampled in real time by the frequency sampling module, and the control system calculates the deviation of the number of reference pulses per unit time and saves it in the memory. This method avoids the generation of cumulative errors; the control system calculates the clock deviation time through the cumulative sum of the deviation of the number of reference pulses per unit time, automatically completes the calibration of the RTC chip, and ensures the timing precision of the clock.

[0052] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for achieving precision timing, characterized in that: The following steps are involved: S1. According to the ambient temperature when the clock module is working normally, the ambient temperature ModeF_TO of the reference frequency module is set, and the preset value in the memory is read to obtain the number of reference pulses Num0 per unit time, the number of pulse deviations T_Num per second, and the temperature error ΔModeF_T0; S2, constant temperature control: obtain the current ambient temperature ModeF_T of the reference frequency module, and determine whether the constant temperature requirement is met according to the temperature difference ΔT=ModeF_T0-ModeF_T. If so, jump to step S3. If not, perform temperature correction. S3, frequency sampling: read the current time of RTC, determine whether the frequency sampling condition is met, if so, start collecting the pulse number Num of the reference frequency, save the reference pulse number difference per unit time ΔNum=Num-Num0 in the memory, and save the positive and negative polarity of ΔNum; S4, clock self-correction: read the current time of RTC, determine whether it is time for clock correction, if it is, calculate the cumulative sum Sum of the difference in the number of reference pulses per unit time, and determine whether the conditions for clock correction are met. If so, perform time correction first and then return to step S2. If not, return directly to step S2.

2. A method for achieving precision timing according to claim 1, characterized in that: The constant temperature control of step S2 comprises the following steps: S21, obtaining the current ambient temperature value ModeF_T of the reference frequency module, and calculating the temperature difference ΔT=ModeF_T0-ModeF_T; S22, if the current temperature difference ΔT>ΔModeF_T0 / 2, jump to step S23, otherwise turn off the heating actuator and jump to step S3; S23, turn on the heating actuator to make it work in PWM mode, and jump to step S21.

3. A method for achieving precision timing according to claim 1, characterized in that: The frequency sampling of S3 includes the following steps: S31, get the current time of RTC, determine whether it is the frequency sampling time, if it is the frequency sampling time, jump to step S32, if it is not the frequency sampling time, jump to step S4; S32, start timing and sampling the pulse number Num of the reference frequency, and after completing the frequency sampling, calculate the reference pulse number difference ΔNum=Num-Num0 per unit time; S33, storing the reference pulse number difference ΔNum within a unit time and the positive and negative polarities in a memory.

4. A method for achieving precision timing according to claim 1, characterized in that: The clock self-correction of S4 comprises the following steps: S41, obtain the current time of RTC, determine whether it is time to calibrate the clock, if it is time to calibrate the clock, jump to step S42, if it is not time to calibrate the clock, jump to step S2; S42, determine whether the correction condition is met: calculate the cumulative sum of the reference pulse number difference ΔNum, Sum = ΔNum1 + ΔNum2 + ... ΔNum n If Sum≥T_Num or Sum≤-T_Num, the correction condition is met, and the process goes to step S43; otherwise, the correction condition is not met, and the process goes to step S44; S43, the value of Sum / T_Num is an integer of Count_Sec. If Sum≥T_Num, the time of the current clock is slowed down by Count_Sec seconds, and the number of remaining pulses after correction is Count_Num=Sum-Count_Sec*T_Num; if Sum≤-T_Num, the time of the current clock is fastened by Count_Sec seconds, and the number of remaining pulses after correction is Count_Num=Sum+Count_Sec*T_Num, and jump to step S45; S44, remaining pulse assignment: Count_Num = Sum; S45, clear all calculated reference pulse number differences in the register, and save the remaining pulse number as the first reference pulse number difference ΔNum1 = Count_Num.

5. A device for achieving precision timing, characterized in that: It includes a control system, a frequency sampling module, a reference frequency module, and a clock module; the frequency sampling module, the reference frequency module, and the clock module are connected to the control system respectively; and the reference frequency module is connected to the frequency sampling module; The control system includes an embedded control system and a memory; the frequency sampling module includes a Schmitt trigger, a frequency divider and a counter. The frequency sampling module shapes the reference frequency output by the reference frequency module through the Schmitt trigger, divides the reference frequency through the frequency divider, and then accumulates the number of pulses per unit time through the counter, and finally obtains the number of pulses through the control system; The clock module is composed of a high-precision crystal oscillator and an RTC clock chip, and the control system can obtain the current real-time clock at any time; the reference frequency module includes a high-precision reference crystal oscillator, a reference frequency generator, a temperature sensor, a heating actuator and a thermos. The high-precision reference crystal oscillator, the reference frequency generator, the temperature sensor and the heating actuator are all placed in a sealed double-layer vacuum thermos, which ensures that the ambient temperature of the reference frequency generator is constant. Even if the temperature changes, the temperature correction can be completed through the temperature sensor and the heating actuator.

6. A device for achieving precise timing according to claim 5, characterized in that: The thermos bottle is double-layered, with a vacuum state between the two layers. The material can be glass or other poor thermal conductors. The vacuum state can reduce heat conduction and convection. The inner layer can be coated with a layer of silver or a radiation material to block heat radiation, thereby achieving the purpose of heat preservation.