CN110769546B - Temperature compensation method and system for timing LED lamp in variable temperature environment - Google Patents

Temperature compensation method and system for timing LED lamp in variable temperature environment Download PDF

Info

Publication number
CN110769546B
CN110769546B CN201911008232.0A CN201911008232A CN110769546B CN 110769546 B CN110769546 B CN 110769546B CN 201911008232 A CN201911008232 A CN 201911008232A CN 110769546 B CN110769546 B CN 110769546B
Authority
CN
China
Prior art keywords
value
crystal oscillator
quartz crystal
led lamp
timing
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
Application number
CN201911008232.0A
Other languages
Chinese (zh)
Other versions
CN110769546A (en
Inventor
陈伟民
吴士章
洪海鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Topstar Lighting Co Ltd
Original Assignee
Xiamen Topstar Lighting Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Xiamen Topstar Lighting Co Ltd filed Critical Xiamen Topstar Lighting Co Ltd
Priority to CN201911008232.0A priority Critical patent/CN110769546B/en
Publication of CN110769546A publication Critical patent/CN110769546A/en
Application granted granted Critical
Publication of CN110769546B publication Critical patent/CN110769546B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Landscapes

  • Circuit Arrangement For Electric Light Sources In General (AREA)
  • Electric Clocks (AREA)

Abstract

The invention discloses a temperature compensation method, medium and system for a timing LED lamp in a variable temperature environment, wherein the method comprises the following steps: detecting the ambient temperature; acquiring a frequency deviation value of an external quartz crystal oscillator according to the environment temperature and a temperature characteristic curve of the external quartz crystal oscillator of the MCU in the timing LED lamp; estimating a time deviation direction according to the frequency deviation value of the external quartz crystal oscillator; correcting the timer count value of the timing LED lamp according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator so as to perform timing compensation on the timing LED lamp; thereby enabling the timing accuracy to be improved at low cost.

Description

Temperature compensation method and system for timing LED lamp in variable temperature environment
Technical Field
The invention relates to the technical field of lamp timing, in particular to a temperature compensation method of a timing LED lamp in a variable temperature environment, a computer readable storage medium and a temperature compensation system of the timing LED lamp in the variable temperature environment.
Background
In the related art, an LED lamp with a timing function is generally provided with a microcontroller, and a crystal oscillator frequency on the microcontroller generates a certain deviation along with a change of temperature, so that the LED lamp has a timing error due to a change of an external environment temperature and a self temperature; the conventional method for compensating timing errors caused by temperature of the LED lamp is generally to adopt an industrial grade vehicle-mounted RTC clock chip with temperature compensation or a crystal oscillator with temperature self-compensation; however, the RTC clock chip or crystal oscillator with compensation is expensive, and this solution is obviously not feasible for some low-cost products requiring mass production.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above. Therefore, an object of the present invention is to provide a temperature compensation method for a timing LED lamp in a variable temperature environment, in which a timer count value of the LED lamp is corrected by a frequency deviation value of an external quartz crystal oscillator to perform timing compensation on the timing LED lamp, so that timing accuracy can be improved at low cost.
A second object of the invention is to propose a computer-readable storage medium.
The third objective of the present invention is to provide a temperature compensation system for a timing LED lamp in a variable temperature environment.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides a method for compensating temperature of a timing LED lamp in a polytropic temperature environment, where the method includes the following steps: detecting the ambient temperature; acquiring a frequency deviation value of an external quartz crystal oscillator according to the environment temperature and a temperature characteristic curve of the external quartz crystal oscillator of the MCU in the timing LED lamp; estimating a time deviation direction according to the frequency deviation value of the external quartz crystal oscillator; and correcting the timer count value of the timing LED lamp according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator so as to perform timing compensation on the timing LED lamp.
According to the temperature compensation method of the timing LED lamp in the variable temperature environment, the environment temperature is detected firstly, then the frequency deviation value of the external quartz crystal oscillator is obtained according to the environment temperature and the temperature characteristic curve of the external quartz crystal oscillator of the MCU in the timing LED lamp, then the time deviation direction is estimated according to the frequency deviation value of the external quartz crystal oscillator, and finally the timer count value of the timing LED lamp is corrected according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator so as to perform timing compensation on the timing LED lamp; thereby enabling the timing accuracy to be improved at low cost.
In addition, the temperature compensation method for the timing LED lamp under the variable temperature environment according to the above embodiment of the present invention may further have the following additional technical features:
optionally, predicting a time deviation direction according to the frequency deviation value of the external quartz crystal oscillator, including: if the frequency deviation value of the external quartz crystal oscillator is less than 0, the time deviation direction is reverse deviation; and if the frequency deviation value of the external quartz crystal oscillator is greater than 0, the time deviation direction is positive deviation.
Optionally, the correcting a timer count value of the timing LED lamp according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator includes: judging the time deviation direction; if the time deviation direction is reverse deviation, calculating a heavy load fine adjustment value according to the frequency deviation value of the external quartz crystal oscillator, and reducing and correcting the count value of the timer according to the heavy load fine adjustment value; if the time deviation direction is positive deviation, calculating a heavy-load fine adjustment value according to the frequency deviation value of the external quartz crystal oscillator, and increasing and correcting the timer counting value according to the heavy-load fine adjustment value.
Optionally, the override trim value is calculated according to the following formula:
TIMEpre=A*FREpre*Fall/106
wherein A is the deviation constant of the current theoretical timing interval and frequency, and is related to the timing interval of the quartz crystal oscillator, FREpreIs the frequency deviation value of the external quartz crystal oscillator, and the unit is one millionth, FallThe frequency of the clock source of the timer.
Optionally, when the timer count value is corrected according to the overloading fine tuning value, an expanding quantization algorithm and a segmented compensation algorithm are further adopted to finely tune the timer count value.
In order to achieve the above object, a second aspect of the present invention provides a computer-readable storage medium, on which a temperature compensation program of a timing LED lamp is stored, and when the temperature compensation program of the timing LED lamp is executed by a processor, the temperature compensation method of the timing LED lamp in a polytropic temperature environment is implemented.
According to the computer-readable storage medium of the embodiment of the invention, the temperature compensation program of the timing LED lamp is stored, so that when the temperature compensation program of the timing LED lamp is executed by the processor, the temperature compensation method of the timing LED lamp under the variable temperature environment is realized, and the timing precision can be improved at low cost.
In order to achieve the above object, a third aspect of the present invention provides a temperature compensation system for a timing LED lamp in a polytropic temperature environment, including: the temperature detection module is used for detecting the ambient temperature; the acquisition module is used for acquiring a frequency deviation value of an external quartz crystal oscillator according to the environment temperature and a temperature characteristic curve of the external quartz crystal oscillator of the MCU in the timing LED lamp; the pre-estimation module is used for pre-estimating the time deviation direction according to the frequency deviation value of the external quartz crystal oscillator; and the compensation module is used for correcting the timer count value of the timing LED lamp according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator so as to perform timing compensation on the timing LED lamp.
According to the temperature compensation system of the timing LED lamp in the variable temperature environment, the environment temperature is detected through the temperature detection module, the frequency deviation value of the external quartz crystal oscillator is obtained through the obtaining module according to the environment temperature and the temperature characteristic curve of the external quartz crystal oscillator of the MCU in the timing LED lamp, the time deviation direction is pre-estimated through the pre-estimating module according to the frequency deviation value of the external quartz crystal oscillator, and the counting value of the timer of the timing LED lamp is corrected through the compensation module according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator so as to perform timing compensation on the timing LED lamp; thereby enabling the timing accuracy to be improved at low cost.
In addition, the temperature compensation system for the timing LED lamp in the variable temperature environment provided by the above embodiment of the present invention may further have the following additional technical features:
optionally, the estimation module is further configured to determine a frequency deviation value of the external quartz crystal oscillator; if the frequency deviation value of the external quartz crystal oscillator is less than 0, estimating that the time deviation direction is reverse deviation; and if the frequency deviation value of the external quartz crystal oscillator is greater than 0, estimating that the time deviation direction is positive deviation.
Optionally, the compensation module is further configured to determine the time deviation direction; if the time deviation direction is reverse deviation, calculating a heavy load fine adjustment value according to the frequency deviation value of the external quartz crystal oscillator, and reducing and correcting the count value of the timer according to the heavy load fine adjustment value; and if the time deviation direction is positive deviation, calculating a heavy-load fine adjustment value according to the frequency deviation value of the external quartz crystal oscillator, and increasing and correcting the count value of the timer according to the heavy-load fine adjustment value.
Optionally, the compensation module calculates the reload trim value according to the following formula:
TIMEpre=A*FREpre*Fall/106
wherein A is the deviation constant of the current theoretical timing interval and frequency, and is related to the timing interval of the quartz crystal oscillator, FREpreIs the frequency deviation value of the external quartz crystal oscillator, and has the unit of one millionth and FallIs the frequency of the timer clock source.
Drawings
Fig. 1 is a schematic flow chart of a temperature compensation method for a timing LED lamp in a polytropic temperature environment according to an embodiment of the present invention;
fig. 2 is a block diagram illustrating a temperature compensation system of a timing LED lamp in a polytropic temperature environment according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
At present, the frequency of an external crystal oscillator adopted by an LED timing lamp is calibrated only at a normal temperature of 25 degrees by a manufacturer, and because of the characteristic of frequency deviation at different temperatures, a large timing error is easily generated if a product directly uses the MCU internal crystal oscillator; the cost is greatly increased by directly adopting an industrial grade vehicle-mounted RTC clock chip with temperature compensation or adopting a crystal oscillator with temperature self-compensation, and the cost is obviously irreparable for low-cost products needing mass production due to the high price of the RTC clock chip with compensation or the crystal oscillator.
The method for compensating the temperature of the timing LED lamp in the changeable temperature environment comprises the steps of detecting the ambient temperature, obtaining the frequency deviation value of an external quartz crystal oscillator according to the ambient temperature and the temperature characteristic curve of the external quartz crystal oscillator of an MCU in the timing LED lamp, estimating the time deviation direction according to the frequency deviation value of the external quartz crystal oscillator, and correcting the count value of a timer of the timing LED lamp according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator so as to perform timing compensation on the timing LED lamp; thereby enabling the timing accuracy to be improved at low cost.
In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Fig. 1 is a schematic flow chart of a temperature compensation method for a timing LED lamp in a variable temperature environment according to an embodiment of the present invention. As shown in fig. 1, the temperature compensation method for a timing LED lamp in a variable temperature environment according to an embodiment of the present invention includes the following steps:
step 101, detecting an ambient temperature.
As one example, the current ambient temperature may be read by a thermistor.
That is, the thermistor has different resistance values at different temperatures, and corresponding temperature values can be obtained according to the different resistance values.
And 102, acquiring a frequency deviation value of an external quartz crystal oscillator according to the ambient temperature and the temperature characteristic curve of the external quartz crystal oscillator of the MCU in the timing LED lamp.
The horizontal axis of the temperature characteristic curve of the external quartz crystal oscillator is temperature, and the vertical axis thereof is frequency deviation of the external quartz crystal oscillator, thereby displaying frequency deviation values corresponding to the external quartz crystal oscillator at different temperature values.
That is, the frequency deviation value corresponding to the ambient temperature is found on the temperature characteristic curve of the external quartz crystal oscillator according to the ambient temperature, so as to obtain the frequency deviation value of the external quartz crystal oscillator corresponding to the ambient temperature.
And 103, estimating a time deviation direction according to the frequency deviation value of the external quartz crystal oscillator.
It should be noted that, if the frequency deviation value of the external quartz crystal oscillator is less than 0, the time deviation direction is reverse deviation; and if the frequency deviation value of the external quartz crystal oscillator is greater than 0, the time deviation direction is positive deviation.
That is, the frequency deviation of the external quartz crystal oscillator will cause the actual time transmission to change, and if the frequency deviation value of the external quartz crystal oscillator is smaller than 0, the actually occurring time value is slower than the set theoretical time value, and the time deviation direction is determined to be reverse deviation; if the frequency deviation value of the external quartz crystal oscillator is larger than 0, the actually generated time value is faster than the set theoretical time value, and the time deviation direction is confirmed to be positive deviation.
And 104, correcting the timer count value of the timing LED lamp according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator so as to perform timing compensation on the timing LED lamp.
Since the frequency deviation value of the external quartz crystal oscillator is not 0, and the actual time value is deviated from the set theoretical time value to a certain extent, it is necessary to compensate the actually generated time value and correct the timer count value of the LED lamp.
As an embodiment, the method for correcting the timer count value of the timing LED lamp according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator comprises the following steps: judging the time deviation direction; if the time deviation direction is reverse deviation, calculating a heavy-load fine adjustment value according to the frequency deviation value of the external quartz crystal oscillator, and reducing and correcting the count value of the timer according to the heavy-load fine adjustment value; and if the time deviation direction is positive deviation, calculating a heavy-load fine adjustment value according to the frequency deviation value of the external quartz crystal oscillator, and increasing and correcting the count value of the timer according to the heavy-load fine adjustment value.
As one embodiment, the overriding trim value is via TIMEpre=A*FREpre*Fall/106Calculating, wherein A is the deviation constant of the current theoretical timing interval and frequency, and is related to the quartz crystal oscillator and the timing interval, FREpreIs the frequency deviation value of the external quartz crystal oscillator, and the unit is one millionth, FallIs the frequency of the timer clock source.
In addition, FallAlso the frequency of the external crystal oscillator, if the frequency of the external crystal oscillator is high, the frequency of the external crystal oscillator needs to be set to the clock frequency of the timer through frequency division.
As one embodiment, the timer count value is adjusted, and the adjusted timer reload value TIMEreload=Tset+TIMEpreWherein T issetThe timing TIME of the timer is equal to the set theoretical TIME value, TIMEpreAnd the heavy load fine tuning value is obtained.
As an example, the reload trimming value TIMEpreAnd when the timer count value is corrected, the timer count value is finely adjusted by adopting an enlarged quantization algorithm and a segmented compensation algorithm.
As an embodiment, a new heavy-load fine tuning value is obtained by expanding the decimal part of the heavy-load fine tuning value by M TIMEs by adopting an expansion quantization algorithm, the count value of the timer is finely tuned by the new heavy-load fine tuning value, and in order to solve the TIME error caused by the fact that the calculated heavy-load fine tuning value cannot be rounded, the heavy-load fine tuning value TIME can be adjustedpreSplit into an integer part and a fractional part, TIMEpre=△TIMEint+△TIMEdecWherein, Δ TIMEintIs an integer part,. DELTA.TIMEdecIs a fractional part.
As an embodiment, the segment compensation algorithm is implemented by segmenting a period of time, and segmenting the fractional part of the heavy-duty fine tuning value, and dividing the period of time into N segments, so that the fractional part of the heavy-duty fine tuning value has the following relationship:
△TIMEdec=(△TIMEdec0+△TIMEdec1+△TIMEdeci+…+△TIMEdec(N-1)) /N, wherein Δ TIMEdeciThe value of 0 or 1, i ranges from 0 to N-1, and N data are obtained.
Then the reload fine tune value at the split N time may be expressed as:
TIMEprei=△TIMEinti+△TIMEdeciwherein i takes the values 0 to N-1,. DELTA.TIMEdeciValue 0 or 1, wherein TIMEpreiThe reloading fine tuning value is the second reloading fine tuning value; delta TIMEintiFine tuning integer values for the second reloading of the segmentations; delta TIMEdeciThe value of the fine tuning constant of the division order is 0 or 1. Thus, the overloading fine tuning value is a determined integer, and the average value of the total overloading fine tuning fractional part tends to delta TIME in the division TIMEdecThereby greatly improving the calculation precision.
As an embodiment, the method for calculating the heavy-duty fine tuning decimal part can adopt a method of expanding M TIMEs within N segments of the segmentation, reduce the decimal part into an integer and convert the decimal part into an integer according to Delta TIMEdecFractional fine adjustment ofdeciThe larger the value of M is, the finer the segmentation is, and meanwhile, the value of M is not too large in overall timing, and a proper value needs to be determined according to experience. In order to achieve N segments of time, so that the heavy-duty fine tuning value can be rounded, the formula needs to be processed:
TIMEprei=△TIMEinti+△TIMEdeci
when i/N<=△TIMEdec*M/M,
I.e. i<=△TIMEdecWhen M is N/M, Δ TIMEdeci=1,
When i/N>△TIMEdec*M/M,
I.e. i>△TIMEdecWhen M is N/M, Δ TIMEdeci=0,
The precision in a period of TIME can be calculated as a small numerical value which cannot be rounded on average by an algorithm, wherein i is the order of TIMEs of dividing a unit into N sections in a period of TIME, N is the dividing TIMEs in a period of TIME, M is a fractional part expansion coefficient value, and delta TIMEdeciA fine tuning constant that translates the fractional part to the actual reload value.
According to the temperature compensation method of the timing LED lamp in the variable temperature environment, the environment temperature is detected firstly, then the frequency deviation value of the external quartz crystal oscillator is obtained according to the environment temperature and the temperature characteristic curve of the external quartz crystal oscillator of the MCU in the timing LED lamp, then the time deviation direction is estimated according to the frequency deviation value of the external quartz crystal oscillator, and finally the timer count value of the timing LED lamp is corrected according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator so as to perform timing compensation on the timing LED lamp; thereby enabling the timing accuracy to be improved at low cost.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a temperature compensation program of a timing LED lamp is stored, where the temperature compensation program of the timing LED lamp, when executed by a processor, implements the temperature compensation method of the timing LED lamp in the changeable temperature environment.
According to the computer readable storage medium of the embodiment of the invention, the temperature compensation program of the timing LED lamp is stored, so that the temperature compensation program of the timing LED lamp is executed by the processor to realize the temperature compensation method of the timing LED lamp in the variable temperature environment, and the timing precision can be improved under the condition of low cost.
Fig. 2 is a block schematic diagram of a temperature compensation system of a timing LED lamp in a polytropic temperature environment according to an embodiment of the present invention, and as shown in fig. 2, the temperature compensation system of the timing LED lamp in the polytropic temperature environment includes a temperature detection module 201, an acquisition module 202, an estimation module 203, and a compensation module 204.
The temperature detection module 201 is configured to detect an ambient temperature; the obtaining module 202 is configured to obtain a frequency deviation value of an external quartz crystal oscillator according to an ambient temperature and a temperature characteristic curve of the external quartz crystal oscillator of an MCU in the timing LED lamp; the estimation module 203 is used for estimating the time deviation direction according to the frequency deviation value of the external quartz crystal oscillator; the compensation module 204 is configured to correct a timer count value of the timing LED lamp according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator, so as to perform timing compensation on the timing LED lamp.
As an embodiment, the estimation module 203 is further configured to determine a frequency deviation value of an external quartz crystal oscillator; if the frequency deviation value of the external quartz crystal oscillator is less than 0, estimating that the time deviation direction is reverse deviation; if the frequency deviation value of the external quartz crystal oscillator is larger than 0, the estimated time deviation direction is positive deviation.
As an embodiment, the compensation module 204 is further configured to determine a time deviation direction; if the time deviation direction is reverse deviation, calculating a heavy-load fine adjustment value according to the frequency deviation value of the external quartz crystal oscillator, and reducing and correcting the count value of the timer according to the heavy-load fine adjustment value; if the time deviation direction is positive deviation, calculating a heavy-load fine adjustment value according to the frequency deviation value of the external quartz crystal oscillator, and increasing and correcting the count value of the timer according to the heavy-load fine adjustment value.
As an embodiment, the compensation module calculates the reload trim value according to the following formula:
TIMEpre=A*FREpre*Fall/106
wherein A is the deviation constant of the current theoretical timing interval and frequency, related to the quartz crystal oscillator and timing interval, FREpreIs the frequency deviation value of the external quartz crystal oscillator, and has the unit of one millionth and FallThe frequency of the clock source of the timer.
It should be noted that the above description of the temperature compensation method for the timing LED lamp in the variable temperature environment is also applicable to the temperature compensation system for the timing LED lamp in the variable temperature environment of this embodiment, and is not repeated herein.
According to the temperature compensation system of the timing LED lamp in the variable temperature environment, the environment temperature is detected through the temperature detection module, the frequency deviation value of the external quartz crystal oscillator is obtained through the obtaining module according to the environment temperature and the temperature characteristic curve of the external quartz crystal oscillator of the MCU in the timing LED lamp, the time deviation direction is pre-estimated through the pre-estimating module according to the frequency deviation value of the external quartz crystal oscillator, and the counting value of the timer of the timing LED lamp is corrected through the compensation module according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator so as to perform timing compensation on the timing LED lamp; thereby enabling the timing accuracy to be improved at low cost.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that 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 a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood according to specific situations by those of ordinary skill in the art.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature "under," "beneath," and "under" a second feature may be directly under or obliquely under the second feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description of the specification, reference to the description of "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above should not be understood to necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are exemplary and not to be construed as limiting the present invention, and that changes, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (6)

1. A temperature compensation method for a timing LED lamp in a changeable temperature environment is characterized by comprising the following steps:
detecting the ambient temperature;
acquiring a frequency deviation value of an external quartz crystal oscillator according to the environment temperature and a temperature characteristic curve of the external quartz crystal oscillator of the MCU in the timing LED lamp;
estimating a time deviation direction according to the frequency deviation value of the external quartz crystal oscillator;
correcting the timer count value of the timing LED lamp according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator so as to perform timing compensation on the timing LED lamp;
wherein, correcting the timer count value of the timing LED lamp according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator comprises:
judging the time deviation direction;
if the time deviation direction is reverse deviation, calculating a heavy load fine adjustment value according to the frequency deviation value of the external quartz crystal oscillator, and reducing and correcting the count value of the timer according to the heavy load fine adjustment value;
if the time deviation direction is positive deviation, calculating a heavy load fine adjustment value according to the frequency deviation value of the external quartz crystal oscillator, and increasing and correcting the count value of the timer according to the heavy load fine adjustment value;
calculating the reload trim value according to the following formula:
TIMEpre=A*FREpre*Fall/106
wherein A is the deviation constant of the current theoretical timing interval and frequency, and is related to the quartz crystal oscillator and the timing interval, TIMEpreFine-tuning the value for said heavy load,FREpreIs the frequency deviation value of the external quartz crystal oscillator, and has the unit of one millionth and FallIs the frequency of the timer clock source.
2. The method according to claim 1, wherein the estimating a time deviation direction according to the frequency deviation value of the external quartz crystal oscillator comprises:
if the frequency deviation value of the external quartz crystal oscillator is less than 0, the time deviation direction is reverse deviation;
and if the frequency deviation value of the external quartz crystal oscillator is greater than 0, the time deviation direction is positive deviation.
3. The method according to claim 1 or 2, wherein when the timer count value is modified according to the reloading fine tuning value, the timer count value is further fine-tuned by using an expansion quantization algorithm and a piecewise compensation algorithm.
4. A computer-readable storage medium, having a temperature compensation program of a timed LED lamp stored thereon, wherein the temperature compensation program of the timed LED lamp, when executed by a processor, implements the temperature compensation method of the timed LED lamp in a polytropic temperature environment according to any one of claims 1 to 3.
5. The utility model provides a temperature compensation system of timing LED lamps and lanterns under changeable temperature environment which characterized in that includes:
the temperature detection module is used for detecting the ambient temperature;
the acquisition module is used for acquiring a frequency deviation value of an external quartz crystal oscillator according to the environment temperature and a temperature characteristic curve of the external quartz crystal oscillator of the MCU in the timing LED lamp;
the pre-estimation module is used for pre-estimating the time deviation direction according to the frequency deviation value of the external quartz crystal oscillator;
the compensation module is used for correcting the count value of the timer of the timing LED lamp according to the time deviation direction and the frequency deviation value of the external quartz crystal oscillator so as to perform timing compensation on the timing LED lamp;
wherein the compensation module is further configured to,
judging the time deviation direction;
if the time deviation direction is reverse deviation, calculating a heavy-load fine adjustment value according to the frequency deviation value of the external quartz crystal oscillator, and reducing and correcting the timer counting value according to the heavy-load fine adjustment value;
if the time deviation direction is positive deviation, calculating a heavy load fine adjustment value according to the frequency deviation value of the external quartz crystal oscillator, and increasing and correcting the count value of the timer according to the heavy load fine adjustment value;
the compensation module calculates the reload fine adjustment value according to the following formula:
TIMEpre=A*FREpre*Fall/106
wherein A is the deviation constant of the current theoretical timing interval and frequency, and is related to the quartz crystal oscillator and the timing interval, TIMEpreFor the heavy load fine adjustment, FREpreIs the frequency deviation value of the external quartz crystal oscillator, and has the unit of one millionth and FallThe frequency of the clock source of the timer.
6. The temperature compensation system for a timed LED lamp under multiple varying temperature environments of claim 5, wherein the estimation module is further configured to,
judging the frequency deviation value of the external quartz crystal oscillator;
if the frequency deviation value of the external quartz crystal oscillator is less than 0, estimating that the time deviation direction is reverse deviation;
and if the frequency deviation value of the external quartz crystal oscillator is greater than 0, estimating that the time deviation direction is positive deviation.
CN201911008232.0A 2019-10-22 2019-10-22 Temperature compensation method and system for timing LED lamp in variable temperature environment Active CN110769546B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911008232.0A CN110769546B (en) 2019-10-22 2019-10-22 Temperature compensation method and system for timing LED lamp in variable temperature environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911008232.0A CN110769546B (en) 2019-10-22 2019-10-22 Temperature compensation method and system for timing LED lamp in variable temperature environment

Publications (2)

Publication Number Publication Date
CN110769546A CN110769546A (en) 2020-02-07
CN110769546B true CN110769546B (en) 2022-07-19

Family

ID=69333038

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911008232.0A Active CN110769546B (en) 2019-10-22 2019-10-22 Temperature compensation method and system for timing LED lamp in variable temperature environment

Country Status (1)

Country Link
CN (1) CN110769546B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111429711B (en) * 2020-04-01 2021-06-01 深圳盈特创智能科技有限公司 Infrared receiving method and device
CN114110917B (en) * 2021-11-23 2023-03-31 珠海格力电器股份有限公司 Air conditioner self-adaptive timing high-precision calibration method and air conditioner
CN117353732B (en) * 2023-11-08 2024-04-16 武汉非秒迅连科技有限公司 Constant-temperature crystal oscillator temperature compensation method and device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107329399A (en) * 2017-07-14 2017-11-07 成都天奥电子股份有限公司 A kind of satellite time transfer clock system Low-power-consumptiocontrol control method and clock system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2854293B1 (en) * 2013-09-30 2016-03-30 Micro Crystal AG Temperature compensated timing signal generator
CN105978555A (en) * 2016-07-01 2016-09-28 无锡华润矽科微电子有限公司 Real-time clock timing precision correction circuit and method with temperature compensation function
CN106933300A (en) * 2017-04-05 2017-07-07 上海矽奥微电子有限公司 Real-time clock temperature drift correction circuit

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107329399A (en) * 2017-07-14 2017-11-07 成都天奥电子股份有限公司 A kind of satellite time transfer clock system Low-power-consumptiocontrol control method and clock system

Also Published As

Publication number Publication date
CN110769546A (en) 2020-02-07

Similar Documents

Publication Publication Date Title
CN110769546B (en) Temperature compensation method and system for timing LED lamp in variable temperature environment
EP3786655B1 (en) Method for correcting soh, apparatus, battery management system and storage medium
JP4050618B2 (en) Vibration circuit and method for calibration
CN109572483B (en) Remaining mileage calculation method and device for pure electric vehicle
US8823434B2 (en) Clock correction circuit and clock correction method
US7148761B1 (en) GPS receiver devices and compensation methods therefor
US20200204113A9 (en) Systems and methods for frequency compensation of real-time-clock systems
CN102981551B (en) A kind of temperature compensation system for real-time clock and method
CN111650617B (en) Crystal oscillator frequency taming method, system and medium based on innovation weighted adaptive Kalman filtering
US20190072616A1 (en) Remaining battery amount estimation device, remaining battery amount estimation method, and medium
GB2360404A (en) Temperature compensation of VCO frequency with compensation memory updated in use using externally supplied information
CN101452307A (en) System and method of calibrating real time clock utilizing average calibration
CN112468097B (en) Temperature compensation method, radio frequency device and storage medium
CN116980065B (en) Clock calibration method, clock calibration device, terminal equipment and storage medium
CN113504401B (en) Method, device and system for compensating diary time error of electric energy meter
US9838023B2 (en) Slow-clock calibration method and unit, clock circuit, and mobile communication terminal
CN112236942B (en) Method and apparatus for digital quartz temperature and drift compensation for sleep timers of NB-IoT devices
JP5072115B2 (en) Reference frequency generator
JP2009177771A (en) Method of compensating deterioration of oscillation circuit device with time, and control module
US7554415B2 (en) Microcomputer including a CR oscillator circuit
CN112204354B (en) Method for automatically calibrating a camshaft sensor to correct target run-out
CN107274036B (en) Crop yield prediction method and system
JP2020046428A (en) Method for adjusting mean frequency of time base incorporated in electronic watch
CN116170008A (en) Frequency compensation method, device, medium and clock system of oscillator
WO2010036376A1 (en) Temperature compensation method and apparatus for an output frequency signal based on successive approximation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant