An intelligent electricity meter
Patent Information
- Application Number
- CN202611398357.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-10-09
AI Technical Summary
[0005]本发明针对现有技术中国产外部计时晶振晶振无法满足新一代智能电网电能表计时精度及长期可靠性要求的问题,提出一种智能电表,采用自带温度补偿特性的高精度晶振对RTC模块输出的1Hz计时脉冲实施动态实时校准,降低国产晶振使用局限,提高日计时精度及长期的可靠性
[0016]与现有技术相比,本发明的优点和积极效果是:
Smart Images

Figure CN122882785A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power metering instruments and meters, and more specifically, to a smart meter. Background Technology
[0002] The clock performance requirements for smart meters are a timing accuracy better than ±1s / 24h across the entire temperature range of -25℃ to +55℃, and a daily timing error better than ±0.5s / 24h at a reference temperature. Current mainstream solutions in the industry use an external 32768Hz ordinary crystal oscillator in conjunction with MCU temperature compensation. This solution has long relied on high-consistency crystal oscillators from a few imported suppliers, posing a serious supply chain risk.
[0003] If a domestically produced 32768Hz crystal oscillator and a traditional open-loop fixed formula compensation method are used, it will be difficult to achieve the timing accuracy of professional clock chips within 0.5s / 24h across the entire temperature range. Furthermore, domestically produced 32768Hz crystal oscillators generally suffer from batch quality issues such as aging drift and low-temperature oscillation failure, failing to meet the long-term reliability requirements of next-generation smart grid energy meters.
[0004] The information disclosed in this background section is only intended to enhance the understanding of the background technology of this application, and therefore may include prior art that is not known to those skilled in the art. Summary of the Invention
[0005] This invention addresses the problem that domestically produced external timing crystal oscillators cannot meet the timing accuracy and long-term reliability requirements of next-generation smart grid energy meters in existing technologies. It proposes a smart meter that uses a high-precision crystal oscillator with built-in temperature compensation characteristics to dynamically and in real-time calibrate the 1Hz timing pulse output by the RTC module, reducing the limitations of using domestically produced crystal oscillators and improving daily timing accuracy and long-term reliability.
[0006] To achieve the above-mentioned invention / design objectives, the present invention adopts the following technical solution: A smart meter includes an external timing crystal oscillator, an RTC module, an external calibration crystal oscillator, and a microcontroller; The external timing crystal is used to output the first oscillation signal; The RTC module is connected to the external timing crystal oscillator, receives the first oscillation signal, divides the first oscillation signal by two levels to obtain a continuous output of 1Hz timing pulses, and accumulates and counts the 1Hz timing pulses to obtain the real-time time. The oscillation frequency of the external calibration crystal is the calibration frequency, which is used to output the second oscillation signal; The microcontroller includes a timer, and the timer's operating mode is set to TCIN. The timer pin of the microcontroller is connected to the external calibration crystal oscillator. The microcontroller is connected to the RTC module, receives the 1Hz timing pulse, and counts the calibration pulses of the second oscillation signal received within a single 1Hz timing pulse cycle to obtain an actual count. The difference between the actual count and the calibration frequency is used to obtain the counting deviation. The calibration parameters are obtained based on the counting deviation and transmitted to the RTC module. The RTC module calibrates the 1Hz timing pulse according to the calibration parameters.
[0007] In some specific embodiments, the microcontroller is configured with an initial frequency offset of the external calibration crystal oscillator and is configured to superimpose the initial frequency offset and the counting deviation to obtain a timing deviation; obtain the calibration parameters according to the timing deviation and transmit the calibration parameters to the RTC module; the RTC module calibrates the 1Hz timing pulse according to the calibration parameters.
[0008] In some specific embodiments, a temperature sensor is also included, which is connected to the microcontroller to detect the operating temperature and transmit it to the microcontroller; The microcontroller is configured with a temperature deviation function of the temperature sensor and a temperature compensation function of the external calibration crystal oscillator, and is configured to periodically obtain the operating temperature, and obtain the true temperature based on the operating temperature and the temperature deviation function; obtain the timing error based on the true temperature and the temperature compensation function; and obtain the temperature compensation parameter based on the timing error. A comprehensive calibration parameter is obtained by superimposing the calibration parameter and the temperature compensation parameter; the comprehensive calibration parameter is transmitted to the RTC module; the RTC module calibrates the 1Hz timing pulse according to the comprehensive calibration parameter.
[0009] In some specific embodiments, an EEPROM and FLASH storage module are also included, which are connected to the microcontroller; The microcontroller is configured to acquire the temperature compensation parameters at a period greater than 1 second; the acquired temperature compensation parameters are stored in the EEPROM and FLASH storage modules and updated in real time.
[0010] In some specific embodiments, the oscillation frequency of the external timing crystal is 32.768 kHz; the external calibration crystal is a temperature-compensated crystal oscillator; and the calibration frequency is 10 MHz.
[0011] In some specific embodiments, the second oscillation signal output by the external calibration crystal oscillator is a clipped sine wave; It also includes an inverter module, which is connected to the external calibration crystal oscillator and the microcontroller respectively, for converting the second oscillation signal into the calibration pulse of the continuously output CMOS level.
[0012] In some specific embodiments, the system clock of the microcontroller is configured to be 29MHz, which is obtained by frequency multiplication of the internal oscillation through a phase-locked loop frequency multiplier circuit.
[0013] In some specific embodiments, the RTC module is integrated into the microcontroller.
[0014] In some specific embodiments, the microcontroller is an RN8613.
[0015] In some specific embodiments, an RS485 communication module is also included, which is connected to the microcontroller for communication with a host computer.
[0016] Compared with the prior art, the advantages and positive effects of the present invention are: The smart meter of this invention uses a combination of a high-frequency, high-precision external calibration crystal oscillator and a low-frequency external timing crystal oscillator to perform cyclic calibration of the 1Hz timing pulse, bringing its accuracy close to that of the high-precision external calibration crystal oscillator. This allows for cyclic correction of daily timing errors, improving daily timing accuracy and solving the problem of requiring daily timing errors to be within ±1s / 24h across the entire temperature range in smart meters. In particular, it meets the requirement of daily timing errors within ±1s / 24h across the entire temperature range when using domestically produced external timing crystals with poor consistency. This breaks down the technical barrier to high-precision daily timing, reduces the dependence of domestic meters on external timing crystals from a few imported suppliers, achieves complete domestic substitution for smart meters, improves daily timing accuracy and long-term reliability, and reduces costs.
[0017] Other features and advantages of the present invention will become clearer after reading the detailed embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of the composition and connection structure of a smart meter according to an embodiment; Figure 2 This is a schematic diagram of the calibration pulse count within a single 1Hz timing pulse according to an embodiment.
[0020] In the picture, 1. Microcontroller; 2. Timer; 3. RTC module; 4. External timing crystal oscillator; 5. External calibration crystal oscillator; 6. Inverter module; 7. Temperature sensor; 8. EEPROM and FLASH storage module; 9. RS485 communication module; 10. AC to DC power conversion module. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances. In the description of embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0023] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0024] In the description of this invention, unless otherwise stated, "a plurality of" means two or more.
[0025] Reference Figure 1 , Figure 2 The present invention provides a smart meter including an external timing crystal oscillator 3, which is used to output a first oscillation signal. For example, the oscillation frequency of the external timing crystal oscillator is 32.768KHz; that is, it outputs a first oscillation signal with an oscillation frequency of 32.768KHz.
[0026] The smart meter also includes an RTC module 2, which is connected to an external timing crystal oscillator 3. It receives the first oscillation signal output by the crystal oscillator and performs multi-stage frequency division to convert it into a continuously outputting 1Hz timing pulse. It then increments the count of the continuously output timing pulses, accumulating and storing the total number of seconds since the timing start point. Finally, it performs calendar conversion on the total number of seconds to obtain a real-time clock. For example, for an external timing crystal oscillator with an oscillation frequency of 32.768kHz, 15-stage frequency division is required to obtain a continuously outputting 1Hz timing pulse. The smart meter also includes an external calibration crystal oscillator 4, which outputs a second oscillation signal with an oscillation frequency equal to the calibration frequency. The frequency of the second oscillation signal is greater than the frequency of the first oscillation signal. For example, the calibration frequency is in the megahertz range, used to calibrate the 1Hz timing pulse of the RTC module 2 to approximate the standard 1s.
[0027] The smart meter also includes a microcontroller 1, which includes a timer 11 and sets the operating mode of the timer 11 to TCIN; that is, the timer 11 is set to an external clock input mode; specifically, the timer 11 is a dedicated operating mode in which it is driven by pulses input directly from an external pin, independent of the internal system clock; the external pin of the timer 11 is connected to an external calibration crystal 4 and receives the second oscillation signal output by the external calibration crystal 4; the timer 11 is connected to the RTC module 2 inside the microcontroller 1 through the connection between the microcontroller 1 and the RTC module 2, and receives the 1Hz timing pulse output by the RTC module 2; and calibrates the 1Hz timing pulse output by the RTC module 2 according to the difference between the number of calibration pulses of the second oscillation signal received in a single 1Hz timing pulse cycle and the theoretical number of calibration pulses of the second oscillation signal in 1 second.
[0028] Specifically, the timer of microcontroller 1 receives the actual count of the calibration pulses of the second oscillation signal of the external calibration crystal 4 between two adjacent rising edges of the 1Hz timing pulse; the theoretical number of calibration pulses of the second oscillation signal is the value of the calibration frequency; the difference between the actual count and the theoretical count, i.e. the calibration frequency, is the timing deviation; the calibration parameters are obtained according to the timing deviation and output to RTC module 2 to calibrate the 1Hz timing pulse output by RTC module 2.
[0029] The smart meter of this invention uses a combination of a high-frequency, high-precision external calibration crystal 4 and a lower-frequency external timing crystal 3 to perform cyclic calibration of the 1Hz timing pulse, making its accuracy close to that of the high-precision external calibration crystal 4. This allows for cyclic correction of daily timing errors, improving daily timing accuracy and solving the problem that smart meters require daily timing errors to be within ±1s / 24h across the entire temperature range. In particular, when using the domestically produced external timing crystal 3, which has poor consistency, this requirement is met, breaking through the technical barrier of high-precision daily timing, reducing the dependence of domestic meters on external timing crystals from a few imported suppliers, achieving full domestic substitution for smart meters, improving daily timing accuracy and long-term reliability, and reducing costs.
[0030] The specific structure and principle of the smart meter of the present invention will be described in detail below with reference to specific embodiments.
[0031] In some specific embodiments, refer to Figure 1 , Figure 2 The calibration of the 1Hz timing pulse output by RTC module 2 based on timing deviation also includes: Obtain the initial frequency offset of the external calibration crystal 4, which is the accuracy compensation parameter of the external calibration crystal 4; The true frequency offset of RTC module 2 is obtained by summing the timing deviation and the initial frequency offset; The correction parameters are obtained based on the actual frequency offset and written into the calibration register of RTC module 2. The 1Hz timing pulse output by RTC module 2 is then corrected within RTC module 2.
[0032] That is, the microcontroller 1 obtains the initial frequency deviation of the external calibration crystal 4, obtains the true frequency deviation by the sum of the timing deviation and the initial frequency deviation, and converts the true frequency deviation into a correction parameter and writes it into the calibration register of the RTC module 2; the RTC module 2 corrects the 1Hz timing pulse according to the correction parameter in the calibration register to make it close to 1s.
[0033] In this embodiment, the smart meter incorporates the oscillation error of the external calibration crystal 4 into the correction parameters by calculating the sum of the timing deviation and the initial frequency deviation, thereby improving the calibration accuracy and precision, further enhancing the accuracy and precision of the 1Hz timing pulse, improving the timing accuracy of the smart meter, and reducing daily timing error.
[0034] In some specific embodiments, refer to Figure 1 , Figure 2The smart meter also includes a temperature sensor 6, which is connected to the microcontroller 1. The microcontroller 1 is configured with a temperature deviation function of the temperature sensor 6 and a temperature compensation function of the external timing crystal oscillator 3, and is configured to cyclically acquire the operating temperature, obtain the true temperature based on the operating temperature and the temperature deviation function, obtain the timing error based on the true temperature and the temperature compensation function, obtain the temperature compensation parameter based on the timing error, and obtain the comprehensive calibration parameter by superimposing the temperature compensation parameter and the calibration parameter, which is written into the calibration register of the RTC module 2 to correct the 1Hz timing pulse output by the RTC module 2.
[0035] Among them, the temperature deviation function is the functional relationship between the operating temperature detected by the temperature sensor 6 and the actual temperature, which is obtained by fitting multiple sets of experimental data of operating temperature and actual temperature; the temperature compensation function is the functional relationship between the actual temperature and the timing error of the RTC module 2 caused by the temperature drift performance of the external timing crystal oscillator 3, which is also obtained by fitting multiple sets of experimental data of actual temperature and timing error.
[0036] The smart meter in this embodiment calibrates parameters by integrating temperature compensation parameters. It not only calibrates the external timing crystal oscillator 3 through the high-precision external calibration crystal oscillator 4, but also compensates for timing errors caused by temperature drift, thereby eliminating timing errors caused by temperature drift, further improving the accuracy and precision of diary entries, and reducing diary entry errors.
[0037] In some specific embodiments, the RTC module 2 also includes a calibration circuit, which is connected to an external timing crystal oscillator 3 and controls the calibration of the 1Hz timing pulse by calibration parameters or comprehensive calibration parameters from the calibration register; the temperature compensation parameters and calibration parameters are obtained through the following steps: The calibration step size of the calibration circuit is obtained. This is a pre-set fixed parameter, the value of which is determined by the hardware characteristics of the calibration circuit and the frequency accuracy requirements of the external timing crystal oscillator 3. Specifically, for each calibration step size adjustment of the frequency of the external timing crystal oscillator 3, the corresponding change in timing error is a fixed value (for example, the calibration step size is set to 1.525 ppm / step, meaning that for each adjustment step, the timing error corresponding to the external timing crystal oscillator 3 can be corrected by 1.525 ppm). The calibration step size works in conjunction with microcontroller 1 and the calibration register. The step size ratio is obtained by calculating the ratio of timing error to calibration step size; the timing error and calibration step size are divided to calculate the required step size ratio for calibration; during the calculation, the result is rounded to ensure that the ratio is an integer (because the parameter configuration of the calibration register only supports integer step size adjustment), avoiding calibration errors caused by non-integer step sizes; for example, the timing error is calculated based on the current ambient temperature of the smart meter and the temperature compensation function, then the step size ratio for temperature drift compensation is the integer value of timing error divided by calibration step size; the step size ratio for calibrating the consistency of external timing crystal oscillator 3 is the integer value of timing deviation or true frequency deviation divided by calibration step size. The temperature compensation parameters and calibration parameters are obtained by the microcontroller 1 based on the step size ratio, which are the configuration parameters of the calibration register. They are written into the calibration register by writing instructions. After receiving the configuration parameters, the calibration register synchronously sends a control signal to the calibration circuit. The calibration circuit adjusts its own frequency division ratio according to the control signal to calibrate the frequency deviation of the external timing crystal due to consistency and / or temperature drift.
[0038] In some specific embodiments, microcontroller 1 uses RN8613; RTC module 2 is integrated into microcontroller 1.
[0039] The RN8613 integrates a complete clock calibration circuit and a matching calibration register, enabling high-precision clock calibration without the need for additional external calibration circuitry. The RN8613 processor converts the calculated step ratio into configuration parameters for the calibration register, which are then written to the register via a write instruction. Upon receiving the parameters, the calibration register synchronously sends a control signal to the calibration circuit. The calibration circuit adjusts its own division ratio based on this control signal to calibrate the frequency deviation of the external timing crystal caused by its own inconsistency or temperature drift.
[0040] In some specific embodiments, an EEPROM and FLASH storage module 7 is also included, which is connected to the microcontroller 1 and is used to store operating data and daily timing error data; The 1Hz timing pulse output of RTC module 2, calibrated according to timing deviation, also includes: The actual frequency offset is stored in the EEPROM and FLASH storage module 7, and the actual frequency offset is accumulated to obtain the cumulative timing error; The RTC module 2's 1Hz (1s timing) output or real-time time is dynamically adjusted based on the cumulative timing error.
[0041] In some specific embodiments, the microcontroller 1 is configured to acquire temperature compensation parameters at a period greater than 1 second; the acquired temperature compensation parameters are stored in the EEPROM and FLASH storage module 7 and updated in real time, and are used to calibrate the 1Hz timing pulse in real time in conjunction with calibration parameters.
[0042] In some specific embodiments, refer to Figure 2 The external timing crystal oscillator has an oscillation frequency of 32.768KHz, which is the industry standard for timing crystal oscillators; the external calibration crystal oscillator 4 uses a temperature-compensated crystal oscillator (TCXO); the calibration frequency is 10MHz.
[0043] In some specific embodiments, the output of the external calibration crystal 4 is a clipped sine wave.
[0044] The smart meter also includes an inverter module 5, which is connected to an external calibration crystal oscillator 4 and a microcontroller 1, respectively, and is used to convert the clipped sine wave to CMOS level.
[0045] The smart meter in this embodiment improves temperature and frequency accuracy to ±1ppm by using an external calibration crystal oscillator 4 that outputs a clipped sine wave, ensuring sufficient margin for daily timing error in batches. The clipped sine wave is a distorted sine wave with forced amplitude truncation at the top and bottom, with a maximum peak-to-peak value of 0.8V. This signal cannot be directly recognized by the microcontroller 1 and must be converted into a CMOS level pulse wave by the inverter module 5.
[0046] In some specific embodiments, the system clock of microcontroller 1 is configured to be 29MHz, which is obtained through a phase-locked loop frequency multiplication internal oscillation circuit.
[0047] The smart meter in this embodiment sets the system clock of the microcontroller 1 to 29MHz, which is at least twice the TCIN sampling frequency. According to the Nyquist sampling theorem, by configuring the system clock of the microcontroller 1 to 29MHz, which is the output of the PLL, the sampling accuracy is improved, thereby improving the calibration accuracy and the accuracy of daily timekeeping.
[0048] In some specific embodiments, the smart meter also includes a daily timing error output module, which is connected to the microcontroller 1 and is used to output the daily timing for detecting the factory-set daily timing error.
[0049] In some specific embodiments, the smart meter also includes an RS485 communication module 8 for communication connection between the smart meter and the host computer.
[0050] In some specific embodiments, the 1Hz timing pulse output of RTC module 2 is implemented using a phase-locked loop.
[0051] In some specific embodiments, the microcontroller 1 includes at least one processor, a memory, and a computer program stored in the memory and executable on at least one processor; when the processor executes the computer program, it performs the calibration of any of the aforementioned smart meters.
[0052] The smart meter may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that... Figure 1 This is merely an example of a smart meter and does not constitute a limitation on smart meters. It may include more or fewer components than shown in the illustration, or a combination of certain components, or different components. For example, it may also include an AC to DC converter module 9, a network access module, etc.
[0053] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions claimed by the present invention.
Claims
1. A smart meter, characterized in that, include: An external timing crystal oscillator is used to output the first oscillation signal; The RTC module is connected to the external timing crystal oscillator, receives the first oscillation signal, divides the first oscillation signal by two levels to obtain a continuous output of 1Hz timing pulses, and accumulates and counts the 1Hz timing pulses to obtain the real-time time. An external calibration crystal oscillator, whose oscillation frequency is the calibration frequency, is used to output a second oscillation signal; A microcontroller includes a timer, and the timer's operating mode is set to TCIN; the timer pin of the microcontroller is connected to the external calibration crystal oscillator; the microcontroller is connected to the RTC module, receives the 1Hz timing pulse, and counts the calibration pulses of the second oscillation signal received within a single 1Hz timing pulse cycle to obtain the actual count; The counting deviation is obtained from the difference between the actual count and the calibration frequency; calibration parameters are obtained based on the counting deviation, and the calibration parameters are transmitted to the RTC module. The RTC module calibrates the 1Hz timing pulse according to the calibration parameters.
2. The smart meter according to claim 1, characterized in that, The microcontroller is configured with an initial frequency offset of the external calibration crystal oscillator and is configured to superimpose the initial frequency offset and the counting deviation to obtain a timing deviation; it obtains the calibration parameters based on the timing deviation and transmits the calibration parameters to the RTC module; the RTC module calibrates the 1Hz timing pulse based on the calibration parameters.
3. The smart meter according to claim 2, characterized in that, It also includes a temperature sensor, which is connected to the microcontroller to detect the operating temperature and transmit it to the microcontroller; The microcontroller is configured with a temperature deviation function of the temperature sensor and a temperature compensation function of the external calibration crystal oscillator, and is configured to periodically obtain the operating temperature and obtain the true temperature based on the operating temperature and the temperature deviation function. The timing error is obtained based on the actual temperature and the temperature compensation function. The temperature compensation parameters are obtained based on the timing error. The comprehensive calibration parameters are obtained by superimposing the calibration parameters and the temperature compensation parameters; The integrated calibration parameters are transmitted to the RTC module; The RTC module calibrates the 1Hz timing pulse according to the comprehensive calibration parameters.
4. The smart meter according to claim 3, characterized in that, It also includes EEPROM and FLASH storage modules, which are connected to the microcontroller; The microcontroller is configured to acquire the temperature compensation parameters at a period greater than 1 second; the acquired temperature compensation parameters are stored in the EEPROM and FLASH storage modules and updated in real time.
5. The smart meter according to any one of claims 1 to 4, characterized in that, The external timing crystal has an oscillation frequency of 32.768 kHz; the external calibration crystal is a temperature-compensated crystal oscillator; and the calibration frequency is 10 MHz.
6. The smart meter according to claim 5, characterized in that, The second oscillation signal output by the external calibration crystal oscillator is a clipped sine wave; It also includes an inverter module, which is connected to the external calibration crystal oscillator and the microcontroller respectively, for converting the second oscillation signal into the calibration pulse of the continuously output CMOS level.
7. The smart meter according to claim 5, characterized in that, The system clock of the microcontroller is configured to be 29MHz, which is obtained by frequency multiplication and internal oscillation through a phase-locked loop frequency multiplier circuit.
8. The smart meter according to claim 7, characterized in that, The RTC module is integrated into the microcontroller.
9. The smart meter according to claim 8, characterized in that, The microcontroller used is RN8613.
10. The smart meter according to claim 5, characterized in that, It also includes an RS485 communication module, which is connected to the microcontroller for communication with a host computer.