CN104821820B - A kind of compensation method of timing - Google Patents
A kind of compensation method of timing Download PDFInfo
- Publication number
- CN104821820B CN104821820B CN201510142263.0A CN201510142263A CN104821820B CN 104821820 B CN104821820 B CN 104821820B CN 201510142263 A CN201510142263 A CN 201510142263A CN 104821820 B CN104821820 B CN 104821820B
- Authority
- CN
- China
- Prior art keywords
- timing
- compensation
- time
- constant
- initially set
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G04—HOROLOGY
- G04G—ELECTRONIC TIME-PIECES
- G04G7/00—Synchronisation
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03L—AUTOMATIC CONTROL, STARTING, SYNCHRONISATION, OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
- H03L7/00—Automatic control of frequency or phase; Synchronisation
- H03L7/06—Automatic control of frequency or phase; Synchronisation using a reference signal applied to a frequency- or phase-locked loop
- H03L7/08—Details of the phase-locked loop
- H03L7/0805—Details of the phase-locked loop the loop being adapted to provide an additional control signal for use outside the loop
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03L—AUTOMATIC CONTROL, STARTING, SYNCHRONISATION, OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
- H03L7/00—Automatic control of frequency or phase; Synchronisation
- H03L7/06—Automatic control of frequency or phase; Synchronisation using a reference signal applied to a frequency- or phase-locked loop
- H03L7/08—Details of the phase-locked loop
- H03L7/081—Details of the phase-locked loop provided with an additional controlled phase shifter
- H03L7/0812—Details of the phase-locked loop provided with an additional controlled phase shifter and where no voltage or current controlled oscillator is used
Abstract
The present invention provides a kind of compensation method of timing, including following compensation process:Step S1, input the timing Ts initially set;Step S2, judges whether the timing Ts initially set is more than timing constant Tu, if otherwise jumping to step S3, if then jumping to step S4;Step S3, limit the timing Ts for the timing Tt of actual set=initially set;Step S4, timing Tt=R*P+Ts of actual set is limited, wherein, the P is the value of round numbers after the timing Ts divided by timing constant Tu initially set;The R is the compensation time;The compensation time is the difference between timing constant Tu and actual timing in the same timing cycle.The present invention can substantially eliminate Crystal Oscillator Errors, and then ensure that and will not become big with the timing difference of reality because timing is elongated, add the accuracy of timing, reduce error.
Description
Technical field
The present invention relates to a kind of time compensating method, more particularly to a kind of determine suitable for the electronic product with timing function
When the time compensation method.
Background technology
Timing function is often used in many household electrical appliance, such as air-conditioning, refrigerator, washing machine and electric cooker, is usually used
Timing is controlled its switching on and shutting down to realize;Therefore the accuracy of timing turn into present technological development one it is big it is important because
Element, particularly in some medical electronics products, the required precision for timing is more increased.
At present, it is related to the electronic product of timing function often because the small time error of main control chip crystal oscillator, adds
Main control chip function to be dealt with is more, and when timing is long, it is not high accuracy often occur, the situations such as error is big;
Especially when timing reach 10 it is small when more than, error is obvious all the more.
That is, on the market there is following defect in the electronic product with timing function now:(1) timing
Influenceed by main control chip crystal oscillator very big;(2) when timing is long, timing is longer, and the error of accumulation is bigger, with determining
When time actual value it is more remote;(3) timing is influenceed big by procedure quantity handled by main control chip, handled by the main control chip
Procedure quantity is bigger, and the error of timing is bigger.
The content of the invention
The technical problems to be solved by the invention be need to provide it is a kind of by the way that the timing of setting and reality are determined
When the time be compared, then compensate, make that its precision is higher and the compensation method of the smaller timing of error.
On the other hand, the present invention provides a kind of compensation method of timing, including following compensation process:
Step S1, input the timing Ts initially set;
Step S2, judges whether the timing Ts initially set is more than timing constant Tu, and the timing is normal
Number Tu is the timing cycle that User Defined is set, if otherwise jumping to step S3, if then jumping to step S4;
Step S3, limit the timing Ts that the timing Tt=of actual set is initially set;
Step S4, the timing Tt=R*P+Ts of actual set is limited, wherein, the P is equal portions quantity, and the P is
The value of round numbers after the timing Ts divided by timing constant Tu that initially set;The R is the compensation time;The compensation
Time is the difference between timing constant Tu and actual timing in the same timing cycle.
The timing constant Tu is the timing cycle that User Defined is set, and the timing cycle is made
In the cycle calculated for a compensation time, self-defined setting can be carried out according to the demand of user, in general, could be arranged to
The different numerical value such as 10 minutes, 15 points, 30 minutes or 1 hours;The present invention by the timing Ts that will initially set divided by
Timing constant Tu, then the value of round numbers is as equal portions quantity P, and calculates in the timing cycle, and timing is normal
Difference between number Tu and actual timing is calculated the timing and reality of setting as the compensation time, and then by software
The timing on border is compared, and is then compensated according to actual conditions, and the precision of the timing made is higher, and error is more
It is small.
Further improvement of the present invention is, in step S4, the measuring process of the compensation time is:
Step S41, while timing function is opened, start stopwatch;
Step S42, when timing constant Tu is reached, stopwatch is cut off immediately, and record the record time of stopwatch
Tf;
Step S43, calculate timing constant Tu and record the difference between time Tf;
Step S44, repeat step S41 so circulate 5~20 times to step S43, difference average value are sought, when being compensated
Between.
By step S41 to step S44, difference average value can be tried to achieve, the difference average value is to compensate the time, this
Sample is just able to know that in timing constant Tu timing and real time differ, and then caused error is entered
The effective compensation of row.
Further improvement of the present invention is, in the step S44, repetitive cycling step S41 to step S43 totally 10~15
It is secondary, difference average value is sought, is compensated the time.In general, by circulating 10 difference average values being calculated, the degree of accuracy
It just disclosure satisfy that electronic product of the timing within 10 hours, the setting that circulation is 10~15 times, for timing
Compensation effect is good, in addition, it is desirable to which the data volume of processing is also little, can reasonably take into account cost and the compensation of product
Effect.
Further improvement of the present invention is that the stopwatch is computer stopwatch or high-precision stopwatch.By electronic product certainly
The computer stopwatch of band or other high-precision stopwatches aid in realizing the calculating of compensation time, without extra equipment, implementation
Easy and effective, cost is low.
Further improvement of the present invention is that the timing constant Tu is arranged to 10~60 minutes, when initial setting
Timing Ts when being more than 10~60 minutes, timing is subjected to 10~60 minutes equal portions, and then determined what is initially set
When time Ts point be P equal portions, the remaining time for being unable to equal portions is Ty.
Further improvement of the present invention is that the timing constant Tu is arranged to 15 minutes, when what is initially set determines
When time Ts when being more than 15 minutes, timing is subjected to 15 minutes equal portions, and then be P by the timing Ts initially set points
Equal portions, the time that residue is unable to equal portions is Ty.
Further improvement of the present invention is, often right by a timing constant Tu institute after calculating the compensation time
In the timing cycle answered, single compensation just is carried out to timing.
Further improvement of the present invention is, after being compensated each time to timing, by the timing after compensation
As the timing Ts ' of new initial setting, timing Ts '=R+Ts-Tu of the new initial setting, then set
The timing Ts ' of the new initial setting is as the timing Ts initially set, and then the initial setting new to this is determined
When time Ts ' realize step S1 to step S4 compensation process.
Compared with prior art, the beneficial effects of the present invention are:So that the timing of the electronic product with timing function
Time larger error will not occur because of the cumulative of Crystal Oscillator Errors, can substantially eliminate Crystal Oscillator Errors, and then ensure that not
It can become big with the timing difference of reality because timing is elongated, add the accuracy of timing, reduce error;
Simultaneously, additionally it is possible to reduce timing is influenceed by main control chip processing speed, no matter timing how long, regardless of master control core
Piece needs that how many data volume handled, its timing error all very littles.
Brief description of the drawings
Fig. 1 is the workflow schematic diagram of an embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawings, the preferably embodiment of the present invention is described in further detail:
Embodiment 1:
As shown in figure 1, this example provides a kind of compensation method of timing, including following compensation process:
Step S1, input the timing Ts initially set;
Step S2, judges whether the timing Ts initially set is more than timing constant Tu, and the timing is normal
Number Tu is the timing cycle that User Defined is set, if otherwise jumping to step S3, if then jumping to step S4;
Step S3, limit the timing Ts that the timing Tt=of actual set is initially set;
Step S4, the timing Tt=R*P+Ts of actual set is limited, wherein, the P is equal portions quantity, and the P is
The value of round numbers after the timing Ts divided by timing constant Tu that initially set;The R is to compensate time, the compensation
Time is the difference between timing constant Tu and actual timing in the same timing cycle.
The timing constant Tu is the timing cycle that User Defined is set, and the timing cycle is made
In the cycle calculated for a compensation time, self-defined setting can be carried out according to the demand of user, in general, could be arranged to
The different numerical value such as 10 minutes, 15 points, 30 minutes or 1 hours;This example passes through the timing Ts that will initially set divided by fixed
When time constant Tu, then the value of round numbers is as equal portions quantity P, and calculates in the timing cycle, timing constant
Difference between Tu and actual timing is calculated the timing and reality of setting as the compensation time, and then by software
Timing be compared, then compensated according to actual conditions, the precision of the timing made is higher, and error is smaller.
In Fig. 1, the timing constant Tu is arranged to 15 minutes, when the timing Ts initially set is more than 15 minutes
When, timing is subjected to 15 minutes equal portions, and then be P equal portions by Ts points of the timing initially set, residue is unable to equal portions
Time be Ty.
In the step S4, the measuring process of the compensation time is:
Step S41, while timing function is opened, start stopwatch, the stopwatch is computer stopwatch or other high accuracy
Stopwatch;
Step S42, when reaching 15 minutes, stopwatch is cut off immediately, and record the record time Tf of stopwatch;
Step S43, calculates the difference between 15 minutes and record time Tf, and the difference is that (unit is 15*60-Tf
Second);
Step S44, repeat step S41 so circulate 5~20 times to step S43, preferred cycle 10 times, ask difference to be averaged
Value, is compensated the time.
The record time Tf is the actual timing described in step S4, and timing constant Tu is arranged to by this example
15 minutes, be because error in 15 minutes hardly because main control chip crystal oscillator error and rope procedure quantity to be processed by
Influence, so being not required to compensate it;When the timing Ts initially set is more than 15 minutes, the timing that will initially set
Time Ts carries out 15 minutes per equal portions, if being unable to decile, remaining timing needs not compensate for;Assume that what is initially set determines
When time Ts be 31 minutes, need to only compensate twice, it is assumed that timing Ts points initially set are P equal portions, and residue is unable to decile
Time is Ty, and the compensation time is R, and by all timing parameters all with the second (s) for unit, then the timing of actual set
Tt is Tt=R*P+Ts.
It is described compensation time R need contrasted according to the real time, so as to by main control chip Crystal Oscillator Errors with it is handled
The influence of procedure quantity switchs to the contrast of real time and run time, and thus eliminating the need Crystal Oscillator Errors, are not subject to processing procedure quantity
Influence;The timing Ts initially set is carried out into equal portions processing to contrast with the real time again, the accumulation of error can be eliminated,
So timing precision is higher.
Compensate the computational methods of time R:Set timing constant Tu to be arranged to 15 minutes, opened in setting timing function
While, start computer stopwatch or the higher stopwatch of some precision;When timing arrives, stopwatch is cut off immediately;Assuming that now
The stopwatch record time is Tf, then timing in 15 minutes and actual 15 minutes differences are 15*60-Tf (unit is the second);So circulation 10
It is secondary, its 10 average values are sought, that is, are compensated time R.
When not using timing-compensation, if regularly more than 10 hours, typically within main control chip 16M crystal oscillators, its
Error is generally higher than 5 minutes or more, using timing-compensation, no matter timing how long, its error all very littles are substantially only several
The error of second.
After the timing Ts initially set is set, the timing Ts initially set will be made whether to be more than 15
The judgement of minute;If the timing Ts initially set was not greater than in 15 minutes, it is not necessary to compensation is timed, so Tt
=Ts;If greater than timing-compensation R, Tt=R*P+Ts in 15 minutes, need to be increased.The big I of R values calculates according to the above method
Come.
Contrasted by the compensation method of this example and the timing function for not being timed compensation, the following form of its result:
As shown above, the timing of this example larger error will not occur because of the cumulative of Crystal Oscillator Errors, substantially
Crystal Oscillator Errors can be eliminated, and then ensure that will not be elongated because of timing so that error is larger, adds timing
Accuracy, reduce error;Simultaneously, additionally it is possible to reduce timing is influenceed by main control chip processing speed, no matter timing
How long, need how many data volume handled regardless of main control chip, its timing error all very littles.
In the compensation method of this example description, by carrying out a timing-compensation in every 15 minutes, it can essentially pass through
Compensation is timed in the timing point of different time sections;Can such as set one hour once carry out with actual time contrast obtain when
Between compensate R, such Cumulative Elapsed Time is longer, and its offset more approaches, and makes timing more accurate.
Embodiment 2:
On the basis of embodiment 1, after this example calculates the compensation time, often by corresponding to a timing constant Tu
The timing cycle, just to timing carry out single compensation.I.e., it is assumed that timing constant Tu is 15 minutes, then, often
After 15 minutes, single compensation just is carried out to timing.
After this example compensates to timing each time, using the determining as new initial setting of the timing after compensation
When time Ts ', timing Ts '=R+Ts-Tu of the new initial setting, then set the timing of the new initial setting
Time Ts ' is as the timing Ts initially set, and then the timing Ts ' of the initial setting new to this realizes step S1 extremely
Step S4 compensation process.
If that is, timing constant Tu be 15 minutes, then, often after 15 minutes, just to timing when
Between carry out single compensation, the then timing Ts ' using the timing after being compensated as new initial setting, so as to for
Process is compensated by the overall timing after compensation each time;For example for, it is assumed that the timing initially set
Time is 25 hours, and timing constant Tu is 15 minutes, and the compensation time is 10s, then, after 15 minutes, by (25 is small
When+10 seconds -15 minutes) as the timing Ts ' of new initial setting compensate computing, the timing of new initial setting
Time Ts ' be 24 hours 45 points 10 seconds;After 15 minutes, can produce again a new initial timing Ts ' set as
24 hours 30 points 20 seconds, by that analogy, when timing reaches 23 hours, compensate the cumulative of time and have been over
15 minutes, so, the compensation of one time 10 seconds is just also carried out to the cumulative compensation time, therefore, this example is also carried out to the compensation time
Compensation calculation and operation, equivalent to original timing and later compensation time have carried out dual compensation, so as to
The accuracy of timing is realized to the full extent.
Above content is to combine specific preferred embodiment further description made for the present invention, it is impossible to is assert
The specific implementation of the present invention is confined to these explanations.For general technical staff of the technical field of the invention,
On the premise of not departing from present inventive concept, some simple deduction or replace can also be made, should all be considered as belonging to the present invention's
Protection domain.
Claims (8)
1. a kind of compensation method of timing, it is characterised in that including following compensation process:
Step S1, input the timing Ts initially set;
Step S2, judges whether the timing Ts initially set is more than timing constant Tu, the timing constant Tu
The timing cycle set for User Defined, if otherwise jumping to step S3, if then jumping to step S4;
Step S3, limit the timing Ts for the timing Tt of actual set=initially set;
Step S4, timing Tt=R*P+Ts of actual set is limited, wherein, the P is equal portions quantity, and the P is initial
The value of round numbers after the timing Ts divided by timing constant Tu of setting;The R is the compensation time;The compensation time
For in the same timing cycle, the difference between timing constant Tu and actual timing.
2. the compensation method of timing according to claim 1, it is characterised in that in step S4, the compensation time
Measuring process be:
Step S41, while timing function is opened, start stopwatch;
Step S42, when timing constant Tu is reached, stopwatch is cut off immediately, and record the record time Tf of stopwatch;
Step S43, calculate timing constant Tu and record the difference between time Tf;
Step S44, repeat step S41 are so circulated 5 ~ 20 times to step S43, are sought difference average value, be compensated the time.
3. the compensation method of timing according to claim 2, it is characterised in that in the step S44, repetitive cycling
Step S41 to step S43 totally 10 ~ 15 times, seeks difference average value, is compensated the time.
4. the compensation method of timing according to claim 2, it is characterised in that the stopwatch is computer stopwatch or height
Precision stopwatch.
5. the compensation method of the timing according to Claims 1-4 any one, it is characterised in that during the timing
Between constant Tu be arranged to 10 ~ 60 minutes, will be initial when the timing Ts initially set is more than the timing constant Tu
The timing Ts of setting carries out equal portions processing, and then the timing Ts that will initially set according to the timing constant Tu
It is divided into P equal portions, the time that residue is unable to equal portions is Ty.
6. the compensation method of timing according to claim 5, it is characterised in that the timing constant Tu is set
For 15 minutes, when the timing Ts initially set is more than 15 minutes, timing is subjected to 15 minutes equal portions, and then will just
Ts points of timing for beginning to set is P equal portions, and the time that residue is unable to equal portions is Ty.
7. the compensation method of timing according to claim 6, it is characterised in that after calculating the compensation time, often pass through
The timing cycle corresponding to a timing constant Tu is spent, single compensation just is carried out to timing.
8. the compensation method of timing according to claim 7, it is characterised in that mended each time to timing
After repaying, the timing Ts ' using the timing after compensation as new initial setting, during the timing of the new initial setting
Between Ts '=R+Ts-Tu, then set the timing Ts ' of the new initial setting as the timing Ts initially set, enter
And the timing Ts ' of the initial setting new to this realizes step S1 to step S4 compensation process.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510142263.0A CN104821820B (en) | 2015-03-27 | 2015-03-27 | A kind of compensation method of timing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510142263.0A CN104821820B (en) | 2015-03-27 | 2015-03-27 | A kind of compensation method of timing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104821820A CN104821820A (en) | 2015-08-05 |
CN104821820B true CN104821820B (en) | 2017-11-17 |
Family
ID=53732009
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510142263.0A Active CN104821820B (en) | 2015-03-27 | 2015-03-27 | A kind of compensation method of timing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104821820B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109643142B (en) * | 2017-08-04 | 2022-08-02 | 深圳市汇顶科技股份有限公司 | Timing method, clock equipment and terminal equipment |
CN108628153A (en) * | 2018-04-28 | 2018-10-09 | 惠州市德赛西威汽车电子股份有限公司 | A method of improving vehicle-mounted MP5 times precision |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5826066A (en) * | 1996-08-08 | 1998-10-20 | Tandem Computers Incorporated | Method for keeping accurate time in a computer system |
CN101908956A (en) * | 2009-06-08 | 2010-12-08 | 中兴通讯股份有限公司 | Timing signal based method and system thereof for improving clock precision |
CN102497665A (en) * | 2011-12-28 | 2012-06-13 | 深圳市五巨科技有限公司 | Mobile terminal time correction method and apparatus thereof |
CN102830750A (en) * | 2011-06-14 | 2012-12-19 | 赛酷特(北京)信息技术有限公司 | Real-time clock with high precision |
CN104143960A (en) * | 2014-07-11 | 2014-11-12 | 钜泉光电科技(上海)股份有限公司 | Overflow compensating method and device for correcting MEMS elapsed time clock |
-
2015
- 2015-03-27 CN CN201510142263.0A patent/CN104821820B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5826066A (en) * | 1996-08-08 | 1998-10-20 | Tandem Computers Incorporated | Method for keeping accurate time in a computer system |
CN101908956A (en) * | 2009-06-08 | 2010-12-08 | 中兴通讯股份有限公司 | Timing signal based method and system thereof for improving clock precision |
CN102830750A (en) * | 2011-06-14 | 2012-12-19 | 赛酷特(北京)信息技术有限公司 | Real-time clock with high precision |
CN102497665A (en) * | 2011-12-28 | 2012-06-13 | 深圳市五巨科技有限公司 | Mobile terminal time correction method and apparatus thereof |
CN104143960A (en) * | 2014-07-11 | 2014-11-12 | 钜泉光电科技(上海)股份有限公司 | Overflow compensating method and device for correcting MEMS elapsed time clock |
Also Published As
Publication number | Publication date |
---|---|
CN104821820A (en) | 2015-08-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5266385B2 (en) | Trace processing apparatus and trace processing system | |
EP3451093B1 (en) | Work assistance device, work assistance method, and work assistance program | |
CN102929735B (en) | A kind of method and apparatus of clock correction | |
CN104821820B (en) | A kind of compensation method of timing | |
US20160188380A1 (en) | Progress meters in parallel computing | |
CN106547504B (en) | Fluency appraisal procedure and device | |
CN202256438U (en) | Hardware real time clock (RTC) error compensation system of intelligent electric energy meter | |
CN108958092B (en) | Singlechip clock anomaly detection method and device, computer readable storage medium and equipment | |
CN106468560B (en) | Data output method and device based on pedometer message | |
US9887701B1 (en) | Frequency offset correction precision of real-time clocks | |
CN111543858A (en) | Discharging control method and device | |
CN108631897B (en) | A kind of correcting time in network method and device | |
JPWO2014118984A1 (en) | Signal processing device | |
CN107300650A (en) | A kind of intermittent life pilot system and method | |
CN112773173A (en) | Cooking control method and device and cooking machine | |
Kwasnick et al. | Setting use conditions for reliability modeling | |
US8299777B2 (en) | Calculating a parasitic capacitance of an oscillator circuit | |
JP2019168800A (en) | Process improvement support system and process improvement support method | |
CN108226756A (en) | The test system and its test method of a kind of clock chip | |
CN102402270A (en) | Method and system for regulating frequency of central processing unit | |
CN103699173B (en) | A kind of real-time clock timing error compensation method | |
CN107615205A (en) | Clock diagnostic device and clock diagnostic method | |
CN112798860B (en) | Electric quantity calculation method and device and multi-split system | |
EP4109254A1 (en) | Methods and systems for computerised resource allocation control | |
CN114532829B (en) | Cooking time display method and device, cooking appliance and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: 518000 Guangdong province Shenzhen Guangming New District Gongming street Gongming South Avenue Geya Technology Building 3 building 1-4 layer Patentee after: Shenzhen Zhenbang intelligent Polytron Technologies Inc Address before: 518000 Guangdong, Nanshan District, Taoyuan, Longjing street, industrial zone, building A, building 2, building A, building on the ground floor, building B, building, building 6, building C, block B, building, building No. 3 Patentee before: SHENZHEN ZHENBANG INTELLIGENT TECHNOLOGY CO., LTD. |